Skip to content

test(vcr-ra): non-vacuous --relocatable gate for const-CSE — proves it fires + stays correct on gale's path (#242)#522

Merged
avrabe merged 1 commit into
mainfrom
vcr-const-cse-direct-path-oracle-242
Jun 27, 2026
Merged

test(vcr-ra): non-vacuous --relocatable gate for const-CSE — proves it fires + stays correct on gale's path (#242)#522
avrabe merged 1 commit into
mainfrom
vcr-const-cse-direct-path-oracle-242

Conversation

@avrabe

@avrabe avrabe commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

What

Closes the honesty gap in the const-CSE no-regression fix (#519): its --relocatable
gate was inert, so it gave zero positive evidence on the exact path gale's
gust_mix 90→92 B regression lived on.

--relocatable routes through select_direct(), where the optimized path's inline
const cache never runs — so the post-hoc apply_const_cse acts alone. But the
const_cse.wat arithmetic corpus never makes the direct selector emit the redundant
same-value-in-two-registers materialization that pass dedups, so the direct-path gate
was a tripwire that passed because nothing fired.

Change (test-only, behavior-frozen)

Adds const_cse_direct.wat — single-param, pure-register, reloc-free shapes (a

8-bit const reused across several independent sub-expressions summed at the end) that
do make the direct selector emit the redundant movw, so post-hoc apply_const_cse
fires on --relocatable: r1 44→40, r2 38→34.

The differential's direct-path gate is now non-vacuous — it asserts:

  • (a) CSE actually fires on ≥1 function (fails if the gate goes blind);
  • (b) no function grows (the no-regression property on gale's path);
  • (c) every result is bit-identical to wasmtime under unicorn (correctness of
    post-hoc CSE on the direct selector's output).

This is the positive evidence on gale's exact path that #519 could not provide.

Gate

Behavior-frozen — new fixture + harness only, no codegen change. Frozen anchors
(control_step 0x00210A55, flight_algo 0x07FDF307) and the const_cse flag-off golden
are untouched (frozen gate 3/3, golden 2/2). Full differential passes (exit 0):

--- direct-path (--relocatable) gate, const_cse_direct.wat (#242) ---
OK      r1: 44 -> 40 B (-4) — CSE fired (direct path)
OK      r2: 38 -> 34 B (-4) — CSE fired (direct path)
--      rneg: 46 B (inert)
direct-path gate non-vacuous: CSE fired on 2 function(s), all results match wasmtime, none grew

🤖 Generated with Claude Code

…t fires + stays correct on gale's path (#242)

The const-CSE no-regression fix (#519) ships with an honest gap: its
`--relocatable` gate was INERT. gale's gust_mix 90→92 B regression was on
`--relocatable`, which routes through `select_direct()` where only the post-hoc
`apply_const_cse` runs — but the `const_cse.wat` arithmetic corpus never makes
the direct selector emit the redundant same-value-in-two-registers shape that
pass dedups, so the gate gave zero positive evidence on the exact path the bug
lived on.

This adds `const_cse_direct.wat`: single-param, pure-register, reloc-free shapes
(a >8-bit const reused across several independent sub-expressions summed at the
end) that DO make the direct selector emit the redundant `movw`, so post-hoc
`apply_const_cse` fires on `--relocatable` (r1 44→40, r2 38→34). The differential
now runs a NON-VACUOUS direct-path gate that asserts:
  (a) CSE actually fires on >=1 function — fails if the gate goes blind;
  (b) no function grows (the no-regression property on gale's path);
  (c) every result is bit-identical to wasmtime under unicorn (correctness of
      post-hoc CSE on the direct selector's output).

This is the positive evidence on gale's exact path that #519 could not provide.
Behavior-frozen: new fixture + harness only, no codegen change — frozen anchors
(control_step 0x00210A55, flight_algo 0x07FDF307) and the const_cse flag-off
golden are untouched (frozen gate 3/3, golden 2/2). The full differential passes
(exit 0); flag-off byte-identical.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe avrabe merged commit f56cec6 into main Jun 27, 2026
20 checks passed
@avrabe avrabe deleted the vcr-const-cse-direct-path-oracle-242 branch June 27, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant