• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 34022270192
88%

Build:
DEFAULT BRANCH: main
Ran 06 Sep 2026 09:04AM UTC
Jobs 1
Files 961
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Sep 2026 08:12AM UTC coverage: 87.804% (-0.007%) from 87.811%
34022270192

push

github

web-flow
QPY v18: replace InitialLayoutItemV2Pack with VirtualQBitPack enum (#16832)

* QPY v18: replace InitialLayoutItemV2Pack with VirtualQBitPack enum

Replace the `InitialLayoutItemV2Pack` struct with a proper `VirtualQBitPack` enum having
`Anonymous` and `InRegister { index, register_name }` variants. The old struct had two
fields — `index_value: i32` and `register_name_length: i32` — where `-1` in both meant
"anonymous qubit". These two fields were always in sync (both `-1` or both set) because
a qubit is either anonymous or in a register, never a mix. This dependency existed in the
data but was invisible in the type. The new enum makes it explicit: a qubit is either
`Anonymous` or `InRegister`, with no way to express an inconsistent state.

The wire encoding is version-dependent:
- v<=17 (backwards compatible): anonymous qubits encode as 2 x i32(-1) = 8 bytes, named
  qubits encode as i32(index) + i32(name_len) + name bytes.
- v>=18: anonymous qubits encode as 1 x i32(-1) = 4 bytes (the second sentinel i32 is
  dropped), named qubits are unchanged.

`VirtualQBitPack` implements `BinRead`/`BinWrite` manually with `type Args = (u8,)` (the
QPY version), and `LayoutV2Pack` forwards the version to each element via
`#[bw(args_raw = (version,))]`.

`dump_qpy` in `interface.rs` was calling `serialize(&pack_circuit(...))` — the no-args
variant. `serialize` requires `BinWrite::Args: Default`, so `QPYCircuit` was written with
`version=0`, which propagated down through `LayoutV2Pack` to every
`VirtualQBitPack::write_options` call. Since `version=0 < 18`, all anonymous qubits were
written with the old 8-byte encoding even when dumping a v18 file. The fix is to call
`serialize_with_args::<QPYCircuit, (u8,)>(..., (qpy_version,))` instead, which explicitly
passes the correct version through the entire write path down to each `VirtualQBitPack`.

Signed-off-by: Elad Venezian <eladv@il.ibm.com>

* QPY v18: add test asserting v18 is smaller than v17 for anonymous qubits

... (continued)

68 of 83 new or added lines in 4 files covered. (81.93%)

15 existing lines in 5 files now uncovered.

115980 of 132089 relevant lines covered (87.8%)

988494.95 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
73.83
-0.36% crates/qpy/src/circuit_reader.rs
3
92.91
-0.11% crates/qpy/src/formats.rs
2
92.8
-0.16% crates/qpy/src/circuit_writer.rs

Coverage Regressions

Lines Coverage ∆ File
6
97.63
0.0% crates/qasm2/src/parse.rs
5
91.26
-0.51% crates/qasm2/src/lex.rs
2
80.23
-0.04% crates/circuit/src/parameter/symbol_expr.rs
1
84.76
-0.17% crates/circuit/src/bit.rs
1
90.31
0.0% crates/circuit/src/parameter/parameter_expression.rs
Jobs
ID Job ID Ran Files Coverage
1 34022270192.1 06 Sep 2026 09:04AM UTC 961
87.8
GitHub Action Run
Source Files on build 34022270192
  • Tree
  • List 961
  • Changed 10
  • Source Changed 5
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34022270192
  • 923e6c0d on github
  • Prev Build on gh-readonly-queue/main/pr-10151-c7c7e76a7d18d9ce79fce6cd9484374aa6da7cb3 (#34019515529)
  • Next Build on main (#34035361766)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc