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

MechanismAppears inCalled there
Approximate test guarding an exact oneP02, P04, P03, P08, P14PQ codes, Bloom filter, planner estimate, candidate generation, quantisation
Atomic pointer swap for durabilityP03, P04, P06, P07, P05segment flush, WAL + rename, task commit, checkpoint, log commit
Memory hierarchy as the cost modelP02, P04, P12, P13, P14, P01pointer chasing, block reads, paging, activation memory, roofline, KV cache
Maxima and tailsP06, P10, P15, P05stragglers, multiple comparisons, tail at scale, slowest replica in quorum
Two-stage retrieve-then-rankP02, P03, P08, P01ANN + rerank, planner + scan, candidates + ranker, speculative decoding
Restriction enabling recoveryP06, P07, P05, P13pure map/reduce, deterministic replay, state machine replication, pure ops
Accuracy/latency dialP07, P02, P09, P10watermark + grace, ef, exploration rate, power vs runtime
Amortising a fixed costP04, P03, P05, P01, P12group 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.

ProjectCheap testExpensive thing avoidedError direction
P04Bloom filter, 10 bits/keya block read per runfalse positive only — never says "absent" wrongly
P02PQ code, 64 Bfull-precision distanceapproximate both ways, bounded by quantisation error
P03cardinality estimatechoosing the wrong strategyeither way, and a 10× error picks wrong
P08candidate generatorscoring 10⁶ items with the rankermisses are unrecoverable — a hard ceiling
P14int8 weightsfp32 memory trafficbounded 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)
ProjectNew stateThe pointer
P04SSTable filethe manifest's run list
P03segment directorythe segment-list snapshot
P06part-N.attempt2.tmprename to part-N
P07checkpoint state + offsetthe checkpoint pointer
P05replicated log entrycommitIndex

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:

LevelLatencyRelative to L1
L10.91 ns
L25.94 ns6.5×
DRAM121.10 ns133×
Syscall127.59 ns140×
Context switch1,383--1,706 ns~1,700×
fsync90--105 µs~10⁵×
NVMe random read20--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
P06task is slowtasks in the jobjob time is a maximum; 1% at 10× inflates it 4.5×
P10metric is falsely significantmetrics tested20 metrics → 64% chance of a false winner
P15component exceeds p99fan-out widthat \(n\)=100, the median request contains a p99 event
P05replica is slowquorum sizecommit 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.

ProjectStage 1Stage 2Ceiling measured in
P02graph traversal to ef candidatesexact distancesrecall@ef
P03planner picks a strategyscan or traversethe strategy's own recall
P08popularity / ANN top-CBPR model re-rankblock 7's ceiling column
P01draft model proposes \(k\) tokenstarget model verifiesacceptance 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.

ProjectWhat you may not doWhat that buys
P06read shared mutable state in map/reduceany task may be re-run anywhere, any time
P07depend on processing-time orderdeterministic replay from a checkpoint
P05apply commands out of log orderstate machine replication
P13mutate a tensor an op depends onthe 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.

ProjectDialFast endCorrect end
P07watermark lag + grace93.6% in 2 s100% in 100 s
P02efrecall 0.29 at 192 µsrecall 0.81 at 856 µs
P09exploration rategreedy: most clicks, 96 items aliveUCB1: 600 items alive, −16% clicks
P10sample sizefast, underpowered, 8× inflated estimatesslow, 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.

ProjectFixed costBatchAmortisation
P04fsync ~100 µsmemtable → SSTable1000×
P03fsync + segment metadatasegment of vectors~1000×
P05round trip + fsyncgroup commit of log entries10--100×
P01reading all weights (memory-bound decode)continuous batchingup to batch size
P12page walk on TLB misshuge pages512× TLB reach
P02DRAM latency 121 nsbatched 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.

QuantityValueWhere it decides something
L1 / L2 / DRAM0.91 / 5.94 / 121.10 nsP02, P04, P14
Ratio L1:L2:DRAM1 : 6.5 : 133every data-structure layout choice
Syscall127.59 nsP12, io_uring's reason to exist
Context switch1,383--1,706 nsP12 quantum sizing
fsync90--105 µsP04, P03, P05
Measured bandwidth50--99 GB/s (working-set dependent)P14 roofline
fp32 / fp64 peak1937 / 469 GFLOP/sP14 — and one roofline per dtype
Ridge point, fp32~39 FLOP/bytewhich wall a kernel hits
Bloom FPR at 10 bits/key0.0082P04, 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.

ProjectLooks hardActually hard
P01the attention formulathe causal mask, and knowing the entropy floor
P02the graph algorithmmeasuring contrast before trusting any recall number
P03the indexthe planner's cardinality estimate
P04compactionproving durability with a real crash test
P05leader election§5.4.2 and membership changes
P06the programming modelstragglers and skew
P07windowingchoosing and stating the completeness assumption
P08the modelthe split, the baseline, and the head mass
P09the banditmaking the user model falsifiable
P10the t-testthe stopping rule and SRM
P11the parserdispatch, and the host's cost model
P12the kernel mechanismsthat policy barely matters when the working set does not fit
P13the chain rule+= on diamonds, and un-broadcasting
P14the roofline formulagetting the ceiling and the byte count right
P15the integrationthe 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.