Skip to content

⚡ Reduce release pipeline verification overhead - #2698

Merged
burgholzer merged 1 commit into
mainfrom
codex/release-boundary-verification
Oct 9, 2026
Merged

burgholzer merged 1 commit into
mainfrom
codex/release-boundary-verification

Conversation

@simon1hofmann

@simon1hofmann simon1hofmann commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Description

Reduce repeated verification in pipelines created by runWithPassManager. With NDEBUG, disable per-pass verification and verify the complete output module after the pipeline succeeds. Assertions-enabled builds retain per-pass verification and the final module check.

The helper requires valid input IR. Parsers and program imports validate input; callers that mutate a program's module must preserve its validity. In release builds, invalid intermediate IR can reach a later pass before detection, so assertions-enabled builds remain useful for locating compiler defects.

The change applies to API pipelines using this helper, including target compilation, cleanup, and QIR conversion. The normal mqt-cc pass-manager path, QCProgram::intoQCO, caller-owned managers, and custom textual pipelines keep their existing verification settings. QCO linearity and target-conformance checks remain in place. No new options or dependencies.

Performance

Compare main at ddee68053bb523ccfe71e01703120df9ed96796b against this PR at ea8a87f77a810eb836775b5bf3d0e0fd2986cdba. Both include the conversion improvements from #2695 and the assertion-free release SDK configuration from #2678, isolating this PR's verification policy.

Times are medians. Reductions use the geometric mean of within-pair candidate/baseline ratios, so they need not equal the ratio of the displayed medians.

Workload / topology Pairs Main PR Elapsed-time reduction
bwt_n37 / linear † 4 242.317 s 212.906 s 10.5%
factor247_n15 / square † 6 85.236 s 64.568 s 23.3%
cat_n260 / heavy-hex 12 104.322 ms 96.943 ms 6.6%
wstate_n380 / square 12 109.602 ms 86.866 ms 20.6%
qugan_n395 / heavy-hex 12 5.984 s 5.889 s No clear change
BWT → QIR Adaptive 6 15.187 s 12.721 s 16.0%
2M H gates, one QCO → QC pass 4 2.467 s 2.464 s No clear change

† BWT target compilation and Factor247 ran with recorded background work on a shared host; their percentages are less precise. For the other workloads, whole pairs were repeated when compiler overlap or average external CPU load of at least half a core was observed. This screening does not prove exclusive machine use. Excluded attempts were retained. QuGAN and the single-pass control have paired 95% bootstrap intervals spanning no improvement.

Separate verifier profiling supports the end-to-end results: W-state's accumulated verifier time fell from 27.8 ms to 5.1 ms, and BWT QIR's from 3.77 s to 1.21 s. QuGAN removed only about 0.08 s of verifier work from roughly 6 s of compilation, explaining its neutral result. The one-pass control has no intermediate verification to remove. Profiling used separate binaries; accumulated verifier durations can include concurrent calls and are not necessarily additive wall-time shares.

Measurement setup
  • DGX Spark ARM64; LLVM/MLIR 23.1.2 with assertions off; Clang 23, Release, ThinLTO, mold; affinity restricted to ten Cortex-X925 cores.
  • Native C++ API harness, serial fresh processes, balanced AB/BA pairs. Seed 42, ten mapping trials, one iteration, lookahead 20.
  • Original QASM inputs from Benchpress revision b695f30e83a32bac05b9b4d8e98d37ba9aae5236. Targets: a 37-site line, 4×4 and 20×20 grids, and heavy-hex graphs of distance 11 and 13. Basis: id, sx, x, rz, cz, measure, reset.
  • Target timing includes QC input copy, QC → QCO, target compilation, and QCO → QC. Production pipeline verification is included. Input loading, target setup, additional harness verification, serialization, and hashing are excluded.
  • QIR timing includes QC copy and intoQIR(Adaptive), including preparation, conversion, and cleanup.
  • All primary and profiling variants produced matching serialized output hashes and operation counts; QC outputs also had matching gate counts. Output IR was verified after timing.

Validation

  • All 272 compiler tests pass with the actual assertion-free SDK. The assertions-enabled compiler suite also passes.
  • One focused test covers invalid final output and the assertion-dependent intermediate verification policy. Rebuilt mutations that omit final verification or restore intermediate verification under NDEBUG fail the test.
  • Whole-file C++ lint, repository lint, and git diff --check pass. Hosted checks for the updated commit remain pending.

Codex assisted with implementation, review, tests, benchmarks, and this description.

Checklist

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

If PR contains AI-assisted content:

  • Any agent that created, edited, or submitted GitHub content was explicitly authorized for that scope, as required by our AI Usage Guidelines.
  • Every agent-authored or agent-edited public text body begins with the visible disclosure 🤖 *AI text below* 🤖 (titles are exempt).
  • I have disclosed AI assistance in the PR description.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@simon1hofmann
simon1hofmann added this pull request to stack #2692 October 7, 2026 08:03
@simon1hofmann simon1hofmann self-assigned this Oct 7, 2026
@simon1hofmann simon1hofmann added enhancement Improvement of existing feature c++ Anything related to C++ code MLIR Anything related to MLIR labels Oct 7, 2026
@simon1hofmann simon1hofmann added this to the v4.1.0 - QDMI 1.4 / MQSF milestone Oct 7, 2026
@simon1hofmann
simon1hofmann force-pushed the codex/release-boundary-verification branch from 12b797d to 43c27eb Compare October 7, 2026 11:43
@simon1hofmann
simon1hofmann marked this pull request as ready for review October 7, 2026 11:43
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mergify mergify Bot added the conflict label Oct 7, 2026
Base automatically changed from codex/qco-conversion-performance to main October 8, 2026 08:44
@burgholzer

Copy link
Copy Markdown
Member

Moving on to this one now.

@burgholzer
burgholzer force-pushed the codex/release-boundary-verification branch from 43c27eb to 2cf5d43 Compare October 8, 2026 08:55
@mergify mergify Bot removed the conflict label Oct 8, 2026
🤖 *AI text below* 🤖

Run Core-owned pipelines on valid input and verify the final module.
Disable intermediate verification in NDEBUG builds while retaining it
when assertions are enabled to locate compiler defects.

Cover invalid final output and the assertion-dependent intermediate
verification policy with one test and a reusable test pass.

Assisted-by: Codex
@burgholzer
burgholzer force-pushed the codex/release-boundary-verification branch from 2cf5d43 to ea8a87f Compare October 8, 2026 20:27
@burgholzer burgholzer changed the title ⚡ Verify Release pipelines at their boundaries ⚡ Reduce release pipeline verification overhead Oct 8, 2026
@burgholzer burgholzer self-assigned this Oct 8, 2026

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get this in!

@burgholzer
burgholzer merged commit 077848e into main Oct 9, 2026
26 checks passed
@burgholzer
burgholzer deleted the codex/release-boundary-verification branch October 9, 2026 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code enhancement Improvement of existing feature MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants