Conversation
Automated review for PR #1583pulseengine/synth: Verdict: 💬 Comment Summary: The commit introduces several changes that need to be addressed before the PR can be merged. The main issues are related to the Findings: 0 mechanical (rivet) · 1 from local AI model. Findings (1):
Generated by a local AI model and post-validated against a strict JSON contract. Each finding includes the verbatim line being criticised — verify by reading the file at the cited location. Reviewed at |
Automated review for PR #1583pulseengine/synth: Verdict: 💬 Comment Summary: The changes made to the codebase are focused on addressing issues related to register allocation and branch handling in the VCR-RA-003 validation. These changes include fixing bugs in the Findings: 0 mechanical (rivet) · 2 from local AI model. Findings (2):
Generated by a local AI model and post-validated against a strict JSON contract. Each finding includes the verbatim line being criticised — verify by reading the file at the cited location. Reviewed at |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Automated review for PR #1583pulseengine/synth: Verdict: 💬 Comment Summary: The pull request has been approved. Findings: 0 mechanical (rivet) · 1 from local AI model. Findings (1):
Generated by a local AI model and post-validated against a strict JSON contract. Each finding includes the verbatim line being criticised — verify by reading the file at the cited location. Reviewed at |
…el at an unreachable block join, and lands a function-level br_table edge after the dispatch RQ-89-BRVALUE (Refs #1215): DELIVERED. select_with_stack, the one lowering every affected function takes on both legs (all are pre-gated to it), had two defects: - At a block whose fall-through is unreachable but which a branch targets, the simulated operand stack was never reset to the block's entry height. Values pushed by dead code after a br/br_table were consumed by the code after the block (br.wast nested-br_table-value-index returned 12; wasmtime returns 9). BlockLabel now records the entry height, the live prefix at the first unconditional transfer, and whether a branch targets the join. End resets the model, propagates unreachability out of a loop or an untargeted block, and loud-refuses if dead code reached below the entry height. - A function-level br_table edge landed its carried value in R0 before the dispatch cascade, overwriting an index held in R0 (func.wast break-br_table-nested-num(1) returned 52; wasmtime returns 50). The landing now follows the br_table_fnret label. Evidence: - New oracle brvalue_operand_1215_differential.py, run on the default, --no-optimize and --relocatable legs: 57/144 on v0.88.0, 144/144 on the fix. - Parity oracle with its five #1215 pins removed: red on v0.88.0 with exactly those 11 assertions, green on the fix (17934/17934). - Byte census: zero newly refused functions. Three VCR-RA-003 refusals pinned under #1230 now compile correctly, so that oracle's census moves from 3 to 0. RQ-89-SELWRAP (Refs #1213): REFUTED. as-convert-operand and the issue's distinguishing probe agree with wasmtime on every leg, because the optimized path has declined the shape since v0.65. Also in this commit, squashed from three follow-ups when it was rebased onto 0b9fce7 (#1577/#1578/#1579): - The ARM corpus sweep drops ra003_switch_1230.wat from EXPECTED_DECLINES. It now compiles, and its 12 vectors match wasmtime. - The reach this moves is counted and pinned: - Spec compile census: labels.wast moves partial -> ok, so arm ok is 16, partial 29 and MVP core 13. - Home-alias audit: the new fixture adds +60 functions, +48 homes and +916 attributed instructions. - Mutation replay: the liveness entry's changed set is 53 -> 56, the +3 being the new fixture. - The exact emulation floor is re-derived on the merged tree, the mutation ledger is re-anchored, and the selector ratchets are chained over the INTALIAS and NPARESIDUE waivers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
Rebased onto bbda3f9 (#1577 RELOCSINGLE, #1578 INTALIAS, #1579 NPARESIDUE, #1583 BRVALUE). The census conflict was resolved by taking main's numbers and pinning the LIVE census of the rebuilt binary: arm 16 ok / 27 partial / 92 all_declined / 103 module_decline, riscv 9/31/94/104, aarch64 21/21/78/118, and at-least-one-export 43/40/42. Paired: main's binary passes main's pins and fails ours 9 ways; ours passes ours and fails main's 9 ways. The lane record now quotes the merged-tree figures: parity 17934/17934, 2736 modules, 828 byte-identical compiles. mutation_survey.json reanchored: 7 sites moved +96 lines in main.rs; no count changed. Refs #1582 Refs #1209 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
Rebased onto 0b9fce7 (#1577/#1578/#1579) as a single squashed commit; every number below re-derived on the merged tree.
v0.89 lane: RQ-89-BRVALUE (Refs #1215) and RQ-89-SELWRAP (Refs #1213). DO NOT MERGE; the coordinator lands it.
Refuting commands (run first)
SELWRAP (#1213): REFUTED.
select.wast as-convert-operandagrees with wasmtime on both legs (2 of 2 vectors each) on v0.88.0 (0161dee).It is correct because the optimized path declines an i64 select: the RQ-65-DECLINE fallback (v0.65) sends the function to the direct selector.
ir_to_armwas not fixed.The spec vectors are weak (they return 0 and 1), so the issue's distinguishing probe was also run, selecting between 0x1122334455667788 and 0x1899aabbccddeeff:
--no-optimize): 12 of 12 rows agree.--no-optimize,--relocatable): 18 of 18 rows agree.A five-word-argument variant was not executed, because the harness does not pass stack arguments. Nothing was built for this artifact. Its status stays
proposedwithdisposition: refutedandissue-scope: closes.BRVALUE (#1215): CONFIRMED, then fixed. On v0.88.0 (0161dee), the operand-position functions in the spec
br/br_if/br_tablefiles (plus theif.wast/func.wastcases the issue names) were executed on both selectors:as-*/nested-*vector that compiles; if.wast as-br_if-last / as-br_table-last; func.wast break-br_table-*Probe totals:
On the "both selectors" framing: all 11 wrong assertions take
direct (pre-gate) br-table,value-carryon the default leg too. That is one lowering,select_with_stack, reached two ways, which is why one fix covers both legs.Declines (loud, not wrong code):
stack underflowon both legs: br.wast and br_table.wastas-br_if-cond,as-br_table-index,as-select-all,as-call-all,as-binary-bothand others.#509i64 value-carry.#509branch to an if join.JoinValueNotAvailableon br_if.wastnested-br-valueandnested-br_table-value. These two are fixed by this PR, see below.--relocatableleg: the spec modules are refused whole on this leg (#1052, global initializers), so the parity oracle never executes it. The new oracle re-hosts the functions so it does. On v0.88.0 they are equally wrong there.Root cause and fix (
select_with_stack)br/br_table/return/unreachable; the direct selector's simulated stack is not. A block'sendnever reset the stack to its entry height, so values pushed by dead code after the transfer were consumed by the code after the block. For example,4+8was computed where the spec says1+8.BlockLabelgains three fields:entry_height;dead_prefix, the livestack[..entry]captured after the first unconditional transfer; andbranched.Endat a dead but branched-to block truncates the stack to its entry height. It still emits the legacy dead fall-through move, so no correct function moves a byte.#1215:diagnostic.Elseresets the flag.br_tableR0 landing. The carried value was moved to R0 before the CMP/Bcc cascade, overwriting an index that lived in R0. The value is now peeked after all block edges are allocated, andmov r0, valis emitted afterbr_table_fnret. The cascade writes no register in between. Bytes before the fix:mov r0, r1; cmp r0, #0.Evidence (red on v0.88.0 → green on the fix, against wasmtime)
scripts/repro/brvalue_operand_1215_differential.py, wired into ci.yml (emulations >= 141; the step grepsCHECKS=N/NandRESULT: PASS).rv32_br_value_931.wat'scarried/promoted, and 4 propagation fixtures, on all three legs. It also pins the refusal on all three legs.#1215 CHECKS=57/144, with 29 failures on each leg: 18 wrong values, 10 vectors of refused functions, and the refusal needle absent.144/144with 141 emulations.rv32_br_value_931.wat'scarriedis5 + (block (br 0 (i32.const 1)) (i32.const 0)). It returned 2 on all three ARM legs (wasmtime 6). That fixture is only run on RV32 in CI.selector_parity_197_differential.py), with the five#1215KNOWN pins (11 cases) removed:CHECKS=17913/17924, exactly those 5 unpinned, rc 1.CHECKS=17934/17934over 261 modules, 25328 emulations, 0 unpinned, PASS.--no-optimizeand--relocatablelegs:rv32_br_value_931.wat,ra003_switch_1230.wat(now accepted) and the new fixture.br_if as-call_indirect-*moves are only a literal-pool table address shifting.pberefusal shape was already refused by the base compiler, with a barestack underflow.labels.wast switch, andbr_if.wast nested-br-valueandnested-br_table-value.ra003_join_1230_differential.pypins. Its KNOWN census moves from 3 to 0 (two rows set to 0), and the ci.yml greps move toTOTAL=0 (pin 0)andCHECKS: 0 declines.TOTAL=3 (pin 0)), and the old pins red on the fix.Follow-up commit: whole-block run of every CI oracle step
Every ci.yml
run:block that callsoracle_run.py scripts/repro/was run whole against the fix build (202 blocks; the parity step was run separately, above).ra003_switch_1230.watnow compiles and was still onEXPECTED_DECLINES. The entry is removed; the sweep executes its 12 vectors with 0 mismatches and is green atcompiled=187/207.target/release, artifacts staged by earlier steps, the WCET argument plumbing, the aarch64 host link, fact-spec, and the home-alias audit's grep.ci_subsetsite lies inselect_with_stack.rs. The new step's job is not insuite.selected_jobs.Follow-up: three more populations, each measured old binary vs new binary on the same tree
labels.wastmoved (partial → ok). Itsswitchpasses 6/6 spec assertions in the parity oracle and runs on all three legs in the new oracle. The v0.88.0 binary fails the new pins with exactly these three mismatches; the fix passes on all three backends. The #1225 identity step passes.liveness.rs:7404:36changed setmutation_survey.py ciran to completion locally (subset=10, failures=0) andci_mutants_gatepasses.Pinned numbers moved
Each has a paired control: the old value reds on the new tree, and the new value reds on the base.
known_open_pinsto: 79, five pins closed by a fixknown_open_pinned_casesselector_wildcard_arms_code_ => {}RQ-66 added to thisBrTablematch is goneselector_wildcard_arms_totalselector_lines_codeselector_lines_total--exact-emulation-floor 368409rc 0, 368311 rc 1, 368268 rc 1mutation_survey.jsonartifacts/status.jsonwas regenerated.Checks run locally
cargo fmt --checkandcargo clippy --workspace --all-targets -D warningsare clean.cargo test -p synth-synthesispasses.claim_checkreports 75/75.verdict_prose_checkreports 0 disagreements.status_evidence_checkis clean once this PR's number is inlanded:.$ORACLE_EVIDENCE_JSONLunset, and mutation steps skipped locally. The R15 red from the PR-number placeholder was cleared by the follow-up amend.Not verified
select_with_stack.rs,claims.yamlratchets andmutation_survey.json, so expect merge conflicts on the pinned numbers.🤖 Generated with Claude Code
https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L