Registry Mirror
Skip to content

Conversation

@avrabe

@avrabe avrabe commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

VCR-WASM-001 (epic #242, Track B) — WasmCert-Coq source-semantics anchor

Anchors synth's hand-written WasmSemantics.v stack-machine model on an independently derived reference (WasmCert-Coq, Watt et al. FM'21), mirroring on the WASM side what VCR-ISA-001 / SailArmBridge.v (#667) does on the ARM/selector side. Bounded first increment: 1 op (i32.add), 2 real-Qed refinement lemmas, establishing the pattern.

What landed

  • coq/Synth/WASM/WasmCertReference.v — transcribes WasmCert-Coq's i32.add operational rule (Wasm_int.Int32.int_add = CompCert Int.add = repr(unsigned x + unsigned y)) into synth's I32 primitives, with line-level provenance to the WasmCert-Coq / CompCert source. A bare Definition (0 Qed).
  • coq/Synth/WASM/WasmCertBridge.v — 2 Qed:
    • i32_add_refines_wasmcert_op : I32.add x y = wasmcert_i32_add x y — the algebraic core, discharged via Zplus_mod (NOT reflexivity).
    • i32_add_exec_refines_wasmcert — routes the claim through the real exec_wasm_instr I32Add: the executor pushes exactly wasmcert_i32_add v1 v2 on top of the popped stack.
  • Wired into coq/BUILD.bazel (wasm_cert_reference, wasm_cert_bridge, both in :rocq_proofs) + coq/_CoqProject.

Non-vacuity (why a wrong exec_wasm_instr I32Add fails this PR)

The reference wasmcert_i32_add is phrased only in I32.repr / I32.unsigned / Z — it never mentions I32.add or exec_wasm_instr, so the bridge is not synth agreeing with a copy of itself. synth's I32.add x y := repr (x + y) adds raw representatives; the WasmCert/CompCert reference normalizes each operand with unsigned first. Equal mod 2^32 but definitionally distinct — the proof genuinely discharges the raw-vs-normalized gap. A miswired add (e.g. I32.sub/I32.mul, wrong value, wrong stack shape) would be unprovable: the reference pins the OPERATION, not the shape.

Verification

  • bazel test //coq:verify_proofs — GREEN (both rocq_proofs and vcr_sel_rules_coverage PASSED with WasmCertBridge.v compiled).
  • python3 scripts/claim_check.py claims.yaml — 19/19 claims hold.

Ledger (bumped doc + ledger together)

  • Proof count 474 → 476 Qed / 5 Admitted (claims.yaml, CLAUDE.md, README.md ×3, coq/STATUS.md ×3).
  • New SYNTH-VCR-WASM-001-STATUS claim pins roadmap status=implemented + 2 Qed in WasmCertBridge.v + reference file exists.
  • artifacts/verified-codegen-roadmap.yaml: VCR-WASM-001 proposed → implemented (not verified — 1 op) + status-note.

Scope note (honest)

Bounded first increment — 1 op, establishes the refinement pattern. The reference is a hand transcription of the WasmCert-Coq/CompCert rule (importing the external model wholesale drags in mathcomp + CompCert Integers into the hermetic bazel/nix toolchain — a no-go at this stage, same as the SailArmBridge.v spike precedent). A real external WasmCert-Coq/CompCert coq dependency plus the full integer/control-flow fragment are the named follow-up (VCR-WASM-001 continuation).

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L

avrabe and others added 3 commits July 15, 2026 22:19
…2.add bridge (bounded first increment)

Bounded first increment of VCR-WASM-001 (roadmap Track B, epic #242): anchor
synth's hand-written WasmSemantics.v stack machine on WasmCert-Coq (the
community-standard mechanized WASM 1.0 semantics), mirroring what #667 /
SailArmBridge.v does on the ARM/selector side ("anchor, don't mirror").

- coq/Synth/WASM/WasmCertReference.v: transcribes WasmCert-Coq's i32.add rule
  (= CompCert Integers.Int.add = repr(unsigned x + unsigned y)) into synth's
  I32 primitives, with verbatim provenance to WasmCert-Coq theories/numerics.v
  and CompCert lib/Integers.v. Clearly marked as a transcription to be replaced
  by a real external coq dep (follow-up), per the SailArmBridge spike precedent
  that wholesale importing the external model into the hermetic bazel/nix
  toolchain is a no-go at this scale.
- coq/Synth/WASM/WasmCertBridge.v: 2 real-Qed lemmas.
  * i32_add_refines_wasmcert_op: synth's I32.add (repr of RAW operands) equals
    the reference (repr of unsigned-normalized operands) — a genuine proof via
    Zplus_mod, NOT reflexivity.
  * i32_add_exec_refines_wasmcert: routes the claim through the real
    exec_wasm_instr I32Add, pinning the pushed value to the INDEPENDENT
    reference. A miswired semantics (sub/mul/wrong value) fails this theorem.
- Wired into coq/_CoqProject and coq/BUILD.bazel (new wasm_cert_reference +
  wasm_cert_bridge rocq_library targets; bridge added to :rocq_proofs deps so
  bazel test //coq:verify_proofs checks it).

bazel build //coq:wasm_cert_bridge green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
… roadmap proposed→implemented

Bounded first increment landed and verified (bazel test //coq:verify_proofs
GREEN with WasmCertBridge.v included). The 2 real-Qed refinement lemmas add
to the total; roadmap VCR-WASM-001 moves proposed→implemented (1 op, pattern
established — real external dep + full fragment are the named follow-up).

- claims.yaml: 474→476 Qed (README/CLAUDE/STATUS count claims); new
  SYNTH-VCR-WASM-001-STATUS claim pins roadmap status=implemented + 2 Qed in
  WasmCertBridge.v + WasmCertReference.v exists → 19/19 claims hold.
- CLAUDE.md / README.md (3 spots) / coq/STATUS.md (3 spots): 474→476.
- roadmap: VCR-WASM-001 status proposed→implemented + status-note (scope +
  non-vacuity + follow-up).

claim_check.py: 19/19. G474RE board names untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
…id novel rivet field)

rivet validate runs in CI and greps for `^  ERROR:`; a novel `status-note`
key risks a schema error (rivet 0.15.0 precedent: WARN→ERROR promotion). Fold
the increment/scope/non-vacuity note into the existing verification-criteria
field. Claim text "BOUNDED FIRST INCREMENT LANDED (v0.45, VCR-WASM-001)" still
appears verbatim → 19/19 claims hold; YAML parses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
@avrabe
avrabe merged commit a979e00 into main Jul 15, 2026
33 checks passed
@avrabe
avrabe deleted the feat/45-vcr-wasm-001 branch July 15, 2026 21:06
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

avrabe added a commit that referenced this pull request Jul 16, 2026
… WasmCert anchor + VCR-ISA 41→50, A64 7→50, 12× beat-LLVM, MC/DC provenance) (#775)

Five oracle-gated lanes across semantics/capability/perf/assurance:
- VCR-WASM-001 (#771): WasmCert-Coq source anchor (i32.add refinement, 474→476)
- VCR-ISA-001 (#773): generate-not-mirror 41→50 ops (476→485 Qed)
- #538 (#769): AArch64 milestone 2 — 7→50 integer ops, honest div/rem decline
- #494 (#770): proof-carrying rem_u elision — 12× beat over clang -Os
- #396 (#774): synth-provenance-v1 MC/DC source-to-object map (VCR-DEC-003)

#757 stays OPEN (accepted residual — 7 reconstructions all green, needs reporter
module; #772 lands them as regression guards). i64.trunc_f64 + #761 residuals noted.


Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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