-
Notifications
You must be signed in to change notification settings - Fork 7
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
mermaid rendering child node in incorrect DataflowBlock #1197
Labels
bug
Something isn't working
Comments
I'm not sure it's a bug, the semantics are not too clear. This can be fixed if write inter-graph edges outside the subgraph blocks. graph LR
subgraph 0 ["(0) CFG"]
direction LR
subgraph 1 ["(1) DataflowBlock"]
direction LR
2["(2) Input"]
2--"0:0<br>[]"-->3
3["(3) Output"]
end
1-."0:0".->5
2--"0:0<br>[]"-->7
4["(4) ExitBlock"]
subgraph 5 ["(5) DataflowBlock"]
direction LR
6["(6) Input"]
7["(7) Output"]
end
5-."0:0".->4
end
graph LR
subgraph 0 ["(0) CFG"]
direction LR
subgraph 1 ["(1) DataflowBlock"]
direction LR
2["(2) Input"]
2--"0:0<br>[]"-->3
3["(3) Output"]
end
1-."0:0".->5
2--"0:0<br>[]"-->7
4["(4) ExitBlock"]
subgraph 5 ["(5) DataflowBlock"]
direction LR
6["(6) Input"]
7["(7) Output"]
end
5-."0:0".->4
end |
github-merge-queue bot
pushed a commit
to CQCL/portgraph
that referenced
this issue
Jun 24, 2024
Moves the tests for both to a common module, an uses `rstest::fixtures` plus `insta` snapshots to test things. Adds a `hierarchy_interregional` test case that shows the bug from CQCL/hugr#1197.
github-merge-queue bot
pushed a commit
to CQCL/portgraph
that referenced
this issue
Jul 5, 2024
Defines intergraph edges on the parent region, so mermaid renders them correctly. This required a lowest-common-ancestor implementation for the hierarchy. See #138. I replaced the recursive DFS with a stack-based one that reuses the structures when exploring multiple trees. I also added some benchmarks for both rendering algorithms. This closes CQCL/hugr#1197
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 5, 2024
Includes the fix in CQCL/portgraph#139 that closes #1197
aborgna-q
added a commit
that referenced
this issue
Jul 8, 2024
Includes the fix in CQCL/portgraph#139 that closes #1197
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a Dom edge is connected to an output node, that node is being rendered inside the source dataflow block rather than the target.
Sample hugr:
(output node (7) correctly reports parent node DataflowBlock(5))
mermaid:
Node 7 is now being rendered inside block 1 even though though in the mermaid source it is inside subgraph 5. Maybe a mermaid bug?
Potential fix is adding an invisible edge between all input-output nodes to pin them to the same subgraph?
The text was updated successfully, but these errors were encountered: