10 Commits
Author SHA1 Message Date
Vijay Janapa Reddi 69abd6c3af refactor(figures): keep scaling plot CSVs local to chapters and scalar anchors in mlsysim 2026-10-22 13:29:04 +02:00
Vijay Janapa Reddi a8251ec9b2 Make mlsysim.viz.style the single source of the figure style
The palette, font stack, font sizes, and figure size had two copies:
binder/tools/figures/style.py and a "keep in sync" fallback inside
mlsysim/viz/plots.py. The copies had already drifted (the fallback lacked
the bundled TeX Gyre Heros font and the `secondary` color), so a figure
styled through mlsysim.viz could render in a different font from one
styled through binder.

- move style.py and the bundled fonts into mlsysim/mlsysim/viz/
- plots.py imports the style; the fallback copy is gone
- binder/tools/figures/style.py re-exports mlsysim.viz.style, so chapter
  cells and margin devices keep their import path
- add BODY_FIGSIZE (6.2 x 3.8), MIN_FONT_PT, PRINT_SCALE_RANGE, and
  PRINT_TEXT_WIDTH_IN; setup_plot() and bar_compare() default to the body
  size. No chapter cell relies on the old (8, 5) default, so no existing
  figure changes size.
2026-10-13 10:09:12 +02:00
Vijay Janapa Reddi 0a03a7f29e feat(vol4): margin figures read chapter LEGO values
- generate_margin_figures.py is now a registry: each figure pulls its
  values with lego(chapter, name), so margin figures print the same
  objects as the prose. --check fails on a stale SVG, a fig-alt missing a
  declared value, or an unowned margin SVG placed in a chapter.
- Ported the scratch-only generators behind the Ch8, Ch9 and Ch11 margin
  figures; they reproduce the committed SVGs byte for byte.
- Stale margins regenerated (Ch3 chunk strip, Ch6 decoder envelope, Ch14
  handshake strip); all 21 rendered and visually verified.
- Removed 16 stale, unreferenced margin SVGs the generator refuses to
  own (listed in its DROPPED table); the old injector now refuses to run.

Checks: margin-figure --check 21 figures, 0 problems; all vol4 content
checks pass (only pdf-verify/pdf-numbering, no PDF built). Skipped hooks,
0 vol4 findings each: book-check-headers, book-check-labels-orphans,
book-check-bib, book-check-refs, book-check-footnotes (vol3 / shared
bib); book-check-bib-verify (ledger deferred by the author).
2026-09-29 12:52:02 -06:00
Vijay Janapa Reddi a6d0214306 wip(vol4): partial diagram pass; fix check findings it left
Figure work by the diagram agents before most stopped on a spend limit
(shared timing-strip family; per-chapter figure fixes across ch01-ch17;
ch06 latch contact-force and decoder timing strips and a redrawn
compounding-error sketch, all rendered and visually verified).

Fixes to leave the tree clean:
- ch15: split a figure's closing fence from the next paragraph (it had
  left a div open, putting every later footnote "inside a div").
- ch05: class-scope generator could not see plate_offset; use count().
- ch14: locate the flight-2904 SVG from chapter or repo root.
- Sentence-start @Fig- casing (ch05, ch06, ch15); narrative citation for
  Chi et al. (ch11); LEGO section order in three guard-only classes;
  unused output removed (ch03); exported unit aliases (ch11); literal
  parentheses in a caption URL (ch16); "preempts" (ch14); a Python
  variable renamed from "wit" (ch15).

All vol4 content checks pass; only pdf-verify/pdf-numbering fail (no
PDF built). Skipped hooks, 0 vol4 findings each: book-check-headers,
book-check-labels-orphans, book-check-bib, book-check-refs,
book-check-footnotes (vol3 / shared bib); book-check-bib-verify (vol4
SHA-256 ledger records not yet written).
2026-09-29 12:08:33 -06:00
Vijay Janapa Reddi 3e9a9001bd Refine TikZ figures in Chapter 03 to textbook rectangular styling 2026-09-26 20:28:56 -04:00
Vijay Janapa Reddi 781ed25f7e Update Preface with physical stack and visual margin gallery, fix pointer directions and margin SVG formatting 2026-09-18 20:23:35 +02:00
Vijay Janapa Reddi 6c2f68a882 Add and inject 34 visual margin figures across Volume IV 2026-09-18 20:02:05 +02:00
Vijay Janapa Reddi a70aebd249 Move authoring tooling out of the repository
Removes content-authoring scripts, figure and data generators, and their working notes, which are not needed to build, check, or release the books and sites. The vault CLI drops the matching subcommands and doctor check; docs, comments, ignore rules, and the codegen hash are updated to match what remains.
2026-09-12 11:55:22 +02:00
Vijay Janapa Reddi 371198aa9c Stop pointing at private editorial rule files
Binder error messages, the LEGO cell guide, mlsysim's currency error, check
docstrings, and pre-commit comments cited private rule files that are not part
of this repository. Their guidance stands on its own without the pointer. The
root .gitignore now also covers local editor configuration files, which
were ignored only by a local exclude file.
2026-09-10 19:09:07 +02:00
Vijay Janapa Reddi 14ca66d2e9 Rename bindery/ to binder/ and run the CLI by its real path
The toolchain folder is now binder/, and the root ./binder symlink is gone.
The command is ./binder/binder: a plain path to the script, with no link and
no install step. Every invocation moved with it: pre-commit entries, workflow
steps, the VS Code extension's command palette, help text, and docs.

- bindery/ paths and bindery.* imports, including the chapter code cells
  that import binder.tools.figures, now name binder/.
- Binder (mybinder.org) reads its configuration from a root binder/ folder
  and refuses to build when binder/ and .binder/ both exist. .binder/postBuild
  and .binder/requirements.txt move into binder/, so the TinyTorch "Launch
  Binder" buttons keep working; binder/README.md records which file names the
  toolchain must not use there.
- contributors/projects.json still pointed the book's contributor record at
  publishing/; it now names binder/, where that .all-contributorsrc lives.
- The margin-figure reader-link audit report linked its 222 figures through
  the retired quarto/ tree; the links now resolve under books/.

The hooks reformatted hidden Python cells and trimmed whitespace in the
Volume II chapters whose figure imports this rename touches.

Checks: ./binder/binder check cli passes (contract and canonical hooks),
binder.tools.figures imports, and every workflow YAML file parses.

binder test suite, excluding the four modules that cannot import mlsysim
through the root symlink (fixed separately): 7 failed, 346 passed.

The GitHub repository variables BOOK_ROOT, BOOK_TOOLS, BOOK_DEPS, and
BOOK_DOCKER still name the retired book/ layout and must change when this
reaches origin.
2026-09-10 15:26:07 +02:00