A chunked layout records the element size as its last dimension, and libhdf5 refuses a dataset whose datatype has another size (H5D__chunk_set_sizes: "stored datatype size in chunk layout does not match datatype description"). clawhdf5 ignored the recorded size and read the chunks anyway, for v3 and v4 layouts. The check runs on every chunked read (read_chunked_data*, read_raw_data_selection) and compares against the stored size: a variable-length element is 4 + offset size + 4 bytes, not Datatype::type_size's 16. 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