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: Update extension pointers in customConsts #1780

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

aborgna-q
Copy link
Collaborator

Closes #1742.

Adds a (default defined) update_extensions call to CustomConst so it can update its internal extension Weak pointers after loading a serialized hugr.

@aborgna-q aborgna-q requested a review from doug-q December 12, 2024 15:37
@aborgna-q aborgna-q requested a review from a team as a code owner December 12, 2024 15:37
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 73.07692% with 35 lines in your changes missing coverage. Please review.

Project coverage is 86.64%. Comparing base (080eaae) to head (300ce20).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/extension/resolution.rs 75.00% 10 Missing ⚠️
hugr-core/src/extension/resolution/test.rs 76.66% 7 Missing ⚠️
hugr-core/src/extension/prelude.rs 0.00% 6 Missing ⚠️
hugr-core/src/ops/constant/custom.rs 50.00% 6 Missing ⚠️
hugr-core/src/ops/constant.rs 75.00% 1 Missing and 2 partials ⚠️
hugr-core/src/extension/resolution/types_mut.rs 90.90% 0 Missing and 2 partials ⚠️
hugr-core/src/std_extensions/collections/list.rs 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1780      +/-   ##
==========================================
- Coverage   86.69%   86.64%   -0.05%     
==========================================
  Files         186      186              
  Lines       34035    34145     +110     
  Branches    30910    31020     +110     
==========================================
+ Hits        29506    29586      +80     
- Misses       2857     2883      +26     
- Partials     1672     1676       +4     
Flag Coverage Δ
python 92.35% <ø> (ø)
rust 86.07% <73.07%> (-0.05%) ⬇️

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.

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.

Most of this has no coverage.

I would expect to see Arrays here.

@aborgna-q
Copy link
Collaborator Author

There are no array values yet, I covered all things that implement CustomConst at the moment.
I'll try to add a quick test

@@ -93,6 +94,12 @@ fn resolve_hugr_extensions() {
// A constant op using the prelude extension.
module.add_constant(Value::extension(ConstUsize::new(42)));

// A constant op using lists of non-prelude types.
module.add_constant(Value::extension(ListValue::new(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you make this a list of list of float? That way we'll get coverage of resolve_typeargs_extensions

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.

I wish we had coverage of resolve_typearg_extensions, but this is good enough I think.

Thank you!

@aborgna-q aborgna-q added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit 8722c10 Dec 12, 2024
23 of 24 checks passed
@aborgna-q aborgna-q deleted the ab/const-extension-references branch December 12, 2024 17:10
@hugrbot hugrbot mentioned this pull request 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.

OpaqueValue should keep a Weak<Extension> pointer
2 participants