🐛 Export independently scheduled measurements - #2452
Merged
burgholzer merged 4 commits intoSep 9, 2026
Merged
Conversation
MatthiasReumann
left a comment
Collaborator
There was a problem hiding this comment.
Solid work 🗿 Left some nitpicks. Nothing too dramatic! I'll leave it to @burgholzer to judge how these changes fit into the bigger picture of the QASM export.
Contributor
|
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Permit measurement destination fusion across disjoint recursive effects while accounting for the earlier write in classical snapshot validation. Assisted-by: GPT-5 via Codex
Document the successful native-export matrix and the retained stale-snapshot boundary. Assisted-by: GPT-5 via Codex
Use TypeSwitch and shared memory-effect handling while preserving static-index disambiguation and the existing exporter limits. Cover disjoint bit accesses and intervening register allocations. Assisted-by: GPT-5 via Codex
Move safely fusible stores on the existing export clone before indexing writes. Snapshot analysis then uses the emitted order without synthetic measurement writes or special handling of future measurement stores. Preserve late destination indices, measured-bit control, and ordered shared destinations. Keep conflicting accesses and reversed writes rejected, and leave the caller's program unchanged. Assisted-by: Codex
burgholzer
force-pushed
the
codex/export-grouped-measurements
branch
from
September 9, 2026 08:13
e0b8794 to
5ea693d
Compare
12 tasks
burgholzer
approved these changes
Sep 9, 2026
burgholzer
left a comment
Member
There was a problem hiding this comment.
Also pushed a couple of fixes here. Let's get this in! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI text below 🤖
Description
Stacked on #2351, updated through parent commit
aa1b13cf8. This PR fixes the native Qiskit exporter boundary exposed by theremaining 25 Benchpress feed-forward profiles, separately from the routing
correction in the parent PR. Merge the parent first, then retarget this PR to
main.Mapping may legally separate a measurement from its classical destination by
other measurements or independent control flow. Permit destination fusion when
recursive effects cannot access that bit, using CBit's non-aliasing register
contract and static-index disambiguation. Keep measurements at their original
quantum positions and add no scratch classical bits.
Move each safely fusible store immediately after its measurement on the
exporter's existing IR clone before indexing writes. Snapshot analysis then uses
the actual emitted order, without synthetic measurement writes or special
handling of other measurements' future stores. Preserve late constant indices,
the parent's indexed lookup, and scalar snapshot support. The input program is
unchanged.
Overlapping accesses, unknown effects, and unsupported stale snapshots remain
diagnosed. Stale register snapshots wider than 64 bits remain unsupported.
The unique measurement-destination requirement remains an exporter limitation,
not a QC dialect invariant; multiple classical destinations are outside this PR.
Current validation
5ea693d50, rebuilt Python 3.13 bindings with Qiskit 2.5.2 pass all 398tests in
test_mlir_qiskit_translation.pyandtest_mlir_loops.py.reads without redundant scalar snapshots, late destination indices, input
preservation, and shared destinations with matching write order. Reversed
writes and conflicting effects remain rejected.
the target pipeline.
aa1b13cf8pass. Generated stubs introduce no API changes.validation of this update.
Historical Benchpress validation
At source commit
7dad9e19e, a fresh wheel with Qiskit 2.5.0 passed all 42targeted Benchpress native-export checks: 31 previously guarded profiles, ten
existing profiles, and BV100. No OpenQASM fallback was used. All 4,621
conditionals remained, nested gates passed Qiskit basis/connectivity analysis,
and BV100 retained exactly 99 classical bits and measurements. All 80
Benchpress integration tests and the then-current 330 Qiskit translation tests
passed; the preceding build failed 12 of the new positive cases.
These Benchpress checks were not rerun for this update. The old integration
snapshot-rejection test predates the parent's scalar snapshot support and has
not been revalidated.
The historical Benchpress checks used a corresponding local integration update:
pin that PR snapshot, retire the temporary textual event-order checker, retain
input restrictions, and enable only the validated profiles. Those adapter
changes are not part of this Core diff. The full benchmark suite was not
restarted; structural counts are not a general dynamic-program equivalence
proof.
No changelog or migration entry is needed for this unreleased-v4 fix with no
public API changes. Implementation, tests, and this description were prepared
with AI assistance through Codex. Human review remains required.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).