Skip to content

feat: Ignore invalid non-local Order edges in InlineDFG reachability check#3138

Closed
aborgna-q wants to merge 1 commit into
mainfrom
ab/inline-reachability-in-region
Closed

feat: Ignore invalid non-local Order edges in InlineDFG reachability check#3138
aborgna-q wants to merge 1 commit into
mainfrom
ab/inline-reachability-in-region

Conversation

@aborgna-q

@aborgna-q aborgna-q commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

is_order_reachable in InlineDFGs only needs to check connectivity in the local region.

This is a simple change making the is_order_reachable ignore non-local edges into other regions, to avoid doing unnecessary work.

@aborgna-q aborgna-q requested a review from acl-cqc July 7, 2026 13:38
@aborgna-q aborgna-q requested a review from a team as a code owner July 7, 2026 13:38
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.33%. Comparing base (d1dd809) to head (8eb8dea).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3138   +/-   ##
=======================================
  Coverage   81.33%   81.33%           
=======================================
  Files         242      242           
  Lines       46925    46929    +4     
  Branches    40612    40616    +4     
=======================================
+ Hits        38166    38170    +4     
  Misses       6767     6767           
  Partials     1992     1992           
Flag Coverage Δ
python 89.49% <ø> (ø)
rust 80.06% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

to_visit.extend(
h.linked_inputs(n, order_outport)
.map(|(n, _)| n)
// Ignore non-local edges

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Ignore non-local edges
// Ignore (invalid) non-local order edges

@acl-cqc acl-cqc changed the title feat: Ignore non-local edges in InlineDFG reachability check feat: Ignore invalid non-local Order edges in InlineDFG reachability check Jul 7, 2026

@acl-cqc acl-cqc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly ugh but yeah ok. Let's not confuse anyone by suggesting non-local edges can include order edges tho, these are invalid edges....

EDIT: hmmm, I suppose there is a broader issue here, is it a good idea for NormalizeCFGs to run InlineDFG on an invalid hugr at all? I mean, what kind of behaviour should it expect? This'll mean we assume the order path doesn't exist, but if the path were via a sibling of the DFG being inlined, that will be a valid order path after the InlineDFG completes....

@aborgna-q

Copy link
Copy Markdown
Collaborator Author

Nvm. The check should never be false in valid hugrs.

@aborgna-q aborgna-q closed this Jul 7, 2026
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.

2 participants