-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fix bug in blockRankedReduce #2226
Conversation
/ok to test |
1 similar comment
/ok to test |
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.
One suggestion, but the bug is fixed so I’ll approve.
: std::numeric_limits<T>::min(); | ||
// get the lower_bound of the type if it is a max op, | ||
// get the upper bound of the type if it is a min op | ||
val = reduce_op(lower_bound<T>(), upper_bound<T>()) == lower_bound<T>() ? upper_bound<T>() |
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.
It seems like the identity should be known at compile time rather than evaluating a max/min operation to determine the identity for the given operation.
/ok to test |
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.
Thanks Akif for the fix, LGTM.
It looks like that invalid values are flagged with -1 idx and lower or upper bound value. It would be good to extend the docstring with this expected behavior. But let's not hold the fix with this.
/ok to test |
/merge |
There was a bug appearing for negative floating point numbers with a max reduce operation. The
std::numeric_limits<T>::min()
is greater than the negative floating point values whereas we want it to be smaller than all representable values.This PR replaces the
min
with thelowest
.