Skip to content

Add WASI runtime configuration#443

Merged
heartwilltell merged 1 commit into
mainfrom
codex/runtime-wasi
Apr 28, 2026
Merged

Add WASI runtime configuration#443
heartwilltell merged 1 commit into
mainfrom
codex/runtime-wasi

Conversation

@heartwilltell

Copy link
Copy Markdown
Contributor

Summary

  • add a WASI-specific single-P cooperative scheduler with no threads, signals, NUMA pinning, or stack switching
  • add WASI fallbacks for runtime memory/NUMA/CPU APIs and single-threaded channel/poller locking
  • compile the libxev WASI poll backend on Zig 0.16, including direct WASI fd read/write shims
  • add a runtime-wasi-smoke module and test-wasi-runtime wasmtime step

Fixes #408

Notes

  • zig build -Dtarget=wasm32-wasi installs the runtime artifacts and smoke module instead of trying to build the host compiler for WASI.
  • The local machine does not have wasmtime, so the smoke run itself was not executed locally; the build step reports that dependency explicitly.

Validation

  • zig fmt build.zig src/runtime/run_xev_bridge.zig zig-pkg/libxev-0.0.0-86vtcwIRFACVrx54GaHsMFFlyC4dTi0tcVh10V7btRUc/src/backend/wasi_poll.zig
  • clang-format -i src/runtime/run_scheduler.h src/runtime/run_scheduler_wasi.c src/runtime/run_chan.c src/runtime/run_xev.c src/runtime/run_vmem.c src/runtime/run_numa.c src/runtime/run_runtime_api.c src/runtime/run_debug_api.c src/runtime/tests/wasi_smoke.c
  • zig build -Dtarget=wasm32-wasi
  • zig build
  • zig build test (passes; emits the expected bad_check.run missing-symbol diagnostic)
  • zig build test-runtime (82/82)
  • zig build -Dtarget=wasm32-wasi test-wasi-runtime (not run: wasmtime is not installed locally)

@heartwilltell heartwilltell self-assigned this Apr 28, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 28, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
runlang ae5ed8e Commit Preview URL

Branch Preview URL
Apr 28 2026, 08:40 PM

@heartwilltell heartwilltell marked this pull request as ready for review April 28, 2026 20:40
@heartwilltell heartwilltell merged commit 329c7cc into main Apr 28, 2026
14 checks passed
@heartwilltell heartwilltell deleted the codex/runtime-wasi branch April 28, 2026 20:57
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.

Add WASI runtime support via libxev

1 participant