runtime(coro): add stable executor request gate - #25
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a target-neutral ExecutorRegistry to manage stable executor request gates, providing a mechanism for safe, allocation-free platform executor wakeups. It includes the core registry implementation and comprehensive tests verifying lifecycle management, idle handshakes, and concurrency. The review feedback suggests refactoring complex state validation logic in Register and CanRelease to improve readability and reduce code duplication.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Concurrency protocol
A running compiler safepoint only observes Requested and yields. The scheduler owns acknowledgement and must drain, acknowledge, then recheck every durable source. Idle entry is ArmIdle, source recheck, exact CommitSleep, then a target retained wait. Close races Request through an exact zero-to-Closed CAS and strong backend join covers the complete platform shim, including the doorbell tail.
Deterministic tests cover drain-to-ack coalescing, ArmIdle versus Request, wake before physical block, Post-to-Request idle and shutdown windows, close races, admitted producer pinning, stale generations, and capacity exhaustion.
Validation
Scope
This is the target-neutral request-gate layer. It deliberately does not yet bind the gate to P, PollPreempt, the scheduler idle driver, or a real native/WASM/WASI/RTOS/baremetal backend. Those are the next stacked phases.