fix: ignore NaN sign bits in filters - #9324
lance-gatefixer[bot] wants to merge 3 commits into
Conversation
|
Addressed in 3e35bc6: ordered literal comparisons remain scalar-indexable, including computed JSON paths, and mem-WAL combines the NaN guard into one exact range. The additional |
There was a problem hiding this comment.
The current head preserves scalar-index planning—including computed JSON paths—and gives mem-WAL an exact half-open < range while making NaN sign encodings compare equivalently.
The author has accepted the additional −∞ range cost. The remaining non-blocking performance exposure is recurring read-path work: ordered float-literal predicates add that range (> and >= may perform a second index search), and float column-to-column comparisons scan both operands through normalization UDFs, allocating when negative NaNs are present. Performance-sensitive adopters should benchmark representative float filters.
|
Blocked: PR #9324 still requires an approving review before it can merge. Remote head I revalidated every current Review and inline thread: there are no new actionable requests, and the existing App disposition remains later than the only prior author-facing performance concern. A maintainer can approve the PR; alternatively, Gatekeeper can issue its canonical approval if the documented non-blocking performance risk is acceptable. |
|
Blocked: PR #9324 still requires an approving review before it can merge. Remote head I revalidated all current Reviews, inline threads, and later external contributions: there are no new actionable requests, and the existing App disposition remains valid for the prior performance concern. A maintainer can approve the PR; alternatively, Gatekeeper can issue its canonical approval if the documented non-blocking performance risk is acceptable. |
Summary
Root cause
Arrow comparison and scalar-index kernels use total ordering, which places sign-bit-set NaNs below negative infinity while positive NaNs sort above finite values. Lance already rewrote signed-zero literals but did not normalize NaN signs, so logically equivalent NaNs produced different filter results.
Validation
cargo test -p lance-datafusioncargo test -p lance-index scalar::zonemap::tests::test_nan_zonemap_indexcargo test -p lance --test integration_tests --features slow_tests query::primitives::test_nan_sign_is_ignored_in_column_comparisonscargo test -p lance --test integration_tests --features slow_tests query::primitives::test_query_float_special_valuescargo test -p lance --test integration_tests --features slow_tests query::primitives::test_float_zero_predicate_uses_scalar_indexcargo fmt --all -- --checkcargo clippy --all --tests --benches -- -D warningsFixes #9315