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 — with the v0.5 exact tier:
regression_exact() for correctly rounded coefficients and sub() for exact
downdating/unlearning, plus SumF64.try_unmerge), 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.5.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.5.0.tar.gz | 179.2 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bitrep-0.5.0-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| bitrep-0.5.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.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bitrep-0.5.0-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| bitrep-0.5.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.5.0.tar.gz
| Download URL | bitrep-0.5.0.tar.gz |
|---|---|
| Size | 179.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e43450ba650f55795f178d2f95a91c7baca15d84dad8bdbdc819dcda7d85f90
|
|
BLAKE2b-256 checksum How to use checksums |
f14b0a0f23ff2467a29908101789d186a16269783407fdbd002df60b7bc38b52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.5.0-cp38-abi3-win_amd64.whl
| Download URL | bitrep-0.5.0-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 279.7 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
15920b0b4ae66d5d45fe718c27b16124cfad0bff4a6f1fe429d0095ab2c3ae2a
|
|
BLAKE2b-256 checksum How to use checksums |
44bc932115eb95b2ff48ae7293eaa3498521ea1314b9b0a2fc4208336d7b1bd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bitrep-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 420.6 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
351f71787080e5d98bafc9790e287756bd61d61f77eef1cc485a462335e8cdb5
|
|
BLAKE2b-256 checksum How to use checksums |
fb8ce724cdc1b818a24735e0a35e980c8d598727a8b79ce5d420c4c9b83690c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bitrep-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 418.0 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
6580497e9e4e46c25d690f61075f51d5f0ea2d1478ca94dd005fa74c00c167c4
|
|
BLAKE2b-256 checksum How to use checksums |
85d7b449e5501f700dc6850056e68eb97102dd6d8b61ff2c119c454e1984d6bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | bitrep-0.5.0-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 368.7 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3535ab12e885fa861291081e466432d42818688ff811935fd5db38844fd01cad
|
|
BLAKE2b-256 checksum How to use checksums |
3f3e9649c003c01ed343828935467875670aad8dfcee920fe980de0ba43a4283
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / bitrep-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | bitrep-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 375.1 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
18b8bd8f699550af281847b72c742d3d00962f2284a12ebd5222526b626eb0c0
|
|
BLAKE2b-256 checksum How to use checksums |
9d12a3ec9f2063fb3d40be99016b80f8b2e168ac9e6aaf195a377f775811e50e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|