ReviewOS

zig-utils/zig-js

WebAssembly threads: atomic opcode inventory, decode, and validation

#284
Closed chris opened this 9 days ago ·
9 days ago

Parent: #265 Depends on: #262 Roadmap: #142, #134

Define the exact pinned WebAssembly threads instruction surface and implement its binary and validator foundation.

Acceptance:

  • Check in the exact 0xfe atomic opcode/immediate inventory from the pinned proposal revision.
  • Decode every selected atomic instruction and fence immediate with deterministic malformed-binary diagnostics.
  • Validate stack signatures, memory presence, exact natural alignment, and feature gates; keep fence valid without memory.
  • Accept atomic access and notify on ordinary memories, leave the specified wait-on-unshared trap to runtime issue #286, and reject shared limits without a maximum.
  • Add focused decoder/validator tests and registry drift checks.
9 days ago

Completed the pinned binary and validator foundation.

  • 98911c4 checks in the exact 67-opcode 0xfe inventory from WebAssembly/threads@979d0fc, including the 13-file corpus count, reserved 0x04–0x0f gap, immediates, alignments, and stack shapes. The registry verifier proves exact source/enum agreement.
  • 040d0c0 decodes shared limits and every atomic/fence immediate, requires maximum on shared memory, enforces exact natural alignment and all operand/result signatures, retains fence-without-memory validity, and distinguishes the runtime-only wait-on-unshared trap.
  • 867aed0 publishes the current boundary and child sequence in README/docs. Execution deliberately traps rather than exposing partial semantics until #285/#286 land.

Verification:

  • atomic.zig standalone test: 1/1 green
  • feature registry checker: green
  • focused decode suite: 19/19 green
  • focused validator suite: 47/47 green
  • pinned upstream appendix/inventory subopcode comparison: 67/67 exact

The next dependency is #285 stable shared backing and JavaScript API ownership.

Sign in to comment on this issue.