Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized workflow reordering and insert at cursor #1324

Merged
merged 69 commits into from
May 15, 2023

Conversation

glopesdev
Copy link
Member

@glopesdev glopesdev commented Apr 16, 2023

This PR refactors the workflow graph representation as a collection where nodes can be individually accessed by index. This allows much faster reordering of workflow nodes, and enables ordered insertion at cursor position.

It also lays down the foundation for interpreting the workflow directly as an expression tree, where the roots are sinks, i.e. nodes with no successors, and leaves are sources.

Branch points are interpreted as anonymous scoped publish operators. The publish closure for each branch is resolved by taking the smallest subset of nodes dependent on the branching source. A node is dependent on a branching source if it lies on a direct dependency path from the node to the source, and there exists at least one other node in the workflow which also lies in a direct dependency path to the same branching source, and there are no shared nodes between the two paths except for the branching source itself.

In other words, a publish branch is closed when all branches are merged back to a common trunk. If there is no such common trunk, the branch is closed around the connected set of nodes to which the branch belongs. Nodes belonging to disjoint sets are not affected by this branching behavior.

Fixes #1014
Fixes #1129
Fixes #1317
Fixes #1345

@glopesdev glopesdev added feature New planned feature fix Pull request that fixes an issue labels Apr 16, 2023
@glopesdev glopesdev added this to the 2.8 milestone Apr 16, 2023
@glopesdev glopesdev merged commit 35d6789 into bonsai-rx:main May 15, 2023
@glopesdev glopesdev deleted the issue-1014 branch May 15, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New planned feature fix Pull request that fixes an issue
Projects
None yet
1 participant