You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wasm: synchronize shared writes with relocating memory growth #425
Exact main run 29803416991 exposed a no-GIL TSan race between ordinary shared TypedArray writes and the copy performed by relocating WebAssembly Memory.grow. Relocating growth now observes shared bytes through synchronized semantics while preserving old aliases and leaving exclusive non-shared paths unchanged.
Acceptance
Define a per-memory synchronization contract without reintroducing the JS GIL.
Make relocation race-free while preserving exact contents and historical aliases.
Keep exclusive ArrayBuffer and Wasm memory paths unchanged.
Preserve detach, generation, and publication ordering.
Pass the focused overlap case repeatedly under TSan plus Debug and ReleaseSafe semantics.
Add a regression covering contents, lengths, historical aliases, and teardown.
Reconcile an unsuperseded exact main run.
Completed by 7ed9d280; exact-main run 29806223245 passed 43/43 jobs.
Root fix pushed directly to main in 7ed9d280. Host-observed ordinary Wasm memory now asks the JS embedding to lock the current ArrayBuffer only around the old-to-fresh relocation copy. It unlocks before fresh-wrapper allocation/publication; the existing detach step reacquires the same buffer lock before the old slab is freed. Unrelated memories, shared non-moving slabs, and pure-Wasm/non-host growth retain their existing paths. Evidence on Zig 0.17.0-dev.1426: exact mc-grow-wasm-relocating-grow.js passes Debug (32.8 s), ReleaseSafe (0.17 s), and TSan (220.4 s); the new callback/publication unit passes Debug, ReleaseSafe, and TSan (3/3, zero leaks). Fresh exact main run is pending.
Closed against exact main commit e3fdc52385204c75fe6ae5c64d48dae6e5ede418: Actions run 29806223245 completed successfully with all 43 jobs terminal and no failures.
Activity
fix(wasm): synchronize relocating memory growth (#425)
chrisbbreuer commentedon Jul 21, 2026
Root fix pushed directly to
mainin7ed9d280. Host-observed ordinary Wasm memory now asks the JS embedding to lock the current ArrayBuffer only around the old-to-fresh relocation copy. It unlocks before fresh-wrapper allocation/publication; the existing detach step reacquires the same buffer lock before the old slab is freed. Unrelated memories, shared non-moving slabs, and pure-Wasm/non-host growth retain their existing paths. Evidence on Zig 0.17.0-dev.1426: exactmc-grow-wasm-relocating-grow.jspasses Debug (32.8 s), ReleaseSafe (0.17 s), and TSan (220.4 s); the new callback/publication unit passes Debug, ReleaseSafe, and TSan (3/3, zero leaks). Fresh exact main run is pending.chrisbbreuer commentedon Jul 21, 2026
Closed against exact main commit
e3fdc52385204c75fe6ae5c64d48dae6e5ede418: Actions run 29806223245 completed successfully with all 43 jobs terminal and no failures.