This is the documentation index for libdictenstein — a toolbox of high-performance dictionary data structures (tries, DAWGs, double-array tries, suffix automata, SCDAWGs, and a lock-free durable persistent ARTrie family), unified behind one trait API and backed by machine-checked proofs.
New here? Start with the root README.md for the crate overview and
the backend selector, then come back here for depth.
The docs are organized along a single axis: theory (paper-grounded math and data-structure foundations) → algorithms (per-backend implementation and usage) → architecture / persistence (cross-cutting systems) → formal verification (the proofs that pin the concurrency and durability claims), with benchmarks, experiments, and design records alongside.
| Area | Path | What's there |
|---|---|---|
| 🧮 Theory | theory/ |
Data-structure foundations: disk-tries (trie → B-trie → ART → persistent ART → buffer management), SCDAWG (suffix automaton → CDAWG → symmetric compact DAWG), and volatile automata (DAWG minimization, double-array tries, Bloom filters, bit-parallel child scan). Paper-grounded, with proofs. |
| ⚙️ Algorithms | algorithms/ |
The dictionary-layer trait API and a per-backend deep-dive for each implementation (implementations/). Conceptual guides: zippers (lazy set-algebra), serialization (bincode/JSON/plaintext/protobuf + value-preserving), persistent suffix graphs (durable substring indexes), native u64 + CX (u64-sequence profile + compact snapshot), and the vocab trie (term ↔ u64 bijection). |
| 🏗️ Architecture | architecture/ |
Cross-cutting system design: the core abstractions (CharUnit + KeyEncoding — one code path, three alphabets), the in-memory dictionary architecture (monomorphized cores + the two lock-free strategies), the optimization roadmap, and the persistence family overview. |
| 📖 User guide | user-guide/ |
Task-oriented usage: getting started, choosing a backend, the in-memory tour, and the cookbook. |
| 💾 Persistence | persistence/ |
The durable, lock-free ARTrie engine end-to-end. Start at the architecture entry point, then descend: the reusable durable-storage kernel, the families, the lock-free overlay, durability & recovery, the concurrency model, storage backends + WAL format, eviction, group commit, and the proof map. |
| ♻️ Eviction | persistence/eviction.md |
The memory-pressure eviction subsystem for the persistent ARTrie (part of the persistence corpus). |
| 🔌 Integration | integration/ |
Backend integrations (e.g. PathMap). |
| 📊 Benchmarks | benchmarks/ |
Scientific-method benchmarking ledgers and artifacts. |
| 🧪 Experiments | experiments/ |
Per-optimization experiment ledgers (persistence enhancements, loading, lock-free flip). |
| 📐 Design | design/ |
Architecture/mechanism design records and the historical campaign ledger. |
| ✅ Formal verification | ../formal-verification/ |
Rocq theorems + TLA⁺ models + the CI-gated unsafe contract inventory. |
| 🔒 Security | security/ |
Threat model, untrusted-input / DoS analysis, deserialization safety, and the unsafe-contract map. |
| 🛠️ Engineering | engineering/ |
Testing strategy, benchmarking methodology, and the feature-flag reference. |
| 🎨 Diagrams | diagrams/ |
Diagrams-as-code sources and rendered SVGs; see diagrams/README.md for the rendering pipeline. |
The map below renders the reading paths as a graph: follow an edge from its tail
to its head. The green spine is the on-ramp (crate README → trait layer →
per-backend guide); from there you branch into the grey theory track, the
blue persistence / systems track, and finally the amber formal
verification track. It is split across two figures — part 1 covers the
getting-started and theory tracks, part 2 the persistence and formal tracks; the
three "go deeper" edges that cross between them are drawn as a → see part 2
note in part 1 and re-attached from a ← from part 1 note in part 2.
- Pick a backend — root
README.mdselector +user-guide/backends.md. - Understand the trait layer —
algorithms/README.md. - Go deep on your backend — the matching file under
algorithms/implementations/, with its theory back-link intotheory/. - If you need durability —
theory/disk-tries/for the foundations, thenpersistence/andarchitecture/persistence/for the system. - If you need to trust it —
../formal-verification/.
The query half of approximate string matching — a Levenshtein-automaton transducer that walks any of these dictionaries — lives in the companion crate liblevenshtein. libdictenstein contains no fuzzy-matching code itself.
Prose math is MathJax; diagram labels use PlantUML-LaTeX (<latex> / <math>).
Which delimiters you use is not cosmetic — GitHub corrupts the obvious ones.
This section is the authority on delimiters — the characters that wrap a math span. For which LaTeX goes inside a span and which word names each concept, see the notation & terminology register. In particular, a length bar is
\lvert x \rvert(never\mid), and big-O is inline math, never a code span.
Before handing a math span to MathJax, GitHub's Markdown pass runs CommonMark
backslash-escape processing over the span's interior. Inside $…$ and $$…$$
that rewrites \_→_, \{→{, \}→}, \;→;, \,→,, \#→#. The damage
comes in two flavours, and the silent one is the dangerous one:
- Loud — a bare
_or#reaches MathJax, which aborts with'_' allowed only in math mode. - Silent —
\max\{\,L\,\}renders as\max{,L,}: the set braces disappear and literal commas replace thin-spaces. No error, wrong mathematics.
Only two forms survive GitHub's escape pass verbatim. Use them:
| Write this | Not this | |
|---|---|---|
| Inline | $`\text{checkpoint\_lsn}`$ |
$\text{checkpoint\_lsn}$ |
| Display | a ```math fenced block |
$$ … $$ |
Literal $ |
inline code — `$₁` |
\$₁ |
Two further rules, both established by rendering probes against GitHub's own GFM
endpoint (gh api -X POST /markdown):
- Never let an ASCII letter abut the opening
$`. GitHub declines to open inline math there, soInMem$`\Rightarrow`$descendrenders as literal text. WriteInMem $`\Rightarrow`$ descend. (A digit or)before the$is fine.) - Keep literal dollars in inline code. Two or more
\$on one line can pair into a spurious math span — and whether they do is not predictable from the source:{\$, b\$}renders as text while\$₁, \$₂renders as math.
scripts/check-doc-math.py enforces all four rules over every tracked *.md, and
runs in the diagrams CI job. Run it before committing docs:
python3 scripts/check-doc-math.py # every tracked *.md
python3 scripts/check-doc-math.py FILE… # just these