a learning program, from first principles

Computer science from the roots, upward.

Every technical field has a root layer its practitioners know and everyone else waves away. deep-roots goes down and stays there: each module rebuilds one field from the physics up, so that what others memorize, we derive. Module 01 — the memory models of programming languages — is the root of them all, and twenty-one more modules are now live: security, bugs, decompilation, Android, iOS, desktop kernels, COBOL, concurrency, compilers, databases, GPUs, networking, file systems, virtualization, browsers, hardware, cryptography, type systems, embedded, verification, ML infrastructure — connected by a thousand-plus cross-references (see the connections map). What insiders know, written down.

132
chapters
22
modules
~475k
words
22
final exams

Module 01 — memory models

Twenty-three chapters in four parts. Every chapter ends with What insiders know, a See it yourself lab with real commands, the connections to every other chapter, and a quiz with worked answers. The whole module lands on one comparison table: sixteen languages, four questions, sixty years of design decisions.

Part I · the machine

Where every abstraction is derived, not asserted: the physics, the tower, the illusion, and the two machines every language divides labor between. Read in order — the rest of the module is this argument.

01

Memory from silicon

DRAM cells, addresses, alignment, endianness — why memory is shaped the way it is.

→
02

The hierarchy: latency is the tax, locality is the loophole

The latency tower, the 64-byte line, locality — the physics behind all performance.

→
03

Virtual memory: the grand illusion

Page tables, TLB, demand paging, COW, ASLR, swap — the OS grand illusion.

→
04

The stack: the shape of call lifetimes

Frames, prologues, calling conventions — why local variables are free.

→
05

The heap: the everything-else machine

The everything-else machine: metadata, the three taxes, fragmentation.

→
06

Object layout: what a "value" really looks like in RAM

Unboxed/boxed/tagged, headers, vtables, fat pointers — what a value really is.

→
07

Assembly: the reference model

x86-64 and ARM64 ground truth — the layer no language can hide.

→
Part II · the languages

Sixteen memory models, each positioned by the four questions: what is a value, who owns it, who frees it, what safety. From C’s explicit contract to COBOL’s radical alternative.

08

C: the explicit model

The explicit model: you own it, you free it, the language promises nothing.

→
09

C++: lifetime is scope (RAII)

RAII: lifetime is scope; smart pointers as ownership arithmetic.

→
10

Rust: ownership, borrows, and the third way

Ownership and borrows: safety at compile time — the third way.

→
11

Go: escape analysis and the concurrent GC

Escape analysis, moving goroutine stacks, the concurrent GC.

→
12

Java: the generational heap of the JVM

The generational JVM heap: headers, TLABs, collectors, the 32 GB cliff.

→
13

C# and .NET: value types on a GC heap

Value types on a GC heap: boxing, LOH, spans.

→
14

Python: everything is a PyObject

Everything is a PyObject: refcounts, the cycle detector, pymalloc.

→
15

JavaScript: V8's hidden classes and the scavenger

Hidden classes, the scavenger, the leak-hunting heap graph.

→
16

Swift and Objective-C: the compiler counts (ARC)

ARC: the compiler counts; side tables, COW, no swap.

→
17

COBOL: the memory model with no heap

The memory model with no heap: PICTURE bytes, fixed records, why banking runs on it.

→
18

The elders: where every memory idea was invented

Fortran, Lisp, Haskell, Erlang, Ada, Zig — where every idea was invented.

→
Part III · the deep end

The machinery under malloc, the physics of multicore disagreement, the security consequences of every design decision, and the platforms that made memory a scheduled resource.

19

Allocators: the machinery under malloc

dlmalloc bins, tcache, tcmalloc, jemalloc, slab — the machinery under malloc.

→
20

The hardware memory model: why cores disagree about memory

MESI, store buffers, atomics, fences — why cores disagree about memory.

→
21

Memory security: how every model fails

Overflows, UAF, heap attacks, ROP, Rowhammer — how every model fails.

→
22

Mobile memory: Android and iOS, where the OS is the GC

Zygote, ART GC, Jetsam, compression — where the OS is the GC.

→
Part IV · the payoffs

One table for every language, the instrument for every question, the practice path, and the exam.

23

The unification: one table, every language, every payoff

One table for every language, the toolkit, the practice path.

→
the exam
fin

Module 01 final exam

Thirty questions across all twenty-three chapters, worked answers behind the fold — or take the interactive quiz.

→

The other twenty-one fields — all live

