fix(#944): verified machine-readable origins for compiler-introduced object branches — the 9 were never unattributed, the real 33 now are attributed - #967
Merged
Conversation
…anches + cover 'if' as a source decision The 9 'only-in-synth' divergences in #944 are provenance ENTRIES for real source ops (6 unconditional br, 3 folded select) that witness's manifest never instruments — not object branches without WASM origin. The genuine compiler-introduced conditional branches on that module are the bulk-memory expansion guards, previously surfaced only with a guessing free-text note. - ObjectCondBranch gains additive 'origin': kebab-case, derived from the encode-time line_map (never guessed), only for disassembly-verified families: bulk-memory-fill-loop, bulk-memory-copy-loop, division-trap-guard. Unverified families stay declared-unattributed. - WasmOp::If is now a covered source decision (preserved entry, resolved branch) — its conditional branch was mis-bucketed as introduced. - Unit tests incl. the non-vacuity negative control (unverified family must NOT be labeled). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
…e API session limit Committed by the hub coordinator so the work survives the interruption. NOT reviewed and NOT complete: the lane stopped mid-task, so this is a restore point, not a claim that anything is verified. The lane resumes from here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ibuted floor 0, closed vocabulary Integration gate over scripts/repro/provenance_introduced_944.wat (cortex-m3 --all-exports --relocatable --emit-provenance): - pins EXACT per-origin counts (1 fill-loop, 3 copy-loop, 3+1+1+1 division guards) so an attribution loss OR an excuse-widening both turn red (mutation-verified: unmapping MemoryCopy -> 3 UNATTRIBUTED panics; blanket-labeling trips the synth-core negative control); - asserts the if decision is covered+resolved, not bucketed as introduced; - holds the module-wide unattributed floor at 0 with a closed, disassembly-verified origin vocabulary. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
Codecov Report❌ Patch coverage is
📢 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.
#944 — the 9 "object branches with no WASM origin": triage, attribution, gate
The premise was false — in a good way
Reproducing the count from the committed evidence (
pulseengine/galebenches/gust/drivers/mcdc/evidence/switch-thin.{witness,provenance}.json, joined exactly aswitness object-dispositiondoes, on(func_index, instruction_offset)) gives exactly the 9 keys from the issue — and every one of them is a provenance entry for a real source WASM op, not an object branch without origin:wit_bindgen::rt::cabi_reallocbrpreserved…fsm::Guest>::tickbrpreserved…fsm::Guest>::run_switchbrpreserved…fsm::Guest>::run_switchselectfolded-predication…fsm::Guest>::run_switchbrpreserved…fsm::Guest>::mark_resumedselectfolded-predication_export_mark_swapped_cabiwrapperbrpreserved…fsm::Guest>::current_windowselectfolded-predicationbrpreservedCategory verdict: none of the 9 is a miscompile, and none is even an unattributed compiler-introduced branch. They are 6 unconditional
brs and 3selects folded to predication — source ops synth's map records faithfully, which witness never instruments (its manifest carries onlybr_if/br_table_target/br_table_default/if_then/if_else).only_in_synthin witness's reconciler means "synth entry with no witness branch record"; its hardcoded divergence text — "(object branch witness never instrumented)" — is what turned "uninstrumentedbr/select" into "object branch with no source", and the issue's framing followed from that message. The 9→8→4 movement across the source variants in the follow-up comment tracks whichbr/selectsource ops survive each source-level simplification — consistent, and the "irreducible 4" are thebr/selectops incabi_reallocand the export wrappers. Witness-side classification (filter/labelonly_in_synthby theopfield synth already emits) is witness#109 territory.The REAL unattributed population — and its attribution
The genuinely compiler-introduced conditional branches on
switch-thinare the 33resolved: falseentries inobject_cond_branches(invisible to witness's join, surfaced only with a free-text guessing note). All 33 trace, via the encode-timeline_map, tomemory.fill/memory.copylowerings. Reproduced and disassembly-verified on current main (ELF bytes via pyelftools+capstone, neversynth disasmtext), per introducing op:memory.fillcmp; bhs, zero-trip safe)memory.copycmp dst,src; bhi) + forward and backward copy-loop bound testsi32.div_sINT_MIN/-1overflow guard pair, each skipping audfi32.div_u/i32.rem_s/i32.rem_uifProbed-and-clean on the same path (no cond branches emitted):
call_indirect,memory.grow, i64 div/rem (software), i64 shifts/clz/eqz/compares. No category (b) — no branch that should not exist — was found anywhere in this lane.What this PR changes
crates/synth-core/src/provenance.rsObjectCondBranchgains an additiveoriginfield (absent whenNone; witness's serde ignores unknown fields, wire format stayssynth-provenance-v1): a kebab-case machine-readable origin derived from the op the branch'sline_mapentry traces to — never guessed. Closed, disassembly-verified vocabulary:bulk-memory-fill-loop,bulk-memory-copy-loop,division-trap-guard.origin: Nonewith the op named in the note — unexplained-but-declared beats a confident wrong label (the issue's own follow-up demonstrated the plausible label being wrong).ifis now a covered source decision ("If"preservedentry; its conditional branch resolves). Bonus for the witness join: witness does instrumentif_then/if_else, so coveredifentries can now match instead of falling intono-provenance.scripts/repro/provenance_introduced_944.wat+crates/synth-cli/tests/provenance_introduced_origin_944.rs— the gate:MemoryCopy→ 3UNATTRIBUTEDpanics; blanket-labeling (_ => Some("division-trap-guard")) trips the synth-core negative-control unit test.No CHANGELOG/version/status.json changes (release-hub constraint). No doc-claim changes;
claim_checkstays 43/43.Closes #944.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L