Skip to content

Conversation

@aborgna-q
Copy link
Collaborator

Fixes #2654.

The issue was not with const edges, but rather with creating a subgraph with nodes not from the entrypoint region.

@aborgna-q aborgna-q requested a review from lmondada October 31, 2025 12:42
@aborgna-q aborgna-q requested a review from a team as a code owner October 31, 2025 12:42
@aborgna-q aborgna-q changed the title fix: SiblingSubrgaph::try_from_nodes for non-entrypoint region fix: SiblingSubgraph::try_from_nodes for non-entrypoint region Oct 31, 2025
let (region, node_map) = hugr.region_portgraph(hugr.entrypoint());
// Pick the hugr region that contains the boundary nodes.
// If the nodes are not in the same region, we'll fail the convexity check later on.
let mut nodes = inputs
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe don't call this nodes, it's a bit confusing. Something like input_output_nodes (or just io_nodes)?

@lmondada
Copy link
Contributor

merge before 3pm, otherwise my review will be worthless :)

@aborgna-q aborgna-q enabled auto-merge October 31, 2025 12:50
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.35%. Comparing base (01e7ac0) to head (381ff41).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/hugr/views/sibling_subgraph.rs 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2655   +/-   ##
=======================================
  Coverage   83.35%   83.35%           
=======================================
  Files         259      259           
  Lines       50628    50652   +24     
  Branches    46189    46213   +24     
=======================================
+ Hits        42200    42223   +23     
  Misses       6061     6061           
- Partials     2367     2368    +1     
Flag Coverage Δ
python 91.46% <ø> (ø)
rust 82.58% <96.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@aborgna-q aborgna-q added this pull request to the merge queue Oct 31, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 31, 2025

CodSpeed Performance Report

Merging #2655 will degrade performances by 99.09%

Comparing ab/fix-sibling-subgraph-entrypoint (381ff41) with main (01e7ac0)

Summary

❌ 3 regressions
✅ 22 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
fewnode_subgraph[1000] 49.1 µs 5,394.8 µs -99.09%
fewnode_subgraph[100] 49 µs 620.2 µs -92.09%
fewnode_subgraph[10] 48.7 µs 137.7 µs -64.67%

Merged via the queue into main with commit a7ed401 Oct 31, 2025
30 of 31 checks passed
@aborgna-q aborgna-q deleted the ab/fix-sibling-subgraph-entrypoint branch October 31, 2025 12:58
@hugrbot hugrbot mentioned this pull request Oct 31, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 3, 2025
## 🤖 New release

* `hugr-model`: 0.24.0 -> 0.24.1 (✓ API compatible changes)
* `hugr-core`: 0.24.0 -> 0.24.1 (✓ API compatible changes)
* `hugr-llvm`: 0.24.0 -> 0.24.1 (✓ API compatible changes)
* `hugr-passes`: 0.24.0 -> 0.24.1 (✓ API compatible changes)
* `hugr-persistent`: 0.3.1 -> 0.3.2 (✓ API compatible changes)
* `hugr`: 0.24.0 -> 0.24.1 (✓ API compatible changes)
* `hugr-cli`: 0.24.0 -> 0.24.1 (✓ API compatible changes)

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.24.1](hugr-model-v0.24.0...hugr-model-v0.24.1)
- 2025-11-03

### Bug Fixes

- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.24.1](hugr-core-v0.24.0...hugr-core-v0.24.1)
- 2025-11-03

### Bug Fixes

