Expand description
Deterministic computation primitives for CJC.
This crate provides the foundational building blocks that guarantee bit-identical results across runs, platforms, and thread counts:
Rng– a SplitMix64 PRNG with explicit seed threading. Same seed produces the identical sequence on every platform.KahanAccumulatorF64/KahanAccumulatorF32– incremental compensated-summation accumulators (re-exported from thekahanmodule).kahan_sum_f64/kahan_sum_f32– one-shot compensated summation over slices.pairwise_sum_f64– recursive pairwise summation that falls back to Kahan summation for leaves of 32 elements or fewer.ReproConfig– a lightweight toggle that carries the reproducibility seed through the compiler pipeline.
§Determinism contract
All primitives in this crate are serial and deterministic. When the same inputs are provided in the same order, the output is bit-for-bit identical regardless of the host platform, compiler version, or OS.
No HashMap, no FMA, no non-deterministic SIMD reductions.
Re-exports§
pub use kahan::KahanAccumulatorF32;pub use kahan::KahanAccumulatorF64;pub use kahan::KahanAccumulatorF64x4;pub use kahan::KahanAccumulatorF64x8;
Modules§
- kahan
- Kahan Summation — Scalar-tier deterministic reduction.
Structs§
- Repro
Config - Configuration that controls whether deterministic reproducibility is active.
- Rng
- Deterministic pseudo-random number generator using the SplitMix64 algorithm.
Functions§
- kahan_
sum_ f32 - Computes the sum of a slice of
f32values using Kahan compensated summation. - kahan_
sum_ f64 - Computes the sum of a slice of
f64values using Kahan compensated summation. - pairwise_
sum_ f64 - Computes the sum of a slice of
f64values using recursive pairwise summation.