13 Commits
Author SHA1 Message Date
Vijay Janapa Reddi c944db82e8 binder(notation): forms the vol4 pass needed, and the LaTeX traps it found
Accepted (standard notation the checker rejected): index ranges (s_{0:T}),
an optimum with a transpose (u^{*\top}), an indexed macro in a power
(L_f^{r_i}) or derivative order (y^{(r_i)}), a function's argument as a
subscript (I_x), and \Glyph{...} inside a script. Caption attributes are
unescaped as Pandoc does, so fig-cap="$\\Delta$" is read as \Delta.
Notation tables may put the symbol in the column the header names Symbol.

Rejected (KaTeX renders them, LaTeX does not): an accented macro with a
subscript indexed as {\Macro}_i (TeX unwraps the braces; write
{\Macro{}}_i), and in the registry an unbraced command script such as
\tau_\max.
2026-10-09 02:17:10 +02:00
Vijay Janapa Reddi 53a876e9c2 binder(notation): an appendix of derivations is checked one derivation at a time
glyph_collisions takes a heading level. A back-matter appendix that collects
derivations reuses each home chapter's notation in its own ### section, so
the unit there is the derivation, not the ## section; checking at ## forced
book-wide recolors of symbols that never meet on a reader's page.
2026-10-08 23:38:50 +02:00
Vijay Janapa Reddi 70bddb1fc3 binder(notation): applier keeps the line break after a symbol; ranks and replicates are indices
_macro_extent took the longest run whose normalized text matched the macro's
LaTeX, and trailing whitespace normalizes away, so a replacement at the end
of a display-math line swallowed the line break (rendering unchanged, source
lines joined). It now never ends on whitespace.

Also accept a bootstrap replicate on an optimum (^{*(b)}) and an
order-statistic rank written as a rounded expression (_{(\lceil Bq \rceil)}).
2026-10-08 23:02:33 +02:00
Vijay Janapa Reddi 56f5d78c85 binder(notation): catch scripts LaTeX refuses or misreads
A macro whose LaTeX already carries a subscript, indexed bare
(\RouterGateProbability_{i,j}), is a double subscript; a multi-token macro
used as a script without braces (\sup_\MonitoredFeatureLevel) gives LaTeX only
its first token. KaTeX verification expanded macros in braces and passed both;
the PDF build failed. Report them as double-script and unbraced-script.

Also accept spacing inside a power (^{\,i}) and an order statistic's
parenthesized rank (p_{(1)}).
2026-10-08 21:56:07 +02:00
Vijay Janapa Reddi dcc6e41719 binder(notation): applier and verify fixes from the vol2 run
- Raw text is compared normalized (T_N and T_{N} are the same).
- A macro's extent is the longest exact match within a length bound; stopping
  at the first non-prefix missed brace groups (B^{*} left a stray ^{*}).
- Braces around any single token normalize away, not only letters and digits.
- The before-side table of notation verify defines \Glyph too, so unchanged
  \Glyph spans are no longer reported.
- Collisions skip pairs listed in vocabulary.yaml same_glyph_ok.
2026-10-08 13:36:24 +02:00
Vijay Janapa Reddi 0c8bde7758 binder(notation): collisions are judged per top-level section, not per chapter
A reader works through a chapter one ## section at a time, so one letter may
mean different things in different sections but never two things in one. The
notation chapter is skipped: it lists every meaning by design. Author decision
2026-10-08.
2026-10-08 13:20:09 +02:00
Vijay Janapa Reddi 840ee54cf0 binder(notation): applier keeps only an index or power left over, never a label
When a site is wider than the macro it receives (A_{i0} for a macro rendering
A), the leftover is kept only if it is an index or power; a text label belonged
to the symbol being replaced and is dropped with it. Exemptions for the applier
now come from the repo's exempt.yaml, not the defaults.
2026-10-08 12:55:44 +02:00
Vijay Janapa Reddi 6db1fc6c43 binder(notation): no chapter of a converted volume may show two symbols that render alike
New scope check notation --scope collisions. Two registry entries may share
LaTeX across the book, but a reader of one chapter must never see one letter
mean two things. Enforced for volumes in STRICT_CONVERTED_VOLUMES (renamed
from STRICT_DEAD_ROW_VOLUMES; it now gates both this and dead-row coverage).
2026-10-08 12:18:38 +02:00
Vijay Janapa Reddi 3cbad27238 notation: controlled vocabulary, vol1 registry entries, span-aware applier
Registry. data/vocabulary.yaml: every unit is built from a closed list with
base dimensions (data, compute, money and counted things are dimensions of
their own), and a name ending in a quantity word (Time, Count, Probability,
Rate, Bandwidth, Matrix, ...) must have that word's kinds and dimension. Names
ending in no such word stay free; field idioms (LearningRate) are listed with a
reason. Design reviewed by an empirical test on all entries, a usability test
and a skeptic review; a mandatory suffix vocabulary, an explicit quantity field
and pint dimension checks were dropped on that evidence. Free-text units become
`varies` with the old wording in notes; two kinds fixed; \AccuracyAtTime ->
\AccuracyAfterDeployment and \StoragePricePerByteTime -> \StorageCapacityPrice
(aliases kept). The 752 entries the vol1 conversion needs are registered (no
chapter uses them yet).

