Skip to content

🐛 Export forwarded Qiskit measurement results - #2177

Closed
simon1hofmann wants to merge 8 commits into
codex/qiskit-structured-control-exportfrom
codex/qiskit-measurement-deferral
Closed

🐛 Export forwarded Qiskit measurement results#2177
simon1hofmann wants to merge 8 commits into
codex/qiskit-structured-control-exportfrom
codex/qiskit-measurement-deferral

Conversation

@simon1hofmann

@simon1hofmann simon1hofmann commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Description

  • Export a measurement SSA result as its validated destination Qiskit Clbit
    when CBit cleanup forwards a later load to that result.
  • Remove the old one-use restriction while keeping the existing strict
    measurement/store rule: the unique static destination store must remain in
    the same block and follow the measurement directly, apart from constants.
  • Keep dynamic, duplicate, conditional, delayed, and non-measurement classical
    destinations fail-closed.
  • Remove the earlier quantum-gap, reversed-store, alias-snapshot, and
    target-specific scheduling machinery. Operation ordering belongs to the
    mapping pass and is addressed by ⚡ Implement reorderForDominance function #2240; this exporter does not implement a
    second topological scheduler.

The remaining change fixes the Benchpress-produced cleanup form
measure; store; ... use %measurement_result without broadening accepted
instruction ordering.

Stack

  1. ✨ Export structured control flow to Qiskit #2176 — structured-control export
  2. 🐛 Export forwarded Qiskit measurement results #2177 — forwarded measurement-result export (this PR)
  3. ✨ Preserve Qiskit parameter-vector provenance #2178 — parameter-vector provenance

The earlier symbolic-parameter and classical-expression foundations, #2150 and
#2175, are merged into main.

Testing

  • Isolated release Python package and MLIR binding build: passed.
  • Focused cleanup regression: fails on the parent with the former destination
    error and passes on this branch.
  • test/python/test_mlir_qiskit_translation.py: 219 passed.
  • uvx nox -s stubs: passed; generated stubs are unchanged.
  • uvx nox -s lint: passed.
  • git diff --check: passed.

The documentation build was not rerun for this update.

AI assistance: Codex assisted with the merge, overlap analysis, simplification,
implementation, tests, validation, commits, push, and this description.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

Assisted-by: GPT-5.6 via Codex
Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-5.6 via Codex
Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-5.6 via Codex
Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-5.6 via Codex
Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
@simon1hofmann simon1hofmann added this to the MLIR Support milestone Aug 20, 2026
@simon1hofmann simon1hofmann added bug Something isn't working c++ Anything related to C++ code python Anything related to Python code MLIR Anything related to MLIR labels Aug 20, 2026
@simon1hofmann simon1hofmann self-assigned this Aug 20, 2026
@simon1hofmann
simon1hofmann force-pushed the codex/qiskit-structured-control-export branch from b612830 to a1d106b Compare August 21, 2026 14:27
@mergify mergify Bot added the conflict label Aug 21, 2026
Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Keep measurement-store adjacency strict and map only validated post-store measurement results to their destination CBits.

Assisted-by: GPT-5.6 via Codex

Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Assisted-by: GPT-5.6 via Codex

Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
Record that mapping owns topological ordering and document only the supported post-store result forwarding.

Assisted-by: GPT-5.6 via Codex

Signed-off-by: Simon Hofmann <simon.t.hofmann@tum.de>
@simon1hofmann simon1hofmann changed the title 🐛 Export measurements across independent target work 🐛 Export forwarded Qiskit measurement results Aug 25, 2026
@mergify mergify Bot removed the conflict label Aug 25, 2026
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@simon1hofmann

Copy link
Copy Markdown
Contributor Author

🤖 AI text below 🤖

Folded the focused implementation, regression coverage, and documentation from this PR into #2176, then restacked #2178 directly on #2176. This intermediate PR is no longer needed.

@simon1hofmann
simon1hofmann deleted the codex/qiskit-measurement-deferral branch August 25, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working c++ Anything related to C++ code MLIR Anything related to MLIR python Anything related to Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant