feat: Frontend support for Helios platform configuration - #1848
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1848 +/- ##
=======================================
Coverage 86.26% 86.26%
=======================================
Files 200 202 +2
Lines 31964 31996 +32
Branches 30514 30517 +3
=======================================
+ Hits 27573 27602 +29
- Misses 3159 3162 +3
Partials 1232 1232
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a Python-facing API for attaching Helios-specific platform configuration metadata to compiled HUGRs, with the metadata key/value type defined in the tket-qsystem Helios extension and surfaced through tket-py.
Changes:
- Introduce
HeliosPublicConfigas a serializable metadata payload type with a dedicated metadata key intket-qsystem. - Add
tket.platform.helios.set_platform_configto write the configuration metadata onto HUGR module roots (for bothHugrandPackage). - Export the metadata key through the Python native bindings and add Python tests covering defaults, custom values, and per-module independence.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tket-qsystem/src/extension/qsystem/helios.rs | Adds HeliosPublicConfig metadata type/key and a serde roundtrip test. |
| tket-py/tket/platform/helios.py | Implements set_platform_config and exposes HELIOS_CONFIG_META_KEY. |
| tket-py/tket/platform/init.py | Introduces the tket.platform package and re-exports helios. |
| tket-py/tket/_tket/metadata.pyi | Adds stub for the exported HELIOS_CONFIG_KEY constant. |
| tket-py/tket/init.py | Exposes platform at the top-level tket package. |
| tket-py/test/test_platform_helios.py | Adds unit tests for Helios platform configuration metadata behavior. |
| tket-py/src/metadata.rs | Exports HELIOS_CONFIG_KEY from Rust into the Python bindings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- docstring indentation - put key in tket namespace
|
With the addition of |
| from .._tket import metadata as _metadata | ||
|
|
||
| #: Metadata key under which the Helios platform configuration is stored. | ||
| HELIOS_CONFIG_META_KEY = _metadata.HELIOS_CONFIG_KEY |
There was a problem hiding this comment.
This should be a Metadata subclass instead, plus a python enum for the options. Add the definition to metadata.py.
There was a problem hiding this comment.
I made it a metadata subclass, but I don't understand what you mean about the enum for the options.
There was a problem hiding this comment.
Sorry, "dataclass" rather than enum.
We can use a specialized value type for the python Metadata protocol instead of a generic dict[str, bool].
- Add Python definition of HeliosPlatformConfig - Remove JSON roundtrip test - Align key constant to existing names - Add default derive and serde
This PR adds a new `_set_platform_config` function to tket-py under the path `tket.platform.helios`. This function sets some metadata on the root of a compiled HUGR which controls Helios-specific hardware features. The metadata object and key are defined in `tket_qsystem::extension::qsystem::helios`. Code to consume and apply the platform configuration is not included here. As noted in the function docstring, this interface is unstable and subject to change without notice. This is ported from the original implementation in Quantinuum/guppylang#1807. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Agustín Borgna <agustin.borgna@quantinuum.com>
🤖 I have created a release *beep* *boop* --- ## [0.13.2](tket-py-v0.13.1...tket-py-v0.13.2) (2026-07-21) ### Features * Frontend support for Helios platform configuration ([#1848](#1848)) ([ce8df0b](ce8df0b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Backported release compatible with guppy v0.21. ### `tket-qsystem 0.25.3` ``` ### New Features - Frontend support for Helios platform configuration ([#1848](#1848)) ``` ### `tket 0.19.3` ``` ### Performance - Improve rule evaluation order in dataflow analysis ([#1806](#1806)) - Pre-compute edge neighbours in dataflow analysis ([#1805](#1805)) ```
This PR adds a new
_set_platform_configfunction to tket-py under the pathtket.platform.helios. This function sets some metadata on the root of a compiled HUGR which controls Helios-specific hardware features. The metadata object and key are defined intket_qsystem::extension::qsystem::helios. Code to consume and apply the platform configuration is not included here.As noted in the function docstring, this interface is unstable and subject to change without notice.
This is ported from the original implementation in Quantinuum/guppylang#1807.