Memory first because everything else is a consequence: security bugs are memory bugs, decompilation reads stack frames and vtables, mobile OSes are memory-driven schedulers, COBOL is a memory model, distributed consistency is the memory model at scale, and compilers, databases, and GPUs are the factory, the disk-scale, and the new wing of the same tower. The second round went further: networking, file systems, virtualization, browsers, and hardware. The third round closed the ring: cryptography (where a cache miss is a breach), type systems (the theory under every language the program taught), embedded (the safety net removed), verification (the proofs behind the promises), and ML infrastructure (the tower rebuilt at datacenter scale). Every module below is fully written, quizzed, and final-examined.

M02

Memory security & exploitation

The dark mirror of module 01: canaries, tcache poisoning, ROP, MTE, Rowhammer — every design decision as attack surface.

LIVE
M05

Android internals

Zygote and COW, ART object model and GC, Binder, lmkd, OTA — an OS designed by memory constraints.

LIVE
M06

iOS internals

XNU VM, Jetsam bands, the compressor, Mach ports, DYLD shared cache, code signing as memory trust.

LIVE
M07

Desktop OS internals

Windows (TEB/PEB, heap manager, LFH), Linux (ELF, vdso, slab, OOM), macOS (Mach VM, shared cache) — three concrete pagetable worlds.

LIVE
M08

COBOL & the mainframe world

The fixed-record universe deep dive: storage sections, PICTURE, CICS, AMODE — why the world’s money runs on no heap.

LIVE
M10

Compilers & runtime internals

Where memory models are manufactured: register allocation, escape analysis, barrier insertion, layout choices.

LIVE
M11

Database storage engines

The disk is the new heap: B-trees, LSM, buffer pools as hierarchy, MVCC as copy-on-write.

LIVE
M12

GPU & AI accelerator memory

HBM, the CUDA hierarchy, coalescing as cache lines, allocator arenas in training — a new level of the tower.

LIVE
M13

Networking internals

The stack as a memory machine: DMA rings, sk_buff, TCP windows, epoll, io_uring, QUIC, RDMA — buffers all the way down.

LIVE
M14

File systems & storage

The disk is the heap that outlives the process: FTL garbage collection, the page cache, journals, CoW lineages, overlayfs.

LIVE
M16

Browser engine internals

An OS that renders: process-per-site, Oilpan, the 16.6 ms budget, layout thrashing, site isolation.

LIVE
M18

Cryptography internals

The memory model of trust: entropy from physics, AES and its modes, bignum layouts as attack surface, TLS 1.3 as key erasure, the failure catalog.

LIVE
M19

PL theory & type systems

Types as theorems: soundness proved, null as the billion-dollar lie, memory safety as a theorem, GC as proof search, the limits.

LIVE
M20

Embedded & firmware

The world with no MMU: the memory map in silicon, linker scripts as the memory model, interrupts and DMA, the RTOS, secure boot.

LIVE
M21

Formal verification

The machines that prove programs: Hoare logic, model checking and the state explosion, seL4, the borrow checker as separation logic, CompCert.

LIVE
M22

ML systems & training infrastructure

The distributed memory machine: tensors, the autograd tape, ZeRO and the five parallel axes, the KV cache, collectives and the datacenter.

LIVE

The method

First principles, downward. Each module starts at the physical layer and builds up — no fact is allowed to be memorized if it can be derived. Where a number matters, the number is stated and the platform named; where a simplification is made, it is flagged.

The insider test. Every chapter has a What insiders know section — the sizes, thresholds, flags, failure modes, and folklore that people inside the field use daily. See it yourself labs make every claim reproducible on a laptop: /proc, gdb, perf, ASan, heap snapshots, dumpsys. Research that nobody can check is a diary.

Quizzes with teeth, connections or it didn't happen. Questions predict output, diagnose bugs, and attack false intuitions — with worked answers. Every chapter ends by naming exactly what transfers to the other chapters and to the queued modules: one root, seventeen trees.

About

deep-roots is a learning program, not a tutorial dump. It is the education program of the srivtx line of work — a sibling of srivtx/p-rick, the research program on missing software. Where p-rick specifies software the world lacks, deep-roots rebuilds the knowledge most engineers lack. Both run the same discipline: work tracked in an automatic session ledger (agents.md), sources open, claims checkable.

Everything here is open: markdown sources, this site (GitHub Pages, dark and light), the interactive quiz, and the full roadmap. MIT-licensed — use it, teach it, fork it.