Skip to content

docs(vcr-ra): map the register-exhaustion recovery ladder (#242)#476

Merged
avrabe merged 1 commit into
mainfrom
vcr-ra/recovery-ladder-map
Jun 24, 2026
Merged

docs(vcr-ra): map the register-exhaustion recovery ladder (#242)#476
avrabe merged 1 commit into
mainfrom
vcr-ra/recovery-ladder-map

Conversation

@avrabe

@avrabe avrabe commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Roadmap artifact, no codegen change (frozen gate green).

The north star (#242) replaces synth's single-pass register allocator with a verified one. The clearest spec of what that allocator must do is the failure-recovery ladder the current allocator has accreted in arm_backend.rs::select_direct:

# rung added by catches
0 base attempt the common case
1 optimized→direct decline #120 unlowerable IR (scalar f32/f64)
2 spill-on-exhaustion #242 i32 "all allocatable registers are live on the stack"
3 param frame-backing #204 i64 "no consecutive pair of free registers"
4 promotion-off fallback #474/#475 any exhaustion promotion caused

Each rung is reached only after a recoverable register exhaustion, so the base-attempt corpus is untouched (that's why each was bit-identical when it landed, and why the frozen gate stays green).

Why it matters for #242: rung 4 existing at all is a direct symptom of the single-pass allocator — local promotion is an optimization that can turn a working compile into a failure, "fixed" by a retry that drops the optimization. A correct-by-construction allocator with spilling collapses rungs 2-4 into "allocation succeeds": no exhaustion Err, no ladder. So the VCR-RA acceptance bar is that every function needing rungs 2-4 today allocates on the first pass under the verified allocator, the ladder surviving only as a never-firing assertion.

Honest scoping: only rung 4 is confirmed load-bearing here (its fixture fails without the rung); the other fixture→rung mappings are design-intent pending a per-rung counter (noted as the natural next measurement, env-gated/frozen-safe).

Refs #242, #474

🤖 Generated with Claude Code

Roadmap artifact, no codegen change. The north star (#242) replaces synth's
single-pass register allocator with a verified one; the clearest spec of what that
allocator must do is the failure-recovery ladder the current allocator has accreted
(arm_backend.rs select_direct): base attempt -> optimized-decline (#120) ->
spill-on-exhaustion (#242 3b-lite) -> param frame-backing (#204) -> promotion-off
fallback (#474/#475). Each rung is reached only after a recoverable register
exhaustion, so the base-attempt corpus is untouched (frozen gate green).

Maps each rung to the issue that added it and the failure it catches, ties fixtures
to rungs (only rung 4 / promotion_exhaustion_fallback is confirmed load-bearing;
the rest are by design intent pending a per-rung counter), and states the VCR-RA
acceptance implication: a correct-by-construction allocator with spilling collapses
rungs 2-4 into "allocation succeeds" — the ladder then survives only as a
never-firing defense-in-depth assertion.

Refs #242, #474

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

codecov Bot commented Jun 24, 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 05937fc into main Jun 24, 2026
11 checks passed
@avrabe avrabe deleted the vcr-ra/recovery-ladder-map branch June 24, 2026 21:19
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