From 056092b08200d730d3d989e4acc461295cefd74c Mon Sep 17 00:00:00 2001 From: osobh Date: Sat, 26 Sep 2026 00:13:50 -0500 Subject: [PATCH] ci: lint and test the plugin filters; the conformance probe reads them scripts/ci-test.sh: the format feature matrix (clippy and tests) adds plugin-filters; bitshuffle, bzip2 and blosc are each linted alone (blosc and bitshuffle share code); the facade is linted with plugin-filters; and the interop section runs tests/plugin_filters_interop.rs with it, against h5py + hdf5plugin (CI's venv already installs hdf5plugin). conformance/probe enables plugin-filters. Sweep (tank, 2026-09-26, conformance/run.sh --no-fetch against the cached corpus): 573 of 697 ok (baseline 569), no regressions; newly ok: h5ex_d_blosc.h5, h5ex_d_bshuf.h5, h5ex_d_bzip2.h5, h5ex_d_lzf.h5. h5ex_d_blosc2.h5 and h5ex_d_zfp.h5 remain UnsupportedFilter. Co-Authored-By: Claude Opus 5.5 (1M context) --- conformance/probe/Cargo.lock | 33 +++++++++++++++++++++++++++++++++ conformance/probe/Cargo.toml | 2 +- scripts/ci-test.sh | 26 ++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/conformance/probe/Cargo.lock b/conformance/probe/Cargo.lock index 0ffb1f7..964e0ab 100644 --- a/conformance/probe/Cargo.lock +++ b/conformance/probe/Cargo.lock @@ -29,6 +29,15 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bzip2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c" +dependencies = [ + "libbz2-rs-sys", +] + [[package]] name = "cc" version = "1.5.1" @@ -52,12 +61,15 @@ name = "clawhdf5-format" version = "2.7.0" dependencies = [ "byteorder", + "bzip2", "flate2", "libaec-sys", "lz4_flex", "pco", "portable-atomic", + "ruzstd", "sha2", + "snap", "zstd", ] @@ -192,6 +204,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libbz2-rs-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c" + [[package]] name = "libc" version = "0.2.189" @@ -286,6 +304,15 @@ dependencies = [ "rand_core", ] +[[package]] +name = "ruzstd" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a252f5e20f038fe7b4ea53e073e65398d652c864cc162fc77c56c2f13717b888" +dependencies = [ + "twox-hash", +] + [[package]] name = "serde" version = "1.0.229" @@ -351,6 +378,12 @@ version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" +[[package]] +name = "snap" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199905e6153d6405f9728fe44daace35f8f837bbf830bb6e85fbd5828709a886" + [[package]] name = "syn" version = "2.0.119" diff --git a/conformance/probe/Cargo.toml b/conformance/probe/Cargo.toml index f5c68af..62470b2 100644 --- a/conformance/probe/Cargo.toml +++ b/conformance/probe/Cargo.toml @@ -12,7 +12,7 @@ description = "Walks an HDF5 file with clawhdf5-format and prints a canonical JS [workspace] [dependencies] -clawhdf5-format = { path = "../../crates/clawhdf5-format", features = ["lz4", "zstd", "szip", "pcodec"] } +clawhdf5-format = { path = "../../crates/clawhdf5-format", features = ["lz4", "zstd", "szip", "pcodec", "plugin-filters"] } serde_json = "1" sha2 = "0.10" diff --git a/scripts/ci-test.sh b/scripts/ci-test.sh index 1d7a7f9..dedb2b4 100755 --- a/scripts/ci-test.sh +++ b/scripts/ci-test.sh @@ -64,10 +64,29 @@ run_step "cargo clippy --all-targets" cargo clippy \ # 3. Clippy over clawhdf5-format's optional features, which the default # workspace build never compiles (szip is left out: it needs libaec). +# plugin-filters = bitshuffle, bzip2, blosc (and the default-on lzf). run_step "cargo clippy (format feature matrix)" cargo clippy \ -p clawhdf5-format \ --all-targets \ - --features parallel,lz4,zstd,pcodec,fast-checksum \ + --features parallel,lz4,zstd,pcodec,fast-checksum,plugin-filters \ + -- -D warnings + +# Each plugin filter alone, so none of them leans on another's +# dependencies (bitshuffle and blosc share code). +plugin_filters_alone() { + local f + for f in bitshuffle bzip2 blosc; do + echo "--- $f" + cargo clippy -p clawhdf5-format --all-targets --features "$f" -- -D warnings || return 1 + done +} +run_step "cargo clippy (each plugin filter alone)" plugin_filters_alone + +# The facade's plugin-filter interop tests only build with the features on. +run_step "cargo clippy (facade plugin filters)" cargo clippy \ + -p clawhdf5 \ + --all-targets \ + --features plugin-filters \ -- -D warnings # The HNSW index's parallel bulk build is feature-gated too. @@ -128,7 +147,7 @@ run_step "cargo test" cargo test \ run_step "cargo test (format feature matrix)" cargo test \ -p clawhdf5-format \ - --features parallel,lz4,zstd,pcodec,fast-checksum + --features parallel,lz4,zstd,pcodec,fast-checksum,plugin-filters run_step "cargo test (ann parallel)" cargo test \ -p clawhdf5-ann \ @@ -149,6 +168,9 @@ if "$PYTHON" -c "import h5py" >/dev/null 2>&1 || [ "${CLAWHDF5_REQUIRE_INTEROP:- # libhdf5's registered plugins) compile and run too. run_step "h5py interop (format, ignored tests)" cargo test \ -p clawhdf5-format --features lz4,zstd --test writer_h5py_tests -- --include-ignored + # LZF, bitshuffle, bzip2 and Blosc both ways against h5py + hdf5plugin. + run_step "h5py interop (plugin filters)" cargo test \ + -p clawhdf5 --features plugin-filters --test plugin_filters_interop else echo "" echo "==> [h5py interop] SKIPPED: no h5py in $PYTHON"