runtime(coro): bind executor driver to scheduler - #26
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ExecutorDriver to manage the bridge between the ExecutorRegistry and WaitRegistrationTable for single-P scheduling. It adds necessary state tracking to the P struct and implements the driver lifecycle, including binding, polling, and terminal state handling. The review feedback identifies a potential nil pointer dereference, suggests idiomatic return value handling, points out a potential state inconsistency, and notes redundant code, all of which include actionable code suggestions.
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.
cdb1941 to
a11bd25
Compare
Summary
Concurrency protocol
Platform producers retain only POD wait and executor handles. They publish a durable wait slot before requesting the executor. The running G may repeatedly observe Requested, but only the scheduler-owned driver can drain sources and acknowledge the request.
Idle entry is PollExecutor, ArmIdle, an unconditional full durable-source scan, exact CommitSleep, then a target retained-doorbell wait. Wake first leaves IdleArmed and then repeats drain, acknowledge, and source recheck. Close requires no parked G or live registration, seals the executor gate, relies on a strong target unregister/join, then retires and unbinds the stable generation.
Validation
Scope
This is still a target-neutral single-P driver. It is not wired into production runtime/internal/runtime/coroRun and does not implement a native, WASM/JS, WASI, RTOS, or baremetal retained-doorbell backend. The last-G executor close/join/unbind/retry handoff is an explicit production blocker and intentionally fails closed in this phase.
Stacked on #25.