Skip to content

Allow reflection table experiment metadata over 64 KiB - #56

Merged
dimitrivlachos merged 2 commits into
mainfrom
fix-large-attributes
Oct 12, 2026
Merged

dimitrivlachos merged 2 commits into
mainfrom
fix-large-attributes

Conversation

@dimitrivlachos

Copy link
Copy Markdown
Collaborator

Writing a reflection table with more than about 4090 experiments
produces a file with no identifiers attribute and no error. The file
was created with the default format bound,
which caps each attribute at 64 KiB, and the metadata writer
ran under H5ErrorSilencer without checking its HDF5 calls,
so the rejected attribute was skipped silently.

This PR writes the file in the HDF5 1.8 format, which moves large
attributes into dense storage
with no size cap. Attribute names and types are unchanged, and
reading the file needs HDF5 1.8 or newer. The newer format returns a
group's columns in insertion order rather than name order, so the
reader now asks for name order explicitly.

Changes

  • ReflectionTable::write creates its file with an HDF5 1.8 lower
    format bound, via a new helper in h5utils.hpp.
  • The reader iterates groups in name order regardless of format.
  • write_experiment_metadata checks every HDF5 call and throws on
    failure.
  • read_experiment_metadata checks its reads and frees the identifier
    strings, which previously leaked on every load.
  • A new test round-trips 25600 experiment IDs and identifiers.

… 64 KiB

The old format caps an attribute at 64 KiB, so the identifiers vanished
past about 4090 experiments. The newer format keeps small groups' links
in insertion order, so the reader now asks for name order explicitly.
The writer ran with HDF5 errors silenced and never checked the results,
so a failed attribute write produced a file without the attribute. The
reader also leaked every identifier string it loaded.

@jbeilstenedmands jbeilstenedmands left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, confirmed this now fixes the issue I saw in a real use case.

@dimitrivlachos
dimitrivlachos merged commit 740c4fe into main Oct 12, 2026
9 checks passed
@dimitrivlachos
dimitrivlachos deleted the fix-large-attributes branch October 12, 2026 11:15
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.

2 participants