feat: skeleton for in browser swactor engine #35

Merged
zacheryasc merged 6 commits from in-browser into master 2026-02-13 13:27:35 +00:00

6 commits

Author SHA1 Message Date
Claude
6bbf87f7ea keep agent notes out of repo 2026-02-13 20:26:34 +07:00
Claude
60a9269f98 feat: in-browser engine demo 2026-02-13 20:20:09 +07:00
Claude
3e44579e5c feat: swactor-std feature parity in wasm (Stage 4)
Enable naming, groups, watching, and stats in the browser runtime.
Fix core watching gap: StopSignal deaths now trigger WatchRegistry
notifications. Add register_name to RuntimeNaming trait. Cfg-gate
getrandom in router.rs for wasm builds. 30 Node.js tests pass.

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 20:20:09 +07:00
Claude
82e72ff235 feat: generic browser runtime API with typed handles (Stage 2)
Evolved crates/wasm/ from hardcoded PoC to a generic browser runtime:
- WasmRuntime: wraps Runtime, provides tick/send/stop/stats/inbox creation
- WasmAddr: opaque actor address handle for JS (replaces fragile indices)
- WasmInboxU32, WasmInboxBytes: typed inboxes for receiving actor results
- Free-standing spawn_counter/spawn_relay demonstrate the actor pattern
- 10 Node.js tests pass (accumulator, relay, multi-counter, stop, bytes)

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 20:20:09 +07:00
Claude
2649a54feb feat: platform abstraction layer for wasm32 compilation (Stage 1)
Core swactor now compiles for wasm32-unknown-unknown:
- Added `wasm` feature flag (bundles no_random + web-time)
- Platform-aware Instant: web_time::Instant on wasm, std::time on native
- cfg-gated Runtime::run() and RuntimeHandle (thread::spawn unavailable
  on wasm32 — browser crate provides Web Worker-based alternative)
- Validated: crossbeam-queue, atomics, Mutex, RwLock, thread parking all
  work on wasm32 with atomics target feature
- Updated crates/wasm/ to use new `wasm` feature

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 20:20:09 +07:00
Claude
63cba1c4eb research: in-browser runtime Cycle 0
Research phase for browser-native swactor runtime:
- constraints.md: wasm-threads (SharedArrayBuffer), Rust-only actors,
  COOP/COEP required, no new modules in src/
- research_synthesis.md: P0-P4 priority ranking, platform dependency
  analysis, ecosystem comparison (Lunatic, wasmCloud, Actix)
- 6 feature-stage docs: platform abstraction → single-worker →
  multi-worker parallelism → feature parity → transport → DX
- Key decision: SharedArrayBuffer + wasm-threads over postMessage
  isolation (swactor's shared-memory architecture demands it)

Authored by Claude, lovingly guided by Zachery Aaron Shores-Chmielewski
2026-02-13 20:20:09 +07:00