fix: bump ordeal 0.9.1 → 0.14.0 — rem_s can now route through trap_gate - #290
Merged
Conversation
Contributor
Author
|
CI note: the two non-green checks are not caused by this PR. |
avrabe
force-pushed
the
fix/ordeal-0.14-rem-s-gate
branch
2 times, most recently
from
July 28, 2026 18:44
dd15d85 to
9dbc72e
Compare
Completes the consumer side of ordeal#84 (= ordeal#72): ordeal < 0.10.0's
`trap_div(DivOp::RemS)` wrongly included the `INT_MIN/-1` overflow clause,
so this gate falsely REJECTED the sound `rem_s(INT_MIN,-1) -> 0` fold as a
phantom trap mismatch — which is why rem_s stayed on the per-pass static
guard. ordeal fixed it in v0.10.0 (spec-grounded, mutation-checked); this
bump picks it up (0.14.0 current).
The un-pinning test is MUTATION-CHECKED against the old pin, not asserted:
- ordeal 0.14.0: rem_s_int_min_neg1_fold_is_accepted ... ok
- ordeal 0.9.1: FAILED — "got RejectCounterexample([])"
(the phantom mismatch, reproduced exactly)
Plus the dual guard: a WRONG-value rem_s fold (-> 1 instead of 0) is still
rejected, so accepting the sound fold did not wave rem_s folds through.
Also corrects the div_define doc comment, which described 0.9.1's bug as
spec ("INT_MIN/-1 overflow for the signed ops" — it is div_s ONLY; WASM
defines rem_s(INT_MIN,-1) = 0).
Full loom-core suite with the verification feature: 655 tests, 0 failed.
API compatible across ordeal 0.10-0.14 (no code changes needed beyond
docs+tests).
NOT addressed here: #288's systemic finding that trap_gate is never called
by any pass. This bump removes the rem_s blocker for that wiring, but the
wiring itself (a per-fold gate call inside constant_folding, with its cost
and caching questions) is its own design effort — see #288 comment.
Refs: #288
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBJ6kdJ16E3hnsBbq9Lwf1
…er-approx pin Completes ordeal#84's consumer side AND removes the pin test that reddened main. ordeal < 0.10.0's trap_div(RemS) carried the div_s INT_MIN/-1 overflow disjunct, so the trap-gate falsely rejected the sound rem_s(INT_MIN,-1) -> 0 fold; rem_s stayed on the static #273 guard, pinned by rem_s_int_min_is_over_approximated_rejected. ordeal >= 0.10.0 dropped that disjunct for remainder (main now floats ordeal 0.17.0). The pin then asserted stale behaviour and FAILED on main. This: - routes I32RemS/I64RemS in trap_backstop::div_meta so rem_s const-folds are trap-gated like the other three div/rem kinds (all four covered) - removes the now-false pin rem_s_int_min_is_over_approximated_rejected (superseded by rem_s_int_min_neg1_fold_is_accepted + wrong-value dual), restoring the loom-core verification suite to green - docs updated (rem_s: documented gap -> routed) Verified on ordeal 0.17.0: loom-core --features verification --lib = 481 passed, 0 failed. (The wasm32-wasip2 build red on main is a separate, pre-existing cranelift-isle MSRV issue, not touched here.) Refs #279
avrabe
force-pushed
the
fix/ordeal-0.14-rem-s-gate
branch
from
July 30, 2026 15:39
9dbc72e to
6a281f5
Compare
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.
Completes the consumer side of ordeal#84 (= ordeal#72), and removes one blocker from #288.
The gap
ordeal < 0.10.0's
trap_div(DivOp::RemS)wrongly included theINT_MIN/-1overflow clause (WASM Core §4.4.1: onlyidiv_straps there;irem_s(INT_MIN, -1) = 0, defined). So this gate falsely rejected the soundrem_s(INT_MIN,-1) → 0fold as a phantom trap mismatch — which is whyrem_sstayed on the per-pass static guard. ordeal fixed it in v0.10.0; this picks it up (0.14.0 current).The un-pinning test is mutation-checked, not asserted
That reproduces the historical false rejection exactly. The dual guard is included: a wrong-value rem_s fold (
→ 1instead of0) is still rejected, so accepting the sound fold did not wave rem_s folds through.Also fixed
div_define's doc comment described 0.9.1's bug as spec ("INT_MIN/-1 overflow for the signed ops" — it'sdiv_sonly).Gate
Full loom-core suite with the
verificationfeature: 655 tests, 0 failed. API compatible across ordeal 0.10–0.14 — no code changes needed beyond docs + tests.What this does NOT do
#288's systemic finding stands:
trap_gateis still never called by any pass (confirmed onad39d1c— the only external reference is a test). This bump removes the rem_s blocker for that wiring; the wiring itself — a per-fold gate call insideconstant_folding, with its cost/caching design questions — is its own effort and shouldn't ride along in a dependency bump.🤖 Generated with Claude Code
https://claude.ai/code/session_01EBJ6kdJ16E3hnsBbq9Lwf1