test(vcr-ra): non-vacuous --relocatable gate for const-CSE — proves it fires + stays correct on gale's path (#242)#522
Merged
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the honesty gap in the const-CSE no-regression fix (#519): its
--relocatablegate was inert, so it gave zero positive evidence on the exact path gale's
gust_mix90→92 B regression lived on.--relocatableroutes throughselect_direct(), where the optimized path's inlineconst cache never runs — so the post-hoc
apply_const_cseacts alone. But theconst_cse.watarithmetic corpus never makes the direct selector emit the redundantsame-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 (aThe differential's direct-path gate is now non-vacuous — it asserts:
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_algo0x07FDF307) and the const_cse flag-off goldenare untouched (frozen gate 3/3, golden 2/2). Full differential passes (exit 0):
🤖 Generated with Claude Code