fix(format): selections of v4 implicit-index chunked data no longer panic

read_raw_data_selection's chunked fallback (taken when partial_read
declines, e.g. a bounding box over half the dataset) handed the layout's
chunk dimensions, element-size dimension included, to
generate_implicit_chunks, which indexed past the dataset rank. It then
decoded the whole dataset regardless, so the enumeration is gone: the
arm decodes and extracts for every chunk index.

The new test reads small and large hyperslabs of all five v4 indexes
written by h5py and compares with h5py's values; it panicked before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 08:49:54 -05:00
co-authored by Claude Opus 5.5
parent c3850a0b66
commit 3bcd443e63
4 changed files with 260 additions and 75 deletions
+13
View File
@@ -3,6 +3,19 @@
## Unreleased
### Python bindings (2026-09-26)
- **Panic: selections of v4 implicit-index chunked datasets** (pre-existing,
facade `Dataset::read_selection`, Rust callers too). A hyperslab whose
bounding box covered more than half of a chunked dataset with the implicit
index (`libver='latest'`, early allocation, no filters) panicked with
"index out of bounds" in `generate_implicit_chunks`: the fallback in
`data_read::read_raw_data_selection` passed the layout's chunk dimensions,
element-size dimension included, and then decoded the whole dataset
anyway. That arm now decodes and extracts directly, for every chunk index.
`crates/clawhdf5/tests/v4_chunk_index_selection.rs` reads small and large
hyperslabs of all five v4 indexes (single chunk, implicit, fixed array,
extensible array, B-tree v2) and compares them with h5py; it panicked
before. The Python bindings made this easy to reach (`ds[0:3]` on
libhdf5's `h5fc_ext*.h5` test files).
- **`pip install` / `maturin develop` now gives `import clawhdf5`.** The
distribution in `crates/clawhdf5-py/pyproject.toml` was still called
`rustyhdf5` while the extension module was `clawhdf5`, and the package's