Do not admit a large Float64 remainder from engine agreement alone
Build an independent reference from the integer identity. Numerical-path differences can arise even without NaN inputs.
A reference for a finite remainder
Derive the remainder from the input and modulo definition before admitting a result from engine agreement. Two engines can agree on a wrong answer, and a difference alone does not appoint either as the reference. A finite output is only the start of the check. The Truthound comparison uses a table joining the independent integer-identity remainder with actual engine output. [1, 2, 3]
The reported CPU–GPU difference
Polars #30398 reports CPU Float64 1e20 % 3.0 returning 0.0 while GPU and Python controls return 1.0. A follow-up describes quotient rounding and the multiply–subtract path. That diagnosis and its proposed alternative do not validate every Float64 input. [1]
Start with input representability
Record original values, dtypes, modulo semantics, and engine. Reconcile with an independently exact reference and withhold failures from cyclic or interval assignments. First verify representability of the original integer as the relevant Float64 value, retaining the input losslessly. [1, 3]
An independent quotient–remainder identity
The illustrative exact identity is 100000000000000000000=3×33333333333333333333+1. Its remainder is independently 1. After confirming that the Float64 input exactly represents that integer, actual remainder 1 passes and 0 fails. The identity is an integer reference, not a floating quotient calculation. [1, 3]
Check prepared remainder pairs
ColumnPairValidator in Truthound Python SDK 3.3.2 reconciles observed_remainder and independently_derived_remainder prepared by the operator. Exact representation and modulo definitions are established externally. Core does not repair floating division or establish correctness of all CPU or GPU modulo operations. [1, 2, 3]
The range of an exact-integer path
Test exact-integer computation where applicable or another verified engine, evaluating conversion range and cost. Existing regressions for the same input region reduce the benefit of another audit. Changing types must not silently change the original number or remainder policy. [1, 3]
Application conditions
Verify exact Float64 input representation and modulo semantics, deriving an independent integer reference.
Alternatives
Test the range and cost of an applicable exact-integer path or another verified engine.
Limitations
One matching remainder does not establish all CPU and GPU modulo operations.
Evidence
- Event checked
- Subject checked
- Modified
