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!: force_order failing on Const nodes, add arg to rank. #1300

Merged
merged 3 commits into from
Jul 16, 2024

Conversation

doug-q
Copy link
Collaborator

@doug-q doug-q commented Jul 15, 2024

BREAKING CHANGE: the rank argument of force_order takes an additional argument.

@doug-q doug-q requested a review from mark-koch July 15, 2024 14:39
@doug-q doug-q requested a review from a team as a code owner July 15, 2024 14:39
@doug-q doug-q force-pushed the doug/force-order-const-input-output branch from 7dc3027 to b2e48ea Compare July 15, 2024 14:41
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.24%. Comparing base (cfb0674) to head (36c4010).
Report is 3 commits behind head on main.

Files Patch % Lines
hugr-passes/src/force_order.rs 94.73% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1300      +/-   ##
==========================================
+ Coverage   87.23%   87.24%   +0.01%     
==========================================
  Files         107      107              
  Lines       19564    19584      +20     
  Branches    17302    17322      +20     
==========================================
+ Hits        17066    17086      +20     
  Misses       1714     1714              
  Partials      784      784              
Flag Coverage Δ
rust 86.69% <94.73%> (+0.01%) ⬆️

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.

Comment on lines 59 to 62
// we filter out the input and output nodes from the topological sort
let Some([i, o]) = hugr.get_io(dp) else {
continue;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

For which dataflow parent would this else branch trigger?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

None, but the alternative is to panic here. I was too conservative, wil change to unwrap.

@doug-q
Copy link
Collaborator Author

doug-q commented Jul 16, 2024

I've taken the opportunity to add a &Hugr arg to rank. Rank can't hold a reference to the Hugr because force_order takes a mut reference.

@doug-q doug-q changed the title fix: Const nodes, Input nodes, Output nodes in force_order fix: force_order failing on Const nodes, add arg to rank. Jul 16, 2024
@doug-q doug-q changed the title fix: force_order failing on Const nodes, add arg to rank. fix!: force_order failing on Const nodes, add arg to rank. Jul 16, 2024
@doug-q doug-q requested a review from mark-koch July 16, 2024 06:47
Copy link
Contributor

@mark-koch mark-koch left a comment

Choose a reason for hiding this comment

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

I've taken the opportunity to add a &Hugr arg to rank. Rank can't hold a reference to the Hugr because force_order takes a mut reference.

Nice, I was running into that issue before 👍

@doug-q doug-q added this pull request to the merge queue Jul 16, 2024
Merged via the queue into main with commit 36e71e0 Jul 16, 2024
22 of 23 checks passed
@doug-q doug-q deleted the doug/force-order-const-input-output branch July 16, 2024 09:00
@hugrbot hugrbot mentioned this pull request Jul 16, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 16, 2024
## 🤖 New release
* `hugr`: 0.7.0 -> 0.8.0
* `hugr-core`: 0.4.0 -> 0.5.0
* `hugr-passes`: 0.4.0 -> 0.5.0
* `hugr-cli`: 0.1.3 -> 0.1.4

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

## `hugr`
<blockquote>

## 0.8.0 (2024-07-16)

### Bug Fixes

- [**breaking**] Force_order failing on Const nodes, add arg to rank.
([#1300](#1300))
- NonConvex error on SiblingSubgraph::from_nodes with multiports
([#1295](#1295))
- [**breaking**] Ops require their own extension
([#1226](#1226))

### Documentation

- Attempt to correct force_order docs
([#1299](#1299))

### Features

- Make `DataflowOpTrait` public
([#1283](#1283))
- Make op members consistently public
([#1274](#1274))

### Refactor

- [**breaking**] Rename builder helpers: ft1->endo_ft, ft2->inout_ft
([#1297](#1297))
</blockquote>

## `hugr-core`
<blockquote>

## 0.5.0 (2024-07-16)

### Bug Fixes

- NonConvex error on SiblingSubgraph::from_nodes with multiports
([#1295](#1295))
- [**breaking**] Ops require their own extension
([#1226](#1226))

### Features

- Make `DataflowOpTrait` public
([#1283](#1283))
- Make op members consistently public
([#1274](#1274))

### Refactor

- [**breaking**] Rename builder helpers: ft1->endo_ft, ft2->inout_ft
([#1297](#1297))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.5.0 (2024-07-16)

### Bug Fixes

- [**breaking**] Ops require their own extension
([#1226](#1226))
- [**breaking**] Force_order failing on Const nodes, add arg to rank.
([#1300](#1300))

### Documentation

- Attempt to correct force_order docs
([#1299](#1299))

### Refactor

- [**breaking**] Rename builder helpers: ft1->endo_ft, ft2->inout_ft
([#1297](#1297))
</blockquote>

## `hugr-cli`
<blockquote>

## 0.1.3 (2024-07-10)

### Styling

- Change "serialise" etc to "serialize" etc.
([#1251](#1251))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
@hugrbot hugrbot mentioned this pull request Jul 16, 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.

2 participants