SPEC-VM-021 Step 1: Remove ProgramDispatch.origin and handler_continuation#372
Open
SPEC-VM-021 Step 1: Remove ProgramDispatch.origin and handler_continuation#372
Conversation
…ation Replace Continuation copies in ProgramDispatch with stored fiber IDs and consumed flags. This eliminates clone_handle() usage for dispatch state, enforcing single-owner semantics for continuations. Changes: - ProgramDispatch.origin → origin_fiber_ids: Vec<FiberId> + origin_consumed: bool - ProgramDispatch.handler_continuation → handler_fiber_ids: Vec<FiberId> + handler_cont_id: ContId + handler_consumed: bool - Add ProgramDispatch::origin_as_continuation() and handler_as_continuation() helpers that reconstruct view continuations from stored IDs - Add Continuation::from_ids() constructor for topology-only views - Add mark_dispatch_consumed_for_continuation() to sync consumed state - Replace all handler_dispatch_is_live(&dispatch.handler_continuation) calls with !dispatch.handler_consumed checks - Update all ProgramDispatch construction sites and consumers No shared Arc<AtomicBool> between ProgramDispatch and real continuations. The dispatch stores plain data (fiber IDs + booleans), not Continuation copies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
origin: Continuationandhandler_continuation: ContinuationfromProgramDispatch, replacing them with plain fiber IDs and consumed flagsclone_handle()usage for dispatch state — ProgramDispatch no longer stores Continuation copies that shareArc<AtomicBool>consumed trackingProgramDispatch::origin_as_continuation()/handler_as_continuation()helpers to reconstruct view continuations from stored topology data when needed by existing APIsContinuation::from_ids()constructor andmark_dispatch_consumed_for_continuation()to keep dispatch consumed state in syncThis is Step 1 of SPEC-VM-021 (single-owner continuations). The key architectural change: ProgramDispatch stores plain data (
Vec<FiberId>+bool) instead of Continuation objects. No shared ownership wrappers (Arc, AtomicBool) between dispatch state and real continuations.Test plan
cargo check --features python_bridge— zero errorscargo check --features python_bridge --all-targets— no new errors (3 pre-existing test compile errors)🤖 Generated with Claude Code