Skip to content

feat!: do not require an Order edge for each nonlocal Ext edge; order_graph computes on demand#2951

Draft
acl-cqc wants to merge 9 commits intomainfrom
acl/syn_edges
Draft

feat!: do not require an Order edge for each nonlocal Ext edge; order_graph computes on demand#2951
acl-cqc wants to merge 9 commits intomainfrom
acl/syn_edges

Conversation

@acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Mar 16, 2026

  • Remove the requirement for an Order edge for each Ext edge - validation no longer checks this, and the builder does not add it. (Clients such as guppy will be updated separately).
  • Deprecate the region_portgraph method currently used for (e.g.) topological sorting; this can no longer be relied upon for valid schedules, so really this is a breaking change.
    • TODO: We should deprecate first, and add the new method, in a preliminary non-breaking PR)
  • Add an order_graph method that returns a petgraph (+node map), which includes "synthetic" edges not in the Hugr that express the ordering requirements imposed by the nonlocal edges. (That is, this method scans the relevant region of the Hugr looking for nonlocal edges.)
  • Migrate most uses of region_portgraph, except for SiblingSubgraph, where there is some additional complexity because of traits for convexity checking.
  • TODO: update SiblingSubgraph - we want to do convexity checking on the order graph, but then ignore the synthetic edges for determining the boundary of the SSG, this should allow SSG to be used for more Hugrs than at present.

BREAKING CHANGE: Hugrs are no longer guaranteed to have an Order edge representing the ordering constraint from each nonlocal Ext edge; region_portgraph may return graphs without such edges (use order_graph) - it will return such only if they happen to be present.

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