-
Notifications
You must be signed in to change notification settings - Fork 7
[pass] Check post conditions on the resulting model #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Justin Chu <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 73.59% 73.70% +0.11%
==========================================
Files 37 37
Lines 4492 4492
Branches 902 902
==========================================
+ Hits 3306 3311 +5
+ Misses 858 853 -5
Partials 328 328 ☔ View full report in Codecov by Sentry. |
@codecov-ai-reviewer test |
On it! Codecov is generating unit tests for this PR. |
This PR adds tests for #78 ### Commits: - Add unit tests for postcondition checking bug fix Tests verify that ensures() is called with result.model instead of input model, covering the fix in PassBase.__call__ where postconditions should check the transformed model rather than the original input model. - Add unit tests for postcondition checking bug fix Tests verify that ensures() is called with result.model instead of input model, covering the fix in PassBase.__call__ where postconditions should check the transformed model rather than the original input model. Co-authored-by: codecov-ai[bot] <156709835+codecov-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This PR adds tests for #78 ### Commits: - Add unit tests for postcondition checking bug fix Tests verify that ensures() is called with result.model instead of input model, covering the fix in PassBase.__call__ where postconditions should check the transformed model rather than the original input model. - Add unit tests for postcondition checking bug fix Tests verify that ensures() is called with result.model instead of input model, covering the fix in PassBase.__call__ where postconditions should check the transformed model rather than the original input model. Co-authored-by: codecov-ai[bot] <156709835+codecov-ai[bot]@users.noreply.github.com>
4ade286
to
d251d2f
Compare
There was a problem hiding this 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 fixes a bug where postconditions were incorrectly checked against the input model instead of the resulting model. It updates the internal pass infrastructure and adds tests to ensure that both in-place and non in-place passes properly call ensures() on the correct model, while also verifying the correct exception behavior.
- Updated _pass_infra.py to call ensures() with result.model.
- Added tests in _pass_infra_test.py to verify ensures() for non in-place, in-place, and functional passes.
- Added tests to check proper exception propagation when ensures() fails.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/onnx_ir/passes/_pass_infra_test.py | New tests added to verify that ensures() is called with the resulting model and error handling. |
src/onnx_ir/passes/_pass_infra.py | Updated to call ensures() with result.model to fix the bug reported in issue #77. |
A bug discovered in #77 where we are checking post conditions on the input model and not the resulting model. This PR fixes it.
Fixes #77