Skip to content
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: Extend LowerTypes pass to linearize by inserting copy/discard #2018

Draft
wants to merge 8 commits into
base: acl/lower_types
Choose a base branch
from

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Mar 21, 2025

  • Does not handle nonlocal edges. This is much more involved, not part of this PR. I note feat(hugr-passes)!: Add UnNonLocalPass #1912
  • Need to add handlers for arrays/lists - the parametrized/collection-type bits aren't tested yet. Hence, draft.

@acl-cqc acl-cqc changed the base branch from main to acl/lower_types March 21, 2025 16:24
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.86%. Comparing base (e3da259) to head (83acc18).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           acl/lower_types    #2018      +/-   ##
===================================================
- Coverage            83.87%   83.86%   -0.01%     
===================================================
  Files                  211      211              
  Lines                40144    40127      -17     
  Branches             36816    36799      -17     
===================================================
- Hits                 33669    33652      -17     
  Misses                4585     4585              
  Partials              1890     1890              
Flag Coverage Δ
python 92.06% <ø> (ø)

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 Mar 21, 2025

This PR contains breaking changes to the public Rust API.
Please deprecate the old API instead (if possible), or mark the PR with a ! to indicate a breaking change.

cargo-semver-checks summary

--- 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.40.0/src/lints/enum_variant_missing.ron

Failed in:
variant CliError::NotAnEnvelope, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-cli/src/lib.rs:60

--- 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.40.0/src/lints/inherent_method_missing.ron

Failed in:
StaticArrayValue::get_contents, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/std_extensions/collections/static_array.rs:73

--- failure pub_module_level_const_missing: pub module-level const is missing ---

Description:
A public const is missing or renamed
      ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
     impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.40.0/src/lints/pub_module_level_const_missing.ron

Failed in:
EXIT_OP_ID in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension/prelude.rs:197

--- 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.40.0/src/lints/inherent_method_missing.ron

Failed in:
CodegenExtsBuilder::add_static_array_extensions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:41
CodegenExtsBuilder::add_default_static_array_extensions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:47
CodegenExtsBuilder::add_static_array_extensions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:41
CodegenExtsBuilder::add_default_static_array_extensions, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:47

--- 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.40.0/src/lints/module_missing.ron

Failed in:
mod hugr_llvm::extension::collections::static_array, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:1

--- 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.40.0/src/lints/struct_missing.ron

Failed in:
struct hugr_llvm::extension::collections::static_array::StaticArrayCodegenExtension, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:36
struct hugr_llvm::extension::collections::static_array::DefaultStaticArrayCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:342

--- 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.40.0/src/lints/trait_method_missing.ron

Failed in:
method emit_exit of trait PreludeCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/prelude.rs:161
method emit_exit of trait PreludeCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/prelude.rs:161

--- 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.40.0/src/lints/trait_missing.ron

Failed in:
trait hugr_llvm::extension::collections::static_array::StaticArrayCodegen, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-llvm/src/extension/collections/static_array.rs:148

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.

2 participants