Metraipolis › archive › dc_e173644f8cd6

Bounded, Indeterminate, or a Bug: A Condition-Aware Oracle for Differential Testing of SQL Aggregates — arXiv:2609.00381

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.00381
License (as archived)
CC0-1.0
Archived
2026-10-17T06:57:09.401Z
SHA-256 of the archived text
881a5969de35e2708533bdcf9bdbb22561ce92ac8d09540b6e78b7172b827c48
Stable URL of this page
https://metraipolis.com/documento/dc_e173644f8cd6

How to cite

Bounded, Indeterminate, or a Bug: A Condition-Aware Oracle for Differential Testing of SQL Aggregates — arXiv:2609.00381 — arXiv (en), https://arxiv.org/abs/2609.00381 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_e173644f8cd6 (Metraipolis archive dc_e173644f8cd6, sha256 881a5969de35e2708533bdcf9bdbb22561ce92ac8d09540b6e78b7172b827c48)
BibTeX
@misc{dce173644f8cd6,
  title = {Bounded, Indeterminate, or a Bug: A Condition-Aware Oracle for Differential Testing of SQL Aggregates — arXiv:2609.00381},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.00381},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_e173644f8cd6; sha256 881a5969de35e2708533bdcf9bdbb22561ce92ac8d09540b6e78b7172b827c48},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.00381. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Differential database testing compares results across engines and calls a discrepancy a bug. For floating-point aggregates this is unsound: engines legitimately disagree because floating-point arithmetic is not associative. Practice patches this with an epsilon; the leading oracles avoid floating point entirely. We give the oracle this practice lacks, and show its decisive quantity is not the query but the engine's algorithm. Ground truth is the exact rational value of the stored doubles -- arithmetic, not another engine -- and each discrepancy is classified exact, bounded, or indeterminate. The relative error of an aggregate f under an algorithm A obeys rel_err <= C_A(n,u) * kappa_f^p, so the testability boundary, beyond which no oracle can separate a bug from rounding, is kappa*_{f,A} = (1/C_A)^{1/p}. SUM and AVG are the linear case p=1; variance is p=2 for the one-pass algorithm and p=1 for Welford. Across eight engines in four classes the measured exponent recovers each algorithm, and ClickHouse is the lone one-pass engine (p=2.05); engine-wide, it returns zero standard deviation, NaN correlation and wrong-sign regression, while every other engine stays exact and the vendor ships the Welford fix. Its variance is untestable at a condition number 10^6 below SUM's, which ordinary storage conventions (epoch-nanosecond timestamps, tight sensors) cross -- there ClickHouse errs by 2100%. A randomised hunt of 360 tests finds zero anomalies, evidence the oracle is sound. Code and data are public.

Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-02 in cs.SE).
Categorie arXiv: Databases (cs.DB) ; Software Engineering (cs.SE).
Pagina del lavoro: https://arxiv.org/abs/2609.00381 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-17T06:43:00.625Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-09-02?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).