Skip to content

Commit 2d19ddb

Browse files
avrabeclaude
andauthored
docs(rivet): VCR-DEC-003 — settle synth-provenance-v1 contract for witness MC/DC reconciliation (#396) (#520)
witness (#396, PR witness#130) landed its reconciler + `witness object-disposition` CLI and defined the `synth-provenance-v1` schema synth must emit so MC/DC coverage measured on the WASM reconciles against the object code synth's branch folding/splitting produces. Records the synth-side acceptance of the contract as a rivet decision: - Join key CONFIRMED available — synth's `op_offsets` side-table (VCR-DBG-001 step 1) is the per-function WASM byte offset witness joins on; no decode/manifest change either side. - The 4-kind taxonomy (preserved / folded-predication / eliminated-constant / split-into-object-branches) maps 1:1 onto real synth transforms (cmp→select fuse, guard elision + scry#51 evidence, br_table/i64 multi-branch expansion). - ONE open item raised on #396 before implementing: the offset-normalization domain (module-relative vs function-body-relative) so the join is exact. - Emitter scoped as the follow-up milestone (label branches through both lowering paths — optimized `ir_to_arm` drops provenance today — + serialize behind a CLI flag, frozen-safe/additive). Behavior-frozen: docs/traceability artifact only, no code or `.text` change. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 2024817 commit 2d19ddb

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

artifacts/verified-codegen-roadmap.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,77 @@ artifacts:
12501250
criterion: t_lock << 887, handoff < 1661). All frozen fixtures stay
12511251
bit-identical at every step.
12521252
1253+
- id: VCR-DEC-003
1254+
type: sw-req
1255+
title: "Decision: emit `synth-provenance-v1` branch-transformation map for witness MC/DC source-to-object reconciliation (#396, witness#130)"
1256+
description: >
1257+
witness (#396, PR witness#130 — reconciler + `witness object-disposition`
1258+
CLI landed AHEAD of synth) defines the contract synth must emit so MC/DC
1259+
coverage measured on the WASM can be reconciled against the object code
1260+
synth's branch folding/splitting actually produces. Schema
1261+
`synth-provenance-v1`: a list of entries
1262+
`{ func_index, instruction_offset, kind, count?, scry_evidence? }` where
1263+
`kind ∈ preserved | folded-predication | eliminated-constant |
1264+
split-into-object-branches`. witness's reconciler maps each to an
1265+
object-verdict: preserved/folded-predication → obligation-stands (WASM MC/DC
1266+
authoritative); eliminated-constant → justified-infeasible (carries optional
1267+
scry#51 evidence); split-into-object-branches → needs-object-coverage (N new
1268+
object obligations); an object branch witness never instrumented →
1269+
only-in-synth divergence (surfaced, not hidden). Output extends the
1270+
rivet-evidence schema as `witness-object-disposition-v1`.
1271+
1272+
FEASIBILITY — the join key ALREADY EXISTS in synth. witness keys by the WASM
1273+
`(func_index, byte_offset)` (from walrus `InstrLocId`); synth's decoder
1274+
records exactly this as the `op_offsets` side-table (VCR-DBG-001 step 1,
1275+
SWVER-016 — per-op WASM byte offset, parallel to ops, per function). No
1276+
decoder/manifest change is needed on either side; an if/else's two arms share
1277+
one WASM op offset (one `if` instruction), matching witness's intentionally
1278+
many-to-one join (emit one entry per WASM instruction, not per witness
1279+
branch-arm).
1280+
1281+
TAXONOMY maps cleanly onto synth's real transformations: folded-predication =
1282+
the cmp→select→IT fuse (VCR-SEL-004, SYNTH_CMP_SELECT_FUSE, default-on);
1283+
eliminated-constant = constant-condition guard elision (Opt-1a) carrying
1284+
scry#51 reachability evidence; split-into-object-branches = `br_table`
1285+
lowering (#508) and the i64 ops that expand one WASM branch into a multi-cmp/
1286+
branch object sequence (I64SetCond / I64Shl / I64DivU / …); preserved =
1287+
every 1:1 `br_if`.
1288+
1289+
ONE OPEN ITEM TO SETTLE BEFORE IMPLEMENTING (raised on #396): the offset
1290+
NORMALIZATION domain — synth's `op_offsets` are module-relative WASM byte
1291+
offsets (into the code section); witness's `InstrLocId` byte_offset must be
1292+
confirmed module-relative vs function-body-relative so the join is exact, not
1293+
off-by-a-function-header. Once witness confirms, the emitter is the
1294+
implementation milestone: thread a per-branch transformation label through
1295+
BOTH lowering paths (optimized `ir_to_arm` currently sets `source_line: None`
1296+
— provenance is dropped there today; the direct selector carries it) and
1297+
serialize `synth-provenance-v1` behind a CLI flag (frozen-safe: additive
1298+
output file, no `.text` change). NOT in scope for the contract-settling step;
1299+
tracked as the VCR-DBG/witness follow-up.
1300+
status: proposed
1301+
tags: [witness, mcdc, traceability, provenance, vcr-dbg, decision, integration]
1302+
links:
1303+
- type: derives-from
1304+
target: VCR-001
1305+
- type: refines
1306+
target: VCR-DBG-001
1307+
- type: traces-to
1308+
target: synth:396
1309+
- type: traces-to
1310+
target: witness:130
1311+
fields:
1312+
req-type: constraint
1313+
priority: should
1314+
verification-criteria: >
1315+
Contract-settling step (this artifact): the `synth-provenance-v1` schema +
1316+
kind-taxonomy + join-key (op_offsets) are agreed with witness on #396, and
1317+
the offset-normalization domain is resolved. Implementation milestone
1318+
(separate): `witness object-disposition --manifest m.witness.json
1319+
--provenance synth-map.json` composes end-to-end on a shared fixture, with
1320+
each kind producing its specified object-verdict; the emitter is frozen-safe
1321+
(no frozen `.text` byte changes — control_step 0x00210A55, flight_algo
1322+
0x07FDF307).
1323+
12531324
- id: VCR-PERF-001
12541325
type: sw-req
12551326
title: "Silicon-quantified gust hot-path size gap: 3.9× vs LLVM, per-pass attribution (gale #390)"

0 commit comments

Comments
 (0)