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!: Use the hugr builder #366

Merged
merged 83 commits into from
Aug 21, 2024
Merged

feat!: Use the hugr builder #366

merged 83 commits into from
Aug 21, 2024

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q commented Aug 7, 2024

This is an in-progress transplant of guppy from using an ad-hoc Hugr definition into the builder from the hugr library.

The main mismatch between the old and new builders is that guppy used to lazily add typed ports to the graph nodes as it needed. Since the new builder requires operations to define their signature, we end up having to edit the code everywhere from guppylang.compiler to the guppylang.prelude definitions.

My first goal is to get this working, and then I will try and split some changes from this PR (although most of it will have to be merged monolithically).

Current test status:

  • 390 $\color{green}\text{passed}$
  • 14 $\color{yellow}\text{skipped}$
  • 0 $\color{red}\text{failed}$

These issues currently breake some tests. I'll fix them before merging the PR

Closes #257. Closes #85

BREAKING CHANGE: Removed guppylang.hugr_builder.hugr.Hugr, compiling a module returns a hugr.ext.Package instead. Use module.compile_hugr to obtain a hugr.Hugr.

BEGIN_COMMIT_OVERRIDE
feat!: Use the hugr builder

BREAKING CHANGE: Removed guppylang.hugr_builder.hugr.Hugr, compiling a module returns a hugr.Package instead.
END_COMMIT_OVERRIDE

Copy link
Collaborator

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

Nice work, I think this is ready to be merged! I'm happy with your builtins solution, way nicer than before.

@aborgna-q aborgna-q added this pull request to the merge queue Aug 21, 2024
Merged via the queue into main with commit 536abf9 Aug 21, 2024
3 checks passed
@aborgna-q aborgna-q deleted the ab/hugr-builder branch August 21, 2024 10:23
aborgna-q added a commit that referenced this pull request Sep 10, 2024
This commit will probably get overwritten by a release-please update.
The COMMIT_OVERRIDE in #366 should be the permanent fix.
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.

refactor: port HUGR codegen to use HUGR python builder hugr.serialize shouldn't mutate
3 participants