feat: Frontend support for Helios platform configuration#1807
Conversation
Add new module with a plain Python function that sets the 'qsystem.helios.configuration' metadata key on the module root(s) of a compiled HUGR Package or Hugr. The configuration contains three keyword-only arguments: squash_rxys (bool, default True), enable_replay (bool, default False), and dd_threshold (int, default 0). Also add integration tests for default and custom config values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
| Branch | gh-helios-config |
| 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 | 158.77 x 1e3(0.00%)Baseline: 158.77 x 1e3 | 160.36 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 6,641.00(0.00%)Baseline: 6,641.00 | 6,707.41 (99.01%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 27.54 x 1e3(0.00%)Baseline: 27.54 x 1e3 | 27.81 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 1,074.00(0.00%)Baseline: 1,074.00 | 1,084.74 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 10.91 x 1e3(0.00%)Baseline: 10.91 x 1e3 | 11.02 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 308.00(0.00%)Baseline: 308.00 | 311.08 (99.01%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 14.84 x 1e3(0.00%)Baseline: 14.84 x 1e3 | 14.99 x 1e3 (99.01%) | 📈 view plot 🚷 view threshold | 435.00(0.00%)Baseline: 435.00 | 439.35 (99.01%) |
There was a problem hiding this comment.
Pull request overview
Adds Helios-specific frontend configuration support by introducing a new guppylang.std.qsystem.helios module that writes Helios platform options into compiled HUGR module metadata, along with integration tests validating default/custom configuration and input validation.
Changes:
- Added
guppylang.std.qsystem.helioswithset_platform_configandHELIOS_CONFIG_META_KEYfor attaching Helios config metadata to compiled HUGRs. - Extended qsystem integration tests to verify metadata contents for default/custom configurations and to validate rejection of invalid
dd_threshold.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/integration/test_qsystem.py | Adds integration tests asserting Helios platform config metadata is set correctly and invalid values are rejected. |
| guppylang/src/guppylang/std/qsystem/helios.py | Introduces Helios-specific API to attach configuration metadata to compiled HUGR modules/packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1807 +/- ##
=======================================
Coverage 92.99% 92.99%
=======================================
Files 135 136 +1
Lines 13068 13079 +11
=======================================
+ Hits 12152 12163 +11
Misses 916 916 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
nicolaassolini-qntm
left a comment
There was a problem hiding this comment.
Good for me, only a little change
| squash_rxys=False, | ||
| enable_replay=True, | ||
| dd_threshold=-1, | ||
| ) |
There was a problem hiding this comment.
We usually use the tests/error folder for test errors
This PR adds a new module
guppylang.std.qsystem.heliosand a functionset_platform_configwhich sets Helios-specific platform options on a compiled HUGR. At the moment, this is only for development purposes - none of these options are supported by the backend yet and the interface should be considered unstable.In addition, this module will also provide a definition of the metadata key. Let me know if that should go somewhere else.