9.15 Hashes, checkpoints and numerical identity
SHA-256 serves several distinct identity roles: input manifests, analysis hashes, output checksums, executable identity and random-stream label keys. A shared algorithm does not make these artifacts interchangeable.
The hashing implementation passes the standard vector:
SHA256("abc") =
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
hash_file returns the literal marker unreadable when a file cannot be read so that a manifest can still be written. This marker is not a digest and must fail a complete-provenance review.
Content versus numerical identity
A file hash identifies exact bytes. Equivalent CSV values with different line endings, formatting or row order have different hashes. Conversely, two settings files can hash identically while external environment or executable changes alter results.
For thread determinism, the strongest test is exact hashes of documented stable outputs. For cross-platform agreement, parse values and apply tolerances because textual formatting or last-bit results may differ.
Checkpoint identity
Analysis hashes concatenate versioned settings and artifact hashes before applying SHA-256. This provides a resume guard, not collision-proof semantic canonicalization. Configuration field ordering is controlled by the implementation that creates the string; upgrades can require a new schema boundary.
Common mistakes
- Treating
unreadableas a valid checksum. - Using a file hash to assert semantic equivalence.
- Assuming an analysis hash includes every environmental dependency.
Checklist
- Match each digest to its documented purpose.
- Fail provenance review on unreadable inputs.
- Use parsed/tolerance comparison when byte identity is not promised.
Further reading
See RNG checkpoints, floating-point differences and Chapter 7's manifest/checksum pages.