-
Notifications
You must be signed in to change notification settings - Fork 6
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: Draft for hugr-model
with export, import, parsing and pretty printing
#1542
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1542 +/- ##
==========================================
- Coverage 87.43% 85.71% -1.72%
==========================================
Files 127 132 +5
Lines 21740 24017 +2277
Branches 18740 21017 +2277
==========================================
+ Hits 19008 20587 +1579
- Misses 1964 2366 +402
- Partials 768 1064 +296
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first review of mod.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general comments, I'll do mod/export next.
Other tidbits:
- Add
hugr-model
to.github/change-filters.yml
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
Co-authored-by: Agustín Borgna <121866228+aborgna-q@users.noreply.github.com>
Also added hugr model to change-filters.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Looked at parse.rs
and print.rs
.) LGTM, I just highlighted some TODO comments that you may or may not want to address here (if not we should make issues).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import first pass, second half coming soon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import round 2
Co-authored-by: Seyon Sivarajah <seyon.sivarajah@quantinuum.com>
Given that the code is deliberately declared |
Happy to approve the parts I looked at. |
Happy to approve mod and import |
Same here. Re-request the review once there's no more expected changes. |
## 🤖 New release * `hugr`: 0.12.1 -> 0.13.0 (✓ API compatible changes) * `hugr-core`: 0.9.1 -> 0.10.0 (✓ API compatible changes) * `hugr-passes`: 0.8.1 -> 0.8.2 (✓ API compatible changes) * `hugr-cli`: 0.6.0 -> 0.6.1 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr` <blockquote> ## 0.13.0 (2024-10-08) ### Bug Fixes - [**breaking**] Make list length op give back the list ([#1547](#1547)) ### Features - [**breaking**] Allow CustomConsts to (optionally) be hashable ([#1397](#1397)) - Add an `OpLoadError` variant of `BuildError`. ([#1537](#1537)) - [**breaking**] `HugrMut::remove_node` and `SimpleReplacement` return removed weights ([#1516](#1516)) - Draft for `hugr-model` with export, import, parsing and pretty printing ([#1542](#1542)) </blockquote> ## `hugr-core` <blockquote> ## 0.10.0 (2024-10-08) ### Bug Fixes - [**breaking**] Make list length op give back the list ([#1547](#1547)) ### Features - [**breaking**] Allow CustomConsts to (optionally) be hashable ([#1397](#1397)) - Add an `OpLoadError` variant of `BuildError`. ([#1537](#1537)) - [**breaking**] `HugrMut::remove_node` and `SimpleReplacement` return removed weights ([#1516](#1516)) - Draft for `hugr-model` with export, import, parsing and pretty printing ([#1542](#1542)) </blockquote> ## `hugr-passes` <blockquote> ## 0.8.1 (2024-09-04) ### Features - Op replacement and lowering functions ([#1509](#1509)) </blockquote> ## `hugr-cli` <blockquote> ## 0.6.0 (2024-09-04) ### Features - [**breaking**] Allow registry specification in `run_dump` ([#1501](#1501)) - [**breaking**] Add `Package::validate` and return `ExtensionRegistry` in helpers. ([#1507](#1507)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/MarcoIeni/release-plz/).
This PR defines a draft of the model format, and the following parts that operate on the format:
This PR is very big, and yet it does not present a completed feature. The model and core format differ in several aspects. Where they differ, this is mostly intentional: The model is kept flexible enough to incorporate features that we know that we want in the future but are currently hard or impossible to express in the core. Import and export perform conversions where possible, but do not yet cover everything.
To prevent this PR from becoming even bigger and to allow for core and model to converge incrementally from both directions, I suggest the following plan: We merge this PR into main with the model related code being feature gated and considered experimental. We then perform tweaks to model and core in smaller PRs where necessary until they are sufficiently close.