Skip to content

chore!: hugr-rs v0.16.0 release #2083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

chore!: hugr-rs v0.16.0 release #2083

wants to merge 13 commits into from

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Apr 15, 2025

This draft PR tracks the release branch that accumulates breaking changes to be published in hugr-rs 0.16.0. Milestone: https://github.com/CQCL/hugr/milestone/10.

Breaking PRs should target this branch. We may also merge in changes from main as needed.

Instead of merging this PR, a repo admin should rebase it into main once we decide to bring the breaking changes to main.

BREAKING CHANGE: See individual commit PRs.

@aborgna-q aborgna-q requested a review from a team as a code owner April 15, 2025 13:56
@aborgna-q aborgna-q requested a review from croyzor April 15, 2025 13:56
@aborgna-q aborgna-q marked this pull request as draft April 15, 2025 13:56
@aborgna-q aborgna-q removed the request for review from croyzor April 15, 2025 13:56
@aborgna-q aborgna-q changed the title rfc: hugr-rs v0.16.0 release chore: hugr-rs v0.16.0 release Apr 15, 2025
@aborgna-q aborgna-q changed the title chore: hugr-rs v0.16.0 release chore!: hugr-rs v0.16.0 release Apr 15, 2025
`insert_hugr`, `insert_from_view`, and `insert_subgraph` were written
before we made `Node` a type generic, and incorrectly assumed the return
type maps were always `hugr::Node`s.

The methods were either unusable or incorrect when using generic
`HugrView`s source/targets with non-base node types.

This PR fixes that, and additionally allows us us to have
`SiblingSubgraph::extract_subgraph` work for generic `HugrViews`.

BREAKING CHANGE: Added Node type parameters to extraction operations in
`HugrMut`.
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 87.80710% with 134 lines in your changes missing coverage. Please review.

Project coverage is 83.49%. Comparing base (c8090ca) to head (a1cd051).

Files with missing lines Patch % Lines
hugr-core/src/hugr/views/impls.rs 53.03% 31 Missing ⚠️
hugr-passes/src/composable.rs 88.94% 17 Missing and 4 partials ⚠️
hugr-core/src/hugr/views/sibling.rs 73.77% 16 Missing ⚠️
hugr-passes/src/replace_types.rs 92.63% 6 Missing and 6 partials ⚠️
hugr-core/src/hugr/internal.rs 87.71% 7 Missing ⚠️
hugr-core/src/hugr/views/root_checked.rs 70.83% 7 Missing ⚠️
hugr-core/src/ops.rs 0.00% 7 Missing ⚠️
hugr-passes/src/monomorphize.rs 82.60% 1 Missing and 3 partials ⚠️
hugr-core/src/hugr/hugrmut.rs 96.80% 3 Missing ⚠️
hugr-core/src/hugr/rewrite.rs 0.00% 3 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2083      +/-   ##
==========================================
+ Coverage   83.09%   83.49%   +0.40%     
==========================================
  Files         219      219              
  Lines       41918    42188     +270     
  Branches    37993    38290     +297     
==========================================
+ Hits        34830    35225     +395     
+ Misses       5278     5150     -128     
- Partials     1810     1813       +3     
Flag Coverage Δ
python 85.73% <100.00%> (+0.02%) ⬆️
rust 83.26% <87.79%> (+0.44%) ⬆️

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.

@hugrbot
Copy link
Collaborator

hugrbot commented Apr 15, 2025

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum ImportError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/import.rs:39
enum SignatureError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/extension.rs:381
enum OrderHintError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/import.rs:80

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It 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/enum_variant_missing.ron

Failed in:
variant ExtensionBuildError::ValueExists, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:788

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It 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/inherent_method_missing.ron

Failed in:
Extension::get_value, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:683
Extension::add_value, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:708
Extension::get_value, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:683
Extension::add_value, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:708

--- failure method_requires_different_generic_type_params: method now requires a different number of generic type parameters ---

Description:
A method now requires a different number of generic type parameters than it used to. Uses of this method that supplied the previous number of generic types will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/method_requires_different_generic_type_params.ron

Failed in:
hugr_core::hugr::views::sibling::SiblingMut::try_new takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:256

--- 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::extension::ExtensionValue, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:502

--- failure trait_associated_type_added: non-sealed public trait added associated type without default value ---

Description:
A non-sealed trait has gained an associated type without a default value, which breaks downstream implementations of the trait
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_associated_type_added.ron

