Skip to content

Conversation

@aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Jul 18, 2025

  • PortOffsets now use a u32 internally instead of u16, so we support nodes with higher arity.
  • Portgraph's NodeIndex serialization changed, so I had to update the SerialHugr / SerialPersistentHugr definitions to use usizes directly.

BREAKING CHANGE: Updated public dependency portgraph to 0.15

@aborgna-q aborgna-q requested review from lmondada and ss2165 July 18, 2025 15:38
@aborgna-q aborgna-q requested a review from a team as a code owner July 18, 2025 15:38
@codecov
Copy link

codecov bot commented Jul 18, 2025

Codecov Report

Attention: Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.

Project coverage is 82.42%. Comparing base (2c16a77) to head (9f4d3d2).

Files with missing lines Patch % Lines
hugr-persistent/src/state_space.rs 42.85% 4 Missing ⚠️
hugr-core/src/hugr/serialize.rs 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2455      +/-   ##
==========================================
- Coverage   82.42%   82.42%   -0.01%     
==========================================
  Files         247      247              
  Lines       46185    46194       +9     
  Branches    41764    41773       +9     
==========================================
+ Hits        38070    38077       +7     
- Misses       6076     6078       +2     
  Partials     2039     2039              
Flag Coverage Δ
python 87.74% <ø> (ø)
rust 81.86% <83.87%> (-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 force-pushed the ab/portgraph-generics branch from bbfc860 to 9f4d3d2 Compare July 18, 2025 15:42
@lmondada
Copy link
Contributor

Thanks! lgtm

@aborgna-q aborgna-q added this pull request to the merge queue Jul 18, 2025
Merged via the queue into main with commit a3495d7 Jul 18, 2025
26 checks passed
@aborgna-q aborgna-q deleted the ab/portgraph-generics branch July 18, 2025 15:55
@hugrbot hugrbot mentioned this pull request Jul 18, 2025
@hugrbot hugrbot mentioned this pull request Jul 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 24, 2025
We reverted the serialisation changes in portgraph and yanked the `15.0`
release. We can thus revert the serialisation patches of
#2455.

~There are some breaking tests that I do not yet understand. Will look
into these next.~

EDIT: all tests have been fixed.
@hugrbot hugrbot mentioned this pull request Jul 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 24, 2025
This release fixes multiple inconsistencies between the serialization
formats
and improves the error messages when loading unsupported envelopes.

We now also support nodes with up to `2^32` connections to the same port
(up from `2^16`).

---

## 🤖 New release

* `hugr-model`: 0.21.0 -> 0.22.0 (✓ API compatible changes)
* `hugr-core`: 0.21.0 -> 0.22.0 (✓ API compatible changes)
* `hugr-llvm`: 0.21.0 -> 0.22.0 (✓ API compatible changes)
* `hugr-passes`: 0.21.0 -> 0.22.0 (✓ API compatible changes)
* `hugr-persistent`: 0.1.0 -> 0.2.0 (✓ API compatible changes)
* `hugr`: 0.21.0 -> 0.22.0 (✓ API compatible changes)
* `hugr-cli`: 0.21.0 -> 0.22.0 (✓ API compatible changes)

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

## `hugr-model`

<blockquote>

##
[0.22.0](hugr-model-v0.21.0...hugr-model-v0.22.0)
- 2025-07-24

### New Features

- Names of private functions become `core.title` metadata.
([#2448](#2448))
- include generator metatada in model import and cli validate errors
([#2452](#2452))
- Version number in hugr binary format.
([#2468](#2468))
- Use semver crate for -model version, and include in docs
([#2471](#2471))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.22.0](hugr-core-v0.21.0...hugr-core-v0.22.0)
- 2025-07-24

### Bug Fixes

- Ensure SumTypes have the same json encoding in -rs and -py
([#2465](#2465))

### New Features

- Export entrypoint metadata in Python and fix bug in import
([#2434](#2434))
- Names of private functions become `core.title` metadata.
([#2448](#2448))
- [**breaking**] Use binary envelopes for operation lower_func encoding
([#2447](#2447))
- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
- Detect and fail on unrecognised envelope flags
([#2453](#2453))
- include generator metatada in model import and cli validate errors
([#2452](#2452))
- [**breaking**] Add `insert_region` to HugrMut
([#2463](#2463))
- Non-region entrypoints in `hugr-model`.
([#2467](#2467))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.21.0](hugr-llvm-v0.20.2...hugr-llvm-v0.21.0)
- 2025-07-09

### New Features

- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] More helpful error messages in model import
([#2272](#2272))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- Add `MakeError` op ([#2377](#2377))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.22.0](hugr-passes-v0.21.0...hugr-passes-v0.22.0)
- 2025-07-24

### New Features

- ReplaceTypes allows linearizing inside Op replacements
([#2435](#2435))
- Add pass for DFG inlining
([#2460](#2460))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.2.0](hugr-persistent-v0.1.0...hugr-persistent-v0.2.0)
- 2025-07-24

### New Features

- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
</blockquote>

## `hugr`

<blockquote>

##
[0.22.0](hugr-v0.21.0...hugr-v0.22.0)
- 2025-07-24

### Bug Fixes

- Ensure SumTypes have the same json encoding in -rs and -py
([#2465](#2465))

### New Features

- ReplaceTypes allows linearizing inside Op replacements
([#2435](#2435))
- Add pass for DFG inlining
([#2460](#2460))
- Export entrypoint metadata in Python and fix bug in import
([#2434](#2434))
- Names of private functions become `core.title` metadata.
([#2448](#2448))
- [**breaking**] Use binary envelopes for operation lower_func encoding
([#2447](#2447))
- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
- Detect and fail on unrecognised envelope flags
([#2453](#2453))
- include generator metatada in model import and cli validate errors
([#2452](#2452))
- [**breaking**] Add `insert_region` to HugrMut
([#2463](#2463))
- Non-region entrypoints in `hugr-model`.
([#2467](#2467))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.22.0](hugr-cli-v0.21.0...hugr-cli-v0.22.0)
- 2025-07-24

### New Features

- include generator metatada in model import and cli validate errors
([#2452](#2452))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Agustín Borgna <[email protected]>
@hugrbot hugrbot mentioned this pull request Jul 28, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 28, 2025
## 🤖 New release

* `hugr-model`: 0.22.0 -> 0.22.1
* `hugr-core`: 0.22.0 -> 0.22.1
* `hugr-llvm`: 0.22.0 -> 0.22.1
* `hugr-passes`: 0.22.0 -> 0.22.1 (✓ API compatible changes)
* `hugr`: 0.22.0 -> 0.22.1 (✓ API compatible changes)
* `hugr-cli`: 0.22.0 -> 0.22.1
* `hugr-persistent`: 0.2.0 -> 0.2.1

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

## `hugr-model`

<blockquote>

##
[0.22.0](hugr-model-v0.21.0...hugr-model-v0.22.0)
- 2025-07-24

### New Features

- Names of private functions become `core.title` metadata.
([#2448](#2448))
- include generator metatada in model import and cli validate errors
([#2452](#2452))
- Version number in hugr binary format.
([#2468](#2468))
- Use semver crate for -model version, and include in docs
([#2471](#2471))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.22.0](hugr-core-v0.21.0...hugr-core-v0.22.0)
- 2025-07-24

### Bug Fixes

- Ensure SumTypes have the same json encoding in -rs and -py
([#2465](#2465))

### New Features

- Export entrypoint metadata in Python and fix bug in import
([#2434](#2434))
- Names of private functions become `core.title` metadata.
([#2448](#2448))
- [**breaking**] Use binary envelopes for operation lower_func encoding
([#2447](#2447))
- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
- Detect and fail on unrecognised envelope flags
([#2453](#2453))
- include generator metatada in model import and cli validate errors
([#2452](#2452))
- [**breaking**] Add `insert_region` to HugrMut
([#2463](#2463))
- Non-region entrypoints in `hugr-model`.
([#2467](#2467))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.21.0](hugr-llvm-v0.20.2...hugr-llvm-v0.21.0)
- 2025-07-09

### New Features

- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] More helpful error messages in model import
([#2272](#2272))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- Add `MakeError` op ([#2377](#2377))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.22.1](hugr-passes-v0.22.0...hugr-passes-v0.22.1)
- 2025-07-28

### New Features

- Include copy_discard_array in DelegatingLinearizer::default
([#2479](#2479))
- Inline calls to functions not on cycles in the call graph
([#2450](#2450))
</blockquote>

## `hugr`

<blockquote>

##
[0.22.1](hugr-v0.22.0...hugr-v0.22.1)
- 2025-07-28

### New Features

- Include copy_discard_array in DelegatingLinearizer::default
([#2479](#2479))
- Inline calls to functions not on cycles in the call graph
([#2450](#2450))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.22.0](hugr-cli-v0.21.0...hugr-cli-v0.22.0)
- 2025-07-24

### New Features

- include generator metatada in model import and cli validate errors
([#2452](#2452))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.2.0](hugr-persistent-v0.1.0...hugr-persistent-v0.2.0)
- 2025-07-24

### New Features

- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
</blockquote>


</p></details>

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

* `hugr-model`: 0.22.1 -> 0.23.0 (✓ API compatible changes)
* `hugr-core`: 0.22.1 -> 0.23.0 (⚠ API breaking changes)
* `hugr-llvm`: 0.22.1 -> 0.23.0 (✓ API compatible changes)
* `hugr-passes`: 0.22.1 -> 0.23.0 (✓ API compatible changes)
* `hugr-persistent`: 0.2.1 -> 0.2.2 (✓ API compatible changes)
* `hugr`: 0.22.1 -> 0.23.0 (✓ API compatible changes)
* `hugr-cli`: 0.22.1 -> 0.23.0 (✓ API compatible changes)

### ⚠ `hugr-core` breaking changes

```text
--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_missing.ron

Failed in:
  struct hugr_core::hugr::views::sibling_subgraph::TopoConvexChecker, previously in file /tmp/.tmpA42bjc/hugr-core/src/hugr/views/sibling_subgraph.rs:601
```

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

## `hugr-model`

<blockquote>

##
[0.23.0](hugr-model-v0.22.1...hugr-model-v0.23.0)
- 2025-08-06

### New Features

- Type of constants in `core` `Term`s.
([#2411](#2411))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.23.0](hugr-core-v0.22.1...hugr-core-v0.23.0)
- 2025-08-06

### New Features

- Type of constants in `core` `Term`s.
([#2411](#2411))
- Support LineConvexChecker
([#2487](#2487))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.23.0](hugr-llvm-v0.22.1...hugr-llvm-v0.23.0)
- 2025-08-06

### Bug Fixes

- added public func getter for EmitFuncContext
([#2482](#2482))
- *(hugr-llvm)* Set llvm function linkage based on Visibility hugr node
field ([#2502](#2502))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.22.1](hugr-passes-v0.22.0...hugr-passes-v0.22.1)
- 2025-07-28

### New Features

- Include copy_discard_array in DelegatingLinearizer::default
([#2479](#2479))
- Inline calls to functions not on cycles in the call graph
([#2450](#2450))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.2.0](hugr-persistent-v0.1.0...hugr-persistent-v0.2.0)
- 2025-07-24

### New Features

- [**breaking**] Update portgraph dependency to 0.15
([#2455](#2455))
</blockquote>

## `hugr`

<blockquote>

##
[0.23.0](hugr-v0.22.1...hugr-v0.23.0)
- 2025-08-06

### New Features

- Type of constants in `core` `Term`s.
([#2411](#2411))
- Support LineConvexChecker
([#2487](#2487))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.23.0](hugr-cli-v0.22.1...hugr-cli-v0.23.0)
- 2025-08-06

### New Features

- *(cli)* Deprecate HugrInputArgs::get_hugr
([#2506](#2506))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

---------

Co-authored-by: Luca Mondada <[email protected]>
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.

3 participants