Skip to content

Conversation

@neelay893
Copy link
Contributor

These changes are separate from (#568) since they are not compatible with kirin 0.17 (in case we want to backport).

@neelay893 neelay893 requested review from Copilot and kaihsin November 7, 2025 16:23
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-11-19 16:11 UTC

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the vmath desugaring mechanism from an explicit pass-based approach to an automatic decorator-based approach using the @dialect.post_inference decorator. This simplifies the API by removing the need for manual invocation of the VMathDesugar pass in tests and user code.

Key Changes

  • Removed manual VMathDesugar pass instantiation from all test functions
  • Deleted the VMathDesugar pass class and passes.py file entirely
  • Added @dialect.post_inference decorator to WalkDesugarBinop to automatically register the rewrite rule

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/dialects/vmath/test_desugar.py Removed manual VMathDesugar pass calls from 6 test functions and removed the import, simplifying test code
src/kirin/dialects/vmath/rewrites/desugar.py Added @dialect.post_inference decorator to WalkDesugarBinop class and imported the dialect object to enable automatic registration
src/kirin/dialects/vmath/passes.py Deleted entire file containing the now-obsolete VMathDesugar pass class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@neelay893 neelay893 marked this pull request as draft November 7, 2025 16:28
@neelay893 neelay893 marked this pull request as ready for review November 7, 2025 16:38
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11598 10347 89% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/kirin/dialects/vmath/_init_.py 100% 🟢
src/kirin/dialects/vmath/rewrites/desugar.py 92% 🟢
TOTAL 96% 🟢

updated for commit: b0272b4 by action🐍

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@neelay893
Copy link
Contributor Author

This requires type inference to be run beforehand (and is run automatically for vmath after type inference).

@neelay893 neelay893 self-assigned this Nov 10, 2025
Copy link
Collaborator

@kaihsin kaihsin left a comment

Choose a reason for hiding this comment

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

LGTM

@Roger-luo Roger-luo merged commit d133226 into main Nov 19, 2025
13 checks passed
@Roger-luo Roger-luo deleted the neelay/vmath-cleanup branch November 19, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants