cram.
Error-bounded lossy compression for scientific floating-point data. The bound you ask for is the bound you get, every byte is counted, and the decode is byte-identical on CPU, GPU and in your browser.
Measured
- 0.67–0.72× SPERR's bits at matched PSNR (60/80/100 dB) on 14 held-out SDRBench fields from four applications never used in tuning. It wins 54 of 55 PSNR points against the best external codec at each point (SPERR, TTHRESH, SZ3, ZFP).
- 24–28% fewer bits than the best KV-cache quantizer at matched perplexity (Δppl ≤ 0.1) on SmolLM2-135M and Qwen2.5-1.5B/7B, for storage, offload and transfer.
- Byte-identical decode across CPU, Metal, Vulkan and WebGPU/WASM, from one integer-only decode path, at ≈1–2 GB/s on a consumer GPU.
- Streams can carry their own decoder: a verified integer program in the tang IR, compiled per stream.
Use it
cargo add cram-codec
cram is built on tang and was formerly named tang-compress. It is MIT OR Apache-2.0. Every number above traces to a report in the repository. Not to be confused with the CRAM genomics format.