Failed in:
trait associated type hugr_core::hugr::rewrite::Rewrite::Node in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/rewrite.rs:22
trait associated type hugr_core::hugr::Rewrite::Node in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/rewrite.rs:22

--- failure trait_method_added: pub trait method added ---

Description:
A non-sealed public trait added a new method without a default implementation, which breaks downstream implementations of the trait
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-item-no-default
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_method_added.ron

Failed in:
trait method hugr_core::hugr::internal::HugrInternals::node_metadata_map in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/internal.rs:57

--- failure trait_method_missing: pub trait method removed or renamed ---

Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_method_missing.ron

Failed in:
method hugr_mut of trait HugrMutInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:211
method take_node_metadata of trait HugrMut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/hugrmut.rs:69
method overwrite_node_metadata of trait HugrMut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/hugrmut.rs:81
method extensions_mut of trait HugrMut, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/hugrmut.rs:303

--- failure trait_method_requires_different_generic_type_params: trait method now requires a different number of generic type parameters ---

Description:
A trait method now requires a different number of generic type parameters than it used to. Calls or implementations of this trait method using the previous number of generic types will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_method_requires_different_generic_type_params.ron

Failed in:
Container::add_hugr_view (0 -> 1 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/builder/build_traits.rs:122
HugrMut::insert_from_view (0 -> 1 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:171
HugrMut::insert_subgraph (0 -> 1 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:191

--- failure trait_missing: pub trait removed or renamed ---

Description:
A publicly-visible trait cannot be imported by its prior path. A `pub use` may have been removed, or the trait 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/trait_missing.ron

Failed in:
trait hugr_core::hugr::rewrite::simple_replace::HugrMutInternals, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/hugr/internal.rs:209

--- failure trait_removed_supertrait: supertrait removed or renamed ---

Description:
A supertrait was removed from a trait. Users of the trait can no longer assume it can also be used like its supertrait.
      ref: https://doc.rust-lang.org/reference/items/traits.html#supertraits
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_removed_supertrait.ron

Failed in:
supertrait hugr_core::hugr::rewrite::simple_replace::HugrMutInternals of trait HugrMut in file /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/hugrmut.rs:23

--- failure trait_requires_more_generic_type_params: trait now requires more generic type parameters ---

Description:
A trait now requires more generic type parameters than it used to. Uses of this trait that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_requires_more_generic_type_params.ron

Failed in:
trait SiblingMut (0 -> 1 required generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:242

--- failure type_requires_more_generic_type_params: type now requires more generic type parameters ---

Description:
A type now requires more generic type parameters than it used to. Uses of this type that supplied the previously-required number of generic types will be broken. To fix this, consider supplying default values for newly-added generic types.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#trait-new-parameter-no-default
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/type_requires_more_generic_type_params.ron

Failed in:
Struct SiblingMut (0 -> 1 required generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/hugr/views/sibling.rs:242

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum ResolveError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/ast/resolve.rs:366
enum ModelError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-model/src/v0/table/mod.rs:460

--- failure auto_trait_impl_removed: auto trait no longer implemented ---

Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
      ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/auto_trait_impl_removed.ron

Failed in:
type Machine is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/datalog.rs:31
type Machine is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/datalog.rs:31
type PartialSum is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:67
type PartialSum is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:67
type AnalysisResults is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/results.rs:11
type AnalysisResults is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/results.rs:11
type PartialValue is no longer UnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:314
type PartialValue is no longer RefUnwindSafe, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:314

--- failure derive_trait_impl_removed: built-in derived trait no longer implemented ---

Description:
A public type has stopped deriving one or more traits. This can break downstream code that depends on those types implementing those traits.
      ref: https://doc.rust-lang.org/reference/attributes/derive.html#derive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/derive_trait_impl_removed.ron

Failed in:
type LinearizeError no longer derives Eq, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types/linearize.rs:140

--- failure enum_marked_non_exhaustive: enum marked #[non_exhaustive] ---

Description:
A public enum has been marked #[non_exhaustive]. Pattern-matching on it outside of its crate must now include a wildcard pattern like `_`, or it will fail to compile.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#attr-adding-non-exhaustive
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_marked_non_exhaustive.ron

Failed in:
enum LowerError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/lower.rs:39
enum LinearizeError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types/linearize.rs:140
enum NonLocalEdgesError in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/non_local.rs:27

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum 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/enum_missing.ron

Failed in:
enum hugr_passes::validation::ValidationLevel, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/validation.rs:16
enum hugr_passes::MonomorphizeError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/monomorphize.rs:282
enum hugr_passes::validation::ValidatePassError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/validation.rs:28

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_variant_added.ron

Failed in:
variant PartialValue:LoadedFunction in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:318
variant NodeTemplate:Call in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types.rs:51

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It 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/enum_variant_missing.ron

Failed in:
variant ConstFoldError::ValidationError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/const_fold.rs:47
variant ReplaceTypesError::ValidationError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:187
variant UntupleError::ValidationError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/untuple.rs:60
variant RemoveDeadFuncsError::ValidationError, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dead_funcs.rs:31

--- failure function_requires_different_generic_type_params: function now requires a different number of generic type parameters ---

Description:
A function now requires a different number of generic type parameters than it used to. Uses of this function that supplied the previous number of generic types (e.g. via turbofish syntax) will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/function_requires_different_generic_type_params.ron

Failed in:
function row_contains_bottom (1 -> 2 generic types) in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow.rs:124

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It 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/inherent_method_missing.ron

Failed in:
ReplaceTypes::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:211
ReplaceTypes::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/replace_types.rs:211
DeadCodeElimPass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dead_code.rs:91
DeadCodeElimPass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dead_code.rs:91
ConstantFoldPass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/const_fold.rs:57
RemoveDeadFuncsPass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/dead_funcs.rs:73
MonomorphizePass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/monomorphize.rs:290
UntuplePass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/untuple.rs:82
UntuplePass::validation_level, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/untuple.rs:82

--- failure method_parameter_count_changed: pub method parameter count changed ---

Description:
A publicly-visible method now takes a different number of parameters.
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/method_parameter_count_changed.ron

Failed in:
hugr_passes::untuple::UntuplePass::new now takes 1 parameters instead of 2, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:72
hugr_passes::untuple::UntuplePass::run now takes 2 parameters instead of 3, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:129
hugr_passes::UntuplePass::new now takes 1 parameters instead of 2, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:72
hugr_passes::UntuplePass::run now takes 2 parameters instead of 3, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:129

--- failure method_requires_different_generic_type_params: method now requires a different number of generic type parameters ---

Description:
A method now requires a different number of generic type parameters than it used to. Uses of this method that supplied the previous number of generic types will be broken.
      ref: https://doc.rust-lang.org/reference/items/generics.html
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/method_requires_different_generic_type_params.ron

Failed in:
hugr_passes::replace_types::ReplaceTypes::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types.rs:520
hugr_passes::ReplaceTypes::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/replace_types.rs:520
hugr_passes::const_fold::ConstantFoldPass::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/const_fold.rs:92
hugr_passes::dataflow::PartialSum::try_into_sum takes 1 generic types instead of 3, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:202
hugr_passes::RemoveDeadFuncsPass::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dead_funcs.rs:89
hugr_passes::MonomorphizePass::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/monomorphize.rs:267
hugr_passes::dataflow::AnalysisResults::try_read_wire_concrete takes 1 generic types instead of 3, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/results.rs:90
hugr_passes::untuple::UntuplePass::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:129
hugr_passes::UntuplePass::run takes 0 generic types instead of 1, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/untuple.rs:129
hugr_passes::dataflow::PartialValue::try_into_concrete takes 1 generic types instead of 3, in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-passes/src/dataflow/partial_value.rs:417

--- failure module_missing: pub module removed or renamed ---

Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
      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/module_missing.ron

Failed in:
mod hugr_passes::validation, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-passes/src/validation.rs:1

aborgna-q and others added 5 commits April 15, 2025 16:02
`HugrMutInternals` is part of the semi-private traits defined in
`hugr-core`.
While most things get re-exported in `hugr`, we `*Internal` traits
require you to explicitly declare a dependency on the `-core` package
(as we don't want most users to have to interact with them).

For some reason there was a public re-export of the trait in a
re-exported module, so it ended up appearing in `hugr` anyways.

BREAKING CHANGE: Removed public re-export of `HugrMutInternals` from
`hugr`.
#2027 ended up being breaking due to adding a new variant to an error
enum missing the `non_exhaustive` marker.

This (breaking) PR makes sure all error enums have the flag.

BREAKING CHANGE: Marked all Error enums as `non_exhaustive`
* PartialValue now has a LoadedFunction variant, created by LoadFunction nodes (only, although other analyses are able to create PartialValues if they want)
* This requires adding a type parameter to PartialValue for the type of Node, which gets everywhere :-(.
* Use this to handle CallIndirects *with known targets* (it'll be a single known target or none at all) just like other Calls to the same function
* deprecate (and ignore) `value_from_function`
* Add a new trait `AsConcrete` for the result type of `PartialValue::try_into_concrete` and `PartialSum::try_into_sum`

Note almost no change to constant folding (only to drop impl of `value_from_function`)

BREAKING CHANGE: in dataflow framework, PartialValue now has additional variant; `try_into_concrete` requires the target type to implement AsConcrete.
Adds a generic node type to the `NodeHandle` type.

This is a required change for #2029.

drive-by: Implement the "Link the NodeHandles to the OpType" TODO
@@ -51,15 +51,25 @@ pub struct Sum<V> {
pub st: SumType,
}

/// The output of an [LoadFunction](hugr_core::ops::LoadFunction) - a "pointer"
/// to a function at a specific node, instantiated with the provided type-args.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/// to a function at a specific node, instantiated with the provided type-args.
/// to a function at a specific node, instantiated with the provided type-args.

ss2165 and others added 5 commits April 17, 2025 09:38
Closes #1595

BREAKING CHANGE: `values` field in `Extension` and `ExtensionValue`
struct/class removed in rust and python. Use 0-input ops that return
constant values.
Currently We have several "passes": monomorphization, dead function
removal, constant folding. Each has its own code to allow setting a
validation level (before and after that pass).

This PR adds the ability chain (sequence) passes;, and to add validation
before+after any pass or sequence; and commons up validation code. The
top-level `constant_fold_pass` (etc.) functions are left as wrappers
that do a single pass with validation only in test.

I've left ConstFoldPass as always including DCE, but an alternative
could be to return a sequence of the two - ATM that means a tuple
`(ConstFoldPass, DeadCodeElimPass)`.

I also wondered about including a method `add_entry_point` in
ComposablePass (e.g. for ConstFoldPass, that means `with_inputs` but no
inputs, i.e. all Top). I feel this is not applicable to *all* passes,
but near enough. This could be done in a later PR but `add_entry_point`
would need a no-op default for that to be a non-breaking change. So if
we wouldn't be happy with the no-op default then I could just add it
here...

Finally...docs are extremely minimal ATM (this is hugr-passes), I am
hoping that most of this is reasonably obvious (it doesn't really do a
lot!), but please flag anything you think is particularly in need of a
doc comment!

BREAKING CHANGE: quite a lot of calls to current pass routines will
break, specific cases include (a) `with_validation_level` should be done
by wrapping a ValidatingPass around the receiver; (b) XXXPass::run()
requires `use ...ComposablePass` (however, such calls will cease to do
any validation).

closes #1832
…eady in the Hugr (#2094)

There are two issues:
* Errors. The previous NodeTemplates still always work, but the Call one
can fail if the Hugr doesn't contain the target function node. ATM there
is no channel for reporting that error so I've had to panic. Otherwise
it's an even-more-breaking change to add an error type to
`NodeTemplate::add()` and `NodeTemplate::add_hugr()`. Should we? (I note
`HugrMut::connect` panics if the node isn't there, but could make the
`NodeTemplate::add` builder method return a BuildError...and propagate
that everywhere of course)
* There's a big limitation in `linearize_array` that it'll break if the
*element* says it should be copied/discarded via a NodeTemplate::Call,
as `linearize_array` puts the elementwise copy/discard function into a
*nested Hugr* (`Value::Function`) that won't contain the function. This
could be fixed via lifting those to toplevel FuncDefns with
name-mangling, but I'd rather leave that for #2086 ....

BREAKING CHANGE: Add new variant NodeTemplate::Call; LinearizeError no
longer derives Eq.
- Allows `HugrMut` to be implemented for `HugrView`s with arbitrary node
types
- Removes `HugrMutInternals::hugr_mut(&mut self) -> &mut Hugr`, it can
be implemented for more complex types. This is required for #1926, but I
haven't touched the read-only side yet.
- Added a `Node` associated type to `Rewrite`. All existing rewrites
only implement `Rewrite<Node = Node>` for now, expanding their type is
left for a separate PR.

drive-by: Fix a couple bugs in rewrite implementations that assumed that
`SiblingMut` contained transitive children.

BREAKING CHANGE: `HugrMut` is now implemented generically for any
`HugrView::Node` type.
BREAKING CHANGE: `SiblingMut` has a new type parameter for the wrapped
hugr type.
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.

5 participants