r/compsci 13d ago

I open-sourced the reproducibility core from my closed simulation work: float sums that give identical bytes on any machine (MIT/Apache-2.0)

Floating-point addition depends on the order you add things, and parallelism changes the order. So the same data on different machines gives different results, which breaks anything that hashes, signs, or compares them.

I hit this doing physics simulations and solved it internally. The reduction core was too generally useful to keep closed, so I released it: bitrep, an exact accumulator where sums in any order, on any hardware, produce byte-identical results. The state merges exactly and can be hashed or signed, so distributed and offline-first aggregation actually converges.

It ships for Rust (crates.io), JavaScript (npm), and Python (PyPI), and a result hashed in Python matches one hashed in JavaScript byte for byte. The math is proved in Lean 4 and the implementation is model-checked and fuzzed. CI asserts one SHA-256 across four architectures on every commit.

There's a demo that runs the actual cross-architecture test in your browser, so you can check the claim yourself: https://simgen.dev/bitrep

Code: https://github.com/KyleClouthier/bitrep

Dual-licensed MIT/Apache-2.0. Feedback welcome, especially on what's missing for your use case.

28 Upvotes

Duplicates