Repository navigation
Conversation
0a6cacf to
71dc173
Compare
d769f42 to
4a763ce
Compare
4a763ce to
ebbde92
Compare
a54a779 to
fa0739c
Compare
fa0739c to
ad2c581
Compare
ebbde92 to
70b7f8a
Compare
ad2c581 to
04902f0
Compare
The new --filter-params option implies -p/--properties and also prints a PARAMS_STRING line inside each filter's entry in the FILTERS block. It shows the value H5Pget_filter_params_by_idx() returns: the string stored in the file, else the filter's get_config form, else a cd_values= listing. The value is single-quoted because it is TOML text that often contains double-quoted values. When the string contains a decimal float that is a small multiple of a power of two (at most three hexadecimal fraction digits), a following "# key = <hex float>" line gives its exact value. The line is outside the quotes, so extracting the quoted span still recovers the string exactly. A DESCRIPTION line gives the filter's registered description from H5Zget_filter_class_info() when the filter is available. -p output is unchanged. The new lines depend on which filters are available on the machine running h5dump, and scripts and tools such as h5import parse -p output, so they are shown only on request. With --filter-params, filters that print on one line under -p print as blocks holding the new lines. New tfilter_params_* tests cover each filter with --filter-params. tfilter_params_deflate_noavail and tfilter_params_szip_noavail hold the cd_values= form printed when those filters are not available and run only against the native connector, like tszip and tdeflate in that configuration. The hex annotation uses floor() and isfinite(), so the tools library now links LINK_LIBS (libm). The new DDLBNF300 page documents the PARAMS_STRING, annotation and DESCRIPTION grammar and corrects the NBIT filter rule to COMPRESSION NBIT. The reference-manual links point to it.
04902f0 to
c4c317f
Compare
70b7f8a to
a6b230c
Compare
|
|
||
| <filter_user> :: = USER_DEFINED_FILTER | ||
|
|
||
| <filter_deflate> :: = COMPRESSION DEFLATE { LEVEL <int_value> <filter_extra>opt } |
There was a problem hiding this comment.
I'm a bit on the fence about this one, but considering we have already been printing out the filter parameters for predefined filters previously, I'm thinking it somewhat makes sense to just always print out the parameter string and maybe even the description too without needing to specify a new option (only -p). The description is not really a filter parameter either so I think it's kind of unrelated to a --filter-params option, but I think it would also be a bit of a hassle to have yet another option just for that piece of information. The main concerns would be the increased amount of information displayed and whether the DDL format should be changed by default.
|
|
||
| # --filter-params: -p plus each filter's PARAMS_STRING and DESCRIPTION. PARAMS_STRING | ||
| # is the filter's get_config form when the filter is available and the raw cd_values | ||
| # form otherwise, and DESCRIPTION appears only for available filters, so SZIP and |
There was a problem hiding this comment.
Just from a user perspective, I wonder if it makes more sense to have something like "Filter description unavailable" or similar so at least the DESCRIPTION field doesn't come and go depending on whether the filter is available.
| double f; | ||
| int e; | ||
|
|
||
| /* Reject zero, inf and nan on the bit pattern: fast-math builds can fold |
There was a problem hiding this comment.
Similar to my comment in the other PR, this seems like something we probably shouldn't be concerning ourselves with
| *------------------------------------------------------------------------- | ||
| */ | ||
| static void | ||
| h5tools_format_hexfloat(double v, char *out, size_t out_size) |
There was a problem hiding this comment.
I do think this hex float literal formatting is something that shouldn't necessarily be the default behavior
| /* Too large for the stack */ | ||
| const size_t params_buf_size = H5Z_CONFIG_STRING_MAX + 1; | ||
| char *params_str_buf = (char *)malloc(params_buf_size); | ||
| char *params_annot = (char *)malloc(params_buf_size); |
There was a problem hiding this comment.
Error checking should be included on these
Describe your changes
Part of the string-based filter configuration work, RFC-HDFG-2026-001 (#6153), split into stacked PRs that merge into the integration branch
feature/filter-config-3.0. That branch merges into develop as a unit once the stack is complete, which moves develop to 3.0; nothing here targets the 2.3 release. Review only the top commit; the base branch is the previous PR in the stack.The new
--filter-paramsoption implies-p/--propertiesand also prints aPARAMS_STRINGline inside each filter's entry: the stored string, else theget_configform, elsecd_values=.... It's single-quoted because the value is TOML that often contains double-quoted values. A float that is a small multiple of a power of two gets a following# key = <hex float>line with its exact value, outside the quotes. ADESCRIPTIONline shows the filter's registered description when the filter is available, so it can differ between machines.-poutput is unchanged. The new lines depend on which filters and plugins are available where h5dump runs, and h5import and scripts parse-poutput, so they are opt-in. With--filter-params, filters that print on one line under-p(e.g.COMPRESSION DEFLATE { LEVEL 9 },PREPROCESSING SHUFFLE) print as blocks holding the new lines.tfilter_params_*tests cover each filter with--filter-params.tfilter_params_deflate_noavail/tfilter_params_szip_noavailhold thecd_values=form printed when those filters are unavailable and run only against the native connector.tfilter_params_allruns only when both filters are available. The existing filter tests are unchanged.DDLBNF300page documents the grammar (and corrects the NBIT rule toCOMPRESSION NBIT); reference links point to it. The tools library linksLINK_LIBS(libm) for the annotation code.This follows RFC resolved item R27 (a separate flag so default output is unchanged); the RFC body, which said
-p, is being updated to match.Tested locally before the switch to
--filter-params: 1,688/1,688 (h5dump, h5repack, h5ls, h5diff, tfilter2); CI covers the current version.Issue ticket number (GitHub or JIRA)
#6153
Checklist before requesting a review
Stack
Merges into
feature/filter-config-3.0, in order:Prerequisite, merging into
feature/filter-config-3.0on its own rather than as part of the stack: #6727 (H5F_LIBVER_V300bound and the 3.0.0 version bump).Related standalone fixes against develop: #6693, #6694, #6695, #6696.