-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add MonomorphizePass and deprecate monomorphize #1809
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1809 +/- ##
==========================================
- Coverage 86.66% 86.64% -0.03%
==========================================
Files 191 191
Lines 34692 34713 +21
Branches 31549 31570 +21
==========================================
+ Hits 30067 30077 +10
- Misses 2927 2936 +9
- Partials 1698 1700 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
hugr-passes/src/lib.rs
Outdated
pub use monomorphize::monomorphize; | ||
pub use monomorphize::{remove_polyfuncs, MonomorphizePass}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why remove_polyfuncs is treated any differently to monomorphize here.
Please export MonomorphizeError
hugr-passes/src/monomorphize.rs
Outdated
#[cfg(debug_assertions)] | ||
validate(&h); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(debug_assertions)] | |
validate(&h); |
kill these?
h | ||
} | ||
|
||
fn monomorphize_ref(h: &mut impl HugrMut) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like the name. Is the plan to rename this in the next breaking release, and to add a deprecated alias monomorphize_ref
? If so, could you add a TODO comment?
Similar for remove_polyfuncs_ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a private function so we can rename to monomorphize
when we remove the public one, will add comment
Co-authored-by: Douglas Wilson <[email protected]>
// TODO: Deprecated re-export. Remove on a breaking release. | ||
#[deprecated( | ||
since = "0.14.1", | ||
note = "Use `hugr::algorithms::MonomorphizePass` instead." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is hugr::algorithms
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 134 to 135 in 5dc24c1
pub use hugr_passes as algorithms; | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
## 🤖 New release * `hugr`: 0.14.0 -> 0.14.1 (✓ API compatible changes) * `hugr-core`: 0.14.0 -> 0.14.1 (✓ API compatible changes) * `hugr-model`: 0.15.0 -> 0.16.0 (⚠️ API breaking changes) * `hugr-llvm`: 0.14.0 -> 0.14.1 (✓ API compatible changes) * `hugr-passes`: 0.14.0 -> 0.14.1 (✓ API compatible changes) * `hugr-cli`: 0.14.0 -> 0.14.1 (✓ API compatible changes) ###⚠️ `hugr-model` breaking changes ``` --- failure constructible_struct_adds_field: externally-constructible struct adds field --- Description: A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field. ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.37.0/src/lints/constructible_struct_adds_field.ron Failed in: field Region.scope in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:414 field LinkId.1 in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:162 --- 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.37.0/src/lints/enum_missing.ron Failed in: enum hugr_model::v0::GlobalRef, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:456 enum hugr_model::v0::LocalRef, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:476 enum hugr_model::v0::LinkRef, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:494 --- failure enum_struct_variant_field_added: pub enum struct variant field added --- Description: An enum's exhaustive struct variant has a new field, which has to be included when constructing or matching on this variant. ref: https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.37.0/src/lints/enum_struct_variant_field_added.ron Failed in: field symbol of variant Term::Apply in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:544 field symbol of variant Term::ApplyFull in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:557 --- failure enum_struct_variant_field_missing: pub enum struct variant's field removed or renamed --- Description: A publicly-visible enum has a struct variant whose field 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.37.0/src/lints/enum_struct_variant_field_missing.ron Failed in: field global of variant Term::Apply, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:544 field global of variant Term::ApplyFull, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:557 --- 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.37.0/src/lints/enum_variant_added.ron Failed in: variant ModelError:InvalidVar in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:723 variant ModelError:InvalidSymbol in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:726 variant Operation:Import in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:374 --- 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.37.0/src/lints/enum_variant_missing.ron Failed in: variant ModelError::InvalidLocal, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:723 variant ModelError::InvalidGlobal, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:727 --- 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.37.0/src/lints/inherent_method_missing.ron Failed in: LinkId::new, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:140 LinkId::index, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:140 LinkId::unwrap_slice, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:140 LinkId::wrap_slice, previously in file /tmp/.tmp2gotdW/hugr-model/src/v0/mod.rs:140 --- failure struct_repr_transparent_removed: struct repr(transparent) removed --- Description: repr(transparent) was removed from a struct whose layout was part of the public ABI. This can cause its memory layout to change, breaking FFI use cases. ref: https://doc.rust-lang.org/cargo/reference/semver.html#repr-transparent-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.37.0/src/lints/struct_repr_transparent_removed.ron Failed in: struct LinkId in /tmp/.tmpN5f4vM/hugr/hugr-model/src/v0/mod.rs:162 ``` <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr` <blockquote> ## [0.14.1](hugr-v0.14.0...hugr-v0.14.1) - 2024-12-18 ### Bug Fixes - Constant folding now tolerates root nodes without input/output nodes (#1799) - `Call` ops not tracking their parameter extensions (#1805) ### New Features - add MonomorphizePass and deprecate monomorphize (#1809) - Lower LoadNat to LLVM (#1801) - Cleanup `Display` of types and arguments (#1802) - add ArrayValue to python, rust and lowering (#1773) - Scoping rules and utilities for symbols, links and variables (#1754) </blockquote> ## `hugr-core` <blockquote> ## [0.14.1](hugr-core-v0.14.0...hugr-core-v0.14.1) - 2024-12-18 ### Bug Fixes - `Call` ops not tracking their parameter extensions (#1805) ### New Features - Lower LoadNat to LLVM (#1801) - Cleanup `Display` of types and arguments (#1802) - add ArrayValue to python, rust and lowering (#1773) - Scoping rules and utilities for symbols, links and variables (#1754) </blockquote> ## `hugr-model` <blockquote> ## [0.16.0](hugr-model-v0.15.0...hugr-model-v0.16.0) - 2024-12-18 ### New Features - Scoping rules and utilities for symbols, links and variables (#1754) </blockquote> ## `hugr-llvm` <blockquote> ## [0.14.1](hugr-llvm-v0.14.0...hugr-llvm-v0.14.1) - 2024-12-18 ### Bug Fixes - Add LLVM lowering for `logic.Not` (#1812) ### New Features - Lower LoadNat to LLVM (#1801) - add ArrayValue to python, rust and lowering (#1773) </blockquote> ## `hugr-passes` <blockquote> ## [0.14.1](hugr-passes-v0.14.0...hugr-passes-v0.14.1) - 2024-12-18 ### Bug Fixes - Constant folding now tolerates root nodes without input/output nodes (#1799) ### New Features - Cleanup `Display` of types and arguments (#1802) - add MonomorphizePass and deprecate monomorphize (#1809) </blockquote> ## `hugr-cli` <blockquote> ## [0.14.1](hugr-cli-v0.14.0...hugr-cli-v0.14.1) - 2024-12-18 ### New Features - Print `hugr-cli`'s correct version when using '--version' (#1790) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
No description provided.