Floating-Point and Numerical Reproducibility
The same code can give slightly different answers on different hardware; reproducibility requires understanding and bounding that variation.
Why the Last Digits Move
Run the same program on two machines and the results can differ in the last few digits. Floating-point arithmetic is not associative, so the order in which operations execute changes the rounding. Parallel reductions, vectorized instructions, compiler optimizations, and different math libraries all reorder operations, and each reordering perturbs the result at the round-off level.
Common Causes
- Parallel sums that combine partial results in a non-deterministic order.
- Compiler optimizations that reassociate or fuse operations.
- Different implementations of transcendental functions across libraries.
- Fused multiply-add instructions available on some hardware but not others.
Two Standards of Reproducibility
This forces a distinction. Bit-for-bit reproducibility demands identical output to the last bit, achievable only by pinning hardware, compiler, libraries, and often disabling optimizations. Reproducibility within tolerance accepts differences at the round-off level, requiring only that the science-level result agree. Most scientific work targets the second standard, because the first is fragile and expensive, but the standard being used must be stated.
Making It Manageable
The practical approach captures the environment, compiler and library versions and flags, so that a reproduction attempt runs in a known configuration. Regression tests compare with a tolerance tied to the expected round-off variation, not to exact equality, so that a harmless hardware difference does not raise a false alarm while a real regression still does. Deterministic parallel reductions can be used where bit-reproducibility genuinely matters.
Kronos uses exactly this framing in its reproducibility record: a two-tier standard that separates byte-for-byte reproduction from reproduction within tolerance, so a reader knows which to expect for a given result and is not surprised when the last digits differ across machines.