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

Qiskit / qiskit / 28036664609
88%

Build:
DEFAULT BRANCH: main
Ran 23 Jun 2026 03:52PM UTC
Jobs 1
Files 950
Run time 3min
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

23 Jun 2026 02:57PM UTC coverage: 87.634% (+0.008%) from 87.626%
28036664609

push

github

web-flow
Fix cache and prediction misses in `Target::qargs` (#16476)

In 2.5.0rc1 we noticed a significant slowdown in VF2-dominated
all-to-all connectivity transpilation benchmarks, which this fixes.

Background
----------

We recently changed the internal hash-map data structures in the
`Target` to consolidate various properties, and avoid `IndexSet`
tracking overhead in the qargs tracking[^1]; it wasn't generally needed
for determinism.  However, randomising the iteration order of the
`Qargs` means that graphs constructed from them (like
`Target::coupling_graph` or VF2's custom graph build) add their edges in
random orders.  Edge and neighbour search/iteration methods on graphs
involve following a linked-list-like edge list, which is highly
susceptible to cache and branch-prediction problems; it's far faster if
these accesses are predictable.  For our purposes here with all-to-all
targets, it's the cache properties that matter, and the
branch-prediction is about the same.

Swapping the `qargs_gate_map` back to `IndexSet` does not _itself_
enforce structure in the edge list, but in practice, a `Target` will be
constructed programmatically, and there will be some logical structure
in the construction.  `IndexMap` preserves this, whereas randomisation
is almost guaranteed to be worse.  We could attempt to optimise the edge
list, but sorting arbitrary lists would likely have worse overhead and
not significantly improve on most normal constructions.

Timing
------

Using the `wstate_n380.qasm` file from QASMBench[^2], we have the
following minimised benchmark reproducing the problem:

```python
from qiskit.circuit import QuantumCircuit
from qiskit.transpiler import (
    generate_preset_pass_manager,
    CouplingMap,
    passes,
)
from qiskit.providers.fake_provider import GenericBackendV2

cmap = CouplingMap.from_full(380)
backend = GenericBackendV2(
    cmap.size(),
    coupling_map=cmap,
    basis_gates=["id", "sx", "x", "rz", "cz"],
    seed=42,
)
dag = Quan... (continued)

2 of 2 new or added lines in 1 file covered. (100.0%)

16 existing lines in 3 files now uncovered.

112771 of 128684 relevant lines covered (87.63%)

997096.84 hits per line

Coverage Regressions

Lines Coverage ∆ File
12
97.15
0.47% crates/qasm2/src/parse.rs
3
93.06
0.77% crates/qasm2/src/lex.rs
1
90.36
0.0% crates/circuit/src/parameter/parameter_expression.rs
Jobs
ID Job ID Ran Files Coverage
1 28036664609.1 23 Jun 2026 03:52PM UTC 950
87.63
GitHub Action Run
Source Files on build 28036664609
  • Tree
  • List 950
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28036664609
  • 9da141ae on github
  • Prev Build on gh-readonly-queue/main/pr-16466-13dde517addef3d1303e931d157abc6eadd6d6ae (#28031764682)
  • Next Build on main (#28037819502)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc