Skip to content

fix: support decreasing-order H5A*_by_idx attribute operations - #2

Closed
brtnfld wants to merge 1 commit into
masterfrom
fix-daos-vol-gaps
Closed

brtnfld wants to merge 1 commit into
masterfrom
fix-daos-vol-gaps

Conversation

@brtnfld

@brtnfld brtnfld commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • H5Aget_name_by_idx, H5Aopen_by_idx, and H5Aget_info_by_idx with H5_INDEX_NAME + H5_ITER_DEC now work, using the same target-index-remap technique the creation-order sibling function already uses (H5_daos_attribute_get_name_by_crt_order): walk forward (increasing order) internally, remap the requested decreasing-order index to its increasing-order equivalent (nattrs - 1 - idx) before comparing.
  • Found via the real DAOS test results from the HDF5 API test migration (PR test: replace vol-tests submodule with HDF5's in-tree API test suite HDFGroup/vol-daos#73): these all failed with "decreasing order iteration is unsupported" before this fix.

Not addressed here (separate, harder problems)

  • H5Aiterate/H5Aiterate_by_name with H5_ITER_DEC: needs an actual reverse streaming walk over all attributes, not just remapping a single target index.
  • H5Adelete_by_idx with H5_INDEX_NAME + H5_ITER_DEC: its existing index math in H5_daos_attribute_remove_from_crt_idx appears to assume the requested index is already a creation-order position, which isn't generally true for a name-order request. Needs a proper name-order-to-crt-order resolution step first, not a simple formula fix.

Test plan

  • Confirm against a real DAOS instance that H5Aget_name_by_idx/H5Aopen_by_idx/H5Aget_info_by_idx with decreasing order now return the correct attribute

…t_info_by_idx

Name-order attribute storage only supports forward enumeration, so
H5_daos_attribute_get_name_by_name_order() always walks in increasing order
internally now and remaps the target index for H5_ITER_DEC in the
iteration callback instead - the same technique already used by the
creation-order sibling function (H5_daos_attribute_get_name_by_crt_order).

H5Aiterate/H5Aiterate_by_name with H5_ITER_DEC and H5Adelete_by_idx's
name-order decreasing-order path are separate, harder problems (the former
needs a real reverse streaming walk; the latter's existing index math
appears to assume creation-order semantics for a name-order request) and
are not addressed here.
@brtnfld

brtnfld commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Folded into HDFGroup#73

@brtnfld brtnfld closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant