♻️ Separate target placement from routing - #2316
Conversation
Use compact deterministic placement for all-to-all target compilation and reserve the existing router for explicit coupling graphs. Share the validated dynamic-to-static rewrite between both passes. Assisted-by: GPT-5.6 Sol via Codex
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
simon1hofmann
left a comment
There was a problem hiding this comment.
Went through the changes and they look good to me 👍
I have one comment found by ponytail, where I'm not entirely sure if we should fix it that way:
[P2] The TableGen declaration creates an unsafe targetless public pass.
Passes.td generates createPlacementPass() and registerPlacementPass() with no CompilerTarget. That default-constructs PlacementPass, whose execution exits the process through reportFatalUsageError.
The canonical pipeline is safe because it calls the target-taking overload. The problem is the valid-looking public factory and generated place-qubits registration.
Ponytail fix: remove PlacementPass from TableGen and implement it as an explicitly target-bound PassWrapper, matching TargetNativeSynthesisPass.
Expose only:
createPlacementPass(const CompilerTarget&)
This removes code and an unusable API.
Remove the generated targetless factory and CLI registration, and document the mapper topology precondition. Assisted-by: GPT-5.6 Sol via Codex
|
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 |
MatthiasReumann
left a comment
There was a problem hiding this comment.
Looks great! Pretty much the changes that I would expect.
Left some minor comments; otherwise let's get this merged!
🤖 AI text below 🤖
Description
Separate deterministic qubit placement from topology-aware routing.
Target compilation now uses a compact placement pass for all-to-all targets and reserves the existing mapping pass for explicit coupling graphs. Both paths share the validated allocation discovery, capacity check, and dynamic-to-static rewrite, so the split does not duplicate the fragile part of the transformation.
This is the focused prerequisite for #2218. After this PR merges, #2218 can add its three-state connectivity policy without making the router handle an unknown topology: explicit connectivity uses mapping, all-to-all uses placement, and unknown connectivity rejects residual multi-site operations before placement.
Validated locally with:
No changelog or upgrade-guide entry is needed because this only restructures the unreleased MQT Core v4 target-compilation work.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).