Commit 91e5143
feat(wgpu): add event-driven actor emulation for WebGPU backend
Gap analysis item 3.2 Tier 1: WebGPU cannot do true persistent kernels
but can emulate actor semantics via rapid re-dispatch with persistent
GPU buffers.
- WgpuActorLoop: tick-based dispatch with state/input/output buffers
- state_buffer persists across dispatches (actor state)
- inject_message() / poll_responses() for host-GPU messaging
- start()/stop()/tick()/run() lifecycle
- ActorLoopConfig: buffer sizes, tick interval, workgroup count
- ACTOR_LOOP_WGSL_TEMPLATE: echo actor demonstrating buffer contract
- Wire into WgpuKernel: activate() starts loop when mode=Persistent
- 8 tests (3 CPU + 5 GPU-ignored)
From the user's perspective, the API is identical to CUDA persistent
actors (send/recv/activate/terminate).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent b8d1f22 commit 91e5143
3 files changed
Lines changed: 831 additions & 2 deletions
0 commit comments