Expand description
Deterministic collection family — Phase 7.
A small set of collections each tuned to one workload shape, sharing a determinism contract:
- No randomized hashing. All hash functions are fixed
(
splitmix64forDHarhtandDetOpenMap). - No pointer-address ordering. Iteration order is driven by keys, sort order, or insertion order — never raw addresses.
- Bounded behavior. Every structure has a documented worst
case; failure mode is deterministic fallback (typically
BTreeMap), never silent corruption. - Full key equality on success. Hash collision never returns a wrong value.
§When to use which
| Workload | Pick |
|---|---|
| Tiny maps (≤ ~16 entries) | TinyDetMap |
| Small sealed sorted maps | SortedVecMap |
Dense IdType -> Value ID tables | IndexVec |
| Sparse mutable equality lookup | DetOpenMap |
| Large sealed equality lookup, prefix-heavy | DHarht |
| Range / prefix queries / canonical output | BTreeMap |
DHarht is not a global BTreeMap replacement. It is best for
byte-addressable, sealed/read-heavy, deterministic equality lookup
workloads. BTreeMap remains the choice for canonical ordering,
diagnostics, serialization, and range behavior.
Re-exports§
pub use dharht::DHarht;pub use dharht::LookupProfile;pub use dharht::MicroBucket;pub use dharht_memory::DHarhtMemory;pub use det_open::DetOpenMap;pub use index_vec::Idx;pub use index_vec::IndexVec;pub use sealed_u64_map::SealedU64Map;pub use sorted_vec_map::SortedVecMap;pub use tiny_det_map::TinyDetMap;
Modules§
- det_
open DetOpenMap<K, V>— deterministic open-addressing hash map.- dharht
DHarht— Deterministic HARHT (Hybrid Adaptive Radix Hash Trie).- dharht_
memory DHarhtMemory— port of the user-supplied D-HARHT Memory profile architecture. Distinct fromDHarht(v.01) which uses byte-slice keys with a slab allocator.- index_
vec IndexVec<I, V>— dense ID → value table.- sealed_
u64_ map SealedU64Map<V>— public wrapper aroundDHarhtMemoryenforcing the build → seal → read-many lifecycle.- sorted_
vec_ map SortedVecMap<K, V>— small-to-medium sealed sorted map.- tiny_
det_ map TinyDetMap<K, V>— small map backed by a sortedVec.
Functions§
- hash_
bytes - Hash arbitrary bytes deterministically. Used as the keying function
for
DHarht::insert_bytesand (post-Phase-11) as the canonical 64-bit content hash forByteDictionary::seal_with_u64_hash_index.