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: dfg wrapper build handles incorrect output wire numbers #1332

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ss2165
Copy link
Member

@ss2165 ss2165 commented Jul 22, 2024

DFGWrapper handles incorrectly were using internal dfg output number as the outputs from the container node. Fixed for function, case and tailloop. Also fixed a test that relied on this incorrect behaviour.

Closes #1257

@ss2165 ss2165 requested a review from a team as a code owner July 22, 2024 14:10
@ss2165 ss2165 requested a review from aborgna-q July 22, 2024 14:10
DFGWrapper handles incorrectly were using internal dfg output number as the outputs from the container node. Fixed for function, case and tailloop. Also fixed a test that relied on this incorrect behaviour.

Closes #1257
Copy link

codecov bot commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.37%. Comparing base (d8e6cf7) to head (8ea09e0).

Files Patch % Lines
hugr-core/src/hugr/validate/test.rs 33.33% 0 Missing and 2 partials ⚠️
hugr-core/src/builder/tail_loop.rs 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1332      +/-   ##
==========================================
- Coverage   87.42%   87.37%   -0.06%     
==========================================
  Files         109      109              
  Lines       19799    19793       -6     
  Branches    17536    17530       -6     
==========================================
- Hits        17310    17294      -16     
- Misses       1723     1731       +8     
- Partials      766      768       +2     
Flag Coverage Δ
python 91.42% <ø> (ø)
rust 86.85% <70.00%> (-0.07%) ⬇️

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.

LGTM

}
}

impl From<BuildHandle<DfgID>> for BuildHandle<TailLoopID> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we keep the implementation (dropping the loop flag output)?

Copy link
Member Author

Choose a reason for hiding this comment

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

there may be some outputs embedded in the loop flag output in the "break" variant of the Sum.

@ss2165 ss2165 added this pull request to the merge queue Jul 22, 2024
@ss2165 ss2165 removed this pull request from the merge queue due to a manual request Jul 22, 2024
@ss2165 ss2165 added this pull request to the merge queue Jul 22, 2024
Merged via the queue into main with commit 4cb8684 Jul 22, 2024
21 of 22 checks passed
@ss2165 ss2165 deleted the ss/fix-handles branch July 22, 2024 14:24
@hugrbot hugrbot mentioned this pull request Jul 22, 2024
aborgna-q pushed a commit that referenced this pull request Jul 25, 2024
DFGWrapper handles incorrectly were using internal dfg output number as
the outputs from the container node. Fixed for function, case and
tailloop. Also fixed a test that relied on this incorrect behaviour.

Closes #1257
github-merge-queue bot pushed a commit that referenced this pull request Jul 25, 2024
This is a patch release including only some non-breaking changes since
0.9.0.

## New release
* `hugr`: 0.9.0 -> 0.9.1
* `hugr-core`: 0.6.0 -> 0.6.1
* `hugr-passes`: 0.6.0 -> 0.6.1
* `hugr-cli`: 0.2.0 -> 0.2.1

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

## `hugr`
<blockquote>

## 0.9.1 (2024-07-25)

### Bug Fixes

- Dfg wrapper build handles incorrect output wire numbers
([#1332](#1332))
- Sibling extension panics while computing signature with non-dataflow
nodes ([#1350](#1350))
</blockquote>

## `hugr-core`
<blockquote>

## 0.6.1 (2024-07-25)

### Bug Fixes

- Dfg wrapper build handles incorrect output wire numbers
([#1332](#1332))
- Sibling extension panics while computing signature with non-dataflow
nodes ([#1350](#1350))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.6.1 (2024-07-25)

Nothing here.
</blockquote>

## `hugr-cli`
<blockquote>

## 0.2.1 (2024-07-25)

Nothing here.
</blockquote>


</p></details>

---
This PR was generated by a human.

---------

Co-authored-by: Seyon Sivarajah <seyon.sivarajah@quantinuum.com>
ss2165 added a commit that referenced this pull request Jul 26, 2024
This is a patch release including only some non-breaking changes since
0.9.0.

## New release
* `hugr`: 0.9.0 -> 0.9.1
* `hugr-core`: 0.6.0 -> 0.6.1
* `hugr-passes`: 0.6.0 -> 0.6.1
* `hugr-cli`: 0.2.0 -> 0.2.1

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

## `hugr`
<blockquote>

## 0.9.1 (2024-07-25)

### Bug Fixes

- Dfg wrapper build handles incorrect output wire numbers
([#1332](#1332))
- Sibling extension panics while computing signature with non-dataflow
nodes ([#1350](#1350))
</blockquote>

## `hugr-core`
<blockquote>

## 0.6.1 (2024-07-25)

### Bug Fixes

- Dfg wrapper build handles incorrect output wire numbers
([#1332](#1332))
- Sibling extension panics while computing signature with non-dataflow
nodes ([#1350](#1350))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.6.1 (2024-07-25)

Nothing here.
</blockquote>

## `hugr-cli`
<blockquote>

## 0.2.1 (2024-07-25)

Nothing here.
</blockquote>


</p></details>

---
This PR was generated by a human.

---------

Co-authored-by: Seyon Sivarajah <seyon.sivarajah@quantinuum.com>
acl-cqc added a commit that referenced this pull request Aug 28, 2024
* DFContext reinstate fn hugr(), drop AsRef requirement (fixes StackOverflow)
* test_tail_loop_iterates_twice: use tail_loop_builder_exts, fix from #1332(?)
* Fix only-one-DataflowContext asserts using Arc::ptr_eq
acl-cqc added a commit that referenced this pull request Sep 2, 2024
* DFContext reinstate fn hugr(), drop AsRef requirement (fixes StackOverflow)
* test_tail_loop_iterates_twice: use tail_loop_builder_exts, fix from #1332(?)
* Fix only-one-DataflowContext asserts using Arc::ptr_eq
acl-cqc added a commit that referenced this pull request Sep 11, 2024
* DFContext reinstate fn hugr(), drop AsRef requirement (fixes StackOverflow)
* test_tail_loop_iterates_twice: use tail_loop_builder_exts, fix from #1332(?)
* Fix only-one-DataflowContext asserts using Arc::ptr_eq
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.

When building a TailLoop, calling outputs_arr, you are given an OrderEdge "output wire"
2 participants