feat(effects)!: Improve error messages by passing callee into check_call/synthesize_call#1846
feat(effects)!: Improve error messages by passing callee into check_call/synthesize_call#1846acl-cqc wants to merge 11 commits into
Conversation
|
This PR contains breaking changes to the public Python API. Breaking changes summary |
|
| Branch | acl/check_syn_call_target |
| 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 | 154.02 x 1e3(0.00%)Baseline: 154.02 x 1e3 | 155.56 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 6,630.00(0.00%)Baseline: 6,630.00 | 6,696.30 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 27.71 x 1e3(0.00%)Baseline: 27.71 x 1e3 | 27.99 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 1,051.00(0.00%)Baseline: 1,051.00 | 1,061.51 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 10.09 x 1e3(+0.01%)Baseline: 10.09 x 1e3 | 10.19 x 1e3 (99.02%) | 📈 view plot 🚷 view threshold | 301.00(0.00%)Baseline: 301.00 | 304.01 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 13.70 x 1e3(0.00%)Baseline: 13.70 x 1e3 | 13.83 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 420.00(0.00%)Baseline: 420.00 | 424.20 (99.01%) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## effects #1846 +/- ##
==========================================
Coverage ? 92.85%
==========================================
Files ? 148
Lines ? 13993
Branches ? 0
==========================================
Hits ? 12993
Misses ? 1000
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
38cf7e6 to
812ed8f
Compare
Merging this PR will degrade performance by 15.11%
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes |
|
|
||
|
|
||
| def _check_effects( | ||
| target: tuple[str | DefId | None, FunctionType], ctx: Context, node: AstNode |
There was a problem hiding this comment.
In my opinion it would be better to have a class instead of tuples for readability - especially given the call graph will just store this information instead of using it here directly so this would also simplify the type of the graph
There was a problem hiding this comment.
No problem with making this a class, but is it the same as the kind of "node" in the callgraph? Might you want all callgraph nodes to have concrete DefIds, as only such could have outgoing edges?
There was a problem hiding this comment.
Turned into extra parameter!
fb8cbae to
ff68e85
Compare
This significantly improves a lot of the error messages for effects violations, and perhaps might be applied to other errors too?
Note that tensor'd functions are gonna have terrible messages both before and after, I haven't got a test of these yet as they are marked experimental, note comment - we'd need significant refactoring to sort that.
BREAKING CHANGE: (guppylang-internals) top-level
check_callandsynthesize_callmethods take a tuple ofstr | DefId | Noneto identify the callee