Skip to content

✨ Record typed compiler targets in MQT IR - #2215

Merged
simon1hofmann merged 4 commits into
mainfrom
codex/payload-execution-environment
Sep 2, 2026
Merged

✨ Record typed compiler targets in MQT IR#2215
simon1hofmann merged 4 commits into
mainfrom
codex/payload-execution-environment

Conversation

@burgholzer

@burgholzer burgholzer commented Aug 23, 2026

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Description

This PR adds #mqt.compilation_target and its typed leaf attributes to the MQT dialect. CompilerTarget can materialize its immutable source facts as the attribute and reconstruct a validated C++ target from it. The round trip preserves target and site names, ordered sparse site IDs, timing metadata, connectivity, native operations, placements, durations, fidelities, and fixed or variadic operation arities. Fixed arities include zero-arity operations such as gphase; variadic arities record a positive inclusive minimum for arbitrarily controlled native operations.

This is the focused typed-serialization layer at the top of the stack. It builds on #2323, which builds on the compiler target introduced by #2218. It deliberately excludes payload descriptors, execution capabilities, combined target environments, module attachment, and DLTI integration. Those contracts remain separate work.

The TableGen definitions provide concrete syntax examples in the generated dialect documentation, including a complete #mqt.compilation_target example. Attribute verifiers reject malformed target facts before reconstruction, while the existing C++ factories remain the single source of truth for target validation and derived caches.

The changelog records this PR in the existing MQT Compiler Collection launch entry rather than adding a separate entry for unreleased functionality. Its PR-link definition remains in numeric descending order.

Validation

  • Rebased as one signed commit on ✨ Preserve target-native controlled operations #2323 at 60d5bb4db2a4672214ea793dbfe6e2d6c92c8863.
  • MQT dialect unit tests: 14 passed.
  • Compiler unit tests: 146 passed.
  • cmake --build --preset release --target mlir-doc
  • uvx nox -s lint
  • uvx nox -s cpp-lint
  • git diff --check
  • git verify-commit HEAD

Implementation and pull-request text were prepared with OpenAI Codex.

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

@burgholzer burgholzer added feature New feature or request c++ Anything related to C++ code MLIR Anything related to MLIR labels Aug 23, 2026
@burgholzer burgholzer self-assigned this Aug 23, 2026
@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from 7b25247 to 07352c2 Compare August 23, 2026 10:59
@mergify mergify Bot added the conflict label Aug 23, 2026
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.98893% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mlir/lib/Compiler/Target.cpp 91.9% 10 Missing ⚠️
mlir/lib/Dialect/MQT/IR/MQTDialect.cpp 94.6% 7 Missing ⚠️
mlir/include/mlir/Dialect/MQT/IR/MQTAttributes.h 86.6% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from 07352c2 to c2c5028 Compare August 23, 2026 11:35
@mergify mergify Bot added conflict and removed conflict labels Aug 23, 2026
@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from c2c5028 to 420fbc8 Compare August 23, 2026 18:12
@burgholzer burgholzer changed the title ✨ Add typed payload execution environments to MQT IR ✨ Record typed compiler target environments in MQT IR Aug 23, 2026
@burgholzer
burgholzer changed the base branch from main to codex/generalize-compiler-target August 23, 2026 18:12
@mergify mergify Bot added conflict and removed conflict labels Aug 23, 2026
@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch 2 times, most recently from 36b7fbb to 99f2786 Compare August 23, 2026 18:39

@burgholzer burgholzer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This also looks genuinely good except for one little detail.

Comment thread mlir/lib/Compiler/Target.cpp Outdated
Comment thread mlir/lib/Compiler/Target.cpp Outdated
@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from 99f2786 to e7350d0 Compare August 24, 2026 12:46
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Important

Approval pending

CodeRabbit 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.

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from e7350d0 to 86d01c1 Compare August 24, 2026 13:54
@burgholzer burgholzer added this to the MLIR Support milestone Aug 24, 2026
@burgholzer
burgholzer force-pushed the codex/payload-execution-environment branch from 86d01c1 to 390e966 Compare August 24, 2026 23:47

@denialhaag denialhaag 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.

I really like the addition of these attribues! I only have a nitpick and a comment on the attribute descriptions, otherwise this LGTM! I'm already approving now, as neither of my comments is blocking. 😎

Comment thread mlir/include/mlir/Dialect/MQT/IR/MQTDialect.td
Comment thread mlir/include/mlir/Dialect/MQT/IR/MQTDialect.td
@burgholzer

Copy link
Copy Markdown
Member Author

This was essentially just updated based on the changes in the stack below it. Might not hurt to give it a sanity check though.

@denialhaag denialhaag 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.

This LGTM! :shipit:

I just have two nitpicks, both of which are not blocking:

Comment thread mlir/include/mlir/Dialect/MQT/IR/MQTDialect.td Outdated
Comment thread CHANGELOG.md Outdated

@simon1hofmann simon1hofmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This one also looks good, just one thing to clarify.

Comment thread mlir/include/mlir/Dialect/MQT/IR/MQTDialect.td Outdated
@mergify mergify Bot added the conflict label Sep 2, 2026
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from ce6ccb9 to c677d0f Compare September 2, 2026 12:46
@mergify mergify Bot removed the conflict label Sep 2, 2026
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from e0685f0 to fe2fbf1 Compare September 2, 2026 14:31
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from fe2fbf1 to 5f41779 Compare September 2, 2026 16:10
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from 5f41779 to 690b85a Compare September 2, 2026 16:39
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from 690b85a to 1111a3e Compare September 2, 2026 17:11
@mergify mergify Bot added the conflict label Sep 2, 2026
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from 1111a3e to 90e487c Compare September 2, 2026 18:21
@mergify mergify Bot removed the conflict label Sep 2, 2026
Base automatically changed from codex/target-aware-controlled-decomposition to main September 2, 2026 19:36
burgholzer and others added 4 commits September 2, 2026 21:36
Preserve compiler-target facts as a validated MLIR attribute and support lossless conversion to and from CompilerTarget.

Assisted-by: GPT-5.6 Sol via Codex
Render the native-operation attribute example as an MLIR code block in the generated dialect documentation.\n\nAssisted-by: GPT-5.6 Sol via Codex
Keep the Core 4.0 pull-request references in numeric order.\n\nAssisted-by: GPT-5.6 Sol via Codex
Parse present timing fields with the required integer parser while retaining optional storage, and cover malformed values for every affected attribute.\n\nAssisted-by: GPT-5.6 Sol via Codex
@simon1hofmann
simon1hofmann force-pushed the codex/payload-execution-environment branch from 90e487c to ec03d15 Compare September 2, 2026 19:36
@simon1hofmann

Copy link
Copy Markdown
Contributor

@burgholzer This one is ready to be merged as well right?

@burgholzer

Copy link
Copy Markdown
Member Author

@burgholzer This one is ready to be merged as well right?

Yes, let's get this is once CI is green 🚀
That should also conclude the 4.0 split of this stack.
We may actually want to split off the rest from that stack and form a new one after reorganizing. I'll keep that in mind for after this merges.

@simon1hofmann
simon1hofmann merged commit e9592a5 into main Sep 2, 2026
43 of 45 checks passed
@simon1hofmann
simon1hofmann deleted the codex/payload-execution-environment branch September 2, 2026 20:16
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 feature New feature or request MLIR Anything related to MLIR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants