fix: two problems in array linearization from #2749#2779
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2779 +/- ##
==========================================
+ Coverage 83.44% 83.72% +0.27%
==========================================
Files 263 263
Lines 52734 52725 -9
Branches 47490 47481 -9
==========================================
+ Hits 44005 44144 +139
+ Misses 6342 6192 -150
- Partials 2387 2389 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Dec 24, 2025
mark-koch
approved these changes
Dec 29, 2025
aborgna-q
approved these changes
Dec 29, 2025
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 29, 2025
## 🤖 New release * `hugr-model`: 0.25.0 -> 0.25.1 (✓ API compatible changes) * `hugr-core`: 0.25.0 -> 0.25.1 (✓ API compatible changes) * `hugr-llvm`: 0.25.0 -> 0.25.1 (✓ API compatible changes) * `hugr-passes`: 0.25.0 -> 0.25.1 (✓ API compatible changes) * `hugr-persistent`: 0.4.0 -> 0.4.1 (✓ API compatible changes) * `hugr`: 0.25.0 -> 0.25.1 (✓ API compatible changes) * `hugr-cli`: 0.25.0 -> 0.25.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr-model` <blockquote> ## [0.25.0](hugr-model-v0.24.3...hugr-model-v0.25.0) - 2025-12-22 ### Bug Fixes - *(model)* avoid non abi-compatible pyo3 calls ([#2679](#2679)) ### New Features - [**breaking**] Upgrade pyo3 dependency to 0.27 ([#2736](#2736)) ### Refactor - Direct import of model representation to Python ([#2683](#2683)) </blockquote> ## `hugr-core` <blockquote> ## [0.25.0](hugr-core-v0.24.3...hugr-core-v0.25.0) - 2025-12-22 ### Bug Fixes - *(hugr-core)* [**breaking**] Return error instead of panicking in `MakeRegisteredOp::to_extension_op()` ([#2701](#2701)) - register packaged extensions before model_ast import ([#2702](#2702)) - ModuleGraph misses static edges to non-container entrypoints ([#2745](#2745)) ### New Features - return description output to python on error ([#2681](#2681)) - add hugr-core StaticGraph, deprecate hugr-passes CallGraph ([#2698](#2698)) - [**breaking**] Remove `RootCheckable` ([#2704](#2704)) - Add method to link Hugr modules (linking pt3) ([#2529](#2529)) - `insert_link_hugr` adds entrypoint subtree and links, with reachability ([#2555](#2555)) - [**breaking**] Upgrade pyo3 dependency to 0.27 ([#2736](#2736)) - [**breaking**] Bump MSRV to Rust 1.89 ([#2747](#2747)) - [**breaking**] Allow disconnecting specific edges in a hugr ([#2737](#2737)) - Optype iterators over value ports ([#2738](#2738)) - [**breaking**] Type-safe access for node metadata ([#2755](#2755)) - [**breaking**] GeneratorDesc metadata definition ([#2759](#2759)) ### Refactor - [**breaking**] move envelope reading to dedicated module with dedicated errors ([#2689](#2689)) - Direct import of model representation to Python ([#2683](#2683)) - *(linking.rs)* [**breaking**] (tiny) avoid type_complexity ([#2721](#2721)) - [**breaking**] Remove multiple deprecated definitions ([#2751](#2751)) - [**breaking**] Delete ValueArray ([#2760](#2760)) - Deprecate Value::Function and inline_constant_functions ([#2770](#2770)) </blockquote> ## `hugr-llvm` <blockquote> ## [0.25.0](hugr-llvm-v0.24.3...hugr-llvm-v0.25.0) - 2025-12-22 ### New Features - *(llvm)* [**breaking**] upgrade to inkwell 0.7 ([#2695](#2695)) ### Refactor - Deprecate Value::Function and inline_constant_functions ([#2770](#2770)) </blockquote> ## `hugr-passes` <blockquote> ## [0.25.1](hugr-passes-v0.25.0...hugr-passes-v0.25.1) - 2025-12-29 ### Bug Fixes - two problems in array linearization from #2749 ([#2779](#2779)) </blockquote> ## `hugr-persistent` <blockquote> ## [0.4.0](hugr-persistent-v0.3.4...hugr-persistent-v0.4.0) - 2025-12-22 ### New Features - [**breaking**] Remove `RootCheckable` ([#2704](#2704)) - [**breaking**] Bump MSRV to Rust 1.89 ([#2747](#2747)) - [**breaking**] Type-safe access for node metadata ([#2755](#2755)) ### Refactor - [**breaking**] Remove multiple deprecated definitions ([#2751](#2751)) </blockquote> ## `hugr` <blockquote> ## [0.25.1](hugr-v0.25.0...hugr-v0.25.1) - 2025-12-29 ### Bug Fixes - two problems in array linearization from #2749 ([#2779](#2779)) </blockquote> ## `hugr-cli` <blockquote> ## [0.25.0](hugr-cli-v0.24.3...hugr-cli-v0.25.0) - 2025-12-22 ### New Features - *(cli, python)* programmatic interface to cli with python bindings ([#2677](#2677)) - return description output to python on error ([#2681](#2681)) - [**breaking**] Type-safe access for node metadata ([#2755](#2755)) - [**breaking**] GeneratorDesc metadata definition ([#2759](#2759)) ### Refactor - [**breaking**] move envelope reading to dedicated module with dedicated errors ([#2689](#2689)) - *(cli)* [**breaking**] remove deprecated hugr_json handling ([#2690](#2690)) - [**breaking**] Remove multiple deprecated definitions ([#2751](#2751)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
Merged
github-merge-queue bot
pushed a commit
to Quantinuum/guppylang
that referenced
this pull request
Dec 30, 2025
This odd `guppy.comptime` + `result` combo seems to invoke the BorrowArray *copying* handler in a way that I haven't managed to otherwise. The two calls with different-length arrays caused linking problems following https:://github.com/Quantinuum/hugr/pull/2749, fixed in https:://github.com/Quantinuum/hugr/pull/2779. Note, all testing was based on guppylang 0.21.6, I realize there has been a 0.21.7 since but the testing was quite a faff so I will not repeat it unless you think there is reason guppy compilation may have changed....
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 30, 2025
## 🤖 New release * `hugr-model`: 0.25.1 -> 0.25.2 * `hugr-core`: 0.25.1 -> 0.25.2 (✓ API compatible changes) * `hugr-llvm`: 0.25.1 -> 0.25.2 * `hugr-passes`: 0.25.1 -> 0.25.2 * `hugr`: 0.25.1 -> 0.25.2 (✓ API compatible changes) * `hugr-cli`: 0.25.1 -> 0.25.2 * `hugr-persistent`: 0.4.1 -> 0.4.2 <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr-model` <blockquote> ## [0.25.0](hugr-model-v0.24.3...hugr-model-v0.25.0) - 2025-12-22 ### Bug Fixes - *(model)* avoid non abi-compatible pyo3 calls ([#2679](#2679)) ### New Features - [**breaking**] Upgrade pyo3 dependency to 0.27 ([#2736](#2736)) ### Refactor - Direct import of model representation to Python ([#2683](#2683)) </blockquote> ## `hugr-core` <blockquote> ## [0.25.2](hugr-core-v0.25.1...hugr-core-v0.25.2) - 2025-12-30 ### Bug Fixes - *(determinism)* use BTreeMap in ModuleGraph ([#2783](#2783)) ### New Features - Re-export hugr_core::hugr::linking from hugr:: ([#2781](#2781)) </blockquote> ## `hugr-llvm` <blockquote> ## [0.25.0](hugr-llvm-v0.24.3...hugr-llvm-v0.25.0) - 2025-12-22 ### New Features - *(llvm)* [**breaking**] upgrade to inkwell 0.7 ([#2695](#2695)) ### Refactor - Deprecate Value::Function and inline_constant_functions ([#2770](#2770)) </blockquote> ## `hugr-passes` <blockquote> ## [0.25.1](hugr-passes-v0.25.0...hugr-passes-v0.25.1) - 2025-12-29 ### Bug Fixes - two problems in array linearization from #2749 ([#2779](#2779)) </blockquote> ## `hugr` <blockquote> ## [0.25.2](hugr-v0.25.1...hugr-v0.25.2) - 2025-12-30 ### Bug Fixes - *(determinism)* use BTreeMap in ModuleGraph ([#2783](#2783)) ### New Features - Re-export hugr_core::hugr::linking from hugr:: ([#2781](#2781)) </blockquote> ## `hugr-cli` <blockquote> ## [0.25.0](hugr-cli-v0.24.3...hugr-cli-v0.25.0) - 2025-12-22 ### New Features - *(cli, python)* programmatic interface to cli with python bindings ([#2677](#2677)) - return description output to python on error ([#2681](#2681)) - [**breaking**] Type-safe access for node metadata ([#2755](#2755)) - [**breaking**] GeneratorDesc metadata definition ([#2759](#2759)) ### Refactor - [**breaking**] move envelope reading to dedicated module with dedicated errors ([#2689](#2689)) - *(cli)* [**breaking**] remove deprecated hugr_json handling ([#2690](#2690)) - [**breaking**] Remove multiple deprecated definitions ([#2751](#2751)) </blockquote> ## `hugr-persistent` <blockquote> ## [0.4.0](hugr-persistent-v0.3.4...hugr-persistent-v0.4.0) - 2025-12-22 ### New Features - [**breaking**] Remove `RootCheckable` ([#2704](#2704)) - [**breaking**] Bump MSRV to Rust 1.89 ([#2747](#2747)) - [**breaking**] Type-safe access for node metadata ([#2755](#2755)) ### Refactor - [**breaking**] Remove multiple deprecated definitions ([#2751](#2751)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
Merged
github-merge-queue bot
pushed a commit
to Quantinuum/tket2
that referenced
this pull request
Jan 6, 2026
So following #1325 I was finally able to (/finally succeeded) in evaluating the effect of Quantinuum/hugr#2749 on guppy tests. (There was some question on that PR as to whether we needed to add new facility, see #2766; here is the data.) Three tests were affected (indeed the same ones as were broken and then fixed by Quantinuum/hugr#2779 but that is a separate issue). The sizes of the LLVM output as follows: | | Original (hugr 0.24.3) | Hugr 0.25+[fix](Quantinuum/hugr#2779) | Hugr 0.25+[fix](Quantinuum/hugr#2779) + this PR | |----|----|----|----| | [new test](Quantinuum/guppylang#1411) | 9568 | 11856 | 9888 | | basic_type | 10224 | 11616 | 10400 | | notebook2 | 15680 | 17184 | 15936 | | notebook5 (Hugr 1) | 10832 | 12304 | 11072 | | notebook5 (Hugr 2) | 10480 | 11840 | 10656 | Inspection of the hugrs in the middle row revealed the helper functions from Quantinuum/hugr#2749 were indeed present in the LLVM output as `define` (not `define private`). Hence, this PR, following which LLVM is able to remove the `define`s. (I have not looked into the remaining +2-3% increase. (The numbers include many other changes between hugr-0.24.3 and hugr-0.25.0.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2749 suffered from poor test coverage, and although I thought I had run the guppy test suite using a modified
selene-hugr-qis-compilerI failed to reveal the first bug here (and the rest were not covered by the guppy test suite of the time).__unwrapand__mk_nonehelper functions; ReplaceTypes generally runs after monomorphization so this avoids needing to rerun the latter.copy_scan_func_namedid not depend on the size of the array, yet the generated helper function took and returned an array (of options, plus an index) - this means linking raises a conflicting-signature error if you are linearizing copies of two different-size arrays of the same element type