223 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
75c25583ee fix(vol1): correct camera-ready technical content 2026-07-15 06:37:14 +02:00
Vijay Janapa Reddi
74f9ae3f14 Audit napkin math assumptions 2026-06-26 19:20:13 -04:00
Vijay Janapa Reddi
45aeb6b026 Audit citations and consolidate bibliography 2026-06-14 19:41:26 -04:00
Vijay Janapa Reddi
65946a02fe Polish Vol II SVG figures 2026-06-12 11:13:55 -04:00
Vijay Janapa Reddi
e26b6e145b Remove LEGO header import-export bookkeeping 2026-06-12 04:49:48 -04:00
Vijay Janapa Reddi
c6d214fe80 chore(audit): remove local MIT Press path assumptions 2026-06-11 16:09:10 -04:00
Vijay Janapa Reddi
92f9165d03 fix(book): harden LEGO formatting across volumes
Add native Binder checks for LEGO formatting/unit/prose contracts, extend mlsysim formatter helpers, and normalize Vol1/Vol2 LEGO output strings through typed formatters.

Validate precision-sensitive prose rendering across both volumes and promote direct math/string assembly to fmt_math, fmt_display_math, fmt_text, and domain-specific helpers.
2026-06-11 14:36:35 -04:00
Vijay Janapa Reddi
42dc55e6c6 fix(lint-lego-units): report L016 at the real line, not offset // 80
The L016 runner computed its line number as base_line + match.start() // 80,
a magic 'cols per line' guess that pointed authors at the wrong line. Count
actual newlines like the sibling L014 runner does.
2026-06-10 16:55:38 -04:00
Vijay Janapa Reddi
e9edeeafa4 Merge #1832: upgrade MiniMax caption example to M3 default
feat(captions): upgrade MiniMax example to M3 default
2026-06-10 15:36:09 -04:00
Vijay Janapa Reddi
c6c4125483 Align LEGO cells with closed-formatter prose contract across vol1 and vol2.
Fix naming mismatches, migrate ridge/intensity exports to fmt_arithmetic_intensity, adopt fmt_length and fmt_rate for distance and speed, and register fmt_length in binder checks.
2026-06-06 14:06:29 -04:00
Vijay Janapa Reddi
5b34d89c64 Merge dev into fix/lego-cell-format for retire
Resolved 36 conflicts by taking dev's side (mlsysim-deferred-polish
import migrations) and deterministically re-applying this branch's
mechanical transformations: LEGO cell reformat, dead #| label removal,
and the two #| output: false hoists.
2026-06-06 12:07:52 -04:00
Vijay Janapa Reddi
9c3dce60dc Delete the core/constants.py compat shim; migrate the whole corpus
No-backward-compat sweep, part 2. The module had been reduced to a
units-only re-export ('retired, do not add values'); per policy it is
now gone and every consumer reads the real home:

- 32 internal modules, the package __init__, and core/__init__ import
  core.units (physics modules keep their own physics/constants)
- 43 book chapters' LEGO cells migrated (star imports, named imports,
  and the appendix attribute style 'constants.VIDEO_*' -> units.*);
  lego_focal_verify confirms identical pass/flag state to pre-sweep
  (8 pre-existing structural flags, A/B-verified unchanged)
- tutorial/tools/test imports migrated (incl. binder test_units.py);
  book tests' legacy-symbol scanner treats a missing constants.py as
  'nothing defined'
- test_constants_allowlist.py rewritten as a deletion pin: the module
  (and any shim for it) must never return; core.units must keep the
  measurement surface (ureg, Q_, GB, BYTES_FP16, PRECISION_MAP, ...)
- test_mlsysim_registry_parity.py deleted: it compared registry values
  against legacy constants 'before deletion' — that migration is
  complete (registry gate list updated)
- Docs prose (DATA_MODEL, architecture, contributing) states the
  deletion instead of describing a retired shim

