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!: rename extension_reqs to runtime_reqs #1776

Merged
merged 6 commits into from
Dec 12, 2024
Merged

feat!: rename extension_reqs to runtime_reqs #1776

merged 6 commits into from
Dec 12, 2024

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Dec 12, 2024

Closes #1734
CustomConst::extension_reqs not renamed because they still refer to the extensions where they are defined. this should be updated to references to match ops and types #1775

BREAKING CHANGE: extension_reqs field in FunctionType and Extension renamed to runtime_reqs

@ss2165 ss2165 requested a review from a team as a code owner December 12, 2024 12:03
@ss2165 ss2165 requested a review from doug-q December 12, 2024 12:03
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 4 lines in your changes missing coverage. Please review.

Project coverage is 86.73%. Comparing base (b63aabc) to head (f666be3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/export.rs 75.00% 1 Missing ⚠️
hugr-core/src/hugr/rewrite/replace.rs 0.00% 1 Missing ⚠️
hugr-core/src/types/signature.rs 88.88% 0 Missing and 1 partial ⚠️
hugr-py/src/hugr/_serialization/tys.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1776   +/-   ##
=======================================
  Coverage   86.73%   86.73%           
=======================================
  Files         186      186           
  Lines       33995    33990    -5     
  Branches    30870    30865    -5     
=======================================
- Hits        29486    29482    -4     
+ Misses       2840     2839    -1     
  Partials     1669     1669           
Flag Coverage Δ
python 92.57% <92.30%> (ø)
rust 86.14% <90.32%> (+<0.01%) ⬆️

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.

@hugrbot
Copy link
Collaborator

hugrbot commented Dec 12, 2024

This PR contains breaking changes to the public Rust API.

cargo-semver-checks summary

--- 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.38.0/src/lints/constructible_struct_adds_field.ron

Failed in:
field FuncTypeBase.runtime_reqs in /home/runner/work/hugr/hugr/PR_BRANCH/hugr-core/src/types/signature.rs:37

--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field 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.38.0/src/lints/struct_pub_field_missing.ron

Failed in:
field extension_reqs of struct FuncTypeBase, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/types/signature.rs:37
field extension_reqs of struct Extension, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:490
field extension_reqs of struct Extension, previously in file /home/runner/work/hugr/hugr/BASELINE_BRANCH/hugr-core/src/extension.rs:490

Copy link
Collaborator

@doug-q doug-q left a comment

Choose a reason for hiding this comment

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

Looks good. Can you please explain in the commit message why you have chosen not to rename CustomConst::extension_reqs?

Copy link
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

  • Should we rename the extension_inference feature? I can't find a good name that's not a mouthful, so we may leave it as is.
    We should however update the feature explanation in hugr/README.md and hugr-core/README.md

@@ -125,7 +125,7 @@ pub(crate) fn collect_signature_exts<RV: MaybeRV>(
used_extensions: &mut ExtensionRegistry,
missing_extensions: &mut ExtensionSet,
) {
// Note that we do not include the signature's `extension_reqs` here, as those refer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the TODO and issue link below.

@@ -128,7 +128,7 @@ fn resolve_signature_exts(
extensions: &ExtensionRegistry,
used_extensions: &mut ExtensionRegistry,
) -> Result<(), ExtensionResolutionError> {
// Note that we do not include the signature's `extension_reqs` here, as those refer
// Note that we do not include the signature's `runtime_reqs` here, as those refer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the TODO and issue link below.

@doug-q
Copy link
Collaborator

doug-q commented Dec 12, 2024

  • Should we rename the extension_inference feature? I can't find a good name that's not a mouthful, so we may leave it as is.

I think we should remove this feature, making it always-on. Not here, but I don't think we should spend time looking for a better name

@ss2165 ss2165 requested a review from aborgna-q December 12, 2024 13:53
@ss2165
Copy link
Member Author

ss2165 commented Dec 12, 2024

I don't want to make any decisions about extension_inference now - the spectrum of possibilities has some strong extremes we need to think through slowly and carefully. Have just updated the README.

@ss2165 ss2165 added this pull request to the merge queue Dec 12, 2024
@ss2165 ss2165 removed this pull request from the merge queue due to a manual request Dec 12, 2024
@ss2165 ss2165 added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 5f5bce4 Dec 12, 2024
24 checks passed
@ss2165 ss2165 deleted the ss/run-reqa branch December 12, 2024 14:34
This was referenced Dec 12, 2024
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.

Rename extension_reqs to runtime_reqs
4 participants