Chapter 1: Why 42,375 Translation Units Took 2.5 Hours
Chapter 1: Why 42,375 Translation Units Took 2.5 Hours
Lineage: Green Dragon (1977) → Red Dragon (1986) → Purple Dragon (2006) → White Dragon (2026)
Live Proof: sections/chromium-build/THIRD-PARTY-ALGO-AUDIT-REPORT.md
1.1 The Dragon Book Assumption That Broke at Browser Scale
When Aho, Sethi, and Ullman published the Green (1977) and Red (1986) Dragon Books — and when Lam joined them for the Purple Dragon (2006) — the compilation unit was modeled after a single-CPU Von Neumann machine: read a text file from disk, expand preprocessor macros, parse an AST, emit an isolated .o blob, and hand a mountain of .o files to a disk-bound linker.
At 40 source files, textual inclusion is an optimization. At 42,375 translation units (a real Chromium release build), it becomes a quadratic tax that burns 2.5 hours of wall-clock compute and emits 551 DLLs totaling 1,298.95 MB (1.30 GB) on disk. The compiler is not spending 2.5 hours generating machine code; it is re-lexing and re-instantiating the same 500,000-line C++ header graph (v8.h, absl, skia, Oilpan, <vector>, <memory>) tens of thousands of times in parallel, then thrashing NVMe I/O while lld-link merges gigabytes of duplicate COMDAT symbols.
/* Classical Von Neumann TU boundary: 1 line of intent, ~480,000 lines preprocessed */
#include "v8/include/v8.h"
#include "third_party/abseil-cpp/absl/container/flat_hash_map.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
/* Every downstream TU re-parses template instantiations, allocator traits,
* and private layout offsets — coupling binary compatibility to header text. */
1.2 The #include Tax and the C++ Layout Coupling Trap
Why does changing a single private field in a core header trigger a multi-thousand-TU rebuild storm? Because Von Neumann C++ compilers conflate interface with memory layout:
- Textual Expansion Explosion: A 60-line
.ccfile routinely expands to> 2.5 MBof preprocessed C++ tokens before semantic analysis even begins. - Template Re-Instantiation: Identical
std::vector<T>,absl::StatusOr<T>, and Mojo traits are instantiated independently in thousands of TUs, only to be discarded by the linker during COMDAT folding. - Monolithic Link Barriers:
lld-linkmust ingest all.objsections before resolving cross-DLL imports, serializing the entire pipeline behind a disk-bound global barrier.
1.3 Empirical Audit: 286 / 333 (85.9%) Third-Party Bloat
To separate irreducible algorithmic value from Von Neumann boundary bloat, Awesome-OS audited all 333 third_party/ directories of a real linked Chromium build (out/B8gRelease, 551 DLLs, 1,298.95 MB) in 226,985 ms:
| Audit Bucket | Directories | % of third_party/ |
C/C++/Rust Files | ASM Files | Source Size | Post-Neumann Action |
|---|---|---|---|---|---|---|
KEEP-ALGO |
47 | 14.1% | 25,175 | 1,843 | 718.48 MB | Wrap in B8gDepModuleV3 (lazy, origin-scoped) |
REPLACE-NATIVE |
28 | 8.4% | 2,427 | 12 | 73.86 MB | Collapse into < 500 LOC B8G_ARENA_V1 primitives |
WRAPPER-OVER-WRAPPER |
81 | 24.3% | 5,794 | 4 | 256.59 MB | Delete via zero-header B8G-ABI C11 dispatch stubs |
DEAD-WEIGHT |
177 | 53.2% | 9,800 | 46 | 286.14 MB | Strip from build graph (0 B shipped) |
The Verdict: 286 of 333 (85.9%) third-party trees are not irreducible algorithms (boringssl, ffmpeg, dav1d, skia, icu, zstd). They are glue layers, duplicate utilities, and build scaffolding forced into existence because C++ lacks a stable, zero-header binary boundary.
Duplicate Functional Clusters Exposed by the Audit
Because C++ libraries cannot share an ABI without sharing header graphs, Chromium ships redundant implementations across nearly every primitive domain:
- Compression (
6copies):zstd,brotli,zlib,lzma_sdk,libzip,snappy. - Hashing & Checksums (
4copies):farmhash,smhasher,crc32c,rapidhash. - Serialization & Parsing (
19trees):protobuf,flatbuffers,nlohmann_json,jsoncpp,libxml,expat,inspector_protocol, and 12 others. - Wrappers & Platform Glue (
227trees):nearby,openscreen,grpc,devtools-frontend,llvm-build, and 222 adjacent adapters whose sole job is translating one C++ object model into another.
Each duplicate cluster multiplies both the #include fan-out (42,375 TUs × ~2.5 MB preprocessed text ≈ >100 GB of C++ lexed per clean build) and the lld-link symbol table pressure across 551 DLLs.
1.4 Historical Contrast: Von Neumann vs. Post-Neumann Compilation
| Architectural Dimension | Green / Red / Purple Dragon (1977–2006) | White Dragon / Post-Neumann (2026) |
|---|---|---|
| Boundary Unit | Textual #include header graphs (100K–500K LOC) |
Zero-header C11 dispatch tables (<stddef.h> + <stdint.h>) |
| Cache Key | File timestamps (mtime) + opaque .o blobs |
Content-addressed .b8p CAS packs + sub-TU block hashes |
| Linking Phase | Disk-bound monolithic ld / lld-link (551 DLLs) |
W^X (RW → RX) in-memory trampolines (0.893–1.968 ms) |
| Dependency Footprint | 333 bundled trees (1,298.95 MB linked) |
47 KEEP-ALGO kernels loaded lazily (0 B idle RAM) |
| Memory Teardown | Per-object free() + tracing GC pauses |
B8G_ARENA_V1 VirtualFree/munmap in O(1) (233 µs) |
| Rebuild Latency | 2.5 hours cold / minutes incremental |
170 ms per ABI module / < 190 ms sub-TU recompile |
1.5 First Principle of the White Dragon
A compiler should never parse a byte it has already hashed, never link a symbol an origin never calls, and never expose a private C++ layout across a module boundary. In Chapter 2, we replace heavyweight syntax trees with a four-operator composition algebra (^, &, |>, ∇) that makes orthogonal boundaries provable at both compile time and runtime.