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

fix: Do not require matching extension_reqs when creating a replacement #1177

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Jun 6, 2024

Fixes #1175

Signatures have three components:

  • The input type row
  • The output type row
  • The set of extensions used by the local operations

Many interesting replacements in a graph changes the latter, but SiblingSubgraph::create_simple_replacement required the signatures to match exactly.

@aborgna-q aborgna-q requested a review from a team as a code owner June 6, 2024 16:47
@aborgna-q aborgna-q requested a review from zrho June 6, 2024 16:47
@aborgna-q aborgna-q changed the title fix: Do not require matching extension_reqs when creating a replaceme… fix: Do not require matching extension_reqs when creating a replacement Jun 6, 2024
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.12%. Comparing base (1cdaeed) to head (28ef30d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1177      +/-   ##
==========================================
+ Coverage   87.09%   87.12%   +0.03%     
==========================================
  Files          97       97              
  Lines       19285    19288       +3     
  Branches    18420    18423       +3     
==========================================
+ Hits        16796    16805       +9     
+ Misses       1636     1630       -6     
  Partials      853      853              
Flag Coverage Δ
rust 87.02% <100.00%> (+0.03%) ⬆️

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

@cqc-alec cqc-alec left a comment

Choose a reason for hiding this comment

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

Looks right to me.

@aborgna-q aborgna-q added this pull request to the merge queue Jun 7, 2024
Merged via the queue into main with commit 68595c8 Jun 7, 2024
21 checks passed
@aborgna-q aborgna-q deleted the ab/less-strict-replacement branch June 7, 2024 12:13
@hugrbot hugrbot mentioned this pull request Jun 7, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jun 7, 2024
## 🤖 New release
* `hugr`: 0.5.0 -> 0.5.1
* `hugr-core`: 0.1.0 -> 0.2.0
* `hugr-passes`: 0.1.0 -> 0.2.0
* `hugr-cli`: 0.1.0 -> 0.1.1

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr`
<blockquote>

## 0.5.1 (2024-06-07)

### Refactor

- Move binary to hugr-cli
([#1134](#1134))
</blockquote>

## `hugr-core`
<blockquote>

## 0.2.0 (2024-06-07)

### Bug Fixes

- [**breaking**] Validate that control-flow outputs have exactly one
successor ([#1144](#1144))
- Do not require matching extension_reqs when creating a replacement
([#1177](#1177))

### Features

- Add `ConstExternalSymbol` to prelude
([#1123](#1123))
- `HugrView::extract_hugr` to extract regions into owned hugrs.
([#1173](#1173))

### Testing

- Serialisation round trip testing for `OpDef`
([#999](#999))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.2.0 (2024-06-07)

### Features

- Add `ValidationLevel` tooling and apply to `constant_fold_pass`
([#1035](#1035))
</blockquote>

## `hugr-cli`
<blockquote>

## 0.1.1 (2024-06-07)

### Features

- Reexport `clap::Parser` and `clap_verbosity_flag::Level` from hugr_cli
([#1146](#1146))

### Refactor

- Move binary to hugr-cli
([#1134](#1134))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
github-merge-queue bot pushed a commit to CQCL/tket2 that referenced this pull request Jun 17, 2024
…ors (#390)

- Stores the circuit name in the `FuncDefn` operations instead of a
"name" metadata key.
In the future we will decode tket1 circuits into funtion definitions
instead of Dfg blocks, but that currently causes errors due to
CQCL/hugr#1175.

- `Circuit::circuit_signature` returns a `FunctionType` instead of a
`PolyFuncType`, since we (currently) don't allow parametric signatures.

- Improves the errors when constructing and manipulating circuits.

This work is in the path to solving #385 and #389, but we will require
some fixes in hugr (CQCL/hugr#1177) before
fixing the support for non-Dfg rooted circuits.
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.

Allow changing extension_reqs in SiblingSubgraph::create_simple_replacement.
2 participants