♻️ Generalize MLIR compiler target facts - #2218
Conversation
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 feels close to ready.
|
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 |
9b961b2 to
8fafa97
Compare
8fafa97 to
a6f7fd1
Compare
denialhaag
left a comment
There was a problem hiding this comment.
I just had a free minute to go through this, and it looks really clean to me! ![]()
simon1hofmann
left a comment
There was a problem hiding this comment.
This also looks quite good, just a few comments about the documentation and two concerns flagged by another LLM review run.
|
Thanks @denialhaag and @simon1hofmann 🙏🏼 |
Thanks for addressing my comments, I agree with all your answers. |
Go also from my side! |
a6f7fd1 to
fe41d2a
Compare
fe41d2a to
363f8b5
Compare
burgholzer
left a comment
There was a problem hiding this comment.
Two more things to address here before this can go in.
|
I believe I am happy with this now. Looking forward to what you think @simon1hofmann 😌 |
simon1hofmann
left a comment
There was a problem hiding this comment.
This looks quite clean and I really like the changes here!
I just have two comments that should be checked before this can go in.
|
@burgholzer I fixed the two open comments and this PR should we ready now. |
One (hopefully) last request for changes. Then this can go in 👍🏼 |
9355f74 to
2b887ba
Compare
Represent unknown, unrestricted, and explicit connectivity and native-operation facts separately. Use site and arity vocabulary, and make target passes request facts only when needed. Assisted-by: OpenAI Codex
Assisted-by: OpenAI Codex
Keep unavailable QDMI v1.3 properties unknown while preserving the compile-and-execute integration with explicit simulator capabilities. Assisted-by: OpenAI Codex
Replace ordered sets with the project's LLVM containers and in-place canonicalization. Assisted-by: OpenAI Codex
Copy public collection views into compact LLVM storage and document the explicit DDSIM synthesis basis used until QDMI v1.4 reports all-to-all connectivity. Assisted-by: GPT-5.6 Sol via Codex
Avoid topology reconciliation when a single-site program does not need unknown connectivity, preserve the full nonnegative site-ID domain, and document explicit DDSIM capabilities. Assisted-by: GPT-5.6 Sol via Codex
QDMI 1.3 cannot enumerate the DDSIM all-to-all topology or homogeneous operation loci compactly. Advertise an exact custom marker and let the compiler adapter consume it without changing the fail-closed default for other devices. Assisted-by: GPT-5.6 Sol via Codex
Parallel Windows CTest workers could delete each other's inputs because the QIR and invalid-input scripts shared one output directory. Give the invalid-input test its own scratch path. Assisted-by: GPT-5.6 Sol via Codex
Keep the generic Python overload checks independent of DDSIM metadata now that CUSTOM1 carries compiler-target facts. Assisted-by: GPT-5.6 Sol via Codex
Dispatch explicit connectivity to mapping and use deterministic placement for all-to-all or safe unknown-connectivity programs. Reject unknown multi-site placement before mutation. Keep the QDMI 1.3 DDSIM metadata marker explicitly temporary until QDMI standardizes the equivalent facts. Assisted-by: GPT-5.6 Sol via Codex
Require complete topology and native-operation facts at target construction instead of propagating unusable unknown states. Model global phase as fixed zero arity and simulator gate families as positive variadic capabilities. DDSIM reports arbitrary controls through one exact QDMI 1.3 compatibility marker, so compiler support covers every canonical base gate without enumerating controlled aliases. Assisted-by: GPT-5.6 Sol via Codex
Rely on the QCO cleanup pipeline to canonicalize empty control modifiers before target synthesis. Keep target documentation consistent with the current Doxygen style and query an unused custom-property slot in generic DDSIM tests. Assisted-by: GPT-5.6 Sol via Codex
Treat variadic X and Z capabilities as CX and CZ support in the gate cache. This keeps synthesis-basis resolution consistent with controlled-operation support. Assisted-by: GPT-5.6 Sol via Codex
Global-phase normalization can leave an empty control shell beside the lowered phase operation. Remove that shell before target support planning so the standalone synthesis pass accepts P-only targets. Assisted-by: GPT-5.6 Sol via Codex
Use LLVM early-increment iteration to preserve reverse deletion without manual iterator bookkeeping. Assisted-by: GPT-5.6 Sol via Codex
Keep an explicit pointer to the previous operation before erasing the current node. Reverse early-increment iteration retains a dangling base iterator after deletion.\n\nAssisted-by: GPT-5.6 Sol via Codex
Adapt the mapping test added on main to the explicit connectivity and native-operation facts required by the generalized compiler target API.\n\nAssisted-by: GPT-5.6 Sol via Codex
2b887ba to
ba81d4b
Compare
Adapt the fixed-point test added on main to the explicit connectivity and native-operation facts required by the generalized compiler target API. Assisted-by: GPT-5.6 Sol via Codex
🤖 AI text below 🤖
Description
Define a complete, immutable MLIR compiler-target contract before serializing it as a typed MQT dialect attribute.
gphaseas a fixed zero-arity operation and preserve its observable phase effects during native synthesis.The DDSIM custom property is private to MQT Core and can be removed when QDMI standardizes the same operation capability. Controlled aliases such as
mcxandmcpremain available to existing adapters but are not enumerated as compiler-target capabilities.This PR is the bottom layer of the stack. #2323 adds target-aware controlled-operation decomposition, and #2215 adds typed target serialization on top of it. This PR does not add payload capabilities, replaceable-driver work, or a dependency on the QDMI v1.4 development API.
Target synthesis relies on the canonical QCO cleanup pipeline to remove empty control modifiers. Doxygen comments in every C++ file touched by this PR consistently use
///.Validation
CUSTOM1unsupported-property probe. The corrected isolated test passes.uvx nox -s lintpasses.uvx nox -s cpp-lint -- origin/mainreports no clang-format or clang-tidy findings.git diff --checkpasses.All 13 commits were rebased onto current
main, signed, and verified. Hosted checks for the new head are pending.Implementation, validation, and pull-request text were prepared with OpenAI Codex.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).