Conversation
acl-cqc
commented
Aug 17, 2026
|
|
||
| Help: Consider adding type annotations to coerce them into opaque function | ||
| values: `baz: Function[[?T], ?T] = ...` | ||
| | ^^^ Polymorphic functions as dynamic higher-order values are not |
Contributor
Author
There was a problem hiding this comment.
I mean, maybe this test is entirely redundant given the new one in poly_callable.py ?
Contributor
|
| Project | guppylang |
| Branch | acl/check_poly_load |
| 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 | 62.10 x 1e3(0.00%)Baseline: 62.10 x 1e3 | 62.72 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 4,585.00(0.00%)Baseline: 4,585.00 | 4,630.85 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 27.83 x 1e3(0.00%)Baseline: 27.83 x 1e3 | 28.11 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 1,301.00(0.00%)Baseline: 1,301.00 | 1,314.01 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 7.24 x 1e3(0.00%)Baseline: 7.24 x 1e3 | 7.32 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 310.00(0.00%)Baseline: 310.00 | 313.10 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 9.91 x 1e3(0.00%)Baseline: 9.91 x 1e3 | 10.01 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 411.00(0.00%)Baseline: 411.00 | 415.11 (99.01%) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2213 +/- ##
==========================================
+ Coverage 93.29% 93.30% +0.01%
==========================================
Files 160 160
Lines 15261 15270 +9
==========================================
+ Hits 14238 14248 +10
+ Misses 1023 1022 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
(Stumbled across this while investigating another issue, but nonetheless this seems an improvement.)
Currently if you assign a polymorphic function to a variable you get an error during compilation, not checking. Turned out we didn't have a test of this at all, so have added one...
(See new tests in first commit which are passing on
main)In a couple of cases this leads to checking issuing a different error, and of course we never get to the one that would be issued later in compilation, so detecting the error earlier leads to a change in message.
I reason that assignment is the only case where we care:
foowhere that's a poly-function), we don't need to find an instantiation, so it seems fine not to.