Research
What Output-Equivalence Oracles Miss: An Empirical Study of Equivalence-Invisible Bug Fixes in Quantum Transpilers
Overview Research area: Quantum software engineering — specifically compiler/transpiler testing, test-oracle adequacy, and empirical software engineering via repository mining. Technical level: Interm

- arXiv
- 2609.13839
- Published
- 2026-09-12
- Authors
- Furqan Nasir, Arif Shah, Iftikhar Alam
AI summary
Overview
Research area: Quantum software engineering — specifically compiler/transpiler testing, test-oracle adequacy, and empirical software engineering via repository mining.
Technical level: Intermediate. Readers should know roughly what a quantum circuit, a unitary, and a compiler test oracle are; no deep physics or heavy statistics is required beyond the idea of a confidence interval.
Scope: An empirical measurement of how often real, merged bug fixes in quantum transpilers repair faults that a standard output-equivalence oracle cannot detect.
What This Paper Is About
Quantum transpilers are normally judged by an output-equivalence oracle: the compiled circuit must implement the same unitary as the original, allowing for global phase and a permutation of qubits. By construction that oracle only inspects the semantic map, not the compiler's own records of layout, permutation, and phase — nor whether a fixed-seed run is deterministic — so a defect in those areas can pass a public record unseen. The paper mines real merged transpiler fixes to measure how frequently that actually happens, and whether the pattern generalizes beyond one compiler.
Key Contributions
- A systematically identified corpus of real bug fixes. The authors assemble a corpus of Qiskit transpiler bug-fixes found through repository mining, together with an extended 104-fix corpus covering a wider time window.
- A validated fault-manifestation taxonomy. Fixes are classified using a taxonomy that was independently dual-coded and validated against source, rather than assigned by a single coder.
- A quantified rate of equivalence-invisible faults, with uncertainty. The paper reports proportions with Wilson confidence intervals, including a conservative floor based only on the channel that is unconditionally invisible to the oracle.
- Cross-compiler replication and released artifacts. The finding is checked in tket and Cirq, five inexpensive PR-level characteristics are examined for association, and the corpus, codebook, and coding artifacts are released.
Main Findings
- The headline rate is about 28%. Nineteen of 68 merged Qiskit fixes repair faults invisible to the equivalence screen, 28% with a 95% Wilson interval of 19–40%.
- The rate holds on a larger corpus. The extended 104-fix corpus gives 29 of 104 (27.9%, CI 20–37%), the same rate with a tighter interval.
- A conservative floor survives the strictest definition. Restricting to the one unconditionally equivalence-invisible channel — a corrupted layout or permutation record — still leaves 10 of 68 fixes (15%, CI 8–25%).
- Strengthening the oracle does not close the gap. The invisible fixes remain invisible even when the equivalence check is augmented with compilation-validity, circuit-quality, and performance checks.
- The problem is not Qiskit-specific. It replicates in tket at 7 of 21 (33%), and in Cirq the effect is smaller but consistent.
- PR-level characteristics do not explain it. No systematic differences were detected across five inexpensive pull-request-level characteristics; the comparison (19 vs 49) is underpowered on its own, and the extended 29-vs-75 corpus tightens every interval toward zero.
- The faults cluster at representation boundaries. This class dominates the invisible set and concentrates where one representation is converted into another.
Methodology in Plain English
The authors treat this as a software-engineering field study rather than a compiler-theory paper. They mine the version-control history of Qiskit to find bug fixes that were actually merged, then define what counts as an "invisible" fix: one whose defect the output-equivalence oracle — with or without extra validity, quality, and performance checks — could not have caught. Each fix is sorted into a fault-manifestation taxonomy by two coders working independently, with the classification checked against the source changes so the labels are grounded in what the patch actually did. From those counts they estimate proportions and attach confidence intervals, which matters because the sample is modest. They then repeat the procedure on tket and Cirq to see whether the pattern travels, and compare a handful of cheap pull-request attributes between visible and invisible fixes to see whether the invisible ones are distinguishable in advance. The paper explicitly frames itself as measurement: it does not attempt to trace the downstream consequences of these defects.
Why This Matters
For research, the paper reframes oracle adequacy as an empirical question: it supplies a measured rate rather than an argument that equivalence checking is incomplete, and it does so on fixes that real maintainers accepted as correct repairs. It also gives quantum software testing a labeled, source-validated corpus where the field has largely relied on hand-picked examples.
Real-world applications:
- Compiler and SDK test suites — maintainers can add checks on layout, permutation, and phase records, and on fixed-seed determinism, that a unitary-equivalence test will never exercise.
- CI pipelines for quantum toolchains — regression gates can be extended beyond semantic equivalence to catch a class of defect that currently ships.
- Cloud and hardware providers — anyone compiling circuits for a specific device depends on layout and routing records being faithful, which is exactly the channel this paper finds corrupted while passing validation.
- Reproducibility audits — the determinism angle matters for anyone re-running a fixed-seed compilation and expecting the same output.
Industry relevance is direct: the three compilers studied are production tools used to prepare circuits for real hardware, so a defect class that survives the standard correctness gate is a practical release-quality concern, not a theoretical one.
Future Directions
- Oracles that check the record, not just the map. The obvious next step is equivalence checks extended to layout, permutation, and phase metadata and to determinism, then measuring how much of the 28% such checks recover.
- Root-cause work at representation boundaries. Since the invisible class concentrates at representation crossings, targeted testing and design rules for those conversion points are a natural follow-up.
- Downstream impact. The authors state they only measure the phenomenon; whether these fixes change compiled output, execution results, or reproducibility in practice is left open.
- More compilers and more power. Extending beyond Qiskit, tket, and Cirq, and scaling the corpus so the PR-level comparisons are adequately powered, would test whether any cheap signal can flag invisible fixes before merge.
Target Audience
Quantum software engineers and transpiler/compiler developers, especially those maintaining test suites for Qiskit, tket, or Cirq; software engineering researchers working on test oracles, mutation and fault taxonomies, and repository mining; and quantum computing practitioners who depend on compilation records being correct. Readers wanting a formal treatment of equivalence checking will find this is not that paper — it is a measurement study.
Authors’ abstract
Quantum compilers face the test oracle problem, judged by an output-equivalence oracle: the compiled circuit must compute the same unitary as the original, modulo global phase and a qubit-layout permutation. This oracle, by construction, checks only that semantic map, not the circuit's own layout, permutation, or phase records: a defect there, or in a fixed-seed run's determinism, can pass unseen though the record is public. This empirical software engineering study of quantum transpiler correctness uses repository mining to measure how often this happens in real merged compiler fixes: a systematically identified corpus of Qiskit transpiler bug-fixes, classified by an independently dual-coded, source-validated fault-manifestation taxonomy. Nineteen of 68 fixes (28%, 95% Wilson CI 19-40%) repair faults invisible to this equivalence screen, even one augmented with compilation-validity, circuit-quality, and performance checks, and an extended 104-fix corpus over a wider window holds at the same rate with a tighter interval (29/104, 27.9%, CI 20-37%). A conservative floor remains even restricted to the one unconditionally equivalence-invisible channel (a corrupted layout or permutation record): 10 of 68 fixes (15%, CI 8-25%) beneath the 28% headline. The gap is not Qiskit-specific: it replicates in tket (7/21, 33%), with Cirq smaller but consistent. We detected no systematic differences on five inexpensive PR-level characteristics (19 vs 49, underpowered alone; the extended 29-vs-75 corpus tightens every interval toward zero). This class dominates the invisible set, concentrating at representation-boundary crossings. We release the corpus, codebook, and coding artifacts for quantum software testing research. Here we only measure it.