Skip to content

♻️ Refactor IR Verification Logic#1781

Merged
MatthiasReumann merged 38 commits into
mainfrom
enh/ir-verifier-refactoring
Jun 15, 2026
Merged

♻️ Refactor IR Verification Logic#1781
MatthiasReumann merged 38 commits into
mainfrom
enh/ir-verifier-refactoring

Conversation

@MatthiasReumann

@MatthiasReumann MatthiasReumann commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Description

Among other things, resolves #1752. The goal of this pull request is to simplify the verifier, while improving its performance, and make it somewhat bulletproof by explicitly stating its assumptions.

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:

  • I have disclosed the use of AI tools in the PR description as per our AI Usage Guidelines.
  • 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.

@mergify mergify Bot added the conflict label Jun 11, 2026
@mergify mergify Bot removed the conflict label Jun 11, 2026
@burgholzer burgholzer added fix Fix for something that isn't working MLIR Anything related to MLIR labels Jun 11, 2026
@burgholzer burgholzer added this to the MLIR Support milestone Jun 11, 2026
@MatthiasReumann MatthiasReumann self-assigned this Jun 12, 2026
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.87234% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mlir/lib/Support/IRVerification.cpp 97.8% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@MatthiasReumann MatthiasReumann marked this pull request as ready for review June 12, 2026 13:39
Signed-off-by: burgholzer <burgholzer@me.com>

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

Thanks @MatthiasReumann for working on this! 🙏🏼 much appreciated.
To be honest, I did not fully think through all of the verifier rewrites, which are quite substantial. But they do look convincing.

I just pushed some fairly minor cosmetic changes (things that CLion showed as warnings).
Other than that, I have two smaller comments inline and one bigger one here:
It is nice that the existing test suite is still running. However, that was the status quo also before this PR.
To gain some certainty that this addresses the underlying problems we have been trying to solve, it would be helpful to add at least one new test case that would have failed before this PR.

Comment thread mlir/unittests/programs/qc_programs.cpp Outdated
Comment thread mlir/lib/Support/IRVerification.cpp
@mergify mergify Bot added the conflict label Jun 12, 2026
@mergify mergify Bot removed the conflict label Jun 15, 2026
@MatthiasReumann

Copy link
Copy Markdown
Collaborator Author

@burgholzer Thanks for the review! 🙏

To gain some certainty that this addresses the underlying problems we have been trying to solve, it would be helpful to add at least one new test case that would have failed before this PR.

I've added an additional test to the qtensor-ir suite. The test fails on main but succeeds on this PR.

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

LGTM modulo one typo.
Feel free to resolve and merge after CI is green.

Comment thread mlir/unittests/programs/qco_programs.h Outdated
Co-authored-by: Lukas Burgholzer <burgholzer@me.com>
Signed-off-by: matthias <matthias@bereumann.com>
@MatthiasReumann MatthiasReumann merged commit b7f0a94 into main Jun 15, 2026
29 checks passed
@MatthiasReumann MatthiasReumann deleted the enh/ir-verifier-refactoring branch June 15, 2026 12:33
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 MLIR Module equivalence verifier fails for equivalent circuits with different insertion order

2 participants