The Concept Map — What Recurs Across All Fifteen
Fifteen projects, but far fewer mechanisms. The same handful of ideas appear at different altitudes, wearing different names, and the point of building all fifteen is that you stop seeing fifteen problems and start seeing one problem with fifteen surfaces.
This page is the index of that claim. Every row is a mechanism that appears in three or more projects, with the specific place it appears and the name it goes by there.
Contents
- The eight recurring mechanisms
- One: an approximate test guarding an exact one
- Two: atomic pointer swap as the durability primitive
- Three: the memory hierarchy is the cost model
- Four: maxima, tails and fan-out
- Five: two-stage retrieve-then-rank
- Six: restriction as the enabler of recovery
- Seven: the accuracy/latency dial
- Eight: amortising a fixed cost
- The numbers every project leans on
- Where each project's real difficulty lies
- What the seven refuted predictions have in common
The eight recurring mechanisms
| Mechanism | Appears in | Called there |
|---|---|---|
| Approximate test guarding an exact one | P02, P04, P03, P08, P14 | PQ codes, Bloom filter, planner estimate, candidate generation, quantisation |
| Atomic pointer swap for durability | P03, P04, P06, P07, P05 | segment flush, WAL + rename, task commit, checkpoint, log commit |
| Memory hierarchy as the cost model | P02, P04, P12, P13, P14, P01 | pointer chasing, block reads, paging, activation memory, roofline, KV cache |
| Maxima and tails | P06, P10, P15, P05 | stragglers, multiple comparisons, tail at scale, slowest replica in quorum |
| Two-stage retrieve-then-rank | P02, P03, P08, P01 | ANN + rerank, planner + scan, candidates + ranker, speculative decoding |
| Restriction enabling recovery | P06, P07, P05, P13 | pure map/reduce, deterministic replay, state machine replication, pure ops |
| Accuracy/latency dial | P07, P02, P09, P10 | watermark + grace, ef, exploration rate, power vs runtime |
| Amortising a fixed cost | P04, P03, P05, P01, P12 | group commit, segment batching, batched log append, batched decode, TLB huge pages |
One: an approximate test guarding an exact one
The pattern: an exact operation is expensive because it touches slow storage. Put a cheap, approximate, one-sided test in fast memory in front of it.
| Project | Cheap test | Expensive thing avoided | Error direction |
|---|---|---|---|
| P04 | Bloom filter, 10 bits/key | a block read per run | false positive only — never says "absent" wrongly |
| P02 | PQ code, 64 B | full-precision distance | approximate both ways, bounded by quantisation error |
| P03 | cardinality estimate | choosing the wrong strategy | either way, and a 10× error picks wrong |
| P08 | candidate generator | scoring 10⁶ items with the ranker | misses are unrecoverable — a hard ceiling |
| P14 | int8 weights | fp32 memory traffic | bounded by quantisation error |
The design question is always the same: what is the error direction, and is it recoverable? A Bloom filter's error costs one wasted read. A candidate generator's error costs the result entirely. That asymmetry decides how much budget each deserves — and it is why P08 block 7's ceiling is the first thing to check when a recommender misses.
Two: atomic pointer swap as the durability primitive
Every durable system in this track reduces to the same three lines: write the new state somewhere else, make it durable, then flip one pointer atomically.
write payload to a temporary location
fsync (~90-105 us, measured)
rename / CAS the pointer (atomic by construction)
| Project | New state | The pointer |
|---|---|---|
| P04 | SSTable file | the manifest's run list |
| P03 | segment directory | the segment-list snapshot |
| P06 | part-N.attempt2.tmp | rename to part-N |
| P07 | checkpoint state + offset | the checkpoint pointer |
| P05 | replicated log entry | commitIndex |
Once you see it, "exactly-once" stops being mysterious. P06 runs tasks at least once and renames atomically, so the effect is once. P07 processes records twice after a crash and advances state-and-offset together, so the effect is once. The guarantee is never about delivery; it is about the pointer.
Three: the memory hierarchy is the cost model
Measured on this machine (numbers.md), the ratios that decide every design in the track:
| Level | Latency | Relative to L1 |
|---|---|---|
| L1 | 0.91 ns | 1× |
| L2 | 5.94 ns | 6.5× |
| DRAM | 121.10 ns | 133× |
| Syscall | 127.59 ns | 140× |
| Context switch | 1,383--1,706 ns | ~1,700× |
fsync | 90--105 µs | ~10⁵× |
| NVMe random read | 20--100 µs | ~10⁵× |
| HDD seek | ~10 ms | ~10⁷× |
| Cross-region RTT | ~100 ms | ~10⁸× |
Eight orders of magnitude, and the boundary you cross determines the architecture:
- Cross DRAM → the LSM exists (P04), tiling exists (P14), quantisation exists.
- Cross
fsync→ batching and group commit are mandatory (P04, P03, P05). - Cross HDD seek → graph search becomes impossible and IVF wins (P02).
- Cross the network → consensus costs a round trip and geography sets the floor (P05).
The corollary that catches everyone: the same code changes regime when the data grows. P14's assembly measures a 25 MB working set behaving as if it were free, and the same code at 100 MB paying full DRAM cost — with the roofline ratio crossing 1.0 in between.
Four: maxima, tails and fan-out
One piece of arithmetic, four appearances. If an event has independent probability \(p\) per trial and there are \(n\) trials, \(P(\text{at least one}) = 1 - (1-p)^n\).
| Project | \(p\) | \(n\) | Consequence |
|---|---|---|---|
| P06 | task is slow | tasks in the job | job time is a maximum; 1% at 10× inflates it 4.5× |
| P10 | metric is falsely significant | metrics tested | 20 metrics → 64% chance of a false winner |
| P15 | component exceeds p99 | fan-out width | at \(n\)=100, the median request contains a p99 event |
| P05 | replica is slow | quorum size | commit latency is the slowest in the quorum |
The mitigations rhyme too: redundancy plus cancellation. Backup tasks (P06), hedged requests (P15), larger quorums that can exclude a straggler (P05). And the statistical version — Bonferroni, Benjamini–Hochberg — is the same acknowledgement that \(n\) trials need a stricter per-trial bar.
Five: two-stage retrieve-then-rank
Cheap and wide, then expensive and narrow. Stage 2 can never exceed stage 1's ceiling, which is the single most useful diagnostic in any such system.
| Project | Stage 1 | Stage 2 | Ceiling measured in |
|---|---|---|---|
| P02 | graph traversal to ef candidates | exact distances | recall@ef |
| P03 | planner picks a strategy | scan or traverse | the strategy's own recall |
| P08 | popularity / ANN top-C | BPR model re-rank | block 7's ceiling column |
| P01 | draft model proposes \(k\) tokens | target model verifies | acceptance rate |
P08 block 7 makes the failure explicit: recall after re-ranking tracks the stage-1 ceiling exactly, and no ranker improvement can cross it. Before blaming a ranker, check whether the item was in the candidate set.
Six: restriction as the enabler of recovery
Each of these systems gives up expressiveness and gets fault tolerance in return. The restriction is the feature.
| Project | What you may not do | What that buys |
|---|---|---|
| P06 | read shared mutable state in map/reduce | any task may be re-run anywhere, any time |
| P07 | depend on processing-time order | deterministic replay from a checkpoint |
| P05 | apply commands out of log order | state machine replication |
| P13 | mutate a tensor an op depends on | the tape can be replayed backwards |
P06's assembly is the cleanest demonstration: byte-identical output under three different worker-kill schedules. Allow one impure map function and retry, speculation and rescheduling all become unsound simultaneously.
Seven: the accuracy/latency dial
In four projects, correctness is a parameter rather than a property, and the engineering task is to make the parameter explicit rather than accidental.
| Project | Dial | Fast end | Correct end |
|---|---|---|---|
| P07 | watermark lag + grace | 93.6% in 2 s | 100% in 100 s |
| P02 | ef | recall 0.29 at 192 µs | recall 0.81 at 856 µs |
| P09 | exploration rate | greedy: most clicks, 96 items alive | UCB1: 600 items alive, −16% clicks |
| P10 | sample size | fast, underpowered, 8× inflated estimates | slow, powered, honest |
The mature version of this is not picking a value; it is shipping the dial and labelling each setting with its measured error, as P15 block 6 does when it reports the dashboard's bias alongside its latency.
Eight: amortising a fixed cost
When an operation has a large fixed cost and a small marginal one, batching is not an optimisation — it is the design.
| Project | Fixed cost | Batch | Amortisation |
|---|---|---|---|
| P04 | fsync ~100 µs | memtable → SSTable | 1000× |
| P03 | fsync + segment metadata | segment of vectors | ~1000× |
| P05 | round trip + fsync | group commit of log entries | 10--100× |
| P01 | reading all weights (memory-bound decode) | continuous batching | up to batch size |
| P12 | page walk on TLB miss | huge pages | 512× TLB reach |
| P02 | DRAM latency 121 ns | batched queries → MLP | ~10× effective |
Note the last two: the "batch" is not always requests. Huge pages batch translations; memory-level parallelism batches outstanding misses. The pattern is the same — pay the fixed cost once for many units of work.
The numbers every project leans on
If you memorise one table from this track, make it this one — every design decision above is a comparison between two of its rows.
| Quantity | Value | Where it decides something |
|---|---|---|
| L1 / L2 / DRAM | 0.91 / 5.94 / 121.10 ns | P02, P04, P14 |
| Ratio L1:L2:DRAM | 1 : 6.5 : 133 | every data-structure layout choice |
| Syscall | 127.59 ns | P12, io_uring's reason to exist |
| Context switch | 1,383--1,706 ns | P12 quantum sizing |
fsync | 90--105 µs | P04, P03, P05 |
| Measured bandwidth | 50--99 GB/s (working-set dependent) | P14 roofline |
| fp32 / fp64 peak | 1937 / 469 GFLOP/s | P14 — and one roofline per dtype |
| Ridge point, fp32 | ~39 FLOP/byte | which wall a kernel hits |
| Bloom FPR at 10 bits/key | 0.0082 | P04, proofs.md P3 |
| Quorum intersection | \(2Q > N\) | P05, proofs.md P4 |
| Sample size scaling | \(n \propto 1/\delta^2\) | P10 — halve the MDE, quadruple the traffic |
Where each project's real difficulty lies
Not where the tutorials put it.
| Project | Looks hard | Actually hard |
|---|---|---|
| P01 | the attention formula | the causal mask, and knowing the entropy floor |
| P02 | the graph algorithm | measuring contrast before trusting any recall number |
| P03 | the index | the planner's cardinality estimate |
| P04 | compaction | proving durability with a real crash test |
| P05 | leader election | §5.4.2 and membership changes |
| P06 | the programming model | stragglers and skew |
| P07 | windowing | choosing and stating the completeness assumption |
| P08 | the model | the split, the baseline, and the head mass |
| P09 | the bandit | making the user model falsifiable |
| P10 | the t-test | the stopping rule and SRM |
| P11 | the parser | dispatch, and the host's cost model |
| P12 | the kernel mechanisms | that policy barely matters when the working set does not fit |
| P13 | the chain rule | += on diamonds, and un-broadcasting |
| P14 | the roofline formula | getting the ceiling and the byte count right |
| P15 | the integration | the seams, and closing all three loops |
What the seven refuted predictions have in common
Every one of them (listed in the index) was a case of importing a conclusion without importing the conditions that made it true:
- P08's
pop^0.75— a constant that is correct in word2vec, where discounting frequency is the goal, copied into a domain where popularity is the signal. - P09's Thompson sampling — a result proven for single-action bandits, applied to a slate where 34% of attention sits in one slot.
- P11's bytecode VM — a design whose benefit comes from a jump table, hosted in a language with no jump table.
- P12's working-set cliff — a model of a single phase, applied to a mixture of phases.
- P14's single roofline — a machine constant that is actually a per-dtype constant.
- P13's broadcast failure mode — an assumption about numpy's behaviour that was simply never run.
- P08's negative count — folklore repeated without a control.
The generalisable habit: when you import a result, import its conditions and check that they hold. Every one of these was caught by a measurement that took minutes, and none would have been caught by reading more carefully.
Start with the hands-on index, or go straight to a project's page from the table above.