Skip to content

test(f32): gate all six f32 comparisons + CI-wire f32 soundness oracles (#712)#720

Merged
avrabe merged 1 commit into
mainfrom
fix/712-f32-compare-oracle-all-six
Jul 11, 2026
Merged

test(f32): gate all six f32 comparisons + CI-wire f32 soundness oracles (#712)#720
avrabe merged 1 commit into
mainfrom
fix/712-f32-compare-oracle-all-six

Conversation

@avrabe

@avrabe avrabe commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What

#712 reported all six f32 comparisons returning value-independent wrong results (the MOVS-after-VMRS flag clobber). That bug was already fixed in v0.40.0 (#716) — but #712 exposed a gate gap: the #619 harness only exercised flt/fgt, so eq/ne/le/ge were fixed-but-ungated. This is the same vacuous-harness pattern that let the bug ship in v0.39.0.

Verification (v0.40.0)

  • Disasm of all six on cortex-m4f: movs #0 now precedes vcmp/vmrs, correct condition codes (eq→EQ, ne→NE, lt→MI, gt→GT, le→LS, ge→GE).
  • Extended harness: 84/84 bit-exact vs wasmtime (was 60/60 — +24 for the four added comparisons).

Change

No production code changed (test/oracle + CI only); frozen anchors untouched. Closes #712.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… f32 oracles (#712)

#712 reported all six f32 comparisons returning value-independent wrong results
on cortex-m4f — the MOVS-after-VMRS flag clobber. Already FIXED in v0.40.0
(#716), but #712 exposed a gate gap: the #619 harness only exercised flt/fgt, so
eq/ne/le/ge were fixed-but-ungated (the same vacuous-harness pattern that let the
bug ship). Verified on v0.40.0: disasm shows movs #0 precedes vcmp/vmrs for all
six (correct condition codes), extended harness 84/84 bit-exact vs wasmtime.

Also CI-wired the f32 soundness oracles (619 compares + 708/709 trunc/load/
reinterpret) in the trap-semantics-oracle job — dev-only before, the exact gap
that let #709 + #712 ship. Unioned with #719's f32_ops oracle (all three run).

CI surfaced (and this fixes) a pre-existing harness fragility the dev run missed:
f32.div(-0.0,0.0) is NaN, and WASM leaves a NaN result's sign/payload
NON-DETERMINISTIC (§4.3.3) — ARM's DefaultNaN 0x7fc00000 vs a wasmtime build's
0xffc00000, both valid qNaNs. A bit-exact NaN compare is over-specified and
version-dependent. f32_bits_eq now treats NaN==NaN regardless of bits while
keeping every non-NaN result bit-exact (signed zero / ±inf still can't slip).

Closes #712.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@avrabe avrabe force-pushed the fix/712-f32-compare-oracle-all-six branch from eec46f1 to e4a498e Compare July 11, 2026 14:05
@avrabe avrabe merged commit 91808b2 into main Jul 11, 2026
33 checks passed
@avrabe avrabe deleted the fix/712-f32-compare-oracle-all-six branch July 11, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant