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: