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
2.3 KiB
2.3 KiB
Current Task
Cycle 0 — Research Step: Complete Attempt: 1 of 3
Key Files (read these first on resume)
big-feature-phase/TASK.md— workflow rulesbig-feature-phase/notes/constraints.md— guardrails for in-browser runtimebig-feature-phase/notes/research_synthesis.md— P0-P4 priority rankingbig-feature-phase/notes/feature-stages/01-platform-abstraction.md— Stage 1 specsrc/runtime.rs— thread spawn (line 351), park handles (line 110), Instant (line 205)src/worker.rs— backoff loop (lines 495-523), Instant timing (9 calls)src/delivery.rs— TickContext.worker_threads (line 246)src/channel.rs— crossbeam HybridChannel (validate wasm compilation)crates/wasm/src/lib.rs— existing PoC browser runtime
Last Action & Result
Completed Cycle 0 research phase:
- Investigated similar projects (Lunatic, wasmCloud, Actix wasm attempts)
- Analyzed all platform-specific code in core swactor (4 blockers found)
- User confirmed: Rust-only actors, performance-first, Web Workers, all features, full peer
- Key decision: SharedArrayBuffer + wasm-threads (not postMessage isolation)
- Wrote constraints.md, research_synthesis.md, 6 feature-stage docs
Next Action
Begin Stage 1 (Platform Abstraction Layer) — notes/feature-stages/01-platform-abstraction.md:
- Add
web-timedependency to core Cargo.toml - Replace
std::time::Instantwithweb_time::Instantin runtime.rs and worker.rs - Implement
ParkHandleabstraction with cfg gates - Gate
Runtime::run()thread spawning for non-wasm - Validate crossbeam-queue compiles for wasm32 with atomics
- Add
wasmfeature flag
Completed This Session
- Read TASK.md, state.md, history.md (context restart checklist)
- Investigated similar codebases (Lunatic, wasmCloud, Actix-wasm)
- Analyzed platform dependencies in core swactor
- Asked and resolved design questions with user
- Wrote
notes/constraints.md - Wrote
notes/research_synthesis.md - Created
notes/feature-stages/with 6 stage docs
Open Questions / Blockers
- Need to verify crossbeam-queue compiles for wasm32 with atomics (Stage 1 task)
- Need to find/verify correct
core::arch::wasm32APIs for memory_atomic_wait/notify - Nightly Rust toolchain + wasm32 target needs to be set up in CI