The join knows cancellation: a branch taken back is a branch that doe… - #133
Merged
Merged
Conversation
…s not come A withdrawal now tells the joins: every token taken that was the front of a branch of a pass (FBToken>>isFrontOfItsPass - tokens of an iteration or a sub flow inside the branch do not count) is counted on the pass (FBSplitExecution>>cancelledBranches). The join releases once every branch is accounted for - arrived or cancelled - and at least one arrived, and goes on with what arrived (FBJoinState>>canRelease, #output without the branches taken back). When the branch taken back was the last one a join waited for, the withdrawal releases the join itself (FBFlowInstance>>settlePass:): no further arrival would come to ask. That release queues on the executor the join stands in, not on whatever frame is on top of the instance at that moment (FBBaseActivation>>followAllOutgoingInSplit:on:). A pass whose branches all fell with nothing arrived releases nothing; the branch that led into its split is then gone for the enclosing pass too, which counts it and is settled in turn. Cancelling one branch of a nested split thus costs the outer join exactly one branch. The join's output moved from FBJoinBehavior to FBJoinState, which is where the release now lives. Co-Authored-By: Claude Fable 5.1 <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.
…s not come
A withdrawal now tells the joins: every token taken that was the front of a branch of a pass (FBToken>>isFrontOfItsPass - tokens of an iteration or a sub flow inside the branch do not count) is counted on the pass (FBSplitExecution>>cancelledBranches). The join releases once every branch is accounted for - arrived or cancelled - and at least one arrived, and goes on with what arrived (FBJoinState>>canRelease, #output without the branches taken back).
When the branch taken back was the last one a join waited for, the withdrawal releases the join itself (FBFlowInstance>>settlePass:): no further arrival would come to ask. That release queues on the executor the join stands in, not on whatever frame is on top of the instance at that moment (FBBaseActivation>>followAllOutgoingInSplit:on:).
A pass whose branches all fell with nothing arrived releases nothing; the branch that led into its split is then gone for the enclosing pass too, which counts it and is settled in turn. Cancelling one branch of a nested split thus costs the outer join exactly one branch.
The join's output moved from FBJoinBehavior to FBJoinState, which is where the release now lives.