fix(tools): h5rs diff compares every name of a hard-linked object

The path walk skipped the second hard link to an object, so a file that
shares one dataset between /x and /y differed from a file holding two
identical copies: "</y> exists only in <B>", exit 1, where h5diff exits 0.
For a hard-linked group every member was reported the same way.

diff now enumerates every path below the start object (a hard link back
to an ancestor is recorded but not descended into), so each name is
compared. A group whose links cannot be read is now an error instead of
an empty group.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
osobh
2026-09-26 01:14:53 -05:00
co-authored by Claude Opus 5.5
parent 845a9d0125
commit 699ee9c447
5 changed files with 156 additions and 26 deletions
+4 -2
View File
@@ -130,8 +130,10 @@
files); metadata space is one figure, not broken down.
- `h5rs diff [-r] [-q] [-d D] [-p R] A B [OBJ1 [OBJ2]]` compares objects,
kinds, datatypes, shapes, attributes, values and link targets; exit
status 0/1/2 as h5diff's. Objects that cannot be compared count as a
difference (h5diff exits 0 for them), and NaN equals NaN.
status 0/1/2 as h5diff's. Every path is compared, including every name
of a hard-linked object and the members of a hard-linked group. Objects
that cannot be compared count as a difference (h5diff exits 0 for them),
and NaN equals NaN.
- `h5rs check [--data] FILE` is a structural validator: it walks every
object, parses every header message, verifies the checksums of every
version 2+ structure it meets (superblock, object headers and