bitrep (Python)
Exact, order-invariant, bit-identical floating-point reductions and CRDTs —
a thin Python binding over the Rust bitrep
engine, so every result is the same across any machine, any merge order, any
sharding.
pip install bitrep
import bitrep
# Exact sum — naive float gives 0.0; this gives 1.0, and it's order-invariant.
s = bitrep.SumF64()
for x in (1e16, 1.0, -1e16):
s.add(x)
print(s.value()) # 1.0
# Exactly-rounded statistics
m = bitrep.MomentsF64()
for x in (2, 4, 4, 4, 5, 5, 7, 9):
m.add(x)
print(m.mean(), m.variance(), m.count()) # 5.0 4.0 8
# Receipt: same multiset -> same 32-byte hash, regardless of order.
print(s.state_hash().hex())
# CRDT map that converges without a coordinator
a = bitrep.SumMap(); a.add("k", 1.5); a.add("k", 2.5)
b = bitrep.SumMap(); b.add("k", 2.5); b.add("k", 1.5)
a.merge(b) # idempotent, order-invariant
What's included
Exact accumulators (SumF64, SumF32, FastSumF64), exact dot product
(DotF64, dot), convergent statistics (MomentsF64, Moments4F64 with
skewness/kurtosis, CovF64 regression, WeightedMomentsF64, PnMomentsF64
retractable, CovMatrixF64 multiple regression), HistogramF64 (exact counts +
honest quantile bounds), ExtremaF64, signed receipts (state_hash), and the
CRDT layer (SumMap, MomentsMap, ReplicatedSum, DeltasSum).
The convergence laws of the core are machine-checked in Lean 4. See the main repository for proofs, the Rust crate, and the paper.
License: MIT OR Apache-2.0.
Metadata
Release files for bitrep 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bitrep-0.4.2.tar.gz | 171.1 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bitrep-0.4.2-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| bitrep-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| bitrep-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bitrep-0.4.2-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| bitrep-0.4.2-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 2.0 MB
Release files / bitrep-0.4.2.tar.gz
| Download URL | bitrep-0.4.2.tar.gz |
|---|---|
| Size | 171.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
639f67b93183660c59a483b449c0179edddc558d59d1556b94692d267b21a5e7
|
|
BLAKE2b-256 checksum How to use checksums |
c5511fed689472060f2d231568ff5b1b49c3ecc476419691500b7e598dbe5e86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.2-cp38-abi3-win_amd64.whl
| Download URL | bitrep-0.4.2-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 270.3 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6723608d06ef7bdcd78fa6a5098d11e2e91a0db0507e7e1172e559074e5c3f96
|
|
BLAKE2b-256 checksum How to use checksums |
c64fe45cf64a7e4cc6be55a4b9cb8d3f7e5e450c336862b6154d2ad95af39cb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bitrep-0.4.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 410.7 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
fd2a29073ea4b3d2b1cfd1b697eb728867e7af400a391eec9c29d40dcca69c6b
|
|
BLAKE2b-256 checksum How to use checksums |
cf0f03424e8d9c7ec5e460884324345547961017348767477183596b2d43ea62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bitrep-0.4.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 406.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
751f7b2d2367942f527059ee5643467ef150e5346da05af9f9ed485ebf98e6b6
|
|
BLAKE2b-256 checksum How to use checksums |
9d7b3501c9462a193d9aedb2f0894cae4349e002b13734116b88be8f44d0c09a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.2-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | bitrep-0.4.2-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 367.1 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
353ba5dd9947ef5f9c66ae52a11c189cfde86e8c4555bbe6cc8369168091be1b
|
|
BLAKE2b-256 checksum How to use checksums |
32a8f8bba870048dd8ab5e277702ef257cd7209388ba583aa4d3b4fcfb6370c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.2-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | bitrep-0.4.2-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 373.8 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
efe144b6ebc3c5ade1a44977dcf018510391373b721bad9260d9a4cd99abe0ef
|
|
BLAKE2b-256 checksum How to use checksums |
25330dba28e4cbf69b8b458b5b310a8f1483ce8b89e2095fb5b4d13247b1b869
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|