Systems concepts, slowly enough to follow.
Small interactive simulations in a guided order. Pick a path, start at step one, and let each chapter earn the next.
- FlashAttentionWatch attention drop its biggest memory bill, tile by tile.
- The KV cacheWatch one new token meet the whole past, without re-reading it.
- QuantizationWatch a model's weights shrink from 16 bits to 4 — and see what it costs.
- Continuous batchingWatch the GPU idle between requests, then fill every gap.
- Speculative decodingWatch a small model guess ahead and a big model check four guesses at once.
- Attention variants: GQA & MLAWatch eight heads give up their private copies of the past.
- The tokenizerWatch a sentence merge into tiles, and tiles become the ids a model sees.
- Sampling & temperatureWatch raw scores become shares, temperature reshape them, and one drawn number pick the token.
- MoE routingWatch one token visit only the experts it needs — a router scores, a top-2 gate opens, the rest stay dark.
- Long contextWatch a prompt outgrow the model twice — positions run out, then memory does — and a rotation trick plus a ring of devices open both doors.
System design
One server is never enough. The standard moves, in the order they earn each other.
Start here →- Load balancerWatch requests queue behind one server, then spread across three — and route around a failure.
- CachingWatch a miss fill the cache, hits answer in a blink, and a stale copy expire and refetch.
- CDNWatch an edge cache miss once to the origin, then serve its region's hits — while a second region stays cold until its own first ask.
- Database replicationWatch a write stream from the primary to the replicas, reads spread out — and one quick read arrive before the copy does.
- ShardingWatch one database split into three slices by key, writes and reads route to their own shard — and one celebrity key defeat the whole split.
- Message queuesWatch a slow request become a job, a burst turn into a backlog instead of an outage, a crashed worker's job come back — and the duplicate get caught.
- Consistent hashingWatch mod-N scatter every key when a server dies, then a hash ring move only one slice — and virtual nodes even the slices out.
C++: owning your memory
Where values live, who owns them, and how they move without copying.
Start here →- Smart pointersWatch C++ memory free itself, owner by owner.
- RAII beyond memoryWatch a mutex leak on the early return, then watch one small object release it on every way out.
- Move semanticsWatch a copy double a heap block, then watch the same block change owners without duplicating a byte.
- The stack and the heapWatch a local die at the closing brace while an owned block survives the function that made it.you are here
- Copy elision & RVOThe copies that silently disappear.in the works
- Object lifetime & UBWhere "it worked on my machine" comes from.in the works
- Allocators & arenasThe garden behind the heap.in the works
C++: the machine
What the hardware really does with your code.
First chapter in the works- Branch prediction & cache-friendly codeThe machine under big-O.in the works
- SIMDOne instruction, eight lanes — the speedup hiding inside one core.in the works
- The memory model & atomicsWhat one thread is allowed to see. The hardest chapter in the plan.in the works
Agents that act
Models that observe, decide, and do.
First chapter in the works- The agent loopObserve, think, act, repeat.in the works
- Tool calling & structured outputThe model hands back a plan, not prose.in the works
- Context engineeringWhat fits in the window, and what to drop.in the works