fix(format): write a Group Info message in every group

libhdf5 reads a group's Group Info message before it inserts a link, and
FileWriter wrote none, so h5py in "r+" mode could not add a link to any
group we wrote: "Unable to create link (message type not found)". Each
group header now carries a version 0 Group Info message with the default
link-phase thresholds, as libhdf5 writes for a new group.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 08:08:31 -05:00
co-authored by Claude Opus 5.5
parent 63648c7000
commit 8cbbef3fae
3 changed files with 152 additions and 0 deletions
@@ -196,6 +196,13 @@ pub(crate) fn build_group_oh(
li.extend_from_slice(&u64::MAX.to_le_bytes()); // fractal heap addr = UNDEF
li.extend_from_slice(&u64::MAX.to_le_bytes()); // btree name index addr = UNDEF
w.add_message(MessageType::LinkInfo, li);
}
// Group Info (version 0, default link-phase thresholds, no estimates).
// Readers don't need it, but libhdf5 reads it before inserting a link:
// without one, adding a link to a group we wrote (h5py in "r+" mode)
// failed with "message type not found".
w.add_message(MessageType::GroupInfo, vec![0, 0]);
if dense_link_info.is_none() {
for link in links {
w.add_message(MessageType::Link, link.serialize(OFFSET_SIZE));
}