Skip to content

The join knows cancellation: a branch taken back is a branch that doe… - #133

Merged
noha merged 1 commit into
mainfrom
join-knows-cancel
Sep 10, 2026
Merged

noha merged 1 commit into
mainfrom
join-knows-cancel

Conversation

@noha

@noha noha commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

…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.

…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>
@noha
noha merged commit d240fcd into main Sep 10, 2026
4 checks passed
@noha
noha deleted the join-knows-cancel branch September 10, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant