Apply filters to variable-length data#6178
Apply filters to variable-length data#6178crusaderky wants to merge 6 commits intoHDFGroup:developfrom
Conversation
| } /* end test_optional_filters_scalar() */ | ||
|
|
||
| /*------------------------------------------------------------------------- | ||
| * Function: test_optional_filters_null |
There was a problem hiding this comment.
this was previously untested.
| } /* end test_set_local_updates_cd() */ | ||
|
|
||
| /*------------------------------------------------------------------------- | ||
| * Function: test_set_local_updates_cd_vlen |
There was a problem hiding this comment.
This test fails in the main branch, complaining that filters can't be applied to vlen data.
If I replace H5Z_FLAG_MANDATORY with H5Z_FLAG_OPTIONAL below, it crashes on assert(0) inside the filter callback, highlighting that set_local has not been called.
| } /* end test_set_local_updates_cd_vlen() */ | ||
|
|
||
| /*------------------------------------------------------------------------- | ||
| * Function: test_deflate_vlen |
There was a problem hiding this comment.
This tests what happens when filter actually processes the contiguous raw chunk data.
This test fails in the main branch, complaining that filters can't be applied to vlen data.
However, if I replace H5Z_FLAG_MANDATORY with H5Z_FLAG_OPTIONAL below, it passes in the main branch, thanks to the fact that the deflate filter has no set_local callback.
Running deflate on more substantial data shows that the output file size is much smaller than the uncompressed version.
70ab78a to
a56f335
Compare
|
Downstream tests in hdf5-blosc: Blosc/hdf5-blosc#38 |
|
|
||
| /* Create dataset with optional filter */ | ||
| if ((dsid = H5Dcreate2(file, DSET_OPTIONAL_SCALAR, strtid, sid, H5P_DEFAULT, dcplid, H5P_DEFAULT)) < 0) | ||
| /* Write data to the dataset */ |
There was a problem hiding this comment.
This checks that the filter callback is never invoked, which the previous version of this test left untested.
|
@hyoklee is it possible to avoid having CI re-authorised by a maintainer every time I need to fix a trivial error? This is hurting velocity quite badly. |
|
@crusaderky I believe this is simply a requirement due to our current GitHub configuration. I've approved our workflows to run again, but I believe we'll need to continue re-approving them as necessary. I'll keep an eye on this PR, but feel free to reach out again as needed. |
|
@jhendersonHDF ready for another go |
|
CI is green; this is ready for review and potentially for merging. |
can_applyandset_localfilter callbacks skipped forH5T_VARIABLEdtypes #5942. A more detailed explanation of the rationale for this PR is in the linked issue.can_applyandset_local, only to jump directly tofilter. This fixes hdf5_blosc and HDF5_Blosc2, which rely onset_local. Note that all filters which have neithercan_applynorset_localhave always worked fine with vlen data, as long as they were tagged as optional. Notable examples are deflate, lzf, bzip2 (from hdf5plugin), and lz4 (also from hdf5plugin).can_applyfunction, which however is broken (filters:can_applydoes nothing for optional filters #6161).Important
Enhance filter application to variable-length data, fixing optional filter handling and adding tests.
can_applyandset_localsteps, fixing issues with hdf5_blosc and HDF5_Blosc2.H5Z_ignore_filters()inH5Z.cto handle optional filters correctly.dsets.cfor scalar and null datasets with optional filters, and forset_localupdates with vlen data.test_optional_filters_scalar,test_optional_filters_null,test_set_local_updates_cd,test_set_local_updates_cd_vlen, andtest_deflate_vlenindsets.c.This description was created by
for 70ab78a. You can customize this summary. It will automatically update as commits are pushed.