Skip to main content

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bitrep 0.4.1
File Size Uploaded
bitrep-0.4.1.tar.gz 170.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bitrep 0.4.1
File
bitrep-0.4.1-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
bitrep-0.4.1-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.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
bitrep-0.4.1-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
bitrep-0.4.1-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.1.tar.gz

Download URL bitrep-0.4.1.tar.gz
Size 170.9 kB
Tags Source
SHA-256 checksum
How to use checksums
8e17f09c815bb155ec6ab11dd76e3155f9dddc266a1cdf523051da925bd04e3d
BLAKE2b-256 checksum
How to use checksums
53c84931029d5b6d7db8bec0beb1034b1a2ddc41201759fc57ec5441bf319219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / bitrep-0.4.1-cp38-abi3-win_amd64.whl

Download URL bitrep-0.4.1-cp38-abi3-win_amd64.whl
Size 269.3 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
43a68c5a114417def2967d84148f6b98681deadafc39707ddadcf8f87818bbe4
BLAKE2b-256 checksum
How to use checksums
4bea56f5d1e09c048ed03bf3802c5a2360fb9090656f539ce6c62ae6510b5051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / bitrep-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bitrep-0.4.1-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
cc6e308a9bd726d1278ea0834d5cb78ec14d40383791d0e23c2034333d05a629
BLAKE2b-256 checksum
How to use checksums
6a76a40dc82772f89205f664d068b69d20042b9fc3639ced5a9050a329105968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / bitrep-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL bitrep-0.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 405.6 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
4d95d73c756e5015bd45f439082aa43d5c177934bb3d13b5fa36b798d6631ac1
BLAKE2b-256 checksum
How to use checksums
0d9377d9cb6fef063af3b5c3cd30141733476317748311a85670e409df9b0b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / bitrep-0.4.1-cp38-abi3-macosx_11_0_arm64.whl

Download URL bitrep-0.4.1-cp38-abi3-macosx_11_0_arm64.whl
Size 365.8 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c6d1f5c5e00666c22b4a7eb5be38438baa0d20d63cd837d9381fb3640fa6d388
BLAKE2b-256 checksum
How to use checksums
7514a0f14e3e4e552fe161d70b295b710d4a586a21671b22278ba44d06c44e0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release files / bitrep-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl

Download URL bitrep-0.4.1-cp38-abi3-macosx_10_12_x86_64.whl
Size 372.8 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f36b310bd8a877a8c1f99968c693292f46b7a5d7f9058db67bb27460777658da
BLAKE2b-256 checksum
How to use checksums
742aa6a029ad38d1adfbc1cb1743e0827c715360c136f43937d87961090f4aaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.14.1

Release history Release notifications | RSS feed

0.5.1

6 release files

0.5.0

6 release files

0.4.2

6 release files

This release

0.4.1 This release

6 release files

0.4.0

6 release files

0.2.1

6 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page