⚡️ Simplify routing and standardize benchmark experiments - #2488
Merged
Merged
Conversation
Skip graph construction for equal layouts, remove duplicate routing state and unused graph APIs, and diagnose unsupported mapping inputs. Preserve routing heuristics and document the dense temporary workspace. Add boundary regression tests and reproducible before/after benchmarks with mapped-output checks and plots. Assisted-by: GPT-6 via Codex
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
MSVC's isfinite overload otherwise tries to copy the non-copyable MLIR option wrapper. Pass its stored float value explicitly. Assisted-by: GPT-6 via Codex
Move the routing harness, build hook, data, and plots into .agents/benchmarks/routing. Build against selected checkouts without adding benchmark targets to the production or test source trees. Define shared benchmark evidence and reproduction rules in AGENTS.md and link them from the planning and audit guides. Assisted-by: GPT-6 via Codex
Condense the benchmark rules and exclude one-off experiments from routine pre-commit, Python, and local and hosted C++ lint checks. Validate benchmark execution explicitly instead. Assisted-by: GPT-6 via Codex
burgholzer
commented
Sep 9, 2026
burgholzer
left a comment
Member
Author
There was a problem hiding this comment.
Let's get this in ⚡
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
Mapping currently builds repair graphs for equal layouts, copies adjacency lists during cycle search, and carries duplicate routing state. Skip that work, remove the unused graph distance matrix and related APIs, and update parent routing state directly. Keep branch-join heuristics, A* ordering, and traversal semantics unchanged.
Diagnose qubit-carrying calls, multi-block entry functions, and invalid mapping options before mutation. Preserve classical calls and document the dense temporary routing workspace. Payload capability checks and control-flow legalization remain owned by #2162.
Keep the complete one-off benchmark under
.agents/benchmarks/routing/: source, explicit CMake hook, collection and plotting scripts, raw samples, and figure. It builds against a selected checkout without edits to production or test build files.AGENTS.mddefines shared requirements for matched before/after runs, correctness and quality checks, raw data, plots, revision attribution, and reproducibility;PLANS.mdandAUDITS.mdlink to those requirements. Benchmark files are excluded from routine pre-commit, Ruff, ty, and local/CI C++ lint; benchmark execution is validated explicitly.Benchmarks
Compared with
91a9e0ba514af938680cdd394d6d63195872dc9a, on DGX Spark with GCC 13.3.0 and LLVM/MLIR 23.1.0, release builds without IPO, pinned to CPU 0. Nine alternating process pairs, five samples after warmup per workload; bars show medians and interquartile ranges.Benchmark source, workload definitions, raw samples, and plotting instructions are reproducible. The benchmark executable is optional and excluded from the default build and CTest; plotting adds no project dependency.
Validation
The relocated harness builds against baseline and candidate checkouts; all 45 outputs per variant match the recorded IR hashes and SWAP counts. A candidate build with tests disabled, a normal configuration without the benchmark target, collection/plotting smoke runs, and C++ lint without the benchmark hook passed. Historical timing samples remain attributed to their original revisions.
104 mapping tests, 192 QCO utility tests, and 182 compiler tests passed locally.
uvx nox -s lintpassed.Full changed-file
uvx nox -s cpp-lint -- 91a9e0ba514af938680cdd394d6d63195872dc9apassed.A disposable combination with ✨ Legalize control flow for selected payloads #2162 at
1c5d4cc667046e9d3270898bfa658c786d74368dapplied cleanly through three-way patch application. All 100 existing mapping tests passed. The combined compiler suite passed 193/195:PayloadControlRejectsLinearStateInGenericSCFControlandPayloadControlRejectsUnstructuredCFGfail during parsing because their allocations violate main's entry-block rule. Both failures reproduce with these routing changes removed, before mapping runs. This is not a claim that the complete ✨ Legalize control flow for selected payloads #2162 stack is green.This changes unreleased v4 functionality; no standalone changelog entry or migration section is required. Codex assisted with implementation, regression tests, benchmarks, and this description. Human review remains required before acceptance or merge.
Checklist
If PR contains AI-assisted content:
🤖 *AI text below* 🤖(titles are exempt).