🐛 Reject nonlinear QCO programs at checked boundaries - #2220
Conversation
b783143 to
7b8c432
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
burgholzer
left a comment
There was a problem hiding this comment.
This one looks good already.
ae5b72f to
b0dd192
Compare
b0dd192 to
bb0240b
Compare
7b8c432 to
6c8caf5
Compare
5aefae1 to
f6ccb12
Compare
6c8caf5 to
3e20de2
Compare
f6ccb12 to
c463a53
Compare
3e20de2 to
5c15cce
Compare
c463a53 to
4289979
Compare
0883404 to
c139d2a
Compare
6d36be3 to
8099ad5
Compare
85e1bba to
d2cd2bf
Compare
756d7d6 to
fcf7027
Compare
2f5f79f to
fb549ab
Compare
fcf7027 to
0c598df
Compare
fb549ab to
07896c0
Compare
0c598df to
6d85e61
Compare
07896c0 to
57286ea
Compare
simon1hofmann
left a comment
There was a problem hiding this comment.
Also went through this and looks good to me!
denialhaag
left a comment
There was a problem hiding this comment.
I also had a brief look at this. Apart from my three (non-blocking) nitpicks below, this LGTM! 😎
|
If I'm not missing anything right now, this could even be pulled out of the stack and merged immediately. 🤔 |
Yeah. Most likely! And it feels independent enough, that we could just do it. Let me try to do that in the next iteration. This feels stable enough. |
Verify that every scalar qubit, rank-one qubit tensor, and qubit vector result or block argument has exactly one use at checked C++ and CLI ownership boundaries. Keep transformation passes built on the linear IR invariant. Assisted-by: GPT-5.6 Sol via Codex
57286ea to
56c3e10
Compare
|
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
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 |
|
@denialhaag @simon1hofmann pulled this one out of the PR chain and rebased it on current |
🤖 AI text below 🤖
Description
Reject QCO programs that violate the linear quantum-value invariant at every checked ownership boundary.
Scalar qubits and rank-one qubit tensors and vectors are linear. Every quantum operation result and block argument must therefore have exactly one use. Transformation passes may rely on that invariant and do not need recovery paths for malformed IR.
This pull request:
qco::verifyLinearity(Operation*)semantic verifier;QCOProgramfactories;mqt-ccboundaries;QCOProgramthat a caller invalidated through mutable low-level MLIR access before any public transform runs; andThis PR is based directly on
main.Validation:
mqt-ccCTests: 2/2 passed;Hosted CI is pending for the rebased revision.
AI assistance: OpenAI Codex assisted with implementation, review, testing, and this description.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).