ReviewOS

zig-utils/zig-js

Wasm: score Core 3 exnref null assertions correctly

#642
Closed chris opened this 11 days ago ·
11 days ago

Problem

Fresh required CI on the pinned Core 3 corpus 9d36019973201a19f9c9ebb0f10828b2fe2374aa fails test/core/ref_null.wast at 31 pass / 3 fail. Exact local inventory with wasm-tools 1.253.0 identifies commands 3, 19, and 22 (source lines 18, 67, and 70): the three assertions whose expected JSON is { "type": "exnref", "value": "null" }.

The owned engine already decodes, validates, executes, and exposes each result as JavaScript null. The defect is in the owned live-corpus comparator: its exnref branch unconditionally requires a non-null object and ignores the converter's explicit null value. This is a scoring contract bug, not an engine ref.null gap.

Required implementation

  • Make the comparator distinguish explicit null exnref expectations from non-null exception references.
  • Preserve non-null eqref, structref, arrayref, and exnref matching, along with refnull and bottom-reference matching.
  • Lock the converter representation into the corpus-driver self-test.
  • Do not exclude assertions, mark failures n/a, pin away the file, or delegate execution to a system Wasm engine.

Acceptance

  • Pinned test/core/ref_null.wast moves from 31/34 to 34/34 with the same evaluator binary; exactly the three exnref assertions flip.
  • Neighboring Core 3 reference/exception smokes and the corpus-driver self-test remain green.
  • Fresh CI records a nonzero inventory with zero fail/runner entries.

Parents: #486, #493 Related: the wasm-core-3-memory64-gc-smoke required check.

11 days ago

Implemented and pushed in fbbde14c. The live-corpus comparator now honors wasm-tools' explicit value: "null" for exnref before requiring the host object representation used by non-null exception references; eqref/structref/arrayref, bottom reference spellings, and non-null exnref behavior are unchanged.

Exact pinned evidence (9d36019973201a19f9c9ebb0f10828b2fe2374aa, wasm-tools 1.253.0, same evaluator binary):

  • ref_null.wast: 31/34 -> 34/34.
  • Exactly commands 3, 19, and 22 (source lines 18, 67, 70) flipped fail -> pass.
  • ref.wast: 13/13.
  • Core 3 exceptions: 98 pass / 2 declared n/a / 0 fail / 0 runner.
  • Corpus-driver self-test: PASS.

No assertions were excluded or reclassified, and this changes 0 test262 cases.

Sign in to comment on this issue.