Labs
One lab per part. Each is seeded, runs in seconds with nothing to download, checks its own result against the theory it illustrates, and ends with three things to change. They are written on Pebble and its tools: the computer the series builds from NAND gates, with its assembler, emulators, compilers, algorithms and systems models.
pip install numpy scipy matplotlib
python -m videos.cs.labs --list
python -m videos.cs.labs 1 --show
python -m pytest -q tests/test_courses.py -k cs
Lab 1 · What Is a Computation?Busy beavers by brute force, and what one tape costs
Lab 2 · Proof and CountingAn invariant against a search, and one fixed point on average
Lab 3 · Logic from SwitchesOne gate is enough, and what two levels cost
Lab 4 · ArithmeticCarries in a chain and in a tree; rounding error in a sum
Lab 5 · Memory and TimeA latch, a register file and every shift register of degree 2 to 8
Lab 6 · The Stored-Program ComputerPrograms on Pebble: Euclid, a Turing machine, and the Job, version 0
Lab 7 · PipelinesEvery bubble counted: a sort on the five-stage pipeline
Lab 8 · Out of OrderThe dataflow limit of a table scan
Lab 9 · The Memory HierarchyLoop order, stack distance and the scan that defeats LRU
Lab 10 · Parallel MachinesBrent's theorem, two scans and a sorting network
Lab 11 · The Running ProgramHoles in the heap, and 81 bytes on the stack
Lab 12 · Languages and AutomataA regex that doubles, and an automaton that does not
Lab 13 · The CompilerSSA interference graphs are chordal, until the copies come back
Lab 14 · Lambda and TypesChurch arithmetic, confluence and type safety, by machine
Lab 15 · RuntimesWhat a copying collector costs, and what a missing barrier loses
Lab 16 · Counting StepsCounting comparisons: the lower bound, and quicksort's average
Lab 17 · Data StructuresProbes against load, and the depth of a random search tree
Lab 18 · GraphsExact routes with less search, and flows certified by cuts
Lab 19 · The Great ParadigmsThree products, n log n butterflies, and one problem four ways
Lab 20 · Randomness as a ResourceCoins against their bounds
Lab 21 · StringsFour matchers, one transform, one diff
Lab 22 · GeometryOne predicate, and the shadow of a hull
Lab 23 · OptimizationA certificate, an exponential walk, and three guarantees
Lab 24 · Algorithms in PracticeWhat a range structure touches
Lab 25 · UndecidableDominoes that compute: bounded search, a reduction, and PRIMEGAME
Lab 26 · P versus NPReductions that preserve the answer, and the 3-SAT threshold
Lab 27 · Proofs and RandomnessSoundness, measured: sum-check and fingerprints against their bounds
Lab 28 · Error-Correcting CodesHamming(7,4) against its exact curve, and Reed-Solomon's 2e + f rule
Lab 29 · SecretsAES from scratch: the standard's vector, the avalanche, ECB, and the birthday bound
Lab 30 · Public KeysEasy forwards, a square root backwards: Diffie-Hellman, RSA and their generic attacks
Lab 31 · The KernelThe convoy, and why a busy server is slow
Lab 32 · Virtual MemoryWhich page to evict: Belady's anomaly and the stack property
Lab 33 · ConcurrencyEvery schedule of a race, and a lock that the store buffer breaks
Lab 34 · StorageCrash at every write, and what spare flash buys
Lab 35 · DatabasesJoins by the page, and which interleavings are safe
Lab 36 · Networks I: Moving BitsALOHA's 1/2e and the count to infinity
Lab 37 · Networks II: Reliable ConversationOnly AIMD is fair, and TCP is an optimizer
Lab 38 · Distributed Systems I: AgreementRaft under attack: invariants, a planted bug, and split votes
Lab 39 · Distributed Systems II: ScaleQuorums that overlap, and the tail at scale
Lab 40 · Software EngineeringWhat a change costs: Parnas's modules, Brooks' law, and estimates
Lab 41 · Version Control, Builds and DependenciesThree machines, one idea: hashes, rebuilds and version solving
Lab 42 · The Browser and the WebGreedy against total-fit line breaking, checked by brute force
Lab 43 · APIs and ServicesAt most once, at least once, exactly once
Lab 44 · People and ProductsPeeking, a sequential test, and CUPED
Lab 45 · The CloudBin packing bounds, a delayed control loop, and the nines
Lab 46 · Logs, Streams and WarehousesWatermarks, checkpoints and repetition levels
Lab 47 · Search EnginesPostings merged, compressed and pruned; PageRank as an eigenvector
Lab 48 · System Design I: Building BlocksThree blocks against their formulas: a cache, a rate limiter, an expiring key
Lab 49 · System Design II: Case StudiesFour designs under test: fan-out, dispatch, dedup and double entry
Lab 50 · Keeping It RunningAvailability, a retry storm, and a sketch that keeps its promise
Lab 51 · Light and PixelsSamples of light: noise, roulette and the white furnace
Lab 52 · Computing with Real NumbersWhich answers to trust: backward error, pivoting, and two fast solvers
Lab 53 · Quantum ComputationFive quantum claims, each checked on a state-vector simulator
Lab 54 · Proving Programs CorrectFive midpoints, one solver, and every 8-bit input
Lab 55 · Trusting TrustA trojan with no source, caught by a second compiler
Lab 56 · Spectral Graphs and ExpandersWhat the second eigenvalue promises: cuts, walks and expanders
Lab 57 · Learning TheoryBounds against measurements: PAC, VC, margins, regret
Lab 58 · SemanticsThree interpreters, one meaning
Lab 59 · Distributed Computing TheoryLocality, a liar and a lemma
Lab 60 · Domain-Specific HardwareA matrix product as a wave
Lab 61 · Doing ResearchHow not to fool yourself with a stopwatch