mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-10-05 04:03:28 +03:00
Implements the blob storage mechanism from RFC-HDFG-2026-001: filters can attach a binary blob (configuration too large for cd_values or a parameter string, e.g. JIT-compiled filter source or a dataset reference) to a pipeline entry via the new H5Pappend_filter_blob() API. H5Z_class3_t gains three NULL-able callbacks: write_blob, read_blob, and close_blob. When NULL, the library stores the blob as a global-heap object at H5Dcreate time, recovers it at H5Dopen, and frees the buffer at dataset close; custom callbacks own their storage and receive an opaque H5Z_blob_loc_t locator passed unchanged through the pipeline message. H5Z_class_info_t reports implementation via has_blob_callbacks. On-disk, a version-3 pipeline message appends a has_aux flag byte per filter and, when set, the blob locator; the pipeline message's delete handler reclaims the heap object. H5Pencode serializes blob bytes inline so encoded DCPLs stay self-contained, and H5Pcopy deep-copies them, which carries blobs through h5repack with no tool-specific code. In parallel HDF5, rank 0 writes the blob and broadcasts the locator so all ranks encode identical pipeline messages. Writing the v3 pipeline message is gated behind a new library version bound, H5F_LIBVER_V220 (now aliased by H5F_LIBVER_LATEST): the enum, every *_ver_bounds[] array, H5trace, h5test's env parsing, and the Fortran/Java constants gain the new bound. All other message versions are unchanged from H5F_LIBVER_V200. Tests cover the default-storage round-trip (create/write/reopen/read, H5Pcopy and H5Pencode/H5Pdecode propagation, dataset delete), custom callbacks (invocation points, locator round-trip, allocator symmetry), and argument validation.