CQCL / hugr

Hierarchical Unified Graph Representation
https://crates.io/crates/hugr
Apache License 2.0
15 stars 4 forks source link

fix!: Ops require their own extension #1226

Open acl-cqc opened 1 week ago

acl-cqc commented 1 week ago

closes #388

much less pain than the previous attempt #734 but there is still some pain for FuncDefn's (as there was always going to be) - that's #1237.

Includes adding new variants of block_builder, entry_builder, simple_entry_builder and conditional_builder: the default version omits the extension set parameter, the _exts variant takes an extra parameter (being an ExtensionSet). simple_block_builder is untouched (as it takes a FunctionType, so can use ft1/ft2)

We'll need similar updates to cfg_builder, tail_loop_builder, ConditionalBuilder::new and TailLoopBuilder::new but I'll leave those for another PR, there's quite enough here ;)

BREAKING CHANGE: (1) container-node extension-deltas will need to be enlarged to include ops therein; for FuncDefn this will have to be manually specified but TO_BE_INFERRED (or ft1/ft2 from #1219) works for other containers. (2) block_builder, entry_builder, simple_entry_builder and conditional_builder no longer take an ExtensionSet; either drop the argument or use the ..._exts variant.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 85.77406% with 34 lines in your changes missing coverage. Please review.

Project coverage is 87.03%. Comparing base (320a9a7) to head (79da288). Report is 1 commits behind head on main.

Files Patch % Lines
hugr-passes/src/nest_cfgs.rs 0.00% 0 Missing and 12 partials :warning:
hugr-core/src/builder/dataflow.rs 62.50% 0 Missing and 6 partials :warning:
hugr-core/src/hugr/rewrite/simple_replace.rs 60.00% 0 Missing and 4 partials :warning:
hugr-core/src/builder/cfg.rs 94.44% 0 Missing and 3 partials :warning:
hugr-core/src/hugr/rewrite/replace.rs 71.42% 0 Missing and 2 partials :warning:
hugr-passes/src/merge_bbs.rs 0.00% 0 Missing and 2 partials :warning:
hugr-core/src/extension/op_def.rs 91.66% 0 Missing and 1 partial :warning:
hugr-core/src/hugr/rewrite/outline_cfg.rs 0.00% 0 Missing and 1 partial :warning:
hugr-core/src/hugr/serialize/test.rs 0.00% 0 Missing and 1 partial :warning:
hugr-core/src/hugr/validate/test.rs 92.30% 0 Missing and 1 partial :warning:
... and 1 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1226 +/- ## ========================================== + Coverage 86.97% 87.03% +0.06% ========================================== Files 100 100 Lines 18994 19003 +9 Branches 17013 17022 +9 ========================================== + Hits 16520 16540 +20 + Misses 1696 1686 -10 + Partials 778 777 -1 ``` | [Flag](https://app.codecov.io/gh/CQCL/hugr/pull/1226/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CQCL) | Coverage Δ | | |---|---|---| | [rust](https://app.codecov.io/gh/CQCL/hugr/pull/1226/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CQCL) | `86.52% <85.77%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CQCL#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.