Match Arrow totalOrder float comparison in the CUDA filter kernel and add NaN and -0.0 rows to conformance

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
44/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, databases

Direzione di ricerca

Read the CPU comparison in crates/oxidelake-device/src/cpu/kernels.rs:82-88 and the CUDA filter in crates/oxidelake-device/kernels/cuda/filter_project.cu:57-62, then inspect the conformance fixtures in crates/oxidelake-compute/tests/conformance.rs:41-43. Add rows covering NaN, signed zero, and infinities, and check Float64 MIN/MAX against DataFusion; done means CPU, Metal, and CUDA conformance passes with matching semantics.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Today — the CPU reference compares Float64 with Arrow's cmp::eq/lt/… (crates/oxidelake-device/src/cpu/kernels.rs:82-88), which Arrow documents as IEEE 754 totalOrder ("treats positive and negative zeros as different", arrow-ord-58.4.0/src/cmp.rs:72-75; is_eq is total_cmp(..).is_eq()). The CUDA kernel is plain IEEE arithmetic:

// crates/oxidelake-device/kernels/cuda/filter_project.cu:57-62
case 0: r = v == literal; break;
case 1: r = v <  literal; break;

So for a Float64 column: v > 4.0 is true for NaN on CPU/DataFusion (NaN is greatest in total order) and false on CUDA; v = 0.0 on a -0.0 value is false on CPU and true on CUDA. The conformance fixtures cannot see it: v is f64::from(rng.random_range(0..40)) / 4.0 (crates/oxidelake-compute/tests/conformance.rs:41-43) and datagen's v is u32 % 100 / 4.0 — no NaN, no negative zero, no infinities.

Why it is worth fixing — a GPU-planned filter silently returns different rows from the CPU reference on real float data (NaN is common in analytics). This is exactly the divergence ADR-0012's conformance suite exists to catch, and it is invisible to it today.

Fix — implement total order on device by comparing sign-adjusted bit patterns (__double_as_longlong, flip the low bits for negatives) in filter_project.cu; Metal is Int64-only and unaffected. Add NaN, -0.0, +0.0, ±inf rows to gen_left/gen_right and to oxide gen-data (behind a flag) so every backend is pinned. Also check MIN/MAX(Float64) in cpu/kernels.rs:401-402 (f64::min/max) against DataFusion's stock semantics for NaN — same fixture gap.

Done when — conformance on CPU, Metal and CUDA (the latter in the on-demand GPU job) passes with the new rows; the CPU reference and stock DataFusion agree on MIN/MAX with NaN present.

Lingua principale
Rust
Stelle
1
Fork
2
Merge medio
1g 11h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vyncint/oxidelake

Tutte le issue di vyncint/oxidelake

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.