Skip to content

feat(vcr-ra)!: SYNTH_SPILL_REALLOC default-on — Belady spilling ships (#242, VCR-RA-001)#583

Merged
avrabe merged 1 commit into
mainfrom
feat/242-spill-realloc-default-on
Jul 2, 2026
Merged

feat(vcr-ra)!: SYNTH_SPILL_REALLOC default-on — Belady spilling ships (#242, VCR-RA-001)#583
avrabe merged 1 commit into
mainfrom
feat/242-spill-realloc-default-on

Conversation

@avrabe

@avrabe avrabe commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

SYNTH_SPILL_REALLOC default-on — Belady spilling ships (#242, VCR-RA-001)

The deliberate byte-changing flip, executed with the refreeze ritual (the v0.14.0 local-promotion pattern). The three-stage spill-realloc lever — #569 slot-value forwarding, #576 Belady spill re-choice, #579 whole-function slot liveness — now runs by default; SYNTH_SPILL_REALLOC=0 is the opt-out (any other value, or unset, runs the pass). SYNTH_SPILL_ON_EXHAUST is untouched (population-changing — stays off pending silicon).

Evidence basis for the flip

Execution differentials — run on the NEW default bytes BEFORE re-pinning

All unicorn-vs-wasmtime, exit 0:

harness result
const_cse_differential.py PASS (all fns match wasmtime, spill12 −88 B with CSE, direct-path gate non-vacuous)
frame_slot_dce_differential.py PASS — flight_algo 0x07FDF307 on default AND opt-out, 4 arg sets each
flight_seam_differential.py MATCH — 0x07FDF307 vs wasmtime
spill_rung_581_differential.py PASS 12/12 (spill_rung_581 + spill_on_exhaust_242 fixtures)
r12_spill_496_differential.py PASS — control_step_decide 5/5 + flight_algo vs wasmtime
i64_param_518_differential.py PASS (full AAPCS matrix, loud-skips intact)
br_table_value_509_differential.py PASS (both paths)

control_step_differential.py has a pre-existing harness break (KeyError control_step_decide in its disasm-text symbol parse — the #489 host-dependence class); it fails identically with SYNTH_SPILL_REALLOC=0, i.e. on the pre-flip bytes, so it is not the flip. Its anchor is covered by r12_spill_496_differential.py vs wasmtime, and control_step's .text is byte-identical under the flip anyway (see table).

Refreeze table (frozen_codegen_bytes.rs, ARM --relocatable gate)

fixture old sha256 / len new sha256 / len Δ
control_step.wasm 1a97711c… / 304 unchanged 0
flight_seam.wasm dce728b4… / 738 6872d6f3… / 730 −8 B
flight_seam_flat.wasm 0665e623… / 878 d11849db… / 866 −12 B
signed_div_const.wasm b277453b… / 34 unchanged 0

RV32 anchors: UNCHANGED — the pass is wired only in arm_backend.rs (ARM path); frozen_fixtures_rv32_text_is_bit_identical_oracle_001 passes untouched. The const_cse_reduction_242.rs optimized-path golden (0xa68aa2da…/576) is also byte-identical under the flip — verified, no re-bless needed.

Opt-out pin (CI-gated escape hatch)

  • SYNTH_SPILL_REALLOC=0 reproduces the OLD hashes byte-for-byte (verified per fixture, and locked by the new frozen_fixtures_spill_realloc_escape_hatch_restores_old_bytes test — the rollback proof AND a leak tripwire).
  • The older SYNTH_NO_STACK_FWD escape hatch now composes with SYNTH_SPILL_REALLOC=0 to reach the pre-STACK_FWD goldens (documented in the test).
  • spill_realloc_242.rs flag-on assertions became default assertions; flag-off became the =0 opt-out.

Gate (all foreground, exit 0)

  • cargo build -p synth-cli
  • Execution differentials (above) BEFORE refreeze ✓
  • cargo test -p synth-cli (43+ tests incl. re-pinned frozen gate + both escape hatches) ✓
  • cargo test -p synth-synthesis (510+) ✓
  • cargo test --workspace --exclude synth-verify
  • cargo fmt --check ✓ · cargo clippy --workspace --all-targets -- -D warnings

🤖 Generated with Claude Code

…#242, VCR-RA-001)

The deliberate byte-changing flip, with the refreeze ritual (the v0.14.0
local-promotion pattern). The three-stage spill-realloc lever — #569
slot-value forwarding, #576 Belady spill re-choice, #579 whole-function
slot liveness — now runs BY DEFAULT on the ARM path;
SYNTH_SPILL_REALLOC=0 is the opt-out.

Evidence basis: three landed flag-off increments, 40+ functions shrink /
0 grow across the 68-fixture x 2-path sweep, per-segment executable
value-trace equality guards, and the unicorn-vs-wasmtime execution
differentials re-run green on the NEW default bytes BEFORE re-pinning
(flight_seam 0x07FDF307, frame_slot_dce default+opt-out, const_cse,
spill_rung_581 12/12, r12_spill_496 control_step_decide 5/5,
i64_param_518, br_table_value_509).

Refreeze: flight_seam 738->730 (-8 B, dce728b4->6872d6f3),
flight_seam_flat 878->866 (-12 B, 0665e623->d11849db); control_step and
signed_div_const byte-identical. RV32 anchors UNCHANGED (ARM-only
wiring). const_cse_reduction_242 optimized-path golden byte-identical.

Opt-out is CI-gated: the new
frozen_fixtures_spill_realloc_escape_hatch_restores_old_bytes test pins
SYNTH_SPILL_REALLOC=0 to the pre-flip goldens; the SYNTH_NO_STACK_FWD
hatch now composes with it. spill_realloc_242 flag-on assertions became
default assertions.

SYNTH_SPILL_ON_EXHAUST is untouched (population-changing; stays off
pending silicon).

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

codecov Bot commented Jul 2, 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 0e1a4cc into main Jul 2, 2026
25 checks passed
@avrabe avrabe deleted the feat/242-spill-realloc-default-on branch July 2, 2026 20:27
avrabe added a commit that referenced this pull request Jul 2, 2026
… Belady spilling default-on (#585)

Caps the four-lane arc: slot liveness (#579), exhaustion spill (#580),
spill-rung fix (#582), SYNTH_SPILL_REALLOC flip + refreeze (#583).
VCR-RA-001 -> verified; rivet release status v0.24.0: cuttable. Pin sweep +
lock + CHANGELOG.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
avrabe added a commit that referenced this pull request Jul 2, 2026
) (#586)

The script parsed `synth disasm` text with a regex to find the
control_step_decide entry point — the #489 host-dependence class — and
drifted into a KeyError on current main (found by the #583 flip lane;
identical with SYNTH_SPILL_REALLOC=0, so pre-existing harness drift, not
a codegen change).

Symbols now come from the ELF symtab via pyelftools, mirroring the
merged #575 flight_seam_differential pattern:

- locate SHT_SYMTAB by section TYPE (synth's ET_REL objects emit it
  with an empty section name, so get_section_by_name fails)
- mask the Thumb bit on STT_FUNC st_value
- export name first (control_step_decide), positional func_0 fallback
  for older objects, loud SYMBOL MISSING exit otherwise

Vectors and semantics are unchanged (13 vectors incl. gale's reference
anchor control_step_decide(3000,50,40,0) = 0x00210A55); the script no
longer needs a synth binary at runtime at all. Also CI-gates it as
control-step-584-oracle (flight-seam-570-oracle pattern) so harness
drift reddens instead of rotting — the r12_spill_496 oracle covers
control_step on the DEFAULT optimized path, this covers --relocatable.

Closes #584

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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