Checker and applier, from what the first vol1 run taught:
- A macro whose LaTeX spans several tokens (P_t, \Pr(E)) replaces the whole
  run; a site wider than the macro (A_{i0} for a macro rendering A) keeps its
  leftover subscript. Both used to print wrong; the KaTeX check caught it.
- Inline `{python}` values inside math are one token, not a string of letters.
- Matrix-entry positions (ij, i0, 0j) are indices.
- A macro may carry an index macro as subscript, a power by another macro, a
  parenthesized layer or block index, * for the optimum, and a prime when it is
  a function. Text labels still make a new symbol.
- \Glyph{B} marks a letter that prose mentions rather than uses; it renders
  unchanged and replaces the unused per-line notation-ok hatch.

Strict baseline regenerated: 42,880 -> 42,427 sites (the wider rules remove
findings, none are added).
2026-10-08 12:16:45 +02:00
Vijay Janapa Reddi 32e21aa933 binder(notation): a glossary row may override an alias used with another meaning 2026-10-08 11:37:45 +02:00
Vijay Janapa Reddi 96963656e7 feat(binder): label subscripts belong to the symbol; glossary assigner
A raw symbol's site now includes a descriptive subscript (A_{\text{component}}),
because the registry entry's LaTeX carries it; replacing only the base letter
would render the subscript twice. Index, power and transpose subscripts stay
outside the symbol.

binder notation assign turns a chapter glossary into exact edits with no
judgment: each site takes the glossary row for its glyph and line; retired
aliases take their canonical name; unmatched or doubly matched sites are
returned for review instead of guessed.
2026-10-08 08:33:26 +02:00
Vijay Janapa Reddi bfc069decb fix(binder): read fmt_math f-strings correctly in the notation check
Nested escaped braces (2^{{-{alpha:.3f}}}) left field names in the text,
which read as stray letters; fields now become a numeral, which can never
count as a symbol. Baseline regenerated for the corrected reading.
2026-10-08 08:28:53 +02:00
Vijay Janapa Reddi 7e55ce787e feat(binder): strict notation check, ratchet, rendering proof, and applier
Every symbol in math must be a registered mlsysim macro. The check reads
math the way Pandoc does (body math matches Pandoc's AST on all 151 files)
plus figure/table captions, quiz JSON and fmt_math strings, and reports
raw letters, Greek letters, font/accent forms, decorated macros, retired
aliases, unknown commands, and macros a chapter has not declared.

- check notation --scope strict: ratchet on fingerprints (symbol + span),
  so a commit can remove raw symbols but never add one; baseline
  44,527 sites in 145 files
- check notation --scope conventions: registry naming and field rules
- binder notation report|find|verify|apply: work packages grouped by
  section with candidate macros and meanings; registry search by meaning;
  KaTeX MathML comparison proving an edit renders exactly as before
  (including registry LaTeX changes); a deterministic applier that edits
  only the exact tokens it is given and refuses anything that moved
- Exemptions by role, not glyph (exempt.yaml): index letters only in
  subscripts, d as a differential, e as a base, T as a transpose
- 23 unit tests plus the Pandoc cross-check
2026-10-08 08:27:02 +02:00