ci: lint all targets, run interop suites for real, compile benches

- clippy --all-targets plus a clawhdf5-format feature matrix (parallel, lz4,
  zstd, pcodec, fast-checksum); fix the accumulated lint backlog in test,
  bench and feature-gated code (no behaviour changes).
- Install python3 + h5py/numpy/netCDF4/xarray in the CI container and set
  CLAWHDF5_REQUIRE_INTEROP=1, which makes a missing interop dependency a test
  failure. Every h5py/netCDF4 interop test used to skip silently in CI. Run
  the #[ignore]d writer_h5py_tests suite explicitly.
- cargo bench --no-run so benches can't rot; fix bench.rs and memory_bench.rs,
  which no longer compiled against the current strategy/consolidation APIs.
- Optional fuzz smoke run via CLAWHDF5_FUZZ_SECONDS.
- CHANGELOG and docs/known-issues.md updated.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
osobh
2026-09-19 05:36:22 -07:00
co-authored by Claude Fable 5.1
parent 706189c3ef
commit bbe1baa208
30 changed files with 588 additions and 405 deletions
+4 -7
View File
@@ -469,13 +469,10 @@ mod tests {
let ds = file.dataset("data").unwrap();
// Zero-copy should succeed for contiguous LE f64 on mmap
match ds.read_f64_zerocopy() {
Ok(slice) => {
assert_eq!(slice, &original[..]);
assert_eq!(slice, &ds.read_f64().unwrap()[..]);
}
Err(_) => {} // alignment issue, acceptable
}
if let Ok(slice) = ds.read_f64_zerocopy() {
assert_eq!(slice, &original[..]);
assert_eq!(slice, &ds.read_f64().unwrap()[..]);
} // else: alignment issue, acceptable
assert_eq!(ds.read_f64().unwrap(), original);
std::fs::remove_file(&path).ok();
@@ -10,6 +10,12 @@ use clawhdf5::{AttrValue, CompoundTypeBuilder, DType, File, FileBuilder};
// Helpers
// ---------------------------------------------------------------------------
/// When `CLAWHDF5_REQUIRE_INTEROP=1` (set in CI), a missing Python dependency
/// is a test failure instead of a silent skip.
fn interop_required() -> bool {
std::env::var("CLAWHDF5_REQUIRE_INTEROP").is_ok_and(|v| v == "1")
}
fn python_available() -> bool {
Command::new("python3")
.args(["-c", "import h5py; print(h5py.__version__)"])
@@ -21,6 +27,10 @@ fn python_available() -> bool {
macro_rules! skip_if_no_python {
() => {
if !python_available() {
assert!(
!interop_required(),
"CLAWHDF5_REQUIRE_INTEROP=1 but python3 with h5py is not available"
);
eprintln!("SKIP: python3 with h5py not available");
return;
}
+4 -2
View File
@@ -955,8 +955,10 @@ fn read_selection_all_matches_read_raw_on_chunked_dataset() {
let via_read_f64 = ds.read_f64().unwrap();
let via_selection_bytes = ds.read_selection(&Selection::All).unwrap();
let via_selection: Vec<f64> = via_selection_bytes
.chunks_exact(8)
.map(|c| f64::from_le_bytes(c.try_into().unwrap()))
.as_chunks::<8>()
.0
.iter()
.map(|c| f64::from_le_bytes(*c))
.collect();
assert_eq!(via_read_f64, data);
+1 -1
View File
@@ -315,7 +315,7 @@ fn zerocopy_roundtrip_write_read() {
let dir = std::env::temp_dir();
let path = dir.join("zc_roundtrip.h5");
let original = vec![3.14, 2.718, 1.414, 1.732, 0.577];
let original = vec![3.25, 2.75, 1.414, 1.732, 0.577];
let mut b = FileBuilder::new();
b.create_dataset("data")
.with_f64_data(&original)