Module hash

Module hash 

Source
Expand description

2026-09-25: Hash primitives for cache keys that outlive the process: FNV-1a/64 and the mix64 fold.

The keys land in the paging peer’s swap file, which outlives the client that wrote them, so the same input must give the same u64 across toolchains, platforms and rebuilds. Hence both functions are written out here over fixed constants instead of coming from std::hash or a crate. The users import them from here: model-engine’s SSM tier (ssm_tier/fingerprint.rs, and the wire key in ssm_tier/arena_store.rs) and the KV paging namespace (kv_paging/ns.rs).

FNV-1a is not collision-resistant: each step is an XOR and a multiply by an odd constant, both invertible, so colliding inputs can be constructed. The keys separate the configs of one trusted fleet; they are no boundary between tenants that choose their own configs.

Owner: storage (tier). Invariants: fnv1a_64 and mix64 are pure const fns of their inputs.

Constants§

FNV_OFFSET
2026-09-25: FNV-1a/64 offset basis.
FNV_PRIME
2026-09-25: FNV-1a/64 prime.

Functions§

fnv1a_64
2026-09-25: FNV-1a/64 over bytes. It reads bytes, not words, so the result does not depend on endianness.
mix64
2026-09-25: The splitmix64 finalizer over a ^ b * GOLDEN.