Documentation Index

§ docs/README.md 1,162 words τ ~6 min read

Every code citation in this tree uses file.py:Symbol anchors

(e.g. models/mask.py:build_block_causal_mask); scripts/check_docs.py

fails on any anchor that stops resolving, and --coverage fails if a public

symbol in models/, training/, data/, inference/, utils/ is never

cited. Line-number citations are rejected — they rot. The measured state of

this tree — verification runs, findings, acceptance criteria — is recorded in

AUDIT.md.

Visual systems atlas#

Explore the Interactive Visual Systems Guide: five verified Archify showcase maps (System Overview, Forward Pass & Block Attention, Data Pipeline, Discrete Sampler, Training Pipeline), interactive D3PM cosine noise simulator, block-causal mask inspector, and verification receipts.

Corpus size#

Measured 2026-09-21 (wc -w, md files only; excludes diagrams/ and

docs_html/):

trackfileswords
concepts/1141,366
references/103,983
guides/95,214
training.md + inference.md27,477
README.md + AUDIT.md22,226
../DIFFUSION.md13,237
total3563,503

Reading order#

#doclinesread when
1../DIFFUSION.md464start here — the authoritative engineer's contract (all math + semantics + rulings)
2concepts/block-diffusion.md99beginner — the uniform-state formulation in one page: corruption process, what "uniform state" means, why canvases, x0-parameterization
3concepts/foundations.md1,074the from-scratch textbook chapter: AR → diffusion → D3PM → every primitive derived, worked forward pass, param accounting
4concepts/diffusion-core.md719forward process, cosine schedule, x0-parameterization, chunked-CE
5concepts/block-causal-attention.md720mask derivation, GQA + RoPE at production dims, three attention paths, KV chaining
6concepts/canvas-denoising.md92how one 256-token canvas is generated in parallel: per-step semantics, commit rule, decode mask, re-encode
7concepts/self-conditioning-mechanism.md98the self-conditioning mechanism in one page: zero-init, when the input is fed, train/test symmetry
8concepts/self-conditioning.md525zero-init equivalence, detached pre-pass, cross-step eval conditioning
9concepts/sampler.md711decode loop, commit rule, temperature annealing, entropy bond, FLOP accounting
10concepts/memory-engineering.md644the byte budget, chunked-CE memory argument, VRAM-for-MFU trade
11concepts/chunked-ce-equivalence.md100expert — the proof that training/losses.py:chunked_x0_ce equals the eager CE, and the tests that pin it
12concepts/data-pipeline.md482shard/window contract, no-+1-shift rationale, resumable shuffler
13training.md523the training loop, determinism recipe, NaN guard, checkpointing, A100 run
14inference.md469eval harness, headline metric, honest gaps
15references/R1_config.md82every model/runtime/sampler knob
16references/R2_transformer_api.md54models/transformer.py API
17references/R3_mask_attention_api.md51mask + attention + block + time-embed APIs
18references/R4_diffusion_api.md39diffusion + self-conditioning APIs
19references/R5_loss_training_api.md35chunked loss + trainer API
20references/R6_sampler_eval_api.md41sampler + eval APIs
21references/R7_data_utils_api.md52data + checkpoint + memory + logging APIs
22guides/quickstart.md126data → train → eval commands with expected outputs
23guides/learning-paths.md82three audience-routed step tables (beginner / intermediate / expert) through the whole corpus
24guides/glossary.md115notation table + per-component term tables — the single cross-cutting lookup
25guides/debugging-playbook.md106NaN rollback, resume divergence, shape errors, anchor failures
26guides/sampler-tuning.md46SamplerConfig knobs: what to touch, what not to
27guides/benchmarking.md57honest speedup/VRAM/MFU discipline
28guides/checkpoint-ops.md53checkpoint layout, resume recipes, disk hygiene
29guides/contributing.md58the doc contract + gates for new code
30guides/a100-runbook.md89A100 pod operational sequence, boundary checks, resume
31references/eval-scripts.md120B1–B6 gates, flags, CPU vs A100 forms, PASS/DISCLOSED semantics
32AUDIT.md112measured verification runs, findings, condensed codebase map, acceptance criteria

Concepts track#

docaudiencecore topics
block-diffusion.mdbeginnercorruption process, uniform state, why canvases, x0-parameterization
foundations.mdbeginnerAR → D3PM lineage, transformer primitives from scratch, param accounting, worked forward pass
diffusion-core.mdintermediateforward process, cosine schedule, per-canvas t, x0 vs xt, chunked-CE memory story, time conditioning
block-causal-attention.mdintermediatemask derivation, GQA + RoPE, three attention paths, KV chaining
canvas-denoising.mdintermediateper-step semantics of one canvas, commit rule, all-ones decode view, re-encode
self-conditioning-mechanism.mdintermediatezero-init, feeding schedule, train/test symmetry, one-add routing
self-conditioning.mdexpertzero-init proof, detached pre-pass, cross-step conditioning, worked examples
sampler.mdexpertdecode loop, commit derivation, Gumbel draw + temperature, entropy bond, FLOPs
chunked-ce-equivalence.mdexpertchunked-CE ≡ eager CE proof sketch, fp32 logsumexp boundaries, backward identity, test pins
memory-engineering.mdexpertbyte budgets, chunk-scaling law, VRAM-for-MFU trade
data-pipeline.mdintermediateshard/window contract, no-+1-shift, resumable shuffler

File→doc map#

modulewhere documented
models/transformer.pyreferences/R2, foundations §5
models/mask.py, models/attention.py, models/block.pyblock-causal-attention, references/R3
models/diffusion.pyblock-diffusion, diffusion-core, references/R4
models/selfcond.py, models/time_embed.pyself-conditioning (+ mechanism), references/R4
training/losses.pychunked-ce-equivalence, memory-engineering, references/R5
training/pretrain.pytraining.md, references/R5
data/prepare_data.py, data/dataset.pydata-pipeline, references/R7
inference/generate.pycanvas-denoising, sampler, references/R6
inference/evaluate.pyinference.md, references/R6 + eval-scripts
utils/checkpoint.py, utils/logging.py, utils/memory.pyreferences/R7, checkpoint-ops

Every concept doc carries its own glossary, "what breaks if you change this"

table, and embedded interview Q&A. First read for the foundations:

concepts/foundations.md; for rulings and deltas, ../DIFFUSION.md stays

authoritative. If you don't know where to start, guides/learning-paths.md

routes you by background and goal; for a term you don't recognize,

guides/glossary.md.

House rules#

  • Docs ship with code; stale docs fail CI (AGENTS.md §6). Rename/move a
    public symbol → update every citing doc in the same commit.
  • Anchor style: file.py:Symbol, file.py:Class, or
    file.py:Class.method. Never line numbers.
  • Gates (run after any doc or code change):
bash
uv run --python 3.13 --with torch --with numpy --with pyyaml \
  --with safetensors --with pytest python -m pytest -m "not gpu and not slow"
uv run --python 3.13 --with torch --with numpy --with pyyaml \
  --with safetensors --with pytest python scripts/check_docs.py --coverage --links
python3 scripts/build_docs_html.py
  • The SDD decision ledger (rulings 1–26) lives in
    .superpowers/sdd/EXECUTION-PLAN-diffusiongemma-lite/progress.md; the
    DESIGN/EXECUTION-PLAN specs live in ../../llm-research/ outside the repo.