Skip to content

💥 Require LLVM/MLIR for all MQT Core builds - #1953

Merged
burgholzer merged 6 commits into
mainfrom
agent/extract-1912-mlir-off
Jul 29, 2026
Merged

💥 Require LLVM/MLIR for all MQT Core builds#1953
burgholzer merged 6 commits into
mainfrom
agent/extract-1912-mlir-off

Conversation

@burgholzer

@burgholzer burgholzer commented Jul 27, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

Require LLVM/MLIR for every MQT Core source build.

This removes the BUILD_MQT_CORE_MLIR switch and the corresponding conditional
build paths. MQT Core now always:

  • discovers LLVM/MLIR during CMake configuration,
  • builds the MLIR compiler infrastructure,
  • fetches the MLIR-specific dependencies,
  • builds the MLIR Python extension whenever Python bindings are enabled, and
  • exposes the QIR feature switches independently of MLIR availability.

Unsupported macOS compiler combinations now fail during configuration instead
of silently disabling MLIR. The Python packaging configuration, installation
guide, QIR documentation, changelog, and upgrade guide reflect the mandatory
dependency.

The existing Core CI and wheel jobs already install LLVM/MLIR through Reusable
MQT Workflows, so no workflow-specific compatibility path is needed here.
Projects that build MQT Core from source must provide a compatible LLVM/MLIR
installation and set MLIR_DIR; pre-built MQT Core distributions remain the
alternative for consumers that do not build from source.

Validation

  • Fresh release configuration with LLVM/MLIR 22.1.3.
  • Verified the CMake cache no longer contains BUILD_MQT_CORE_MLIR.
  • Verified the configured graph contains mqt-cc,
    mqt-core-mlir-bindings, mlir-doc, the QIR runner, and QIR-enabled DDSIM
    targets.
  • Built mqt-cc and mqt-core-mlir-bindings.
  • Ran all 119 compiler-pipeline tests.
  • Regenerated the Python stubs after a full package build; the tracked stubs
    remained unchanged.
  • Built the warning-as-error documentation.
  • Ran the full lint session.

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.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • 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).
  • AI-assisted commits include an Assisted-by: [Model Name] via [Tool Name] footer.
  • I confirm that I have personally reviewed and understood all AI-generated content, and accept full responsibility for it.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Remove the BUILD_MQT_CORE_MLIR switch and configure the MLIR compiler infrastructure for every source build. Keep QIR feature switches independent, fail clearly for unsupported macOS compilers, and update packaging and migration documentation.

Assisted-by: GPT-5.6 via Codex
@burgholzer
burgholzer force-pushed the agent/extract-1912-mlir-off branch from 8418840 to 0ed598c Compare July 27, 2026 19:07
@burgholzer burgholzer changed the title 📦 Support Python builds without MLIR 💥 Require LLVM/MLIR for all MQT Core builds Jul 27, 2026
@burgholzer burgholzer added refactor Anything related to code refactoring MLIR Anything related to MLIR labels Jul 29, 2026
@burgholzer burgholzer added this to the MLIR Support milestone Jul 29, 2026
@burgholzer burgholzer self-assigned this Jul 29, 2026
Remove the remaining switches for the QIR runner and DDSIM QIR support now that LLVM and MLIR are required for every source build. Collapse the guarded production and test build graph and document the removed options.

Assisted-by: GPT-5.6 via Codex
Integrate the latest upstream changes without rewriting the published review history.

Assisted-by: GPT-5.6 via Codex
Integrate the latest upstream changes without rewriting the published review history.

Assisted-by: GPT-5.6 via Codex
Assisted-by: GPT-5.6-sol via Codex
Assisted-by: GPT-5.6-sol via Codex
@burgholzer
burgholzer marked this pull request as ready for review July 29, 2026 13:39
@burgholzer
burgholzer enabled auto-merge (squash) July 29, 2026 13:39
@burgholzer
burgholzer disabled auto-merge July 29, 2026 15:37
@burgholzer
burgholzer merged commit 4931732 into main Jul 29, 2026
31 checks passed
@burgholzer
burgholzer deleted the agent/extract-1912-mlir-off branch July 29, 2026 15:37
burgholzer added a commit that referenced this pull request Jul 29, 2026
Integrate unconditional LLVM/MLIR and QIR support from #1953, remove obsolete QIR capability negotiation, and keep the embedded QDMI consumer test hermetic by reusing the parent FetchContent sources.

Assisted-by: GPT-5.6 via Codex
burgholzer added a commit that referenced this pull request Jul 29, 2026
Integrate the mandatory LLVM/MLIR and unconditional QIR build from #1953.

Assisted-by: GPT-5.6-sol via Codex
burgholzer added a commit to munich-quantum-toolkit/templates that referenced this pull request Jul 29, 2026
🤖 *AI text below* 🤖

## Description

Prepare the v1.4.3 release and align the `c++-mlir-python` installation
template with projects that require LLVM/MLIR for every source build.

The template now states that LLVM/MLIR is mandatory and no longer
generates instructions for a `BUILD_MQT_<NAME>_MLIR` switch. This
prevents munich-quantum-toolkit/core#1963 from restoring the option
removed by munich-quantum-toolkit/core#1953. It also removes an invalid
generated option from `core-plugins-catalyst`, the only other consumer
of this template variant.

## Validation

- `uv run --group test python -m pytest` (9 passed)
- `uv run prek run --all-files`
- Rendered the updated installation template into the exact head of Core
PR #1963 and ran Core's changed-file checks; the resulting
`docs/installation.md` matches current Core `main` exactly.