- validation outside entrypoint, normalize_cfgs w/ nonlocal edges
([#2633](#2633))
- SiblingSubgraph::try_from_nodes for non-entrypoint region
([#2655](#2655))
- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.24.0](hugr-llvm-v0.23.0...hugr-llvm-v0.24.0)
- 2025-10-13

### New Features

- LLVM lowering for borrow arrays using bitmasks
([#2574](#2574))
- *(py, core, llvm)* add `is_borrowed` op for BorrowArray
([#2610](#2610))

### Refactor

- [**breaking**] consistent inout order in borrow array
([#2621](#2621))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.24.1](hugr-passes-v0.24.0...hugr-passes-v0.24.1)
- 2025-11-03

### Bug Fixes

- validation outside entrypoint, normalize_cfgs w/ nonlocal edges
([#2633](#2633))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.3.2](hugr-persistent-v0.3.1...hugr-persistent-v0.3.2)
- 2025-11-03

### New Features

- *(persistent)* More efficient HugrView iterators for PersistentHugr
([#2595](#2595))
</blockquote>

## `hugr`

<blockquote>

##
[0.24.1](hugr-v0.24.0...hugr-v0.24.1)
- 2025-11-03

### Bug Fixes

- validation outside entrypoint, normalize_cfgs w/ nonlocal edges
([#2633](#2633))
- SiblingSubgraph::try_from_nodes for non-entrypoint region
([#2655](#2655))
- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.24.1](hugr-cli-v0.24.0...hugr-cli-v0.24.1)
- 2025-11-03

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Nov 3, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2025
## 🤖 New release

* `hugr-model`: 0.24.1 -> 0.24.2
* `hugr-core`: 0.24.1 -> 0.24.2
* `hugr-llvm`: 0.24.1 -> 0.24.2
* `hugr-passes`: 0.24.1 -> 0.24.2 (✓ API compatible changes)
* `hugr`: 0.24.1 -> 0.24.2 (✓ API compatible changes)
* `hugr-cli`: 0.24.1 -> 0.24.2 (✓ API compatible changes)
* `hugr-persistent`: 0.3.2 -> 0.3.3

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.24.1](hugr-model-v0.24.0...hugr-model-v0.24.1)
- 2025-11-03

### Bug Fixes

- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.24.1](hugr-core-v0.24.0...hugr-core-v0.24.1)
- 2025-11-03

### Bug Fixes

- validation outside entrypoint, normalize_cfgs w/ nonlocal edges
([#2633](#2633))
- SiblingSubgraph::try_from_nodes for non-entrypoint region
([#2655](#2655))
- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.24.0](hugr-llvm-v0.23.0...hugr-llvm-v0.24.0)
- 2025-10-13

### New Features

- LLVM lowering for borrow arrays using bitmasks
([#2574](#2574))
- *(py, core, llvm)* add `is_borrowed` op for BorrowArray
([#2610](#2610))

### Refactor

- [**breaking**] consistent inout order in borrow array
([#2621](#2621))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.24.2](hugr-passes-v0.24.1...hugr-passes-v0.24.2)
- 2025-11-03

### Bug Fixes

- ReplaceTypes: operate on whole Hugr, with set_regions
([#2662](#2662))
</blockquote>

## `hugr`

<blockquote>

##
[0.24.2](hugr-v0.24.1...hugr-v0.24.2)
- 2025-11-03

### Bug Fixes

- ReplaceTypes: operate on whole Hugr, with set_regions
([#2662](#2662))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.24.1](hugr-cli-v0.24.0...hugr-cli-v0.24.1)
- 2025-11-03

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.3.2](hugr-persistent-v0.3.1...hugr-persistent-v0.3.2)
- 2025-11-03

### New Features

- *(persistent)* More efficient HugrView iterators for PersistentHugr
([#2595](#2595))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
This was referenced Nov 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 6, 2025
## 🤖 New release

* `hugr-model`: 0.24.2 -> 0.24.3 (✓ API compatible changes)
* `hugr-core`: 0.24.2 -> 0.24.3
* `hugr-llvm`: 0.24.2 -> 0.24.3 (✓ API compatible changes)
* `hugr-passes`: 0.24.2 -> 0.24.3 (✓ API compatible changes)
* `hugr`: 0.24.2 -> 0.24.3 (✓ API compatible changes)
* `hugr-cli`: 0.24.2 -> 0.24.3 (✓ API compatible changes)
* `hugr-persistent`: 0.3.3 -> 0.3.4

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.24.1](hugr-model-v0.24.0...hugr-model-v0.24.1)
- 2025-11-03

### Bug Fixes

- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.24.1](hugr-core-v0.24.0...hugr-core-v0.24.1)
- 2025-11-03

### Bug Fixes

- validation outside entrypoint, normalize_cfgs w/ nonlocal edges
([#2633](#2633))
- SiblingSubgraph::try_from_nodes for non-entrypoint region
([#2655](#2655))
- Correct conversion of `table::Term::Tuple` to `ast::Term`
([#2653](#2653))

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.24.3](hugr-llvm-v0.24.2...hugr-llvm-v0.24.3)
- 2025-11-06

### Bug Fixes

- BorrowArray discard handler allows elements to be borrowed
([#2666](#2666))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.24.3](hugr-passes-v0.24.2...hugr-passes-v0.24.3)
- 2025-11-06

### Bug Fixes

- BorrowArray discard handler allows elements to be borrowed
([#2666](#2666))
</blockquote>

## `hugr`

<blockquote>

##
[0.24.3](hugr-v0.24.2...hugr-v0.24.3)
- 2025-11-06

### Bug Fixes

- BorrowArray discard handler allows elements to be borrowed
([#2666](#2666))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.24.1](hugr-cli-v0.24.0...hugr-cli-v0.24.1)
- 2025-11-03

### New Features

- track package descriptions when loading
([#2639](#2639))
- *(cli)* describe sub-command
([#2650](#2650))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.3.2](hugr-persistent-v0.3.1...hugr-persistent-v0.3.2)
- 2025-11-03

### New Features

- *(persistent)* More efficient HugrView iterators for PersistentHugr
([#2595](#2595))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Nov 10, 2025
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.

SiblingSubgraph::try_from_nodes fails if there's a Const+LoadConst

3 participants