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 remaining builder methods to "infer by default" #1386

Merged
merged 6 commits into from
Aug 2, 2024

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Jul 31, 2024

closes #1318 and also deals with BlockBuilder not mentioned there.
I think this is now all of the nested-structures covered:

XBuilder::new fn x
Conditional here in #1226
->Case takes Signature inherits exts
TailLoop here here
DFG takes Signature takes Signature (dfg_builder_endo in #1219)
CFG takes Signature here
->Block here in #1226

(FuncDefn takes Signature and is not supported by inference yet anyway)

BREAKING CHANGE: cfg_builder, tail_loop_builder, ConditionalBuilder::new, BlockBuilder::new and TailLoopBuilder::new no longer take an ExtensionSet parameter; either remove the argument (to use extension inference) or use the _exts variant

@acl-cqc acl-cqc marked this pull request as ready for review July 31, 2024 15:53
@acl-cqc acl-cqc requested a review from a team as a code owner July 31, 2024 15:53
@acl-cqc acl-cqc requested review from zrho and aborgna-q and removed request for zrho July 31, 2024 15:53
@acl-cqc
Copy link
Contributor Author

acl-cqc commented Jul 31, 2024

@aborgna-q manually rolling the die here as @zrho is away in Scotland but has not set himself to "Busy"...hope that's ok!

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 87.64%. Comparing base (dd1dc48) to head (6b45e05).

Files Patch % Lines
hugr-core/src/builder/cfg.rs 63.63% 3 Missing and 1 partial ⚠️
hugr-core/src/builder/conditional.rs 85.71% 0 Missing and 2 partials ⚠️
hugr-core/src/builder/tail_loop.rs 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1386      +/-   ##
==========================================
- Coverage   87.66%   87.64%   -0.02%     
==========================================
  Files         117      117              
  Lines       20279    20298      +19     
  Branches    17981    18000      +19     
==========================================
+ Hits        17778    17791      +13     
- Misses       1719     1725       +6     
  Partials      782      782              
Flag Coverage Δ
python 91.60% <ø> (ø)
rust 87.14% <86.66%> (-0.02%) ⬇️

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

@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.

Nice.

Does BlockBuilder not get an inferred variant?

@acl-cqc
Copy link
Contributor Author

acl-cqc commented Jul 31, 2024

Good spot, thanks. I will draw up a table with all the different nodes and check we really have dealt with all of them....

@acl-cqc acl-cqc added this pull request to the merge queue Aug 2, 2024
Merged via the queue into main with commit b75dd09 Aug 2, 2024
24 checks passed
@acl-cqc acl-cqc deleted the acl/builder_inference branch August 2, 2024 08:14
@hugrbot hugrbot mentioned this pull request Aug 1, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 12, 2024
## 🤖 New release
* `hugr`: 0.10.0 -> 0.11.0
* `hugr-core`: 0.7.0 -> 0.8.0
* `hugr-passes`: 0.6.2 -> 0.7.0
* `hugr-cli`: 0.3.0 -> 0.4.0

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

## `hugr`
<blockquote>

## 0.11.0 (2024-08-12)

### Bug Fixes

- [**breaking**] BasicBlockExits should not be `OpTag::DataflowParent`
([#1409](#1409))

### Documentation

- Clarify CustomConst::equal_consts
([#1396](#1396))

### Features

- [**breaking**] Serialised extensions
([#1371](#1371))
- Serialised standard extensions
([#1377](#1377))
- [**breaking**] Update remaining builder methods to "infer by default"
([#1386](#1386))
- Add Eq op to logic extension
([#1398](#1398))
- Improve error message on failed custom op validation
([#1416](#1416))
- [**breaking**] `Extension` requires a version
([#1367](#1367))
</blockquote>

## `hugr-core`
<blockquote>

## 0.8.0 (2024-08-12)

### Bug Fixes

- [**breaking**] BasicBlockExits should not be `OpTag::DataflowParent`
([#1409](#1409))

### Documentation

- Clarify CustomConst::equal_consts
([#1396](#1396))

### Features

- [**breaking**] `Extension` requires a version
([#1367](#1367))
- [**breaking**] Serialised extensions
([#1371](#1371))
- Serialised standard extensions
([#1377](#1377))
- [**breaking**] Update remaining builder methods to "infer by default"
([#1386](#1386))
- Add Eq op to logic extension
([#1398](#1398))
- Improve error message on failed custom op validation
([#1416](#1416))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.7.0 (2024-08-12)

### Features

- [**breaking**] `Extension` requires a version
([#1367](#1367))
</blockquote>

## `hugr-cli`
<blockquote>

## 0.4.0 (2024-08-12)

### Features

- Serialised standard extensions
([#1377](#1377))
- Validate with extra extensions and packages
([#1389](#1389))
- [**breaking**] Move mermaid to own sub-command
([#1390](#1390))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: Craig Roy <craig.roy@cambridgequantum.com>
@hugrbot hugrbot mentioned this pull request Aug 13, 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.

Remaining bits of builder frontend for inference
2 participants