ReviewOS

zig-utils/zig-js

WebAssembly memory64: execution, JavaScript API, and host limits

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

Parent: #267 Depends on: #296 Roadmap: #142, #134

Implement the memory64 runtime and embedding boundary after its binary contract is pinned.

Acceptance:

  • Execute 64-bit-addressed loads, stores, size/grow, bulk operations, tables, imports, exports, and traps with overflow-safe arithmetic.
  • Define public JavaScript Memory construction/growth/reflection behavior and BigInt conversions for 64-bit memories.
  • Enforce deterministic host address-space and allocation limits without truncation or partial mutation.
  • Preserve precise roots and release partial instances/backings exactly once under failure, repeated growth, and cross-instance sharing.
  • Add supported-host, unsupported-host, stress, leak, and sanitizer witnesses.

Completed boundary

  • ce749467 retains memory64/table64 address types through runtime objects, imports, exports, active offsets, and exact host limits.
  • 54cbb5db executes full-width scalar, SIMD, atomic, bulk-memory, table, indirect-call, size, and grow operations with checked range arithmetic.
  • bbce58db exposes BigInt-only i64 construction, indexing, growth, reflection, import/export identity, and precise table64 roots through the JavaScript API.
  • 093bf0e7 makes the 64-bit-host requirement explicit, rejects impossible shared maxima before allocation, and covers concurrent shared growth, fixed historical buffers, and cross-instance sharing.
  • The focused ordinary and ThreadSanitizer runs each pass 22/22 memory64 tests with 0 failures, 0 skips, and 0 leaks.
  • README and docs/wasm.md publish the supported-host policy, 16 GiB memory/10,000,000-element table limits, exact test evidence, and the remaining #300 corpus-scoring boundary.
9 days ago

Completed in ce74946, 54cbb5d, bbce58d, and 093bf0e. The final ordinary and ThreadSanitizer memory64 slices each pass 22/22 with zero failures, skips, or leaks. Documentation now distinguishes this finished runtime/API boundary from the remaining terminal corpus score in #300.

Sign in to comment on this issue.