Skip to content

[Fix] Consistent promotion rules for Vector and Numeric#797

Open
sjfeng1999 wants to merge 1 commit into
ROCm:mainfrom
sjfeng1999:pr/vector-numeric-promotion-single
Open

[Fix] Consistent promotion rules for Vector and Numeric#797
sjfeng1999 wants to merge 1 commit into
ROCm:mainfrom
sjfeng1999:pr/vector-numeric-promotion-single

Conversation

@sjfeng1999

Copy link
Copy Markdown
Collaborator

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

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

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 an Int32x4 + Int64x4 regression 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.

Comment thread python/flydsl/expr/numeric.py
@sjfeng1999

Copy link
Copy Markdown
Collaborator Author

rebase #789 later

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.

2 participants