feat!: Visibility annotations on Guppy functions#1478
Closed
maximilianruesch wants to merge 7 commits intomainfrom
Closed
feat!: Visibility annotations on Guppy functions#1478maximilianruesch wants to merge 7 commits intomainfrom
maximilianruesch wants to merge 7 commits intomainfrom
Conversation
Collaborator
|
This PR contains breaking changes to the public Python API. Breaking changes summary |
Contributor
Contributor
|
| Branch | mr/feat/visibility-annotation |
| Testbed | Linux |
Click to view all benchmark results
| Benchmark | hugr_bytes | Benchmark Result bytes x 1e3 (Result Δ%) | Upper Boundary bytes x 1e3 (Limit %) | hugr_nodes | Benchmark Result nodes (Result Δ%) | Upper Boundary nodes (Limit %) |
|---|---|---|---|---|---|---|
| tests/benchmarks/test_big_array.py::test_big_array_compile | 📈 view plot 🚷 view threshold | 141.80 x 1e3(+0.57%)Baseline: 140.99 x 1e3 | 142.40 x 1e3 (99.58%) | 📈 view plot 🚷 view threshold | 6,592.00(0.00%)Baseline: 6,592.00 | 6,657.92 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 18.15 x 1e3(-0.10%)Baseline: 18.17 x 1e3 | 18.35 x 1e3 (98.91%) | 📈 view plot 🚷 view threshold | 608.00(0.00%)Baseline: 608.00 | 614.08 (99.01%) |
…tion # Conflicts: # guppylang-internals/src/guppylang_internals/checker/func_checker.py # guppylang-internals/src/guppylang_internals/definition/declaration.py # guppylang-internals/src/guppylang_internals/definition/function.py # guppylang/src/guppylang/decorator.py
Collaborator
Author
|
The corresponding issue has been reworked into the auto-collection / export feature, and with #1495 there is a way to mark symbols as public (by including them as a library interface). Thus, I consider this PR stale and work may begin from somewhat of a scratch anyway. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Allows adding visibilities to Guppy function with a keyword in the decorator, with non-given visibilities auto-inferred from the convention of whether there is a leading
_in the function name. E.g. (see test cases for more info):This is provided for both definitions and declarations, and annotated visibilities are lowered to the corresponding HUGR function nodes.
Requires an update of
hugr-pyto include Quantinuum/hugr#2862.Important
This changes the default visibility of function definitions without leading underscores to "Public", which is technically a breaking change, since now function names can clash. This is a problem as all functions defined at the file top level are considered global. Thus, defining both
mod_a.fandmod_b.fclashes in name, since both functions claim the name"f"(see the failing tests for more info).Closes #1482
BREAKING CHANGE:
Added required visibility parameters to functions in the compiler internals. No migration is required.