[Fix] Consistent promotion rules for Vector and Numeric#797
Open
sjfeng1999 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates FlyDSL’s dtype promotion so Vector operators and scalar Numeric operators share consistent promotion and result-type rules, and strengthens unit tests to catch vector/scalar drift and a specific mixed-width integer regression.
Changes:
- Refactors promotion into shared helpers (
_coerce_operands,_result_type_for_op) and applies them to Vector arithmetic. - Updates Vector unit tests to expect auto-promotion (no explicit
.to()required) and adds anInt32x4 + Int64x4regression check. - Expands numeric promotion tests to assert vector/scalar dtype consistency across more operators.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/unit/test_vector.py | Updates expectations to vector auto-promotion and adds a mixed-width integer vector regression test. |
| tests/unit/test_numeric_promotion.py | Refactors _binop to exercise both scalar and vector ops and asserts dtype consistency across more operators. |
| python/flydsl/expr/typing.py | Moves Vector operator dtype resolution to the shared scalar promotion/result-type helpers. |
| python/flydsl/expr/numeric.py | Introduces shared promotion/result-type helpers and adjusts operator implementation accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
rebase #789 later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist