You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Port compiler.rs operator-text helpers (compound_binop, has_empty_operand) to specs/compiler/operator_text.t27 through t27o #9109
Second step of the t27o dogfood run on bootstrap/src/compiler.rs (see #8998, see #5980). The first step is #9090. This one falls under the owner's standing rule of 2026-10-11 for ports, which covers FROZEN_HASH.
tri t27o --check converts two pure helpers, and its oracle passes on both:
compound_binop ("|=" -> "|");
CCodegen::has_empty_operand (did the renderer drop an operator's right side, as in (BOARD_NAME != )?).
This issue moves them into one generated plan, mounted with #[path].
Ready-made commit: branch port/compiler-operator-text (41285ef) holds this port, verified on the lab. It is stacked on #9093, so rebase it onto master once #9093 merges; FROZEN_HASH stays valid only if master did not touch compiler.rs in between (otherwise re-run t27c frozen-digest). The PR body is ready in the commit's evidence: corpus gen/gen-verilog/gen-rust/gen-c over 2270 specs byte-identical, a planted fault moves 245 rows, 504,205-input differential vs the hand Rust with 0 differences, cargo test 2990/9/2 same as master, compiler.rs +7 -60, check_all and check_budget exit 0.
Region lines to be added once the merge-side region check is live (see #9062).
User Scenarios
Given x |= y in a spec, when the Verilog backend or assign_op_text asks for the binary operator, then compound_binop in the generated plan answers |.
Given the rendered C expression (BOARD_NAME != ), when is_c_constant_expr checks it, then has_empty_operand in the generated plan answers true, and for (a != b) it answers false.
Requirements
FR-001: specs/compiler/operator_text.t27 MUST define compound_binop and has_empty_operand with t27o's bodies, reusing tri::t27b::type_text's same for text equality.
FR-002: The spec MUST carry tests that call each function by name, with expected values the hand Rust returned on the lab.
FR-003: bootstrap/gen/rust/compiler/operator_text.rs MUST be unedited t27c gen-rust output, mounted by #[path]. Both hand bodies MUST be deleted and their call sites MUST call the generated module.
FR-004: Generated output across the corpus MUST be byte-identical before and after, and cargo test --release MUST match clean master.
grep -cE 'fn (compound_binop|has_empty_operand)\(' bootstrap/src/compiler.rs prints 0.
gen, gen-verilog, gen-rust and gen-c over every tracked spec give the same bytes with t27c built from master and from the branch.
The diff touches compiler.rs only inside compound_binop, has_empty_operand, gen_verilog_stmt, is_c_constant_expr and assign_op_text, apart from the one #[path] mount block at the top of the file.
Activity
compiler: operator text moves to specs/compiler/operator_text.t27, co…