Skip to main content

Module detcoll

Module detcoll 

Source
Expand description

Deterministic collection family — Phase 7.

A small set of collections each tuned to one workload shape, sharing a determinism contract:

  1. No randomized hashing. All hash functions are fixed (splitmix64 for DHarht and DetOpenMap).
  2. No pointer-address ordering. Iteration order is driven by keys, sort order, or insertion order — never raw addresses.
  3. Bounded behavior. Every structure has a documented worst case; failure mode is deterministic fallback (typically BTreeMap), never silent corruption.
  4. Full key equality on success. Hash collision never returns a wrong value.

§When to use which

WorkloadPick
Tiny maps (≤ ~16 entries)TinyDetMap
Small sealed sorted mapsSortedVecMap
Dense IdType -> Value ID tablesIndexVec
Sparse mutable equality lookupDetOpenMap
Large sealed equality lookup, prefix-heavyDHarht
Range / prefix queries / canonical outputBTreeMap

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 from DHarht (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 around DHarhtMemory enforcing 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 sorted Vec.

Functions§

hash_bytes
Hash arbitrary bytes deterministically. Used as the keying function for DHarht::insert_bytes and (post-Phase-11) as the canonical 64-bit content hash for ByteDictionary::seal_with_u64_hash_index.