Skip to content

feat: Frontend support for Helios platform configuration - #1848

Merged
aborgna-q merged 12 commits into
mainfrom
gh-helios-config
Jul 20, 2026
Merged

feat: Frontend support for Helios platform configuration#1848
aborgna-q merged 12 commits into
mainfrom
gh-helios-config

Conversation

@cgh-qtnm

@cgh-qtnm cgh-qtnm commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

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>
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.26%. Comparing base (c7f6ed4) to head (e00a4f1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tket-qsystem/src/extension/qsystem/helios.rs 0.00% 3 Missing ⚠️
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           
Flag Coverage Δ
python 92.11% <100.00%> (+0.16%) ⬆️
rust 85.98% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HeliosPublicConfig as a serializable metadata payload type with a dedicated metadata key in tket-qsystem.
  • Add tket.platform.helios.set_platform_config to write the configuration metadata onto HUGR module roots (for both Hugr and Package).
  • 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.

Comment thread tket-qsystem/src/extension/qsystem/helios.rs Outdated
Comment thread tket-py/tket/platform/helios.py
cgh-qtnm added 2 commits July 15, 2026 14:46
- docstring indentation
- put key in tket namespace
@cgh-qtnm
cgh-qtnm marked this pull request as ready for review July 15, 2026 21:30
@cgh-qtnm
cgh-qtnm requested a review from a team as a code owner July 15, 2026 21:30
Comment thread tket-py/tket/platform/helios.py
@cgh-qtnm

Copy link
Copy Markdown
Contributor Author

With the addition of leakage_repump the set of supported config features is now complete. I think this PR can move independently of the backend support, it won't break anything if we release this first.

Comment thread tket-py/test/test_helios_config.py Outdated
@cgh-qtnm
cgh-qtnm requested review from aborgna-q and ss2165 July 17, 2026 13:32
Comment thread tket-py/tket/platform/helios.py Outdated
from .._tket import metadata as _metadata

#: Metadata key under which the Helios platform configuration is stored.
HELIOS_CONFIG_META_KEY = _metadata.HELIOS_CONFIG_KEY

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a Metadata subclass instead, plus a python enum for the options. Add the definition to metadata.py.

@cgh-qtnm cgh-qtnm Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it a metadata subclass, but I don't understand what you mean about the enum for the options.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, "dataclass" rather than enum.

We can use a specialized value type for the python Metadata protocol instead of a generic dict[str, bool].

Comment thread tket-qsystem/src/extension/qsystem/helios.rs Outdated
Comment thread tket-qsystem/src/extension/qsystem/helios.rs
Comment thread tket-qsystem/src/extension/qsystem/helios.rs Outdated
- Add Python definition of HeliosPlatformConfig
- Remove JSON roundtrip test
- Align key constant to existing names
- Add default derive and serde
@cgh-qtnm
cgh-qtnm requested a review from aborgna-q July 20, 2026 16:57
@aborgna-q
aborgna-q added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit ce8df0b Jul 20, 2026
26 checks passed
@aborgna-q
aborgna-q deleted the gh-helios-config branch July 20, 2026 20:59
This was referenced Jul 20, 2026
aborgna-q added a commit that referenced this pull request Jul 21, 2026
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>
aborgna-q pushed a commit that referenced this pull request Jul 21, 2026
🤖 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).
aborgna-q added a commit that referenced this pull request Jul 22, 2026
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))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants