ReviewOS

zig-utils/zig-js

Wasm: restore pinned Threads simple.wast runner execution

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

Problem

Fresh required Linux CI reaches the pinned WebAssembly Threads corpus and fails the first smoke file: wasm-threads-smoke records simple.wast: 0 pass, 0 fail, 0 n/a, 1 runner, then correctly rejects the corpus run.

The failing identities are:

  • WebAssembly/threads commit 979d0fcb994439423d63b2f0a8a7332d6285dd84
  • WABT 1.0.39
  • profile threads
  • filter simple.wast

A runner result is neither an assertion failure nor an allowed unsupported feature. The underlying converter/evaluator diagnostic must be retained and fixed at the owned decode/validate/execute or driver boundary.

Required implementation

  • Reproduce the exact simple.wast conversion and evaluator command with the recorded identities.
  • Preserve the underlying child diagnostic in the inventory and console output when a runner fails.
  • Fix the actual owned Wasm or driver defect; keep all supported atomic/shared-memory assertions executing.
  • Do not classify the file as n/a, exclude it, pin away the corpus, invoke a system JavaScript engine, or accept a zero assertion denominator.

Acceptance

  • simple.wast completes with a nonzero assertion denominator and zero runner failures.
  • deeply_nested.wast and wait_notify.wast continue to execute under the same Threads profile.
  • Focused decode/validate/execute or driver tests cover the root cause and diagnostic propagation.
  • WebAssembly Threads, MVP, Core 2/3, GC, memory64, units, and applicable TSan gates remain green.

Parents: #486, #493 Related: #642

11 days ago

Exact local reproduction isolates the failure before zig-js execution:

wast2json 1.0.39 --enable-threads test/core/threads/simple.wast …
simple.wast:6:1: error: unexpected token (, expected EOF.
(thread $T1 (shared (module $Mem))
^

WABT converts the leading shared-memory module, then rejects the proposal corpus's script-level thread / wait forms. The current driver collapses that converter stderr into one conversion runner_error, writes it only inside the temporary inventory, then CI removes the work directory and prints counts without the detail. The evaluator is never invoked.

Accordingly, the implementation must add owned script-level Threads corpus handling that preserves the upstream concurrent semantics—extracting only the leading module or marking thread/wait unsupported would be vacuous. It must also surface per-file runner details before temporary cleanup.

11 days ago

Implemented and pushed in c91b6907. The root cause was a regression in the Python-to-Home TypeScript migration: the owned WABT-preserving proposal-script compiler from #287 was omitted. The restored TypeScript path now masks thread/wait forms while retaining exact line spans, converts each lexical scope with pinned WABT, injects only explicitly shared named modules, executes nested bodies in real shared-realm Threads, joins at wait, and normalizes merged child reports. Conversion/evaluator runner details are printed in bounded unique form before temporary cleanup.

Exact evidence at Threads commit 979d0fcb994439423d63b2f0a8a7332d6285dd84 and WABT 1.0.39:

  • simple.wast: 0 pass / 1 runner -> 9/9 pass.
  • deeply_nested.wast: 32/32 pass.
  • wait_notify.wast: 12/12 pass, including the real blocking wait/notify overlap.
  • Complete 13-file profile: 551/551 pass, 0 fail, 0 n/a, 0 runner.
  • Full generated result is semantically identical to the checked Threads inventory.
  • Driver self-test covers nested comments/strings, line preservation, shared-module parsing, malformed directive rejection, thread/wait codegen, and bounded diagnostic deduplication.

No converter pin, corpus file, assertion, or execution mode was weakened.

Sign in to comment on this issue.