hdf5plugin's Blosc (hdf5-blosc) failed with UnsupportedFilter(32001). The
new `blosc` feature decodes the Blosc 1 frame c-blosc 1.x writes: the
16-byte header, raw ("memcpyed") frames, the block table, blocks split
into one stream per byte plane (and the "do not split" flag), streams
stored raw, the byte shuffle and bit shuffle (whole 8-element groups, the
rest copied) - and every codec hdf5plugin offers: BloscLZ (implemented
here from c-blosc 1.21's blosclz_decompress, including its rejection of
malformed and truncated streams), LZ4/LZ4HC (lz4_flex), Snappy (snap),
Zlib (flate2) and Zstandard (ruzstd). Every stream must decode to exactly
its size and the frame to at most the chunk size; a frame of another
format version (Blosc 2) is a clear error.
It also encodes (DatasetBuilder::with_blosc(codec, level, shuffle)):
LZ4, Snappy, Zlib or Zstandard, with c-blosc's split rule, raw streams
where compression does not pay, and a stored frame for level 0 or
incompressible data. It cannot write BloscLZ (asking for it is an
error). `plugin-filters` enables LZF, bitshuffle, bzip2 and Blosc.
Interop: hdf5plugin writes all six codecs x {no, byte, bit} shuffle at
levels 5/9/1, plus level 0, over the 12-case matrix, read byte for byte;
our four codecs x four shuffle/level settings read back through
hdf5plugin. Both fail with the decoder removed. `cargo tree` with
`plugin-filters` has no -sys crate other than libbz2-rs-sys (pure Rust),
no cc and no cmake.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
82 lines
3.1 KiB
TOML
82 lines
3.1 KiB
TOML
[package]
|
|
name = "clawhdf5-format"
|
|
version = "2.7.0"
|
|
edition = "2024"
|
|
rust-version.workspace = true
|
|
description = "Pure-Rust HDF5 binary format parsing and writing — no C dependencies"
|
|
license = "MIT"
|
|
repository = "https://git.redclaw.dev/quantumclaw/clawhdf5"
|
|
readme = "README.md"
|
|
keywords = ["hdf5", "science", "data", "binary", "no-std"]
|
|
categories = ["parser-implementations", "science", "encoding", "no-std"]
|
|
|
|
[dependencies]
|
|
byteorder = { version = "1", default-features = false }
|
|
portable-atomic = { version = "1" }
|
|
flate2 = { version = "1", default-features = false, features = ["rust_backend"], optional = true }
|
|
sha2 = { version = "0.10", default-features = false, optional = true }
|
|
rayon = { version = "1", optional = true }
|
|
crc32fast = { version = "1", optional = true }
|
|
lz4_flex = { version = "0.11", optional = true }
|
|
zstd = { version = "0.13", optional = true }
|
|
blake3 = { version = "1", optional = true }
|
|
libaec-sys = { path = "../libaec-sys", version = "0.1", optional = true }
|
|
pco = { version = "1.0", optional = true }
|
|
# Pure-Rust Zstandard, for the plugin filters that embed zstd (bitshuffle,
|
|
# blosc). The `zstd` feature (filter 32015) links libzstd instead.
|
|
ruzstd = { version = "0.9", optional = true }
|
|
# bzip2 with its default backend, libbz2-rs-sys: a pure-Rust port of
|
|
# libbzip2 (no C is compiled, despite the -sys name).
|
|
bzip2 = { version = "0.6", optional = true }
|
|
snap = { version = "1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
half = { workspace = true }
|
|
serde_json = "1"
|
|
criterion = { workspace = true }
|
|
clawhdf5-derive = { path = "../clawhdf5-derive", version = "2.7.0" }
|
|
|
|
[[bench]]
|
|
name = "bench"
|
|
harness = false
|
|
|
|
[features]
|
|
# Deflate backend: `zlib-rs` (pure Rust) by default. `fast-deflate` selects
|
|
# zlib-ng instead (C, built with cmake); flate2 prefers a C zlib whenever one
|
|
# is enabled, so turning it on anywhere in the build overrides the default.
|
|
default = ["std", "checksum", "deflate", "provenance", "zlib-rs", "system-zlib-decompress", "lzf"]
|
|
std = []
|
|
checksum = []
|
|
deflate = ["flate2"]
|
|
provenance = ["sha2"]
|
|
parallel = ["rayon", "std"]
|
|
fast-checksum = ["crc32fast"]
|
|
fast-deflate = ["flate2/zlib-ng"]
|
|
system-zlib = ["flate2/zlib-default"]
|
|
system-zlib-decompress = []
|
|
# `runtime_detection` gives zlib-rs `std`, which it needs to detect and use
|
|
# SIMD at runtime. flate2 enables it by default, but we build flate2 with
|
|
# default-features = false, and without it zlib-rs inflates 3.5x slower.
|
|
zlib-rs = ["flate2/zlib-rs", "flate2/runtime_detection"]
|
|
lz4 = ["lz4_flex"]
|
|
zstd = ["dep:zstd"]
|
|
blake3_hash = ["blake3"]
|
|
szip = ["libaec-sys"]
|
|
pcodec = ["dep:pco"]
|
|
# Plugin filters, pure Rust. LZF (32000) is h5py's built-in compression; it
|
|
# has no dependencies, so it is on by default.
|
|
lzf = []
|
|
# Bitshuffle (32008), with its LZ4 and Zstandard modes.
|
|
bitshuffle = ["lz4_flex", "ruzstd"]
|
|
# bzip2 (307).
|
|
bzip2 = ["dep:bzip2", "std"]
|
|
# Blosc 1 (32001) with its BloscLZ, LZ4, Snappy, Zlib and Zstandard codecs.
|
|
blosc = ["lz4_flex", "ruzstd", "snap", "deflate", "std"]
|
|
# Every plugin filter above.
|
|
plugin-filters = ["lzf", "bitshuffle", "bzip2", "blosc"]
|
|
|
|
[[bench]]
|
|
name = "parallel_decompress_bench"
|
|
harness = false
|
|
required-features = ["parallel"]
|