Skip to content

fix(wasm): keep synchronous pathfinding off browser pthread pool - #57

Merged
apotema merged 1 commit into
mainfrom
codex/threaded-wasm-pathfinding
Oct 2, 2026
Merged

apotema merged 1 commit into
mainfrom
codex/threaded-wasm-pathfinding

Conversation

@apotema

@apotema apotema commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Enabling WASM pthreads makes the synchronous parallel Floyd-Warshall implementation reachable. Zig 0.16 CPU discovery then links unsupported sysctlbyname, and the implementation cannot reserve workers from the browser pool shared with persistent engine asset workers.

Keep both the public optimized algorithm and the navigation wrapper on their existing SIMD/scalar path for Emscripten and single-threaded targets. Native multithreaded behavior remains enabled.

Validation:

  • zig build test -j2 passed with Zig 0.16.
  • zig build spec -j2: all 65 navigation specifications passed.
  • FP ReleaseSafe dual WASM bundle linked successfully with these changes and the backend worker-startup fix.
  • Chromium gameplay through first nightfall, 150 seconds each: three shared-memory asset workers with isolation; zero workers in the automatic non-isolated fallback. Both passed without runtime errors.

Pathfinding parallelism on web remains deferred until an asynchronous worker-budgeted job API is available.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 5cfa281f-7a6f-461e-b55a-cfc58333dbc7

📥 Commits

Reviewing files that changed from the base of the PR and between abb7a11 and 972d063.

📒 Files selected for processing (2)
  • src/floyd_warshall_optimized.zig
  • src/nav/floyd_warshall.zig
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@apotema
apotema marked this pull request as ready for review October 2, 2026 19:24
@apotema
apotema merged commit d15be26 into main Oct 2, 2026
1 of 2 checks passed
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