ReviewOS

zig-utils/zig-js

WebAssembly profile: multi-memory binary, runtime, and corpus

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

Parent: #142 Related: #263, #267, #300 Roadmap: #134

Implement the finished WebAssembly multi-memory proposal as an independently gated profile. The terminal Memory64 corpus exposed this as an ambient Core-3 dependency in imports.wast; it must not be hidden, conflated with Memory64, or reported as a Memory64 semantic failure.

Acceptance:

  • Pin the exact proposal revision, dependencies, binary/text changes, and complete upstream inventory.
  • Add an explicit feature gate and retain every memory index in decoding, validation, constant expressions, data segments, and instructions.
  • Validate multiple defined/imported memories, address-type compatibility, index bounds, shared limits, and cross-memory operation typing with deterministic errors.
  • Instantiate and execute independent memory stores, imports, exports, growth, bulk operations, traps, and JavaScript API identity without assuming memory zero.
  • Cover mixed memory32/memory64 modules, failure-atomic allocation/linking, precise buffer lifetime, host limits, fuzzing, stress, leak checks, and supported-host sanitizers.
  • Publish per-file upstream totals, reproduction, CI witnesses, and documentation without changing the default MVP profile.

Completion evidence

  • Runtime and validation landed through 3cdb0b87; the profile remains disabled by default.
  • Failure-atomic lifecycle coverage landed in 96dbc0de; 32 mixed-memory stress cycles and 512-operation deterministic store fuzzing landed in fe643630.
  • 0fb0c069 documents the focused normal, Linux TSan, and ReleaseSafe gates.
  • The pinned terminal inventory scores 829/829 commands across all 38 proposal files with zero failures, skips, or runner errors; README and detailed reproduction are published in docs/wasm.md.
9 days ago

Implemented and pushed the proposal-semantic multi-memory profile in five small commits:

  • e82aa6d0 — independent multi_memory gate, lossless memidx decoding, indexed validation
  • 743305af — indexed scalar/SIMD/atomic/size/grow execution
  • 0534c231 — standalone pinned 38-file proposal profile
  • 3cdb0b87 — memory32 limits correctly reject u32-overlong encodings
  • c2d6d61b — terminal inventory, registry/CI guard, docs, concise README status

Terminal result: 829/829 commands pass across all 38 declared files, with 0 failures, 0 N/A, and 0 runner errors. The checked-in inventory pins WebAssembly/multi-memory@cf8b5aa27257311b8eac80ae83f4ba22ee308064 and WABT 1.0.39 (ad75c5ed...). Focused execution coverage also proves memory isolation across scalar, SIMD, atomic, size, and grow paths, including mixed memory32/memory64 validation; the project test slice passed 3/3 with 0 leaks.

The issue stays open for the deliberately broader final acceptance boundary: a dedicated binary/text contract inventory, mixed-width host/failure-injection lifetime cases, fuzz/stress, supported-host sanitizers, and the final green CI witness.

9 days ago

Pinned the complete standalone multi-memory contract in a00bb70: exact cf8b5aa proposal revision and dependencies, SHA-256 locks for the normative overview/binary/text/syntax documents, bit-6 memarg encoding, every memory-instruction immediate order, text defaults/pairing rules, and the link to the complete 38-file terminal inventory. The lightweight registry checker now validates both the contract and decoder evidence; python3 tools/wasm-feature-profiles.py passes with 13 pinned features.

9 days ago

Added focused robustness evidence in 96dbc0d. A mixed imported-memory + defined memory32 + defined memory64 module now targets active segments at all three stores and performs cross-address-type memory.copy. The harness runs through every allocation-failure point and 32 full instantiate/execute/destroy cycles, verifies imported stores remain borrowed and live after teardown, and uses std.testing.allocator leak detection. Focused result: 4/4 passed, 0 skipped/failed/leaked. The broader fuzz/supported-host sanitizer portion remains open.

9 days ago

Added deterministic model-based fuzz coverage in fe64363: 512 seeded write/fill/copy/grow operations across four alternating memory32/memory64 stores, with every store compared byte-for-byte to independent models after each operation. The focused multi-memory cluster is now 8/8 passing with zero leaks; docs include the exact filtered reproduction command. The remaining acceptance gap is supported-host sanitizer/CI evidence.

9 days ago

Optimized safety witness: zig build test -Doptimize=ReleaseSafe -Dtest-filter="multi-memory" passed 8/8 with zero skips, failures, or leaks at fe64363. The same tests are included in every Linux TSan unit shard; I am leaving the CI-related acceptance boxes open until the current main run produces a concrete green URL.

9 days ago

Closing as completed. The two stale acceptance boxes were already satisfied by the committed fault-injection/fuzz coverage, documented sanitizer gates, and the pinned 829/829 terminal inventory.

Sign in to comment on this issue.