Skip to content

8 1 regression and battletest suites

TransCompilator edited this page Nov 26, 2026 · 1 revision

8.1 Regression and Battletest Suites

Source: https://deepwiki.com/PonvasanthPon/TransCompilator/8-1-regression-and-battletest-suites

Regression and Battletest Suites

Relevant source files

The following files were used as context for generating this wiki page:

Purpose and Scope

This page details the verification infrastructure and test suites backing TransCompilator (tc_r1). Because TransCompilator is a deterministic, zero-ML compiler, correctness is enforced through rigorous differential testing, end-to-end interpreter-versus-ELF64 parity checks, human-English battle-test corpora, discourse synthesis suites, and programmatic orthogonality audits. Every test suite runs against both the tc_ir reference interpreter and native static x86_64 ELF binaries via tc_editor::runner::run_elf_with_parity to guarantee exact behavioral match across backends.

Sources: [crates/tc-semantics/tests/battletest_conv_regressions.rs:1-20], [crates/tc-cli/tests/human_english_battletest.rs:1-18]


Convergence and Permanent Regression Suites

The convergence suite (battletest_conv_regressions.rs) and Phase 5 regression suite (battletest_p5_regressions.rs) capture edge cases discovered during long-running compilation campaigns. They assert correct handling of chained mutations, referent sharing, and data structure scaling.

Key functional patterns tested include:

  • Compound Put/Set Chains: Expressions like Put 100 in cash, add 50 to it, remove 20 from it, and say it verify that the implicit anaphor it correctly propagates through multi-clause assignment sequences [crates/tc-semantics/tests/battletest_conv_regressions.rs:6-20], [crates/tc-semantics/tests/battletest_conv_regressions.rs:84-98].
  • Output Synonym Resolution: Show, Print, Display, and Say across integers, floats, booleans, and memory addresses [crates/tc-semantics/tests/battletest_conv_regressions.rs:46-82].
  • Nesting and Parsing Limits: Deeply nested parentheses (e.g., 150 levels of recursion) verify that parser protection triggers clean structured diagnostics rather than stack overflows [crates/tc-semantics/tests/battletest_conv_regressions.rs:158-173].
  • Map and List Capacity Scaling: Tests like int_map_grows_beyond_256_entries and text_map_grows_beyond_256_entries ensure dynamic hash maps and vector storage resize correctly without memory leaks under heavy allocation [crates/tc-semantics/tests/battletest_p5_regressions.rs:47-106].
graph TD
    TestFile["battletest_conv_regressions.rs"] --> Runner["tc_editor::runner::run_elf_with_parity"]
    Runner --> Compiler["tc_semantics::compile_english_to_ir"]
    Compiler --> IR["tc_ir (Reference Interpreter)"]
    Compiler --> ELF["tc_codegen_x86 (Native ELF64)"]
    IR --> ParityCheck["Byte-Level & Output Parity Assertion"]
    ELF --> ParityCheck
Loading

Sources: [crates/tc-semantics/tests/battletest_conv_regressions.rs:1-174], [crates/tc-semantics/tests/battletest_p5_regressions.rs:1-106]


Human-English and Blind-LLM Battletests

