From 4e8109770d41ac22f6f8cc19c7d9bc1d5571d350 Mon Sep 17 00:00:00 2001 From: osobh Date: Sat, 26 Sep 2026 17:25:28 -0500 Subject: [PATCH] tests: shrink and regrow datasets allocated early Datasets with early allocation and unlimited dimensions (Extensible Array, version-2 B-tree, version-1 B-tree under earliest), unfiltered and deflated: the random resize workload gives the values h5py gets and the same chunk index shape, with every chunk a growth brings in allocated and filled as H5D__chunk_allocate does. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../tests/edit_coverage_interop.rs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/crates/clawhdf5-tools/tests/edit_coverage_interop.rs b/crates/clawhdf5-tools/tests/edit_coverage_interop.rs index ffe13d9..7fc309a 100644 --- a/crates/clawhdf5-tools/tests/edit_coverage_interop.rs +++ b/crates/clawhdf5-tools/tests/edit_coverage_interop.rs @@ -717,6 +717,42 @@ fn shrink_matches_libhdf5() { false, 99, ); + // Early allocation with unlimited dimensions (Extensible Array, + // version-2 B-tree; version-1 B-tree under `earliest`), filtered and + // not: growth allocates and fills every new chunk, as libhdf5 does. + for (i, (lv, dump)) in [("'earliest'", true), ("'v110'", true), ("'latest'", false)] + .iter() + .enumerate() + { + for (j, (max, z)) in [ + ("(None, 9)", ""), + ("(None, None)", ""), + ("(None, 9)", ", compression='gzip'"), + ("(None, None)", ", compression='gzip'"), + ] + .iter() + .enumerate() + { + shrink_workload( + &format!("early_{i}_{j}"), + lv, + &format!( + "\x20 f.create_dataset('x', data=np.arange(72, dtype='