-
Notifications
You must be signed in to change notification settings - Fork 115
Add checked arithmetic compute #5096
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: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // TODO(ngates): should we automatically cast non-null to nullable if required? | ||
| assert!(matches!(lhs.dtype(), DType::Primitive(..))); | ||
| assert_eq!(lhs.dtype(), rhs.dtype()); |
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.
This is just a question: how do we handle add where values can be null currently? Do we even need to worry about this if we are just taking the OR of the masks?
| #[allow(clippy::mem_forget)] | ||
| static ENCODINGS: LazyLock<EnumMap<ArithmeticOperator, EncodingRef>> = LazyLock::new(|| { | ||
| enum_map! { | ||
| operator => ArithmeticEncoding { operator }.to_encoding(), | ||
| } | ||
| }); |
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.
I'm not sure I understand the purpose of this? Could you instead just implement From<ArithmeticOperator> for ArithmeticEncoding?
| fn array_hash<H: Hasher>(array: &ArithmeticArray, state: &mut H, precision: Precision) { | ||
| array.lhs.array_hash(state, precision); | ||
| array.rhs.array_hash(state, precision); | ||
| } |
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.
Also hash the encoding since it contains which operation?
Signed-off-by: Nicholas Gates <nick@nickgates.com>
connortsui20
left a comment
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.
LGTM
Signed-off-by: Nicholas Gates <nick@nickgates.com>
FLUPs: