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

SiblingSubgraph::from_node fails on nodes with disconnected outputs #1746

Closed
ss2165 opened this issue Dec 9, 2024 · 2 comments · Fixed by #1769
Closed

SiblingSubgraph::from_node fails on nodes with disconnected outputs #1746

ss2165 opened this issue Dec 9, 2024 · 2 comments · Fixed by #1769
Assignees
Labels
bug Something isn't working

Comments

@ss2165
Copy link
Member

ss2165 commented Dec 9, 2024

The function compares the signatures of the subgraph and replacement for equality:

let current_signature = self.signature(hugr);
let new_signature = dfg_optype.dataflow_signature();

However if the replacement had any disconnected outputs or multi-connected outputs this would fail because the current signature is calculated by iterating of the subgraph edges.

Disabling the signature check for the outputs is not enough because subsequent logic iterates over the subgraph outputs and misses out the disconnected port.

@ss2165 ss2165 added the bug Something isn't working label Dec 9, 2024
@ss2165 ss2165 added this to the hugr-rs 0.14 / hugr-py 0.10 milestone Dec 9, 2024
@ss2165
Copy link
Member Author

ss2165 commented Dec 10, 2024

See failing test: 2be1147

@ss2165 ss2165 self-assigned this Dec 11, 2024
@ss2165 ss2165 changed the title bug: SiblingSubgraph::create_simple_replacement compares signatures incorrectly SiblingSubgraph::from_node fails on nodes with disconnected outputs Dec 11, 2024
@ss2165
Copy link
Member Author

ss2165 commented Dec 11, 2024

Edited issue to focus on the fact that from_node doesn't work with disconnected outputs on the node because try_from_nodes doesn't. Making a separate issue for that: #1766

github-merge-queue bot pushed a commit that referenced this issue Dec 11, 2024
Uses `from_node` in lowering code to take advantage of this


Closes #1746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant