Maps to: CMU 15-213/15-513/14-513 Fall 2026, Lecture 25 (Dec 03), “Frontiers of Computing” (Gibbons). Reading: none assigned; this is a reflection lecture. Sources: the public Fall 2026 schedule, CS:APP, and the published literature cited inline. There is no code folder for this lecture — it is a reading-and-reflection close. Every measurement quoted below was produced by an earlier lecture’s demos on an Apple M4 Pro and is labelled with its lecture. Reading time: ~60 minutes.
0. How to read this lecture
0.1 What this lecture is for
The previous 24 lectures took one abstraction apart at a time. This one steps back and asks two questions:
- Where do these ideas go next? Which of them are still being actively rebuilt, and what replaced the assumptions the course made?
- What was the point? The five realities of Lecture 1 were a promise. This lecture collects the evidence the course accumulated against them, and says what to do with it.
There are no exercises with answers to reveal here, and nothing to run. There is a course review (§7), a set of pointers to what comes next (§8), and a short argument about what this material is actually for (§9).
0.2 A note on scope
This lecture names real systems and real vulnerabilities. It treats them the way the course has treated everything: as abstraction leaks to be understood and defended against. Security material stays at the level of mechanism and mitigation — which is where the understanding lives — and includes nothing operational.
1. The engine that stopped: Dennard scaling and the turn to specialization
For about thirty years, computers got faster for free. Moore’s law (transistor counts doubling roughly every two years) was the famous half, but the half that mattered to programmers was Dennard scaling: as transistors shrank, their power density stayed roughly constant, so each generation could run at a higher clock on the same power budget. You wrote ordinary single-threaded code and it got faster every 18 months.
Dennard scaling broke down around 2004–2006. Power density stopped falling, clock speeds flattened near 3–4 GHz, and the industry turned the transistor budget sideways into more cores instead of faster ones. That is the historical reason Lectures 21–24 exist at all: concurrency stopped being a specialty and became the only way to use a new machine.
Moore’s law itself has slowed, and the response has been specialization. If you cannot make general-purpose cores much faster, build hardware that does one class of work far more efficiently:
- GPUs: thousands of simple cores for data-parallel work, with memory systems built for bandwidth rather than latency.
- TPUs / NPUs: systolic arrays for the matrix multiplications that dominate neural networks.
- Fixed-function blocks: video encoders, cryptographic accelerators, and the “neural engine” on the laptop these notes were written on.
- Heterogeneous CPUs: Lecture 24’s measurement — 8 performance cores plus 4 efficiency cores — is specialization, inside what we still call “the CPU”. It is why the speedup curve had a knee at 8 rather than scaling to 12.
The programmer-visible consequence is that the machine is no longer one thing. Lecture 1’s model — a processor executing instructions over a flat memory — is now the description of one engine among several, each with its own memory, its own performance model, and its own cost of moving data in and out. Most of the difficulty in modern performance work is deciding where a computation should happen and how often data must cross between engines.
2. The memory wall, which this course measured
The gap between processor speed and memory speed grew for decades, because processors improved faster than DRAM latency did. That is the memory wall, and it is why Lectures 9–12 occupy a sixth of the course.
The course did not merely assert it; it measured it repeatedly:
- Lecture 9 — the same sum over the same array, row-major versus column-major: 13.8× apart, from locality alone.
- Lecture 10 — the memory mountain: ~93 GB/s on the L1 ridge down to ~3 GB/s in the DRAM corner, a 30× spread on one machine; and matrix multiply varying 20× across loop orders, with blocking recovering 6.3×.
- Lecture 24 — a 512 MB parallel sum saturating at 2.6× on 12 cores, because bandwidth is shared and adding cores cannot add bandwidth.
The last is the modern form of the wall: for a great deal of real work, the limiting resource is not instructions but bytes moved. This reframes optimization. The question “how do I make this loop faster?” has largely become “how do I touch less memory, and reuse what I touch?”
The hardware response is a stack of new memory technologies, all of which are attempts to move bytes less far:
- HBM (high-bandwidth memory), stacked beside or atop the processor — the reason a GPU can feed thousands of cores.
- Unified memory, as on Apple silicon: one pool addressed by CPU and GPU, removing the copy that used to dominate accelerator programming.
- Non-volatile memory and CXL-attached pools, which blur Lecture 9’s tidy hierarchy by adding levels that are persistent, or far away, or both.
- Processing-in-memory, which attacks the problem from the other end: move the computation to the data rather than the data to the computation.
Each of these changes the constants in Lecture 9’s hierarchy, and some change its shape. None of them repeals it. The reasoning — identify the working set, maximize reuse at each level, count the transfers — is exactly what transfers to a GPU, a TPU, or a distributed system where the next level of the hierarchy is another machine.
3. Security as a systems property
Lecture 6 treated buffer overflow as what it is: an abstraction leak. C promises you an array; the machine gives you contiguous bytes with no bound, and the difference is where the vulnerability lives. The defences that lecture covered — stack canaries, non-executable stacks, ASLR (whose per-boot randomization the demo measured) — are all attempts to make the leak harder to exploit rather than to seal it.
The last decade’s lesson is that the same reasoning applies to hardware abstractions, and the leaks there are worse because they are invisible from the source code.
Spectre and Meltdown (2018) are the canonical examples, and they are worth understanding precisely because every ingredient is something this course taught:
- The processor executes instructions speculatively past a branch it has not yet resolved (Lecture 4’s branch prediction).
- If the speculation is wrong, the architectural state is rolled back — the “contract” is preserved.
- But the cache state is not rolled back (Lecture 10). A line fetched during mis-speculation stays in the cache.
- Cache state is measurable from software by timing (exactly what the Lecture 10 memory-mountain demo does deliberately).
So a secret value can influence which line was speculatively loaded, and timing can read that out afterwards. No instruction in the program ever “accessed” the secret architecturally. The vulnerability is not a bug in anyone’s code; it is a gap between the architectural abstraction (what instructions are specified to do) and the microarchitectural reality (what the hardware actually does, including its caches and predictors).
The consequences have been structural:
- Mitigations that cost real performance — flushing or partitioning predictors, isolating page tables, inserting barriers (Lecture 24’s fences, pressed into security service).
- Whole families of follow-on work (Rowhammer, cache side channels, speculative-store-bypass variants) built on the same insight: anything shared and measurable is a channel, including caches, predictors, buses and power.
- A genuine shift in how architectures are specified, with microarchitectural state becoming part of the security contract rather than an implementation detail.
The transferable lesson is the course’s thesis in its sharpest form: an abstraction’s leaks are not edge cases, they are attack surface. Knowing where the abstraction stops — which is what this entire course has been training — is now a security skill.
4. Warehouse-scale computing
Lectures 19–20 built a client and a server on one machine. Scale that to a data centre and the quantitative facts change enough to change the design:
- Failure is continuous, not exceptional. With tens of thousands of machines, something is always broken, so the system must be designed around partial failure rather than treating it as an error path. Lecture 16’s
waiton a child becomes a distributed problem of detecting whether a remote participant is dead or merely slow — which, famously, you cannot do reliably. - The hierarchy gains levels. Lecture 9’s hierarchy ended at disk; now it continues outward to another rack and another datacentre, with latencies spanning microseconds to hundreds of milliseconds. The same locality reasoning applies, with larger constants and worse variance.
- The unit of design becomes a service, with replication, load balancing (the proxies of Lecture 20, grown up), caching at every layer, and consistency models that trade correctness guarantees for availability — a direct descendant of Lecture 24’s memory-consistency question, asked over a network where the “reordering” is measured in milliseconds.
- Efficiency becomes the headline metric, because the cost is power and capital, not developer patience. This is where specialization (§1) pays for itself.
The abstraction-versus-reality tension is identical; only the numbers moved.
5. What else is changing
Briefly, four more fronts worth knowing exist:
- Compilers and languages. Lecture 15 showed the compiler as a capable but bounded optimizer — and Lecture 22 showed it hiding a race by collapsing a loop. Rust’s ownership model is a direct response to Lectures 13–14 (memory bugs) and 21–23 (data races): make the dangerous states unrepresentable rather than merely detectable. Meanwhile sanitizers (Lecture 8) and formal verification have made real bug classes tractable.
- Virtualization and containers. Lecture 11’s virtual memory and Lecture 16’s processes are the foundations; containers are mostly namespace and resource isolation layered on exactly those mechanisms, and virtual machines add another level of address translation beneath the one Lecture 12 traced.
- Quantum computing, which is not a faster classical computer but a different machine with a different complexity landscape — relevant to this course chiefly because it will need all of systems engineering (control, error correction, I/O) built around it.
- Machine learning as a systems workload. The dominant consumer of cycles today is dense linear algebra at scale, and essentially every lesson of this course reappears there: data layout and locality, memory bandwidth as the binding constraint, numerical representation (Lecture 1’s floats; now
bfloat16,fp8and quantization), parallelism and its synchronization costs, and the engineering of distributed training.
6. The five realities, revisited
Lecture 1 made five promises. Here is what the course actually demonstrated, with the measurement that settled each.
1. Ints are not integers; floats are not reals. (L1–L2, L15)
50000 * 50000 is negative; (1e20 + -1e20) + 3.14 ≠ 1e20 + (-1e20 + 3.14). The practical sequel came in Lecture 15: multiple floating-point accumulators gave a 5.9× speedup and a different answer in the last bits, because FP addition is not associative. Representation is not a detail you can delegate — it is a design decision with both correctness and performance consequences.
2. You’ve got to know assembly. (L3–L6)
Not to write it. To read it. The course’s x86sim simulator cross-checked 547 generated-code behaviours against a real compiled binary with 0 disagreements, and a deliberately planted bug was caught immediately. Then Lecture 22 made the case unanswerably: the question “why does cnt++ lose updates?” is unanswerable in C and obvious in three instructions — and at -O2 on x86-64 it becomes one instruction that is still not atomic, which is precisely the distinction the lock prefix exists to express.
3. Memory matters, and it is not flat. (L9–L14)
13.8× from loop order; a 30× memory mountain; 20× across matrix-multiply orders; blocking worth 6.3×; a measured O(n²) from a strlen in a loop condition. And memory must be managed: Lectures 13–14 built an allocator and showed explicit and segregated free lists cutting search work ~39×, then catalogued the bug classes that make manual management hazardous.
4. Performance is more than big-O. (L10, L15, L24) Identical asymptotics, 20× apart. Multiple accumulators breaking a latency bound for 5.9×. And the parallel version of the same lesson: the same parallel code scaled 2.6× when bandwidth-bound and 6.2× when compute-bound, while a layout change alone — padding counters to separate cache lines — was worth 2.79× between two programs that were logically identical.
5. Computers do more than compute. (L16–L24)
Processes and the illusion of a private machine; signals and the fact that you cannot count them (measured: ~90% of a million were merged); files, descriptors and the three tables that explain why a forked child’s read moves its parent’s file position; sockets, where the connection arrived over IPv6 because the client walked the address list; concurrency, where an iterative server made every fast client wait 604 ms for one slow one; and finally memory consistency, where the provably-impossible outcome occurred in 99.78% of trials.
The spine running through all five is the one Lecture 1 named: every abstraction rests on a mechanism, and the leaks are where bugs, slowdowns and vulnerabilities live. The course’s method was always the same — find the abstraction, find its mechanism, measure the gap.
7. A course review
If you want to check what you actually have, these are the load-bearing skills, in dependency order.
| Unit | You should be able to… |
|---|---|
| I (L1–6) | Predict integer overflow and FP rounding; read x86-64 well enough to explain what a function does and where its data lives; explain stack frames, arrays and structs at the byte level; name buffer-overflow defences and why each is partial |
| II (L7–8) | Explain symbol resolution, relocation and static vs shared libraries; debug by hypothesis and bisection rather than by staring; use sanitizers and assertions deliberately |
| III (L9–12) | Reason quantitatively about locality; compute cache geometry and miss types; trace a virtual→physical translation through a page table and TLB; explain demand paging and copy-on-write |
| IV (L13–15) | Explain fragmentation, free-list designs and coalescing; recognize the standard memory bug classes; remove optimization blockers and expose ILP |
| V (L16–17) | Use fork/exec/wait correctly and reap children; reason about process graphs; write a signal handler that is async-signal-safe and does not assume signals queue |
| VI (L18–20) | Handle short counts; explain the descriptor tables and dup2 redirection; build a client and a server with sockets; read an HTTP transaction on the wire |
| VII (L21–24) | Build a concurrent server three ways and argue for one; find and fix a race; order locks to prevent deadlock; measure speedup honestly and diagnose bandwidth limits, false sharing and reordering |
Two meta-skills matter more than any item in that table, and both were learned the hard way in this repository’s own code:
Measure, then believe. This course’s demos were wrong several times in instructive ways, and each is recorded in a “Plan vs reality” section: a parallel speedup of 9.78× on 2 threads (a cold baseline against warm runs); false sharing “measured” at 0 ms vs 0 ms (the optimizer had deleted both loops); a readers/writers lock that was slower than a mutex (the critical section was too short to amortize it); a race that vanished at -O2 (the loop was collapsed into one add); strtok failing only 1 time in 16 000 until the window was widened, then 78.5%. Every one of those would have been a confident, wrong sentence in a worse set of notes.
Know what you do not know. The honest version of the previous skill. The (0,0) demo was written to report truthfully if the anomaly failed to appear, because absence of a reordering is not evidence of sequential consistency. That habit — distinguishing “I did not observe it” from “it cannot happen” — is the difference between a program that works and a program that has not failed yet.
8. What to read, and where to go next
Each unit of this course is the first chapter of a field. In this repository:
- Parallelism (L21–24) →
CS149, Stanford CS149 Parallel Computing: GPU programming, work scheduling, lock-free data structures, and the performance analysis this course only started. - Distributed systems (L19–20, §4) →
CMU15-440, CMU 15-440 Distributed Systems: failure models, consensus, replication and consistency, where §4’s “you cannot tell dead from slow” becomes the central problem. - Specialization and accelerators (§1–§2) →
CS217, Stanford CS 217 Hardware Accelerators for Machine Learning: systolic arrays, dataflow, quantization and the roofline model — Lecture 9’s hierarchy reasoning applied to custom silicon. - Systems for machine learning (§5) →
CMU11-868(LLM Systems) andCMU15-779(Advanced MLSys); for serving and inference specifically,CS349D(AI Inference Infrastructure).
Outside it, the traditional continuations are an operating systems course (the other side of Lectures 11–12 and 16–18), a compilers course (the other side of Lectures 3–7 and 15), a computer architecture course (the other side of Lectures 4, 10 and 24), networking (Lectures 19–20), security (Lecture 6 and §3), and databases (Lectures 13–14 and 22–23, at scale and on disk).
Primary sources worth owning rather than borrowing:
- CS:APP3e itself, reread. It is a better book the second time, once the mechanisms are familiar.
- Kernighan & Ritchie, The C Programming Language — still the clearest statement of what C actually is.
- Drepper, What Every Programmer Should Know About Memory — the long-form version of Lectures 9–10 and 24.
- Kerrisk, The Linux Programming Interface — the definitive reference for Lectures 16–20.
- Hennessy & Patterson, Computer Architecture: A Quantitative Approach — for §1 and §2 in earnest.
- The original Spectre and Meltdown papers, which are unusually readable and are §3’s primary sources.
9. What this is for
The five realities are not trivia about C and x86-64. They are the general claim that the machine underneath your abstractions has properties you cannot afford to ignore, and that claim outlives any particular machine.
The specifics in this course will age. x86-64 will matter less; this laptop’s arm64 already broke several of the textbook’s assumptions, and the notes said so each time — a 128-byte cache line instead of 64, sem_init that does not work, no pthread_barrier_t, no user-space cycle counter, a weak memory model that turns an “impossible” outcome into the common case. Those are exactly the kind of details that change.
What does not change is the method:
- Find the abstraction you are relying on, and say precisely what it promises.
- Find the mechanism underneath it, concretely enough to predict its behaviour.
- Find the gap, which is where your bug, your slowdown or your vulnerability is.
- Measure it, because your model of step 2 is probably wrong in an interesting way.
That is the whole course. It is why a programmer who understands a cache can make code 20× faster without changing its asymptotics, why one who understands a signal does not try to count them, why one who understands speculation can see why Spectre was inevitable, and why one who understands a measurement does not believe a 9.78× speedup on two threads.
The computer is not magic, and it was never flat. Now you know what it is instead.
术语表 (Glossary, English → 中文)
| English | 中文 |
|---|---|
| Moore’s law | 摩尔定律 |
| Dennard scaling | 登纳德缩放 |
| power density | 功率密度 |
| specialization | 专用化 |
| accelerator | 加速器 |
| GPU / TPU / NPU | 图形/张量/神经处理器 |
| systolic array | 脉动阵列 |
| fixed-function block | 专用功能单元 |
| heterogeneous computing | 异构计算 |
| memory wall | 内存墙 |
| HBM (high-bandwidth memory) | 高带宽内存 |
| unified memory | 统一内存 |
| non-volatile memory | 非易失性内存 |
| CXL | 计算快速链路 |
| processing-in-memory | 存内计算 |
| working set | 工作集 |
| speculative execution | 推测执行 |
| microarchitectural state | 微体系结构状态 |
| side channel | 侧信道 |
| cache timing attack | 缓存计时攻击 |
| Spectre / Meltdown | 幽灵 / 熔断漏洞 |
| Rowhammer | 行锤攻击 |
| mitigation | 缓解措施 |
| attack surface | 攻击面 |
| ASLR | 地址空间布局随机化 |
| warehouse-scale computing | 仓库级计算 |
| data centre | 数据中心 |
| partial failure | 部分失效 |
| replication | 复制 |
| load balancing | 负载均衡 |
| consistency model | 一致性模型 |
| virtualization | 虚拟化 |
| container / namespace | 容器 / 命名空间 |
| ownership model (Rust) | 所有权模型 |
| formal verification | 形式验证 |
| quantization (bfloat16, fp8) | 量化 |
| quantum computing | 量子计算 |
| abstraction leak | 抽象泄漏 |
| abstraction vs reality | 抽象与现实 |