Intentionally Corrupt HDF5 — Truncated After the Superblock (.h5)
An intentionally corrupt HDF5 file cut to 1024 bytes, so the 8-byte signature and superblock survive while the object headers and B-trees they point at do not. Format sniffing will say HDF5 and opening must fail loudly, which is exactly the split this fixture measures.
| Field | Value |
|---|---|
| Damage | intentionally corrupt — truncated to 1024 bytes |
| Original size | 14712 bytes |
| Signature | intact: \x89HDF\r\n\x1a\n at offset 0 |
| Superblock | present, but the B-tree and object headers it points at are gone |
| Expected behaviour | the open fails with a clear HDF5 error |
Specifications
- Intentionally Corrupt
- true
- Damage
- truncated to the first 1024 bytes
- Original Bytes
- 14712
- Kept Bytes
- 1024
- Signature Intact
- true
- Object Headers Present
- false
Testing contract
Expected to fail- Scenario
- Sniff the file signature, then attempt to open it with an HDF5 library and list the root group.
- Expected result
- The first eight bytes match the HDF5 signature, but h5py or libhdf5 raises an explicit truncated-file or bad-object-header error rather than returning an empty root group.
What is a .h5 file?
HDF5 (.h5) is a binary container format for large, heterogeneous scientific data. It stores multidimensional arrays (datasets) in a hierarchical group structure with attributes and chunked, compressed storage, and is standard in ML, physics, and geoscience.
How to use this file
Use an example .h5 file to test HDF5 readers (h5py, PyTables), group and dataset traversal, and attribute extraction.
How to use this file for testing
“Intentionally Corrupt HDF5 — Truncated After the Superblock (.h5)” is a deterministic Novus Examples fixture for Scientific data, Error handling. Citation catalogs (BibTeX, RIS), chemistry structures (MDL Molfile, PDB), and gridded binary data (NetCDF, FITS) — for testing reference managers, molecule viewers, and scientific-data loaders.
Documented properties for this file: damage: truncated to the first 1024 bytes · intentionally corrupt. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Scientific fixtures are small, valid, and fully synthetic — no real organism, patient, sample, or observation. Point your parser or loader at the file and check it reads the documented records, variables, or headers; binary formats ship a readable twin or metadata listing for comparison.
Related files
- h5HDF5 Degenerate Shapes — Scalar, Zero-Length and Null (.h5)Five degenerate but entirely legal datasets — a rank-0 scalar, a zero-length vector, a (0, 5) array, a single-element vector and a NULL dataspace — plus an empty group. None of them is corrupt, and a reader that reports them as errors is the thing being tested.

- h5HDF5 Hard, Soft and Dangling Links (.h5)One array reachable under four names: itself, a hard link sharing its object address, a soft link resolved at access time, and a soft link pointing nowhere. A walker that counts names instead of object addresses reports four arrays and then crashes on the dangling one.

- h5HDF5 Numeric dtype Zoo — Every Width at Its Limits (.h5)Twelve datasets, one per numeric HDF5 type, each holding the extreme values of that type including the uint64 and int64 limits that do not survive a trip through a double. It is the fixture that exposes a reader which widens everything to float64 on the way in.

- csvCensored Values and Detection Limits — Non-Numeric Results (.csv)Nine laboratory results where only four are plain numbers: two are below the detection limit, one is above range, two are missing in different spellings, and one is a legitimate small negative near the blank. Coercing the censored strings to numbers or to NaN both bias the summary, and the file distinguishes every case explicitly.

- cifCIF Parser Edge Cases — Quotes, Text Fields and Wrapped Loops (.cif)A CIF built entirely out of the constructs that break naive parsers: quoted values containing apostrophes and hashes, a semicolon-delimited multi-line text field, the distinct '?' and '.' markers, a standard uncertainty written as 1.2345(7), and a loop whose rows wrap across lines. Every one of them is legal CIF.

- binDICOM-Shaped Stream — No Preamble, No DICM Magic (.bin)The identical element stream with the 128-byte preamble and the DICM magic stripped, which is how DICOM often arrives out of a network transfer or a database blob column. It is not a conformant Part 10 file and its content is entirely recoverable, so a reader should fall back rather than reject.

Generated by generation/scientific.py. Free for any use, no attribution required — license.