fix(determinism): use BTreeMap in ModuleGraph#2783
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2783 +/- ##
=======================================
Coverage 83.69% 83.69%
=======================================
Files 261 261
Lines 52551 52551
Branches 47307 47307
=======================================
Hits 43981 43981
Misses 6183 6183
Partials 2387 2387
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:
|
aborgna-q
approved these changes
Dec 30, 2025
Merged
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
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.
I think this fixes the nondeterminism observed in tket2#1325. (I updated tket2/Cargo.toml to use this branch, then ran
uv clean && uv pip install --reinstall tket selene-hugr-qis-compiler && uv syncand that changed tests from failing to passing).Not sure I completely understand the mechanism - this appears to change only the order in which we add (all the outgoing edges from a node) for each node (not the order of outgoing edges for each), which AFAICS should have no effect. But....let's try....