SPEC-VM-021 Step 7: Fix 5 architecture violations for single-owner continuations#379
Open
SPEC-VM-021 Step 7: Fix 5 architecture violations for single-owner continuations#379
Conversation
…ntinuations Eliminate ContId type, derived_cont_id(), and all patterns that create Continuation objects from stored data. Enforce single-owner semantics where the VM never manufactures continuations from stored fiber IDs. Violations fixed: 1. dispatch.rs return_to_continuation → return_to_fiber_id (returns FiberId, callers use capture_live_continuation for approved Continuation creation) 2. ContId type deleted from ids.rs, replaced with fresh_pending_cont_id() -> u64 3. derived_cont_id() deleted, replaced with identity() -> Option<FiberId> 4. EvalInScope scope: Continuation → scope_fiber: FiberId 5. Scheduler park-and-continue: extract FiberId before parking, create Continuation after k_user is consumed (single owner at all times) 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
return_to_continuation()in dispatch.rs replaced withreturn_to_fiber_id()— returns FiberId instead of manufacturing Continuation from stored frame data. Callers now usecapture_live_continuation()(the approved live-topology method).ContIdtype deleted entirely.derived_cont_id()removed. Replaced withContinuation::identity() -> Option<FiberId>andfresh_pending_cont_id() -> u64for pending continuations.DoCtrl::EvalInScope { scope: Continuation }changed to{ scope_fiber: FiberId }— no Continuation needed for scope reference.k_user, Continuation created afterk_useris consumed. Ensures single owner at all times.Test results
doeffPython module)Files changed (12)
doeff-vm-core: continuation.rs, do_ctrl.rs, ids.rs, lib.rs, vm/dispatch.rs, vm/step.rs, vm/vm_trace.rs, vm_tests.rsdoeff-core-effects: scheduler/mod.rs, handlers/mod.rsdoeff-vm: lib.rs, pyvm.rsTest plan
cargo testfor doeff-vm-core (55 pass)cargo testfor doeff-core-effects (82 pass, 2 pre-existing env failures)cargo buildfor doeff-vm (compiles clean)🤖 Generated with Claude Code