🐛 Diagnose unsupported QC control flow - #2448
Merged
Merged
Conversation
Reject block-successor operations before QC-to-QCO state mapping. The conversion requires structured control flow. Assisted-by: GPT-6 via Codex
Assisted-by: GPT-6 via Codex
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Assisted-by: GPT-6 via Codex
Keep the early rejection of operations with block successors. Remove the unreachable branch conversion pattern and its unused include, and name the preflight check for its supported-input contract. Assisted-by: GPT-6 via Codex
burgholzer
approved these changes
Sep 7, 2026
burgholzer
left a comment
Member
There was a problem hiding this comment.
Cleaned this up slightly. LGTM now 👍🏻
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
QC-to-QCO could accept unstructured branches even though its qubit state mapping requires structured control flow. The conversion now diagnoses operations with block successors, including
cf.br,cf.cond_br, andcf.switch, before state mapping and directs callers to SCF operations.Addresses the unstructured-control-flow finding in #2287. This PR is independent of the other audit fixes and starts from
mainat5f6a8cfa2. No new dependencies.Validation: all 175 QC-to-QCO tests passed on the combined validation branch containing the four audit fixes, including the new branch regression and existing SCF coverage.
uvx nox -s lintanduvx nox -s cpp-lintpassed; the latter checks every line of each changed C++ file.GPT-6 via Codex assisted the implementation, tests, and PR text.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).