Skip to content

test: spec test suite cleanup#313

Merged
guybedford merged 8 commits intomainfrom
test/spec-test-cleanup
Apr 1, 2026
Merged

test: spec test suite cleanup#313
guybedford merged 8 commits intomainfrom
test/spec-test-cleanup

Conversation

@guybedford
Copy link
Copy Markdown
Contributor

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.wast and data.wast un-ignored from build.rs — both pass
  • Dead return Ok(()) guards removed for gc, annotations, function-references, tail-call, exception-handling, relaxed-simd, and extended-const — none of these have a proposals/ subdirectory in the current testsuite checkout so the guards were never reached
  • threads skip retained — the proposals/threads/ testsuite has stale assert_invalid cases for multiple tables that predate the reference-types proposal
  • New custom/ directory in the updated testsuite skipped — uses annotation syntax that wasm-tools json-from-wast does not yet support
  • Testsuite submodule updated from Oct 2025 to Mar 2026

Spec tests go from 269 passing to 284 passing.

…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.
@guybedford guybedford merged commit bf67d55 into main Apr 1, 2026
18 checks passed
@guybedford guybedford deleted the test/spec-test-cleanup branch April 1, 2026 20:51
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