ReviewOS

zig-utils/zig-js

WebAssembly Core 3: execute extended constant expressions

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

Parent: #366 Related: #263, #267, #134

The exact wg-3.0 audit exposed the remaining extended-constant-expression gap. zig-js now retains, validates, and evaluates the Core 3 integer arithmetic subset in every initializer context.

Exact affected roots at WebAssembly/spec@9d36019973201a19f9c9ebb0f10828b2fe2374aa:

  • test/core/data.wast: all 65 commands pass.
  • test/core/global.wast: all 121 applicable commands pass; 3 text-format commands are N/A.
  • test/core/elem.wast: every extended-expression command passes; the file is 146/151 with only five unrelated #389 subtyping cases remaining.

Acceptance:

  • Decode the complete Core 3 integer extended constant-expression subset as bounded expression sequences.
  • Validate operand/result types, imported immutable global.get, index bounds, and constant-expression restrictions exactly.
  • Evaluate globals, data offsets, element offsets, and every other allowed initializer without exposing runtime stack state.
  • Preserve deterministic byte-offset diagnostics and allocation rollback.
  • Pass every command attributable to extended constant expressions in all three exact files with zero runner errors.
  • Add focused units, bounded CI witnesses, registry/inventory evidence, and concise docs.

Evidence:

  • Focused engine units: 4/4 pass, zero leaks.
  • Exact data: 65/65 pass.
  • Exact global: 121 applicable pass, 3 text-only N/A.
  • Exact element extended-expression cases: all pass; residual 5 are tracked exclusively by #389.

Landed on main:

  • e21930b0 feat(wasm): execute Core 3 constant expressions (#387)
  • b4cd0f91 ci(wasm): gate Core 3 constant expressions (#387)
  • ddbe607a docs(wasm): update Core 3 audit evidence (#366)
9 days ago

Implemented and pushed to main. All exact Core 3 extended-constant-expression cases now pass; the five remaining elem.wast failures are isolated to #389.

Sign in to comment on this issue.