Skip to content

vendor/box3d: support WASM atomics builds - #7287

Draft
nic-vdwalt wants to merge 2 commits into
odin-lang:masterfrom
nic-vdwalt:box3d-wasm-threads
Draft

vendor/box3d: support WASM atomics builds#7287
nic-vdwalt wants to merge 2 commits into
odin-lang:masterfrom
nic-vdwalt:box3d-wasm-threads

Conversation

@nic-vdwalt

@nic-vdwalt nic-vdwalt commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • build a second Box3D WASM object with atomics and bulk-memory enabled
  • select the threaded object when Odin's target has the atomics feature
  • use an acquire/release spin mutex on Box3D's generic branch when __wasm_atomics__ is enabled

Depends on #7286. Broader raw-WASM support belongs upstream in Box3D.

Related: erincatto/box3d#127

Testing

  • built serial and atomics Box3D WASM objects with Homebrew LLVM
  • built vendor/box3d for js_wasm32 with and without -target-features:atomics

@nic-vdwalt
nic-vdwalt force-pushed the box3d-wasm-threads branch 5 times, most recently from db622c2 to 4ed52d4 Compare August 14, 2026 07:00
b3GetTicks and friends return zero on the generic branch, so World_GetProfile
reports all zeroes on freestanding wasm32. Add a weak b3PlatformTicks that a
host can override with a strong definition (monotonic microseconds); the weak
default preserves the existing zero behaviour.

Holding branch. Separate upstream concern from the mutex fix in box3d#124;
no issue filed yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant