A port of the zfp 1.0.1 decoder and of H5Z-ZFP 1.1.1's decompression path behind a new `zfp` feature (in `plugin-filters`): every mode (fixed rate, precision, accuracy, reversible, expert), int32, int64, float and double, 1-4 dimensional fields with partial blocks, and headers written big-endian (values byte-swapped as H5Z-ZFP does). H5Z-ZFP keeps the zfp header in cd_values (version word, then the magic/metadata/mode bit stream); each chunk is the bare stream. The decoder reproduces libzfp bit for bit: integer arithmetic wraps as libzfp's, block exponents scale by exact powers of two, and the mode goes through zfp_stream_mode as H5Z-ZFP hands it to zfp. A stream that ends early is an error (libzfp reads past its buffer), as is a field whose size is not the chunk's; the output is allocated only once the stream holds a bit per block. Tests: header/mode unit tests, and a counting-allocator fuzz of random headers (expert parameters at their edges) and streams. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
clawhdf5-format
Pure-Rust HDF5 binary format parsing and writing — no C dependencies.
Features
- Zero-copy superblock, object header, and B-tree parsing
- Chunked dataset read/write with filter pipelines
no_stdsupport (disablestdfeature)- Optional parallel reads via Rayon
- SHA-256 provenance tracking
Usage
use clawhdf5_format::Superblock;
let data = std::fs::read("data.h5").unwrap();
let sb = Superblock::from_bytes(&data).unwrap();
println!("HDF5 version {}.{}", sb.version_major(), sb.version_minor());
License
MIT