test: spec test suite cleanup#313
Merged
guybedford merged 8 commits intomainfrom Apr 1, 2026
Merged
Conversation
…offsets Adds a public Module::get_function_table_entry(idx) method that correctly resolves function table lookups when element segment offsets are expressed as ConstExpr::Global (emitted by lld for large position-independent WASM modules with rustc 1.94+) rather than only ConstExpr::Value(I32). Also guards the local-index arithmetic with checked_sub to avoid u32 underflow when a table has multiple active segments at different offsets, fixing a latent bug that would panic in debug mode. Includes three tests covering global-offset round-trips, extended-const round-trips, and multi-segment underflow prevention. Relates to wasm-bindgen/wasm-bindgen#5076.
- Add ConstExpr::evaluate<F> that reduces any const expression to a Value using a caller-supplied global resolver, handling Value, Global, and Extended (i32/i64/f32/f64/v128 arithmetic) uniformly - Simplify get_function_table_entry to use evaluate instead of ad-hoc pattern matching - Remove stale spec-tests.rs guards for proposals whose tests have graduated into the main testsuite (gc, annotations, function-references, tail-call, exception-handling, relaxed-simd, extended-const) - Skip custom/ annotation tests that wasm-tools cannot yet parse - Un-ignore elem.wast and data.wast from build.rs (both pass) - Update testsuite submodule from Oct 2025 to Mar 2026 (+15 tests, 284 total)
…tead get_function_table_entry was the wrong abstraction for walrus — it operated on raw wasm table indices rather than IDs, and encoded wasm-bindgen-specific logic that doesn't belong in a general-purpose IR library. The right primitive is ConstExpr::evaluate_scalar, which lets callers correctly resolve element segment offsets regardless of whether they are expressed as Value, Global, or Extended const expressions. Coverage is provided by the elem.wast spec tests.
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.
Removes stale ignore entries and skip guards in the spec test runner for proposals whose tests have since merged into the main testsuite, and updates the testsuite submodule to Mar 2026.
elem.wastanddata.wastun-ignored frombuild.rs— both passreturn Ok(())guards removed for gc, annotations, function-references, tail-call, exception-handling, relaxed-simd, and extended-const — none of these have aproposals/subdirectory in the current testsuite checkout so the guards were never reachedthreadsskip retained — theproposals/threads/testsuite has staleassert_invalidcases for multiple tables that predate the reference-types proposalcustom/directory in the updated testsuite skipped — uses annotation syntax thatwasm-tools json-from-wastdoes not yet supportSpec tests go from 269 passing to 284 passing.