You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 15eaa9f
Browse filesBrowse the repository at this point in the historyBrowse files
fix: expand float fuzz coverage and correct discovered inconsistencies (apache#24433)
## Which issue does this PR close?
- Closesapache#24431.
- Closesapache#24432.
## Rationale for this change
Two floating-point edge cases produced inconsistent results:
- `ScalarValue::eq_array` used IEEE equality for floats, while
`ScalarValue` equality uses bit representations. An identical NaN
therefore compared unequal, while `+0.0` and `-0.0` compared equal.
- Grouped floating-point `MIN` and `MAX` used partial ordering. With
NaNs or signed zeros, results could depend on input order, batching, or
partitioning and disagree with the non-grouped accumulators.
Both issues were exposed by generating special floating-point values in
fuzz data and adding fuzz coverage for `ScalarValue` array conversions.
## What changes are included in this PR?
- Generate `+0.0`, `-0.0`, positive and negative infinities, and NaNs
with varied signs and payloads in random Float32 and Float64 test data.
- Add fuzz coverage checking consistency and round trips among
`ScalarValue::try_from_array`, `eq_array`, `to_array`, and
`iter_to_array` across supported array types and sliced arrays.
- Make Float16, Float32, and Float64 `ScalarValue::eq_array` comparisons
use the same bitwise equality as `ScalarValue::PartialEq`.
- Make grouped Float16, Float32, and Float64 `MIN`/`MAX` use total
ordering and total-order extrema as their initial accumulator values.
## Are these changes tested?
Yes. The existing `scalar_eq_array` test now covers NaNs and signed
zeros. New deterministic grouped-accumulator tests cover positive and
negative NaNs, signed zeros, and the total-order sentinel values. The
scalar conversion and aggregation fuzz tests cover the same paths across
randomized arrays and execution configurations.
## Are there any user-facing changes?
Yes. `ScalarValue::eq_array` now uses bitwise float equality, and
grouped floating-point `MIN` and `MAX` now return deterministic results
consistent with DataFusion's existing total-order semantics. There are
no API signature changes.
0 commit comments