The massive human-English test corpus (human_english_battletest.rs) exercises thousands of conversational, idiom-heavy, and LLM-generated phrasing variants across multiple difficulty bands. These tests validate robust linguistic tolerance, ensuring that colloquial contractions (isn't, doesn't, it's), syntactic sugar (Start by setting, At the end, Once everything is finished), and complex multi-step procedural logic compile and execute successfully.

graph TD
    NLSpace["Natural Language Space: Human/LLM English Input"] --> Tokenizer["tc_syntax::tokenize"]
    Tokenizer --> Parser["tc_semantics::LinkGrammarParser"]
    Parser --> AST["Typed AST & Clause Graphs"]
    AST --> IRGen["Core-7 IR Generation"]
    IRGen --> CodeSpace["Code Entity Space: Stmt / BasicBlock / ELF64"]
Loading

Sources: [crates/tc-cli/tests/human_english_battletest.rs:1-213]


Natural-English Flow and Discourse Synthesis Tests

Discourse-level regressions (discourse_synthesis.rs and natural_collatz_flow.rs) verify paragraph-scoped constructs, looping constructs, and anaphoric resolution across multi-sentence contexts.

Important constructs validated:

  • Prime and Composite Finders: Four-sentence and multi-sentence prime number searches (Look at every number from 2 up to 50...) test nested iterations, divisibility checks, and implicit counter binding [crates/tc-cli/tests/discourse_synthesis.rs:72-94].
  • Ellipsis and Anaphora Binding: Sentences starting with If none of them do... or If any of them do... link back to preceding check whether scopes, raising clean UNRESOLVED_ANAPHOR diagnostics if the antecedent is missing [crates/tc-cli/tests/discourse_synthesis.rs:145-150].
  • Complex Loop Iterations: Natural Collatz sequence generation (Repeat while current is greater than 1...) verifies 113+ line output traces and accurate arithmetic reductions [crates/tc-cli/tests/natural_collatz_flow.rs:12-24], [crates/tc-cli/tests/natural_collatz_flow.rs:80-93].

Sources: [crates/tc-cli/tests/discourse_synthesis.rs:1-210], [crates/tc-cli/tests/natural_collatz_flow.rs:1-250]


Casual English, Guards, and Lexicon Expansion

The casual English suite (casual_english_and_guards.rs) and lexicon expansion tests (semantic_frame_and_lexicon_expansion.rs) confirm vocabulary completeness for verb primitives (Increment, Decrement, Reset, Clear, Swap, Exchange, Copy, Duplicate, Square, Cube, Double, Halve, Negate) and conversational idioms (Show me x, Tell me x, Print out x, Echo 10) [crates/tc-cli/tests/casual_english_and_guards.rs:74-132], [crates/tc-semantics/tests/semantic_frame_and_lexicon_expansion.rs:45-224].

Typo guards and lint checks ensure that malformed syntax like orphan Otherwise clauses or empty loop bodies are caught at compile time with descriptive error messages pointing to exact source spans [crates/tc-cli/tests/casual_english_and_guards.rs:236-242], [crates/tc-cli/tests/discourse_synthesis.rs:153-158].

Sources: [crates/tc-cli/tests/casual_english_and_guards.rs:1-255], [crates/tc-semantics/tests/semantic_frame_and_lexicon_expansion.rs:1-316]


The Orthogonality Audit Matrix

To prove that the compiler's semantic lowering rules do not suffer from combinatorial blind spots, orthogonality_audit.rs executes a programmatic Cartesian product test over three dimensions:

$$\text{Statements} \times \text{Targets} \times \text{Scopes}$$

  • Statements (17 variants): Let, Put, Set, Store, Keep, Make, Becomes, Add, Remove, Transfer, Update, Output, Increment, Decrement, Reset, Copy, Swap [crates/tc-semantics/tests/orthogonality_audit.rs:91-110].
  • Targets (7 variants): Target::Scalar, Target::MultiWord, Target::It, Target::ValueField, Target::PointerField, Target::ItsField, Target::DefiniteField [crates/tc-semantics/tests/orthogonality_audit.rs:112-131].
  • Scopes (7 variants): Scope::Top, Scope::Function, Scope::If, Scope::Else, Scope::While, Scope::Until, Scope::ForEvery [crates/tc-semantics/tests/orthogonality_audit.rs:133-152].
graph TD
    Audit["orthogonality_audit.rs"] --> StmtIter["Statement Enum (17 kinds)"]
    Audit --> TargetIter["Target Enum (7 kinds)"]
    Audit --> ScopeIter["Scope Enum (7 kinds)"]
    StmtIter --> Combos["Cartesian Product Generation"]
    TargetIter --> Combos
    ScopeIter --> Combos
    Combos --> CompilerPipeline["compile_english_to_ir"]
    CompilerPipeline --> ExecAudit["run_elf_with_parity"]
Loading

Sources: [crates/tc-semantics/tests/orthogonality_audit.rs:1-425]


Clone this wiki locally