-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Resolve OpaqueOps and CustomType extensions (#1735)
When we do a serialization roundtrip on a hugr, its custom optypes are downgraded to `OpaqueOp`s and its `CustomType`s lose the weak link to their extension. This PR moves the pre-existing `OpaqueOp` resolution into a new `crate::extension::resolution` module and expands it to also update the custom type pointers. This can be run via the new `Hugr::resolve_extension_defs` method (currently called by `update_validate`). In addition, we accumulate the exact list of extensions required to define the hugr (this will be necessary for #1613). Note that this will probably be no longer necessary after we stabilize `hugr-model`, as we manually build the hugr when importing the model so the extensions should already be present at that point. In contrast to extension inference, this detects extensions needed to _define_ a hugr (vs runtime requirements). The inference one will be renamed as per #1734. A big chunk of this PR is fixing tests that used `finish_prelude_hugr` even though they required more extensions -.-' Look at the first commit for the actual changes. BREAKING CHANGE: Removed `resolve_opaque_op` and `resolve_extension_ops`. Use `Hugr::resolve_extension_defs` instead.
- Loading branch information
Showing
35 changed files
with
1,041 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.