-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Support debug info in qis-compiler #1521
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
Open
cgh-qtnm
wants to merge
11
commits into
main
Choose a base branch
from
george/debuginfo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5e4e638
Support debug info in qis-compiler, update snapshots
cgh-qtnm 4474a65
Update snapshot
cgh-qtnm 9f04315
Update another snap, restore justfile
cgh-qtnm 78f9f23
Update qis-compiler snaps
cgh-qtnm f8be757
Actually test debug info generation
cgh-qtnm b2c4e20
Update insta to match hugr
cgh-qtnm 9e9990c
Update to latest version of hugr PR
cgh-qtnm ae84c14
Update GPU snapshots
cgh-qtnm 79599fc
Fixes from copilot
cgh-qtnm 25c18b9
Add 'notail' to QIS calls
cgh-qtnm a9ece17
Revert "Add 'notail' to QIS calls"
cgh-qtnm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
qis-compiler/python/selene_hugr_qis_compiler/selene_hugr_qis_compiler.pyi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,13 @@ | ||
| # /// script | ||
| # requires-python = ">=3.10" | ||
| # dependencies = [ | ||
| # "guppylang ==0.21.9", | ||
| # "guppylang==0.21.9", | ||
| # "guppylang-internals", | ||
| # "tket", | ||
| # ] | ||
| # /// | ||
| # TODO: point at re-released guppylang(-internals) once available with debug info. right | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to fix this before merging, once latest guppylang is rereleased. |
||
| # now the code below is not compatible with the version specified above. | ||
|
|
||
| from pathlib import Path | ||
|
|
||
|
|
@@ -25,6 +28,7 @@ | |
| x, | ||
| z, | ||
| ) | ||
| from guppylang_internals.debug_mode import turn_off_debug_mode, turn_on_debug_mode | ||
|
|
||
| resources_dir = Path(__file__).parent / "resources" | ||
|
|
||
|
|
@@ -244,5 +248,7 @@ def foo(a: int) -> None: | |
| rng, | ||
| entry_args, | ||
| ]: | ||
| turn_on_debug_mode() | ||
| envelope = func() | ||
| turn_off_debug_mode() | ||
|
cgh-qtnm marked this conversation as resolved.
|
||
| (resources_dir / f"{func.__name__}.hugr").write_bytes(envelope) | ||
Binary file not shown.
Binary file modified
BIN
+443 Bytes
(100%)
qis-compiler/python/tests/resources/discard_qb_array.hugr
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+655 Bytes
(110%)
qis-compiler/python/tests/resources/measure_qb_array.hugr
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+356 Bytes
(110%)
qis-compiler/python/tests/resources/postselect_panic.hugr
Binary file not shown.
Binary file modified
BIN
+270 Bytes
(110%)
qis-compiler/python/tests/resources/print_current_shot.hugr
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+365 Bytes
(110%)
qis-compiler/python/tests/resources/unsupported_pytket_ops.hugr
Binary file not shown.
636 changes: 370 additions & 266 deletions
636
...ion/test_llvm/aarch64-apple-darwin-discard_qb_array/discard_qb_array_aarch64-apple-darwin
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Need to update to a released version of HUGR and remove these patches before merging.