Skip to content

🐛 Remove QCO/QTensor dependency cycles - #2352

Merged
burgholzer merged 3 commits into
mainfrom
codex/qco-qtensor-link-dependencies
Sep 3, 2026
Merged

🐛 Remove QCO/QTensor dependency cycles#2352
burgholzer merged 3 commits into
mainfrom
codex/qco-qtensor-link-dependencies

Conversation

@burgholzer

@burgholzer burgholzer commented Sep 3, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

Remove the QCO/QTensor library dependency cycles instead of relying on static archive repetition or bypassing LLVM's target ordering.

  • Move the QTensor-specific qco.if scalarization pattern into QTensor's native dialect-wide canonicalization hook. QCO IR no longer includes or links QTensor.
  • Remove the unused QTensor IR dependency on QTensorUtils. Keep ordinary one-way links from the utilities to QTensor IR and from QTensor IR to QCO IR.
  • Move the five scalarization regressions to the QTensor suite. One runs the generic canonicalizer directly; the others exercise the existing cleanup pipeline.
  • Remove the QIR runtime's redundant QTensor dependency.
  • Use build-tree RPATHs for the LLVM IR test executables so they can find shared MQT Core libraries before installation.

This PR is based on main and is independent of #2336. It preserves the scalarization algorithm and compiler pipeline without adding a pass, library, or interface. No standalone changelog or upgrade entry is needed for this internal fix to unreleased compiler code.

Validation

  • CMake's generated dependency graph has no cycles.
  • All five scalarization regressions passed.
  • Full Debug and Release C++ suites: 3,812 passed and one expected skip each.
  • Debug with BUILD_MQT_CORE_SHARED_LIBS=ON: all 72 QIR runtime tests passed.
  • uvx nox -s cpp-lint, uvx nox -s lint, and git diff --check passed.

An additional global BUILD_SHARED_LIBS=ON configuration probe is blocked by QDMI install-export declarations for MLIRQCODDFunctionality and MQTCompilerPipeline. That packaging issue is outside this change.

Codex assisted with dependency analysis, code relocation, and local validation.

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).
  • 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.

Declare the dependencies between QCO, QTensor, and its utilities so CMake
repeats their static archives for standalone QIR consumers.

Add the public QCO links after add_mlir_dialect_library to avoid LLVM’s
cyclic object-library build dependencies. Generated headers still precede
compilation through mlir-headers. Remove the runtime-only QTensor link.

Assisted-by: GPT-5.6 via Codex
Apply the same build-tree RPATH policy as the other test targets. The
LLVM IR test programs must find shared MQT Core libraries before install.

Assisted-by: GPT-5.6 via Codex
@burgholzer burgholzer added fix Fix for something that isn't working MLIR Anything related to MLIR QIR Anything related to QIR skip-changelog Changes that do not need to show up in the changelog labels Sep 3, 2026
@burgholzer burgholzer self-assigned this Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.77778% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...lib/Dialect/QTensor/IR/QTensorCanonicalization.cpp 97.7% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Register QTensor scalarization through the native dialect hook and move
its regression tests to the QTensor suite. Remove the unused IR-to-utils
edge and restore ordinary one-way library dependencies.

Assisted-by: Codex
@burgholzer burgholzer changed the title 🐛 Fix QCO/QTensor linkage and QIR test RPATH 🐛 Remove QCO/QTensor dependency cycles Sep 3, 2026
@burgholzer burgholzer added this to the v4.0.0 - IEEE Quantum Week milestone Sep 3, 2026
@burgholzer
burgholzer enabled auto-merge (squash) September 3, 2026 22:02
@burgholzer
burgholzer merged commit 8ff0247 into main Sep 3, 2026
26 checks passed
@burgholzer
burgholzer deleted the codex/qco-qtensor-link-dependencies branch September 3, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix for something that isn't working MLIR Anything related to MLIR QIR Anything related to QIR skip-changelog Changes that do not need to show up in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant