bitrep

Any order. Any hardware. Same bits. — fp64 fixes your decisions. It can't fix your hashes.

Floating-point addition isn't associative, so the order of a sum changes the answer — and parallelism, sharding and batch size all change the order. bitrep is a Rust crate whose accumulator state is exact and order-invariant by construction, so the result — and its bytes — are identical everywhere. On every commit, CI computes a hostile 11,007-element reference sum on four architectures and asserts one SHA-256.

1  Your device is the fifth architecture

This button sums the same 11,007 hostile values (600 decades of magnitude, subnormals, exact cancellations) with the same crate, compiled to WebAssembly, on your device, right now — then hashes the 289-byte accumulator state.

whereSHA-256 of the accumulator state
x86-64 Linux (CI)54f3ce5fbbd6130d70db87dffe73c26160b0d99a6f92f9dd3b276a99bb9f8441
ARM64 macOS (CI)54f3ce5fbbd6130d70db87dffe73c26160b0d99a6f92f9dd3b276a99bb9f8441
x86-64 Windows (CI)54f3ce5fbbd6130d70db87dffe73c26160b0d99a6f92f9dd3b276a99bb9f8441
wasm32 (CI)54f3ce5fbbd6130d70db87dffe73c26160b0d99a6f92f9dd3b276a99bb9f8441
this device

2  Reorder it. Shard it. The bytes don't move.

Shuffle the dataset and split it into shards summed separately then merged in random order — the accumulator bytes (and hash) never change. The naive f64 sum of the same numbers does.

value (all 64 bits)state hash
bitrep
naive f64no canonical state to hash

3  Merge across devices

Accumulators serialize to 289 bytes and merge exactly. Open this page on another device (a phone is another architecture), press Export second half there, and paste the state here. This device sums only the first half, merges your pasted state, and — if the property holds — reproduces the full reference hash above, byte for byte, across two machines that never met.

merged state hash: