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()) # 5.0 4.0
# 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.0
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.0.tar.gz | 170.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bitrep-0.4.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| bitrep-0.4.0-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.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bitrep-0.4.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| bitrep-0.4.0-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.0.tar.gz
| Download URL | bitrep-0.4.0.tar.gz |
|---|---|
| Size | 170.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
16b616e89a2b9821f54af754d465795ee95ada4fa85d3c896682f9c06fc2d5dc
|
|
BLAKE2b-256 checksum How to use checksums |
06c3f2683e82ee6307945ea1a912cf2d7cc173c8a9eb447c90c2c47be788d4dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.0-cp38-abi3-win_amd64.whl
| Download URL | bitrep-0.4.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 269.3 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b8ea50a0dfb8d889849526b89086ebc47378daac55649357c1acbdcfccfa2b87
|
|
BLAKE2b-256 checksum How to use checksums |
108ab023c0d395e9485f77807c9316714c9add7357f50bc16f5c7a846f063df0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bitrep-0.4.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 409.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
70bf88ab8fc675385c6efc575195d46da944513cbb4b761c0127430fb7e88f3b
|
|
BLAKE2b-256 checksum How to use checksums |
b23009b5de968599784412e8df258452b64c56f7fbc826147f3e3b584aea0d5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bitrep-0.4.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 405.8 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
947e4536fd6f0a50a3ab834fc4422e97a9e54ed34a43fe1afcca240d9c8e829c
|
|
BLAKE2b-256 checksum How to use checksums |
0eafb5bd704e9c2fb29105342fc0851be83ea0831270fb9718c2ed9ba6399739
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | bitrep-0.4.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 365.9 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e78928a148a30c59484f963403d0b871f793f8ef5e43557493009ae3167267af
|
|
BLAKE2b-256 checksum How to use checksums |
f9ba6a865bce996e4df609f874ec875c34bef578852438c7fd7d39eb46b05e28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.4.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | bitrep-0.4.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 372.7 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
1218ce639249b7c3d8b4d36f029d5d3b31493fbe6d7ae4b6d236acc04c0cc4bf
|
|
BLAKE2b-256 checksum How to use checksums |
80f61be062f5e05e6cce870923b2c596b406901e245808c63cdd27ba9b687904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|