749 passed; binder registry gate green; star import intact.
2026-06-06 11:34:47 -04:00
Vijay Janapa Reddi
bb92b09bcc Extend Python formatter to executable LEGO cells and reformat corpus
The book-format-python hook's fence regex matched display blocks
(```python, ```{.python}) but skipped executable ```{python} cells,
so hand-aligned assignment columns accumulated unchecked in LEGO code
(931 aligned lines across 22 files).

Add a second formatting profile for executable cells:
- Black at 150 chars (keeps one-line fmt_* exports; the display-block
  70-char profile would explode them into multiline calls)
- --skip-string-normalization (preserves the corpus quote-style mix)
- #| option lines shielded with a sentinel (Black rewrites '#|' to
  '# |', which breaks Quarto cell options)
- no comment wrapping (LEGO box-drawing headers must not rewrap)
- blank-line runs collapsed to one inside cells, keeping cells compact
  and making output a fixed point for book-format-blanks, whose fence
  toggle can desync on commented-out partial code blocks

Apply the one-time mechanical reformat across both volumes. Black
verifies AST equivalence, so all cells are semantically unchanged;
binder math/code checks and the LEGO test suites pass.
2026-06-06 11:23:25 -04:00
Vijay Janapa Reddi
129fdd2b15 Convert Adam internals to algorithm 2026-06-04 13:00:55 -04:00
Vijay Janapa Reddi
bb971aab05 Enforce footnote term head capitalization 2026-06-03 13:40:01 -04:00
Vijay Janapa Reddi
4c13bdde41 Tighten introduction margin label 2026-06-03 08:03:48 -04:00
Octopus
4a8c4b9ffd feat: upgrade MiniMax default model example to M3 2026-06-03 10:37:09 +08:00
Vijay Janapa Reddi
45774f361c Fix rendered xref and bib integrity preflights 2026-06-02 21:22:46 -04:00
Vijay Janapa Reddi
23d27dcf9c Add margin figure reader alignment audits 2026-06-02 14:28:04 -04:00
Vijay Janapa Reddi
92744a40bc Move margin figure tooling into Book Tools 2026-06-02 14:19:37 -04:00
Vijay Janapa Reddi
80521aab7f Align log ladder bars to value endpoints 2026-06-02 10:10:04 -04:00
Vijay Janapa Reddi
512eb3bd7e Label log-scaled margin ladders 2026-06-02 10:06:21 -04:00
Vijay Janapa Reddi
ce50dcf30a Add leaders to ratio margin ladders 2026-06-02 09:55:40 -04:00
Vijay Janapa Reddi
775d851593 Add strict margin figure candidates 2026-06-02 09:41:29 -04:00
Vijay Janapa Reddi
a928c144e5 Tighten margin figure caption discipline 2026-06-02 09:24:19 -04:00
Vijay Janapa Reddi
46bcf87d7c Polish margin figure label placement 2026-06-02 08:00:46 -04:00
Vijay Janapa Reddi
ac21ede7e7 Merge branch 'fmt-fix' into codex/margin-figures 2026-06-01 22:49:04 -04:00
Vijay Janapa Reddi
feb1c20c65 Proof and inventory margin figures 2026-06-01 22:42:49 -04:00
Vijay Janapa Reddi
3b574c74b7 Refine margin figure placements and generation 2026-06-01 21:59:51 -04:00
Vijay Janapa Reddi
6ec64cca4f Polish margin figure system 2026-06-01 20:24:14 -04:00
Vijay Janapa Reddi
53169381ec Add semantic unit formatters and close LEGO unit warnings 2026-06-01 08:57:19 -04:00
Vijay Janapa Reddi
e7c3f7e34f Fix TFLOP/s per W rate integrity and add L011 lint rule.
GpuEfficiencyTrajectoryRecap now divides Pint quantities through OUTPUT;
L011 blocks magnitude-ratio rate reattachment without preserved denominators.
2026-05-31 19:35:08 -04:00
Vijay Janapa Reddi
5c2d9bfcd2 Fix L014 closed-name fmt detection and refresh honest baseline.
The linter silently missed *_unit_str = fmt(...) assignments; replace the broken
space-strip check with L014_CLOSED_FMT and allowlist 81 known cases until 8½-B.
2026-05-31 19:28:18 -04:00
Vijay Janapa Reddi
758e5ddfce Clear lego-units lint debt and add closure codemods.
Zero the warning baseline, retire L017 false positives, add L019 blocking and
lint tests, and ship codemods for glued fences and bulk lint fixes.
2026-05-31 19:13:23 -04:00
Vijay Janapa Reddi
60710adadd Promote L019 to block .m_as() and refresh lint baseline post-migration.
Adds error-severity L019, --write-baseline, and fixes six regressions
(NS→nanosecond, Waymo closed-fixed names); baseline now 411 warnings.
2026-05-31 19:02:36 -04:00
Vijay Janapa Reddi
9548af10e4 Add bulk .m_as() migration script and mark Step 14+ complete.
The script converts LEGO .m_as(unit) to .to(unit).magnitude with guards for
US (microsecond), byte vs Bparam, and comment-only leftovers.
2026-05-31 18:58:43 -04:00
Vijay Janapa Reddi
c37b99034e book: allow domain formatters in math check and scope lego-units to staged files
Pre-commit lego-units now lints only staged QMDs with per-file baseline so
parallel WIP does not block atomic migration commits; full-repo baseline remains for CI.
2026-05-31 17:53:05 -04:00
Vijay Janapa Reddi
8154f90099 book: add lego-units linter with warning-only baseline and CI hook
Wire lint_lego_units.py into binder check code --scope lego-units and
book-check-lego-units pre-commit with a committed warning baseline.
2026-05-31 17:47:25 -04:00
Vijay Janapa Reddi
dcf1b668ad Merge dev into feat/margin-elements for retire
# Conflicts:
#	book/quarto/contents/vol2/security_privacy/security_privacy.qmd
#	book/tools/scripts/audit/svg_audit.py
2026-05-30 18:48:39 -04:00
Vijay Janapa Reddi
91b2ae5dc1 fix(book): correct misleading margin figures and harden generator
Visual QA of all 207 margin figures surfaced figures that contradicted
their own captions/labels. Fixes:

- 6 ladder inversions where bar length taught the opposite of the data
  (P99 vs mean, Image vs Text bandwidth, FHE vs AES latency, HBM vs
  register energy, training vs inference memory, radio vs arithmetic).
  Regenerated via margin_devices with consistent-unit / mlsysim SSOT
  values.
- 5 trend/threshold figures whose shape did not match the relationship
  (cloud-edge crossover, FPS collapse, burst-vs-sustained levels) plus
  two caption reframes (retraining knee, training power).
- 7 segmented-bar figures whose labels were truncated to 4 chars and two
  whose highlight contradicted the caption (egress, optimizer state);
  regenerated readable with full labels.
- 10 passive/meta captions rewritten as declarative takeaways.

Root cause hardened in generate_margin_figures.py: _parse_number now
unit-aware (ms vs s, MB/s vs GB/s, pJ vs nJ) instead of mis-reading the
first letter of a unit as a k/M/B/T multiplier; ironbar label cap raised
from 5 chars so words are no longer chopped.
2026-05-30 18:44:55 -04:00
Vijay Janapa Reddi
c8b887249c docs: generalize internal rule-file references in comments
Replace pointers to the private project rules/docs tree (relative .claude/rules
and .claude/docs paths) in code comments and docstrings with neutral phrasing
("the project prose style guide", etc.). Load-bearing runtime paths that the
tooling reads or writes are left intact.
2026-05-30 17:32:19 -04:00
Vijay Janapa Reddi
714e74b02c chore: remove hardcoded private config paths from tooling
Drop absolute references to the author's private config repo (home-dir paths
into an external AIConfigs tree) from audit/newsletter tooling, and resolve the
prose-rule file in scan.py via the repo root instead of a hardcoded $HOME path
(also makes it portable across machines). No behavior change: the SHA lookup
keeps its graceful 'unknown' fallback when the file is absent.
2026-05-30 17:32:16 -04:00
Vijay Janapa Reddi
74860f3427 fix(book): clarify margin rooflines and thresholds 2026-05-30 17:05:52 -04:00
Vijay Janapa Reddi
64b466e548 feat(book): add curated margin figures 2026-05-30 16:49:16 -04:00
Vijay Janapa Reddi
6339322363 feat(book): add margin figure system 2026-05-30 14:54:58 -04:00
Vijay Janapa Reddi
6860c2459f Centralize book checks in Binder CLI 2026-05-30 13:41:34 -04:00
Vijay Janapa Reddi
8d0678b6f0 chore: capitalize 1,021 sentence-start crossrefs across vol1+vol2
With crossref prefixes set to lowercase, sentence-start refs need
the Quarto capitalized syntax (@Fig-, @Tbl-, @Sec-, @Eq-, @Lst-)
to render uppercase at sentence starts while staying lowercase
mid-sentence.

Applied 515 changes in vol1 (22 files) and 506 in vol2 (24 files).
Verified by rendering vol1/conclusion, vol1/introduction, and
vol2/introduction: capitalization correct in all contexts.

Also updated book/cli/commands/validate.py to recognize the
capitalized crossref prefixes in label/ref/citation checkers
(LABEL_REF_PATTERN, EXCLUDED_CITATION_PREFIXES, narrative_cite,
no_space_before_bracket).

Classification script added at book/tools/scripts/maintenance/
for future use and verification.
2026-05-26 20:08:59 -04:00
Vijay Janapa Reddi
4031e26652 Merge dev into codex/notation-audit-mlsysim (dev-sync 2026-05-25)
# Conflicts:
#	book/quarto/contents/vol1/introduction/introduction.qmd
#	book/quarto/contents/vol1/ml_systems/ml_systems.qmd
#	book/quarto/contents/vol1/nn_architectures/nn_architectures.qmd
#	book/quarto/contents/vol1/nn_computation/nn_computation.qmd
#	book/quarto/contents/vol1/training/training.qmd
#	book/quarto/contents/vol2/compute_infrastructure/compute_infrastructure.qmd
#	book/quarto/contents/vol2/data_storage/data_storage.qmd
#	book/quarto/contents/vol2/distributed_training/distributed_training.qmd
#	book/quarto/contents/vol2/fault_tolerance/fault_tolerance.qmd
#	book/quarto/contents/vol2/sustainable_ai/sustainable_ai.qmd
#	book/tests/test_units.py
2026-05-25 10:27:42 -04:00
Vijay Janapa Reddi
f741a12103 Refactor inline-python chapters to one LEGO focal point per cell.
Split mega-classes and break cross-cell reads across vol1/vol2, add lego_focal_verify.py, wire foundation-model amortization prose to computed exports, and repair compute_infrastructure inline python fences and table placement.
2026-05-24 13:17:40 -04:00
Vijay Janapa Reddi
05bdff6e68 Citation-reference audit: prose rewrites + author-form cleanup
Codex chapter-by-chapter audit findings applied across vol1 and vol2:
prose rewrites where the cited source supported only a narrower or
adjacent claim, plus new audit tooling
(book/tools/scripts/build_citation_reference_packets.py and the
companion workflow doc).

Author-form cleanup pass on top of the audit:
- 19 narrative @key conversions where prose already named the author
  (e.g., "Sambasivan et al. describe ... [@sambasivan2021]" -> narrative
  "@sambasivan2021 describe ...", rendering "Sambasivan et al. (2021)
  describe ...") - removes the citeproc duplication that the
  manual-bracket regex did not catch.
- 4 [-@key] suppressed-author conversions for possessive eponyms
  (Han et al., Vaswani et al., Patarasuk and Yuan, Linnainmaa).
- 2 [-@key] conversions where the prose names an author/entity that
  matches the cited author (Patterson and Hennessy's iron law,
  Google's data centers + Google whitepaper).
- 1 Horowitz footnote rewritten to narrative so the inline year
  replaces a duplicated "(ISSCC 2014, ...) (Horowitz 2014)" pair.
- 1 narrative @russell2021 anchoring "As Russell argues" that was
  previously a bare attribution.
- 1 pre-existing narrative fix for "Graham et al. report ..." in
  collective_communication that had no cite on the line.

Pre-commit cleanups landing with this commit:
- subramanya2019diskann: add publisher = Curran Associates (NeurIPS
  proceedings, per bib-check rule 3).
- Remove orphaned @misc{Wu2016} GNMT bib entry in vol2; it had no
  citations and collided case-insensitively with @inproceedings{wu2016}
  (the cited Quantized CNNs paper) under bibtex-tidy's normalization.
- vol1/training/training.qmd: drop the dead UtilizationGap LEGO cell
  (gpu_real_tflops_*, cluster_*_tflops_*) and the dead
  TrainingModels.{gpt3_gpu_years,gpt3_compute_cost}_str exports plus
  their unused upstream values.
- vol2/distributed_training/distributed_training.qmd: anchor the
  orphaned [^fn-parameter-server] footnote on the body-prose mention
  of "parameter-server systems" rather than deleting the definition.

manual-bracket hook (book-check-refs) green at this tip.
2026-05-23 13:35:14 -04:00