Skip to content

Commit dc1d122

Browse files
avrabeclaude
andauthored
docs(vcr): record optimized-path callee-saved/block-brif fixes landed + the optimizer_bridge control-flow frontier (#242) (#501)
VCR-ORACLE-001's running log was stale: it ended with "#490 blocks the non-leaf prologue lever / the lever stays unmerged until #490 lands". Both that fix and a companion control-flow fix have since landed this arc — record the resolution and the broader frontier the work surfaced, so the #242 roadmap reflects reality and prioritizes the next gated step. Appended (behavior-frozen, doc-only) to VCR-ORACLE-001: - #490 LANDED (PR #495): optimized path now wraps a body that touches r4-r8 in push {r4-r8,lr}/pop {r4-r8,pc}, decided on the post-realloc body (no spurious push; >4-param fns decline to direct so stack-arg offsets are untouched), CI oracle callee_saved_490_differential.py. The non-leaf prologue lever it blocked is now unblocked. - #483 LANDED (PR #497): forward block+br_if mid-instruction landing — End labelled with its own id not the closed block's, plus Strh/Strb/Ldrh/... sized 2 vs the 4-byte .w the high-base optimized path emits; CI oracle block_brif_483_differential.py. - The multi-modal control-flow sweep established these are one cluster of optimizer_bridge control-flow/ABI defects — the concrete measured evidence for VCR-SEL-001's "collapse the two/three-selector accretion" motivation — and the next gated frontier: #500 (br_if still unresolved for if/else + sequential blocks; seqblocks the minimal repro; Pattern-3 ruled out), #499 (spill frame not deallocated under control flow; #490's pop epilogue made the SP leak fatal, #215-class), #498 (byte-size estimator incomplete for Cmp/Cmn/Adds/Subs/Popcnt; structural mirror drift), #496 (register-exhausting folds silently miscompiled). All four are separate gated steps, never idle-tick increments; none in shipped firmware (gale ships --relocatable/direct). rivet validate profile unchanged (49 errors / 75 warnings / 0 broken cross-refs, all pre-existing xref/coverage gaps; NON_XREF=0); coverage exit 0. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 024be09 commit dc1d122

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

artifacts/verified-codegen-roadmap.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,44 @@ artifacts:
596596
the differential = repro) until #490 lands. This is a "correctness from
597597
construction" item (the north star itself) and gates the perf lever
598598
downstream of it.
599+
RESOLVED + BROADER OPTIMIZER-BRIDGE CONTROL-FLOW FRONTIER (2026-06-26,
600+
#490/#483/#500): #490 LANDED (PR #495) — the optimized path now wraps any
601+
body that genuinely touches r4-r8 in `push {r4-r8,lr}` / `pop {r4-r8,pc}`,
602+
decided on the POST-realloc body (only genuinely-clobbered regs saved, so a
603+
cs-free leaf never gets a spurious permanent push; >4-param functions
604+
decline to the direct selector, so the inserted push cannot perturb
605+
incoming stack-arg offsets — verified byte-identical to `--no-optimize`),
606+
gated by `scripts/repro/callee_saved_490_differential.py` (r4-r8 sentinels +
607+
result vs wasmtime, covering the 16-bit push and the 32-bit PUSH.W
608+
high-register form). The non-leaf thin-forwarder prologue lever this blocked
609+
is now unblocked for a deliberate flip. A companion optimized-path
610+
control-flow miscompile LANDED the same arc (#483, PR #497): a forward
611+
`block`+`br_if` branch landed mid-instruction — two causes, the closing
612+
`End` labelled with its OWN id instead of the id of the block it closes (so
613+
the `br_if` resolved against an id no label held, left as the unpatched
614+
offset-0 placeholder), plus a `byte_offsets` size estimate that sized
615+
`Strh`/`Strb`/`Ldrh`/`Ldrsh`/`Ldrb`/`Ldrsb` as 2 when the high-base
616+
optimized path emits the 4-byte `.w` form — gated by
617+
`scripts/repro/block_brif_483_differential.py` (linear-memory diff vs
618+
wasmtime, both branch directions, forward + nested blocks). A multi-modal
619+
control-flow SWEEP then established these are ONE CLUSTER of optimizer_bridge
620+
(optimized-path) control-flow / ABI defects — the concrete measured evidence
621+
for VCR-SEL-001's "(ii) collapse the two/three-selector accretion
622+
(select_default / select_with_stack / optimizer_bridge) into one verified
623+
source" motivation — and the next gated frontier, none of it in shipped
624+
firmware (gale ships `--relocatable` / direct): #500 — `br_if` STILL
625+
unresolved for if/else (nested block+br_if+`br`) and SEQUENTIAL-block shapes
626+
(`seqblocks`, two non-nested blocks, is the minimal repro; the #483
627+
End-label fix is necessary-not-sufficient; the Pattern-3 select matcher was
628+
ruled OUT); #499 — a spill frame (`sub sp,#N`) not deallocated under control
629+
flow (missing `add sp`), a latent SP leak that #490's `pop {..,pc}` epilogue
630+
turned FATAL (#215-class "epilogue change exposes a latent frame bug"); #498
631+
— the `byte_offsets` estimator still lacks `Cmp`/`Cmn`/`Adds`/`Subs`/`Popcnt`
632+
(structural: synth-synthesis cannot depend on synth-backend, so the size
633+
table is a hand-maintained mirror of the encoder that drifts); #496 —
634+
register-exhausting i32 folds silently miscompiled (no spill, no decline).
635+
All four are SEPARATE gated steps (flag-off / differential / silicon as
636+
applicable), never idle-tick increments.
599637
status: approved
600638
tags: [oracle, differential, coverage, mcdc, validation, track-c, riscv]
601639
links:

0 commit comments

Comments
 (0)