## Checklist

- [x] The pull request only contains commits that are focused and
relevant to this change.
- [x] I have added appropriate tests that cover the new/changed
functionality.
- [x] I have updated the documentation to reflect these changes.
- [x] I have added entries to the changelog for any noteworthy
additions, changes, fixes, or removals.
- [x] I have added migration instructions to the upgrade guide (if
needed).
- [x] The changes follow the project's style guidelines and introduce no
new warnings.
- [x] The changes are fully tested and pass the CI checks.
- [x] I have reviewed my own code changes.

**If PR contains AI-assisted content:**

- [x] Any agent that created, edited, or submitted GitHub content was
explicitly authorized for that scope, as required by our [AI Usage
Guidelines](https://github.com/munich-quantum-toolkit/templates/blob/main/docs/ai_usage.md).
- [x] Every agent-authored or agent-edited public text body begins with
the visible disclosure `🤖 *AI text below* 🤖` (titles are exempt).
- [x] AI-assisted commits include an `Assisted-by: [Model Name] via
[Tool Name]` footer.
- [x] I confirm that I have personally reviewed and understood all
AI-generated content, and accept full responsibility for it.
burgholzer added a commit that referenced this pull request Jul 29, 2026
🤖 *AI text below* 🤖

## Summary

- add exact-byte FoMaC submission and retrieval for binary QDMI programs
while preserving null-terminated text handling
- expose the complete standard QDMI program-format enum in Python and
enforce text/binary representation contracts
- let embedding projects reuse an existing `spdlog::spdlog` target when
adding MQT Core as a subdirectory
- exercise textual QASM and real QIR bitcode paths through the DDSIM
QDMI device

## Context

This is an independent prerequisite for the QDMI integration in
NVIDIA/cuda-quantum#4882. It does not depend on #1912 and can merge
separately. Stable-ID device registration and selective provider
composition remain part of #1912. QIR support is provided
unconditionally by MQT Core following #1953; this PR does not add
feature or capability negotiation.

## Validation

- release configure and focused build with LLVM/MLIR 22.1.3
- 172 native FoMaC tests
- 47 DDSIM QDMI device tests, including QIR string and binary profiles
- 178 focused Python FoMaC tests
- focused parent-provided `spdlog::spdlog` CMake configure test
- full repository lint
- warning-as-error documentation build

---------

Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
burgholzer added a commit that referenced this pull request Jul 30, 2026
🤖 *AI text below* 🤖

## Description

Backport selected changes from `main` to the maintained `v3.x` branch in
preparation for MQT Core 3.8.0.

The commits are kept separate by upstream change wherever practical. The
series includes:

- configurable QDMI device discovery and stable-ID registration from
#1912
- binary-safe FoMaC/QDMI program handling from #1957
- CMake subproject composability and individually selectable bundled
QDMI devices from the current #1965 head
(`cdc740398e472c19b585cf6dbd7d41de053d84a6`)
- optional QIR support for the DDSIM QDMI device and the associated QIR
runtime improvements
- native RCCX support and the bottom-up DD construction path
- Python CI performance improvements from #1944
- template synchronization through #1964, agent/contributor guide
updates, dependency and pre-commit updates, and related maintenance

## v3 compatibility

This backport deliberately preserves the v3 architecture:

- LLVM/MLIR remains optional and continues to use LLVM/MLIR 21.
- QIR support is available behind the existing MLIR-dependent feature
flags.
- The mandatory LLVM/MLIR 22 transition from #1953 and
compiler-collection changes that depend on the v4 MLIR/QCO redesign are
not included.
- #1965 is adapted to retain optional MLIR and the v3 documentation
roles while preserving its CMake and QDMI behavior.

## Validation

- configured and built the complete non-MLIR library
- configured the MLIR build against LLVM/MLIR 21.1.8
- built and ran focused DD, FoMaC, QDMI driver/registry/device, and QIR
tests
- verified 435 #1965-affected C++ test cases, with two expected device
capability skips
- configured MQT Core as an embedded CMake subproject with all bundled
devices disabled by default
- configured an embedded build with only the DDSIM QDMI device enabled
- built and ran the device-free registry suite: 11 tests passed
- focused Python FoMaC suite: 181 passed, two expected non-MLIR skips
- regenerated Python stubs without a diff
- complete lint, lockfile validation, commit-signature audit, and `git
diff --check` passed

The pre-existing v3 test configuration still requires `llc` even when
MLIR is disabled. The non-MLIR library build itself succeeds; MLIR/QIR
validation used LLVM/MLIR 21.

## Checklist

- [x] The pull request only contains commits that are focused and
relevant to this change.
- [x] I have added appropriate tests that cover the new/changed
functionality.
- [x] I have updated the documentation to reflect these changes.
- [x] I have added entries to the changelog for any noteworthy
additions, changes, fixes, or removals.
- [x] I have added migration instructions to the upgrade guide (if
needed).
- [x] The changes follow the project's style guidelines and introduce no
new warnings.
- [x] The changes are fully tested and pass the CI checks.
- [x] I have reviewed my own code changes.

**If PR contains AI-assisted content:**

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

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: Roberto Turrado Camblor <rturrado@gmail.com>
Signed-off-by: rturrado <rturrado@gmail.com>
Co-authored-by: mqt-app[bot] <219534693+mqt-app[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com>
Co-authored-by: simon1hofmann <119581649+simon1hofmann@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Roberto Turrado Camblor <rturrado@gmail.com>
Co-authored-by: Yannick Stade <100073938+ystade@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MLIR Anything related to MLIR refactor Anything related to code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant