Conversation
…subset VCR-PERF-002 beyond-parity: a literal nonzero i32.const divisor makes i32.rem_u unconditionally total (traps only on divisor==0; no INT_MIN/-1 overflow — that's div_s). Under a proven-narrow dividend (UNSAT(P ∧ (x bvurem C) ≠ x)) the modulo is the identity, so — unlike the general variable-divisor path that only elides the trap GUARD and keeps the op — the whole effect-free op is DELETED and the dividend flows through, exactly like the redundant-mask class. The VC is non-vacuous: WasmSemantics::encode_op(I32RemU,..) emits a real bvurem term, checked UNSAT by ordeal QF_BV with an LRAT certificate. Flag-off / non-eliding-flag-on take the exact general div/rem path (guard obligations + havoc), so bytes are unchanged. 5 unit tests: identity admit, wrong-bound Sat decline, variable-divisor decline (op kept + zero-guard still discharged), no-fact decline, pow2 admit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
…fication incomplete) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ty region The salvaged --expect-decline path asserted the declined build was byte-identical to the OFF baseline. That was wrong-headed: fact-spec ON always fires the pre-existing nonzero-divisor ZERO-GUARD elision (#494 phase 2b) for a literal nonzero divisor, so the ON build can never equal the OFF baseline for this fixture (24 -> 18 B). The prior narrative confused "identity declined" with "no elision fired". Replace the byte proxy with the actual safety property: under a too-wide bound the identity declines LOUDLY and the op SURVIVES computing the true modulo — so sweep OUT-OF-BOUND values (x >= divisor, the exact region the identity would have miscompiled) and assert specialized == wasmtime == unspecialized by execution. Strictly stronger than the byte check. Both paths green: in-bounds (identity fires): unspec 24 B -> spec 2 B, 13 values PASS wrong-bound (identity declines): spec 18 B, 6 OOB values PASS clang -Os `unsigned x % 1000u` for thumbv7em/cortex-m4 = 24 B (measured: movw+movt+umull+lsrs+mov.w+mls+bx, gust_scale st_size 0x18). synth with the discharged ValueRange fact deletes the whole op to 2 B `bx lr` — a 22 B (12x) beat-LLVM win licensed by UNSAT(P and (x bvurem 1000) != x), certificate-checked QF_BV, not a heuristic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L
Codecov Report❌ Patch coverage is
📢 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>
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.
VCR-PERF-002 / #494 — proof-carrying
i32.rem_uidentity elisionA literal nonzero
i32.constdivisor makesi32.rem_uunconditionallytotal (WASM
rem_utraps only on divisor==0 and has no INT_MIN/-1 overflow —that's
div_s). Under a proven-narrow dividend the modulo is the identity,so — unlike the general variable-divisor path that only elides the trap guard
and keeps the op — the whole effect-free op is DELETED and the dividend
flows through, exactly like the redundant-mask class. This is the ONE total
subset of synth's "div/rem is never deleted" rule.
Measured beat-LLVM (named public-cover fixture
gust_scale,x rem_u 1000, Thumb-2 / cortex-m4)gust_scale.textbx lr(the identity)unsigned x % 1000u,thumbv7em-none-eabi -mcpu=cortex-m4)movw+movt+umull+lsrs+mov.w+mls+bxsynth beats clang -Os by 22 B (12x). The win is REAL and licensed by a
DISCHARGED FACT, not a heuristic drop: LLVM has no range on the dividend (a
dissolved WASM primitive), so
-Osmust emit the full reciprocal sequence;synth's WASM-level
ValueRangefact makes the entire sequence dead.The certifying fact (proof-carrying, non-vacuous)
The elision fires only when ordeal QF_BV returns UNSAT on:
where
dividend bvurem 1000is the realbvuremterm emitted byWasmSemantics::encode_op(I32RemU, ..)(wasm_semantics.rs:81), andPis theingested
wsc.factsValueRange premisex ∈ [0, 999]. Every Unsat carries anLRAT proof validated by ordeal-lrat. If the fact is absent, or too wide (x can
reach 1000), the check is Sat and synth declines loudly — the general
lowering stands. A variable divisor also declines (its zero-guard is a
control-flow effect; only a syntactic
i32.const C, C≠0qualifies).Verification (all green)
scripts/repro/fact_spec_rem_494_differential.py):in-bounds sweep of 13 values under unicorn — specialized ≡ wasmtime ≡
unspecialized. Non-vacuity gate: fails unless the certificate-backed identity
actually fired AND shrank
.text.--fact-hi 4000 --expect-decline): identity declinesloudly; the surviving op is swept over 6 out-of-bound values (x ≥ divisor,
the region the identity would have miscompiled) and proven to compute the true
modulo. (This replaces the salvaged harness's incorrect "byte-identical to
baseline" assertion — the pre-existing nonzero-divisor zero-guard elision
legitimately shrinks the declined build 24→18 B; the safety property is
correctness-by-execution, not a byte proxy.)
SYNTH_FACT_SPEC=0≡ plain compile, identical.textsha256 (549feb34…). The lever is flag-gated, default OFF.frozen_codegen_bytes10/10 (default-off ⇒ nofixture bytes move).
decline (op kept + zero-guard still discharged), no-fact decline, pow2 admit.
specialization lever).
Refs #494. Do NOT merge — review gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YJK5LZZEkV5smCY1jKn18L