1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! 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
//!
//! | 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.
pub use ;
pub use DHarhtMemory;
pub use DetOpenMap;
pub use ;
pub use SealedU64Map;
pub use SortedVecMap;
pub use TinyDetMap;
/// Splitmix64 mixer used as the deterministic hash function across
/// `DHarht` and `DetOpenMap`. Pure function: same input → same output
/// on every machine, every architecture, every locale.
///
/// This is the same mixing function `cjc-repro` uses for its RNG —
/// reusing it here keeps the workspace's "one deterministic mixer" rule.
pub
/// 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`.
///
/// **Phase 9: switched from splitmix64+FNV folding to multiplicative
/// hash on 8-byte chunks.** Same determinism contract (no platform-
/// dependent seeds, byte-equal across runs / machines), but ~5× faster
/// on short keys because we skip the inner splitmix64 mixer per chunk.
/// Final mix at the end folds in length to maintain distribution
/// quality.