Repository navigation
harness: the families' style metrics (metrics.csv), the runner pinned, provenance schema 3 (D19, stage 1) - #25
Merged
Merged
Conversation
…, provenance schema 3 (D19, stage 1) Stage 1 of D19 (QuantEcon/project-theme-parity#80, decisions 1 to 5), part of QuantEcon/project-theme-parity#15. The twin is the same branch, harness/metrics, in QuantEcon/test-lecture-theme-mystmd; the shared engine is byte-identical in both. metrics.csv: for every shown surface of every counted family, at the six readings, in the same evaluation as its drawn count (so its rows tie to counts.csv's shown, which the run checks): n, the pairing key (normalised TeX, code, heading or label, hashed; empty where none), the box (width, height, overflow), the dominant text (tag, font size, line height, colour, composited background, contrast) and the page's body text and column. Raw values; empty, never 0, where a value cannot be taken; crop and sha256 left empty until stage 2. New lib/visual.mjs holds the measures and the one colour routine, which behave.mjs's colours() now uses too (dark-palette's colours are composited, as #rrggbb, from the body text). theme.mjs: The content root is main.qe-page__content (profile.text, unchanged in meaning: it is the only .qe-page__content), the body text "section > p:not(.admonition *):not(.proof *)" inside it, and sourceOf reads a display's TeX from MathJax's math list, a cell's input code, a heading without its section number or permalink, and the nearest label below its section that docutils did not generate. harness.yml: the rendered job runs on ubuntu-26.04. provenance.json goes to schema 3, keeping every schema 2 field, with a metrics block and an environment block: the runner image (ImageOS, ImageVersion), the OS, the browser build, and a font fingerprint over the fonts the measured text rendered with and the font files the pages loaded. run.mjs gains --no-metrics and a "Style metrics" notice. The self-test gains math-display and pinned boxes, and compares every metric exactly at both bases; run.mjs is checked with and without --no-metrics. The README documents metrics.csv and schema 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…onger self-test (D19, stage 1) Answers the review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. The dominant text now leaves out visually hidden text (a box of 1px or less hiding its overflow, a clip rect, a clip-path inset), so maths rows describe the glyphs drawn and not MathJax's or KaTeX's hidden copy, and it reads glyphs drawn as ::before content where theme.mjs names them. Zero-width characters are not counted. The font readings follow a glyph's ::before, so the fingerprint lists the maths web fonts. Code keys drop line numbers. A label key comes only from the surface's own label site and only where the page's source (lectures/<page>.md) writes the label, so no generated id becomes a key and no surface takes a box's label; run.mjs gains --labels. A key source that throws is a fault, kept with the others by kind; the exit line is unchanged. The fingerprint follows design 6.3: fc-list with font versions and files, the main frames' font files (frames' listed apart) and the rendered fonts; provenance records MathJax's and KaTeX's versions. dark-palette reads its old elements again, by the shared colour routine. theme.mjs: glyphs is mjx-c (MathJax CHTML draws each glyph as ::before content); code drops span.linenos; the label site is the surface, or the div.math round a display. The self-test gains real-structure maths fixtures, headings, a hide-cell fold, line numbers on one side, a boxed section paragraph, source labels (selftest/labels.yml), pinned dark-palette colours, and unit cases for the key rules, source labels, the tie check, the fingerprint and the measures. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…19, stage 1) By the owner's answer on QuantEcon/project-theme-parity#80 (2026-11-28, "Warn, don't fail"). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. run.mjs's exit status is again what it was before stage 1, errors.length || threw.length ? 1 : 0. A measure, key or body-text fault, or metrics that do not tie to the counts, stays a "Style metrics problems" warning on the run, in provenance.json (metrics.faults, metrics.tied_to_counts) and in the summary, so it never withholds /_harness/, counts.csv included. The self-test still fails on any metrics mismatch, and gains a case: run.mjs, as in GitHub Actions, on a build of the good site whose body text is forced not to be read must exit 0, print the warning, and record the six body-text faults in provenance.json. run.mjs's header, harness.yml's header comment and the README say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…gs and fingerprint per the re-review (D19, stage 1) Answers the re-review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. Overflow is clamped at 0 (Chrome gives a bordered table a client width past its scroll width) and any tag name is a tag. Every metrics step after the page loads is guarded: a value that is not one its column takes is written empty and is a measures problem (sanitiseMetricRows), and the labels, the tie, the fingerprint, the writer and the summary each record a problem of their own kind if they fail; provenance.json is always written. A measuring evaluation that throws leaves the count to countDrawn. Labels are read only when metrics are taken; pages with no source file and the readings that do not tie are in provenance. Sphinx's body text leaves out the theme's author-links paragraph. A heading's inline maths is keyed by its TeX on both stacks. Text drawn as ::before content has no line height. Main-frame font files carry a hash of their bytes. The self-test gains a forced-fault run with a bordered table and an odd tag, a run without --labels against a temporary lectures/, a fingerprint run with a stand-in fc-list and a frame, unit cases for the writer, weight, 1/100 px, measures that throw, ::before fonts and an input-less cell, and fixtures for the byline and a maths heading; missing outputs are mismatches, not crashes. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…ase (D19, stage 1) The line height rule for text drawn as ::before content was checked only through the Sphinx fixtures; the shared unit case now pins it on both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…use, and the key's order is pinned (D19, stage 1) The forced-fault run had no value that fails a column's rule, so a run.mjs that skipped sanitiseMetricRows passed it; its odd-tag element's computed line height is now forced to a value the column does not take, and the run must record six more measures problems and write those rows without a line height. A unit case pins code before heading before label, which on the Sphinx corpus no fixture tells apart. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…X (D19, stage 1) The fixture headings write their maths' TeX the same way on both stacks, so a heading key that skipped the TeX normalisation passed; a unit case now keys a heading whose TeX differs only in spacing, and the README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…els matched through each stack's ids (D19, stage 1) Answers the third review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. A part of the font fingerprint that cannot be read is now a fonts problem: a reading's rendered fonts or maths engines, a font listed by address because its bytes could not be read or dropped, font bodies not read in 15 s, fc-list missing or failing, an installed font file unread. The installed fonts are fingerprinted with a hash of each file's bytes. Only ENOENT means a page has no source; any other read error is a labels problem, and pages with no source are one too. Labels in a directive's YAML options are read. A surface's label is matched through the ids the stack gives each source label (docutils' make_id, mystmd's createHtmlId of normalizeIdentifier), an id two labels would take giving none, and is keyed by the source label itself. The clip-path rule reads all four insets; the dominant text is read on the element that draws the most of it; mystmd strips only a title number the build wrote. metrics.rows is 0 where metrics.csv was not written, and labels.from names the file tried. The self-test forces a problem of each kind in a page reading, runs with a bad labels file, no fc-list and an unwritable metrics.csv, reads an unreadable source, and checks font bytes changing at the same address and installed font bytes; fixtures add a hidden body paragraph first (and, on mystmd, a boxed one in a prose block), with unit cases for the ids, the insets, a fixed box's clip, the title number and the maths engines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
… and an unreadable installed font (D19, stage 1) The unit case for the themes' label ids adds a footnote's (mystmd's is its identifier, not its html id) and two labels that share an id on both stacks; the fingerprint runs list an installed font file that is not there, which must be a fonts problem. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…d (D19, stage 1) Unit cases add grouping by colour where the biggest element would hide it, a family with four shown surfaces, and a display's label id; the stand-in fc-list writes only what --format asks for; a site font whose address answers 301 must be a fonts problem in each reading; and the first paragraph the dark-palette behaviour reads keeps a background of its own beside the new hidden and boxed paragraphs. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…ided alike on both stacks (D19, stage 1) Answers the fourth review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical, with a new shared lib/labels.mjs. A 3xx answer to a font request is no font file: the answer it leads to is hashed, and the hop adds no line and no problem. An embedded frame's fonts, which the fingerprint leaves out, are listed with their hash where there is one, are kept out of the 15 s wait, and are never a problem. An fc-list that lists nothing is a fonts problem. Both stacks' id rules (docutils' make_id, mystmd's createHtmlId) are in lib/labels.mjs, and a label that either stack would give an id another label takes keys on neither, so a label keys on both or on neither. A theme's textSkip leaves a heading's number out of its dominant text; the groups' elements are kept in a Map; a YAML option's value may carry a comment, and CRLF endings are read. The self-test serves a copy of the good site itself for a font whose answer breaks after its headers, and checks a 301 font in the page and in a frame, an empty fc-list, a labelled table, and unit cases for a two-value inset, a display label with a leading digit, a stroked letter, an apostrophe, labels one stack gives one id, a heading shorter than its number and a title whose first text is a number of its author's. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
… stage 1) The quote and letter tables in the shared id rules are written as \\u escapes, as the rest of the engine writes them; the rules are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…pus (D19, stage 1) Pairs of labels that one stack alone gives one id, by each of its rules (mystmd's dropped characters, quotes and id- prefix; Sphinx's digraphs, stroked letters, folded accents and a display's equation- id), must key on neither stack, and a display label with a leading digit must take no other label's id; so a mutation of either stack's rule in the shared lib/labels.mjs fails both corpora's self-tests, not only its own. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…; a # in a YAML value is read (D19, stage 1) Answers the fifth review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. A main-frame font requested and never answered (a network failure, a redirect to a port that refuses it) is a fonts problem. Every font request is now what the waits wait for, as Chrome reports a font's answer only once its bytes are in: a main-frame font still on its way at the limit is a fonts problem, and a frame's is listed by its address from its request and replaced by its hash when the bytes come, never a problem. HARNESS_FONT_WAIT (ms) shortens the limit, for the self-test. provenance names the theme's textSkip (metrics.text_skip). A # inside a YAML option's value is the value's. The self-test's self-served site adds a 302 to a refused port, a 302, a 307 and a 308 to a real font, a main font and (on intro) a frame font whose bytes are held back, with the limit at 1.5 s; unit cases add a tie in the most-characters rule, a section number inside a table-of-contents back-link, a # in a YAML value beside the label it shares an id with, and a pair that shows mystmd's run-collapse on Sphinx. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…ted and listed once (D19, stage 1) The self-served site's frame also loads a font never answered, which must be no fonts problem; the fingerprint runs check that a frame's font reached through a 301 is listed as the answer it leads to and not as the redirect, and that a frame's font is listed once, by its hash, once its bytes come. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
…equests dropped; a bare # value is no label (D19, stage 1) Answers the sixth review of stage 1 (QuantEcon/project-theme-parity#80). The twin commit is on harness/metrics in QuantEcon/test-lecture-theme-mystmd; the shared engine stays byte-identical. The main frame's font requests are waited for against one deadline, and again while more come in, with a moment after each round for a request the last answer led to; each request still pending at the deadline is a fonts problem that names the font. A new document in the main frame (as load()'s retry makes) drops the font requests the one before it left pending. A bare YAML value starting with # is a comment, not a label; a quoted one is still read. HARNESS_FONT_WAIT sets the wait only to a finite number of ms in (0, 600000], else 15 s. The self-served site adds a font asked for while the harness waits and never finished, one that finishes during the wait, a chain that ends within it, a font whose connection fails with nothing held, a long-poll, the frames' fonts pinned exactly, and a page whose font is held on its first request so load() retries; unit cases pin the YAML forms and the wait's bounds. The README follows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
mmcky
added a commit
to QuantEcon/test-lecture-theme-mystmd
that referenced
this pull request
Nov 28, 2026
…, provenance schema 3 (D19, stage 1) (#26) Part of QuantEcon/project-theme-parity#15 (D19, QuantEcon/project-theme-parity#80). Stage 1 of the families' style metrics and element crops, as the design's stage table gives it, under the owner's decisions 1 to 5 there. The twin is QuantEcon/test-lecture-theme-sphinx#25, in QuantEcon/test-lecture-theme-sphinx on the same branch, `harness/metrics`; the shared engine is byte-identical in the two and compared by the engine-drift step, which pairs them by that branch name: `lib/*.mjs`, `run.mjs`, `selftest/run.mjs` and `.github/workflows/harness.yml`, and `package.json` and `package-lock.json` less their names (`.name`, and the lockfile's `.packages."".name`), which differ. `selftest/labels.yml` is the same in both today, but it is fixture data, as the expected files are, and the drift step does not compare it. Branched from main at 191bea3. The first commit, d7ca338, built the stage; the second answers a review of it; the third makes a problem with the metrics a warning, never a failed job, by the owner's answer; the fourth to seventh answer a second review, the eighth to tenth a third, the eleventh to thirteenth a fourth, and the fourteenth and fifteenth a fifth, and the sixteenth a sixth. This description is of all sixteen. The shared files include the new `lib/labels.mjs`. **`_harness/metrics.csv`.** For every shown surface of every counted family (`drawn.yml`'s non-null selectors) at the six readings, taken in the page-wide checks' existing loads and in the same in-page evaluation as the drawn count, so its rows for a page, family and reading number exactly that reading's `shown` (decision 2). The columns are `page, family, viewport, scheme, n, key, width, height, column, overflow, text, font_size, line_height, body_font_size, body_line_height, colour, background, contrast, crop, sha256`. The values are raw (decision 4): the dominant text with its font size, line height, colour and composited background (`#rrggbb`) and WCAG contrast; the box's width, height and overflow (`scrollWidth − clientWidth`); and the page's body text size, line height and width (the column). A value that cannot be taken is written empty, never 0. `crop` and `sha256` are empty until stage 2. `n` is the surface's place among the family's drawn matches; `key` is `<kind>:<12 hex>` of the normalised TeX, input code, heading text or label (decision 3), or empty, when the gallery falls back to `n`. **The text a reader sees.** The dominant text is the style (colour, size, family, weight) that draws the most characters of what the surface draws as text: its text nodes, and the `::before` content of the elements `theme.mjs`'s new `glyphs` names. Whitespace and zero-width characters are not counted. Hidden text is left out: what `checkVisibility()` says is not drawn, and what is visually hidden though drawn, in the surface or anything between: a box of 1px or less in a direction it hides its overflow in, a `clip: rect(…)` that leaves 1px or less on an absolutely placed box, or a `clip-path: inset(…)` that leaves 1px or less (all four insets read: `inset(50% 0 0 0)` leaves half, `inset(0 0 100% 0)` hides). Within the winning style, the tag, size, line height and colours are read on the element that draws the most of it; a theme's `textSkip` (the `span.select-none` before a heading's text) leaves a heading's number out, so a heading reads as its own text however short beside its number. The first commit read MathJax's assistive MathML and KaTeX's MathML copy, both clipped to nothing, as the dominant text of every display; now every `math-display` row reads a span of KaTeX's HTML at 21.78 px and a line height of 26.14 px, where it read the MathML copy's `mi` or `mo` with `normal`. Text read through the `glyphs` hook has no line height. The font readings follow a glyph's `::before`, so the rendered fonts now include the maths web fonts. **One colour routine.** `lib/visual.mjs`'s `harnessPaint` composites translucent backgrounds over the first opaque one (over white where none is), and the text colour over that. `behave.mjs`'s `colours()`, which `dark-palette` reports with, now calls it, on the same elements as before (the content root, the first paragraph and the first link in one): the first commit had moved it to the body text, which changed the text colours to `#44403c` and `#d6d3d1`, and the second puts the elements back. So the values move only through compositing and the format: they would change for a translucent colour, or a page with no opaque background (composited over white), since the compositing is now the metrics' one routine, as the design asks; neither occurs on either corpus today. Before, on main: light "page rgb(255, 255, 255), text rgb(28, 25, 23), link rgb(0, 114, 188)", dark "page rgb(34, 34, 34), text rgb(245, 245, 244), link rgb(255, 255, 255)". Now: light "page `#ffffff`, text `#1c1917`, link `#0072bc`", dark "page `#222222`, text `#f5f5f4`, link `#ffffff`": the same colours, as hex. The self-test now pins all three colours in each scheme. Ancestor `opacity` is not read, as the README says. **The theme facts here.** The content root is `article.article` (`profile.text`). The body text is `.prose-qetext-light > p` inside it, established from the live build: on every page with running text its paragraphs sit directly in `div.prose-qetext-light`, and the theme injects nothing there (every page reads the same body text), while a box's sit in its own body, the footer's in `qe-site-footer` and the outline's in `nav.qe-outline`. `glyphs` is null: KaTeX draws its glyphs as text, in its own fonts. `sourceOf` reads a display's TeX from KaTeX's annotation, a cell's input code (not one in its outputs; a hide-cell dropdown's from the cell it holds) without the highlighter's `.react-syntax-highlighter-line-number`, a heading's `.heading-text` (a page title's number dropped only where the theme wrote it as text of its own, `2`, `. `, so a number its author wrote stays, as on Sphinx), its inline maths as the TeX in KaTeX's annotation, the first page's Book title as its heading (it had no key before), and the id at the surface's own label site: the surface, or the block two levels up that mystmd puts a display's label on, with the `fn-` mystmd writes before a footnote's label dropped. **The label key.** A label key comes only from the surface's own label site, where its id is one this stack gives a label the page's source writes (`lectures/<page>.md`: a target `(label)=`, `:label:`, `:name:`, a `label:` or `name:` in a directive's YAML options, `$$ … $$ (label)`, `\label{…}`, a footnote's `[^label]`; not the front matter), and no label of the page's that either stack would give an id another of its labels takes: both stacks' rules are in the shared `lib/labels.mjs`, so `(10-step)=` and `(step)=` (both `step` on Sphinx), or `Größe` and `Grüße` (both `gr-e` on mystmd), key on neither stack, and a label keys on both or on neither. Each theme's `labelIds` says which ids: on Sphinx the label as written (sphinx-exercise and sphinx-proof), docutils' `make_id` of it (targets, `:name:`, footnotes: ASCII-folded, leading digits and hyphens dropped, so `(2d-plot)=` is `d-plot`, and `(10-step)=` and `(step)=` both `step`, which gives neither a key) and a display's `equation-` id; on mystmd `createHtmlId(normalizeIdentifier(label))` from the fork's `myst-common`, the same at `QE_MYSTMD_SHA` (`id-2d-plot`), and the identifier a footnote's `fn-` id carries. The key is the source label itself, whitespace collapsed and lower-cased, so it is the same on both stacks whatever ids each makes, and an id a build generated (docutils' `id1`, `toggle-2`, `example-3`, mystmd's `rucnplfZ7R`) never becomes a key. `run.mjs --labels FILE` gives labels in place of the sources (the self-test's `selftest/labels.yml`). Over the whole corpus (local, desktop in light), 20 page-families carry a label key on either stack; 16 have the same set of label keys on both; the other four are surfaces only one stack draws with that label: the `iid_violation` admonition and the `perron-frobenius` theorem (Sphinx only: mystmd drops the `:name:` and does not put the label on its theorem), the glued `flow_fig` figure (Sphinx only) and the two figures of `mystmd_native` (mystmd only). Every key, labels included, is identical between the live builds and the earlier build artefacts (Sphinx 8297979a, mystmd 30c251f), on both stacks. **The runner and provenance (decision 5).** The rendered job's `runs-on` is `ubuntu-26.04`, the same line in both corpora. `provenance.json` goes to schema 3 and keeps every schema 2 field (`bin/measure` reads `schema >= 2`). It adds `metrics` (the content, body-text and glyph selectors and the heading-number one, `text_skip`, the key's rules in words, where the labels came from, the rows, the readings taken, `tied_to_counts`, the empty counts, the faults by kind, `crops: null`) and `environment`: the runner's `ImageOS` and `ImageVersion`, `/etc/os-release`, the platform, the browser build, the maths engines (`MathJax.version`; KaTeX's version from its stylesheet's `.katex-version`) and `fonts`. The fingerprint now follows design 6.3: the SHA-256 of the installed fonts (`fc-list --format`'s file, family, style and version, with a hash of each file's bytes, so a new version or new bytes show; about 90 on CI, 0.3 s for 2,670 locally), the font files the main frames loaded (each with a hash of its bytes), and the platform fonts the measured text rendered with; font files of embedded frames (an ourworldindata chart's Lato and Playfair Display) are listed apart and left out. It is a whole-run union, so `--pages` changes it. **`run.mjs`** gains `--no-metrics`, `--labels`, the metrics in the step summary, a "Style metrics" notice (rows, readings, the tie, keys by kind, empties, faults by kind, the environment, the web fonts rendered), and a "Style metrics problems" warning whenever there is one. A key source that throws is now a fault (it was swallowed), kept beside measure and body-text faults by kind in provenance, the summary and the warning. **Metrics problems warn, and never fail the job** (the owner's answer on QuantEcon/project-theme-parity#80, 2026-11-28: "Warn, don't fail"). A problem with the real run's metrics, a surface's measures or key source that threw, a body text that could not be read, or metrics that do not tie to the counts, is a "Style metrics problems" warning on the run, and is recorded in `provenance.json` (`metrics.faults`, by kind, and `metrics.tied_to_counts`) and the step summary. The exit status is exactly what it was before stage 1, `errors.length || threw.length ? 1 : 0`, so a problem with the metrics never withholds `/_harness/`, `counts.csv` included, from the site. `run.mjs`'s header, `harness.yml`'s header comment and the README say so. The self-test still fails on any metrics mismatch with its expected files. **Nothing in the metrics can stop the run** (the re-review). A bordered table had made `metrics.csv`'s writer throw and the run exit 2 with no provenance, since Chrome gives a bordered table a client width past its scroll width. Overflow is now at least 0, documented as content wider than the box, and any tag name is a tag. Every metrics step after the page loads is guarded: a value that is not one its column takes is written empty and is a `measures` problem (`sanitiseMetricRows`); the labels, the tie, the fingerprint, the writer and the summary each record a problem of their own kind (`labels`, `fonts`, `writer`) if they fail; a measuring evaluation that throws leaves the count to the plain count; and `provenance.json` is always written. Labels are read only when metrics are taken, provenance names the pages with no source file (`metrics.labels.no_source`: no page of either corpus is a notebook) and the readings that do not tie (`metrics.not_tied`), and the main frames' font files carry a hash of their bytes in the fingerprint, which is a union over the pages run. A heading's inline maths is keyed by its TeX on both stacks. **Every part that cannot be read is a warned fault** (the third review). A part of the fingerprint that cannot be read is a `fonts` problem, so an incomplete fingerprint is never silent: a reading whose rendered fonts or maths engines fail (one per reading), a main-frame font file listed by its address because its bytes could not be read, a main-frame font requested and never answered (a network failure, a redirect to nowhere), or a font response dropped, a main-frame font request not finished in 15 s, each named (every font request is waited for, against one deadline and again while more come in, as Chrome reports a font's answer only once its bytes are in; `HARNESS_FONT_WAIT` sets the wait in ms, a finite number in (0, 600000], else 15 s; a request left behind by a document the reading navigated away from, as `load()`'s retry does, is no longer the reading's), fc-list missing, failing or listing nothing, and installed font files that cannot be read. A 3xx answer to a font request is no font file: the answer it leads to is hashed, and the hop adds neither a line nor a problem. An embedded frame's fonts, which the fingerprint leaves out, are listed from their request (so one still on its way is listed by its address) and by their hash once read, kept out of the 15 s wait, and are never a problem. The self-test reaches every one of these paths but a font response that cannot be read at all, which is the response listener's own failure and which no page can force. Only `ENOENT` means a page has no source; any other error reading `lectures/<page>.md` is a `labels` problem (`metrics.labels.unreadable`), and pages with no source are one too, as every page of both corpora has one. Where the labels file fails, `labels.from` names it; where `metrics.csv` cannot be written, `metrics.rows` is 0 and `metrics.written` false. **The self-test.** The fixtures pin every measured box in px, so the expected metrics compare exactly on any platform, at both bases. They now draw maths with its real structure (Sphinx: MathJax CommonHTML glyphs as `::before` content with the assistive MathML clipped, and the math list with the inline expression first; mystmd: KaTeX's HTML in two fonts with its MathML copy clipped to 1px and zero-width spaces), two displays keyed out of order across the corpora, page titles and a section heading whose two styles tie, a hide-cell fold, line numbers on one stack's cell and not the other's with the same key, a hidden fold output longer than its input, a translucent text colour, a narrower second body paragraph, a boxed `section > p`, source labels, and the citation inside the solution taking no label from it. Unit cases pin the key's rules, the labels a MyST page gives, the tie check holding and failing, the fingerprint and each of its parts, and the measures on a small page of their own (a tie, whitespace and zero-width characters, six ways of hiding text, `::before` glyphs, compositing, an inline box, `n`, the body text, a key source that throws), and each theme's label sites. Five last cases run `run.mjs` itself, each with its faults in provenance and each exiting 0 but the `lectures/` one, which keeps the drawn table's deliberately broken selector and so exits 1. On a build of the good site whose `typography` forces a problem of each kind a page reading can have (the body text, a surface's measures, a key source, a measuring evaluation, whose family then does not tie, and the fonts' reading), with a bordered table drawing its text in an element whose tag has a `.` and a `_` and a line height the writer's rules refuse: 36 faults, six of each, and six readings not tied, the "Style metrics" notice, and every row it measured. With a `--labels` file that does not parse, no `fc-list` on `PATH` and a `metrics.csv` that cannot be written: a labels, a fonts and a writer problem, no rows written. Without `--labels`, from a `lectures/` with a MyST page (a label in YAML options, a kernelspec `name:` in the front matter) and an `intro.md` that is a directory: the page keyed from its source, intro's source and the pages with none as two labels problems. Five times with a stand-in `fc-list` that writes what `--format` asks for, a font file that is not there, a site font whose address answers 301 (hashed as the answer it leads to, no problem), and a frame that loads a font (one through a 301 in the third run, no problem): the fingerprint moves with the installed font's version or bytes and a site font's bytes at the same address, and not with the frame's font or the port. And on a copy of the good site the self-test serves itself (`--url`), with `HARNESS_FONT_WAIT` at 3 s: on `typography`, a font whose answer breaks after its headers, one through a 302 to a port that refuses it, one whose bytes are held back, and one asked for while the harness waits and never finished must each be a fonts problem in each reading (the last two named as not read in 3 s), and fonts through a 302, a 307 and a 308 none, listed as the font they lead to, as must a font whose bytes come while the harness waits, listed with its hash; on `intro`, with nothing held, a font whose connection fails must be one "never answered" problem in each reading and no "not read", a chain of two fonts that ends within the wait both hashed, and a long-poll that is no font none; the frames' fonts (one that breaks, one never answered, and on `intro` one held back) must be listed exactly, and be none. A second run reads `math`, whose font is held on its first request, so the reading that asks first loads the page again: no fonts problem, and the font hashed. An `fc-list` that lists nothing is a fonts problem in the `lectures/` run. The fixtures add Sphinx's injected author-links paragraph on `intro`, a heading with inline maths on each side, with one key in both corpora, a table labelled by `:name:` (whose label myst-theme puts on the figure round it, so it pairs by `n` here), and a hidden body paragraph before the first shown one (with a boxed paragraph in the prose block before both); the unit cases add the key's order past TeX, a heading's maths normalised as TeX, each theme's ids for a label (a leading digit, a display's with one, a non-ASCII letter, a stroked one, an apostrophe, a footnote) and labels one stack gives one id (no key on either), YAML options (with a comment after a value, a `#` inside one beside the label it shares an id with, and CRLF endings) and front matter, a source missing and one unreadable, the writer's rules, weight and colour in a style, a clip-path's four insets and two, the clip of a box pinned to the viewport, the element that draws the most of the dominant text and the first of two that draw as much, lengths to 1/100 px, measures that throw, the fonts a `::before` is drawn in, the maths engines' versions, each theme's input-less cell, a title number the build wrote against one its author wrote, and a heading shorter than its number. A missing output is a mismatch, never a crash. The counts stay the same in both corpora but where the stacks draw differently (mystmd's hide-cell block sits inside its fold). The mutation tables: in full on the fifteenth commits, 290 mutants on each side, it caught 269 of 290 on each (the survivors equivalent or out of a fixture's reach, as the README says, with eight small rule cases left for a later round). On the sixteenth commits, a run of the code this round changed: the sixth review's 25 mutants (24 on mystmd), mapped onto this code where it moved, and seven of this table's own for the new rules (the deadline loop, the retry's leftovers, the named late fonts, the wait's bounds, a bare and a quoted `#` value). It catches 29 of 30, E03, E10 and E18 among them. E16, the frame fonts' 2 s wait made as long as the main one, survives on both sides and is equivalent: it changes only how long a reading takes, as the README says.select-none` deeper in a heading. **Local runs against the live site** (Playwright 1.63.0, Chrome Headless Shell 153.0.8010.12, on a Mac outside the sandbox: local, not of record). `run.mjs --url` exits 0 and writes 2,340 rows over all 102 (17 pages) readings, every reading tied to `shown`. Keys: tex 222, code 780, heading 684, label 168, none 486. Empty values: text 90, overflow 152 (inline boxes), body text 6 (`zreferences`, which has no paragraph). Faults: none. Fonts: 16 rendered fonts, including the web fonts KaTeX_Main and KaTeX_Math, 14 font files in the main frames, each with a hash of its bytes, and 2 in embedded frames, not fingerprinted; 2,670 installed fonts in 371 files hashed in 0.3 s; the labels' new matching gives the same 168 label keys as before; KaTeX 0.16.33, and MathJax 2.7.5, which the `code_cells` page loads from cdnjs. **Pairing on `math`** (local, both live runs, each of the six readings): the TeX keys anchor all 17 of mystmd's display equations to Sphinx's, and leave one Sphinx display unpaired, `n` 17, the `ar1-tp-eq2` block KaTeX cannot parse; by `n`, none pair, since the counts are 18 and 17. Over every page and family both sites draw (702 readings, less `build_info`), key alignment gives 2,178 pairs against 1,716 by `n`, and wherever the counts agree it pairs exactly as `n` does. `code_cells`' cell 29, which numbers its lines on mystmd, now has one key on both stacks. **Not changed:** the build jobs, the container digest, `QE_MYSTMD_SHA`, `lectures/`, `bin/sync-from-sphinx`, `sync-check.yml`, `cache.yml`, and the deploy and pages jobs. `metrics.csv` reaches `/_harness/` with no change there: the rendered job uploads `_harness/` whole, and the deploy job downloads it whole into `site/_harness`. Crops are stage 2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
mmcky
added a commit
that referenced
this pull request
Nov 30, 2026
…er (D19, stage 2) (#26) Part of QuantEcon/project-theme-parity#15 (D19, QuantEcon/project-theme-parity#80). Stage 2 of the families' style metrics and element crops: the crops, under the owner's decisions 3, 6 and 7 (2026-11-27, each as recommended). The twin is QuantEcon/test-lecture-theme-mystmd#27, on the same branch, `harness/crops`. The shared engine is byte-identical in the two and compared by the engine-drift step, which pairs them by that branch name: `lib/*.mjs`, `run.mjs`, `selftest/run.mjs` and `.github/workflows/harness.yml`. `theme.mjs`, the fixtures and the expected files are this corpus's. Branched from main at 307c718, where stage 1 (#25) merged. Nine commits. The first mends what stage 1's last review left, which the owner chose to mend here ("Ready now; fix in stage 2"), each with a self-test case of its own. The second takes the crops. The third answers the first CI run (one fixture value on the mystmd corpus that depended on the platform's fonts) and a mutation run on the crops (four gaps in the self-test). The fourth answers the first review and the owner's ruling on clipped crops, and the fifth adds the one case a mutation run on that commit found missing. The sixth gives each reading a time limit, after a CI run was cancelled waiting on one, and the seventh answers the second review: the run's own time limit, a crash settled, and every count taken before the metrics; the eighth makes a reading that starts while the browser is relaunched wait for the new one; and the ninth makes the self-test's run-limit case cut its reading at the run's limit whatever the features before it take. ## The carry-over (first commit) The two defects: - **A failed request held the font wait.** The `requestfailed` handler pushed a promise into the main frame's font wait for every failed request and checked the type inside it, so a page that fails a request every so often (a beacon, a fetch that retries) made every reading wait out the deadline. It now checks, at once and in a `try`, that the request is a main-frame font before it adds anything. Test: on the self-served `math` page, fetches to a refused port every 100 ms once the page has settled, with `HARNESS_FONT_WAIT` at 6 s, and a font asked for 3 s on that must not be waited for (with the defect, the wait runs to its deadline and hashes it). - **A navigation that leaves the page in place dropped the pending fonts.** Any main-frame navigation request resolved and deleted the pending font entries, a 204 or 205 answer or a download included, so a font still loading was neither waited for nor named. Only `load()`'s own retry drops them now, through a `beforeRetry` hook on `load()` in `lib/util.mjs`. Test: on the self-served `intro`, a held font, then a frame's navigation and a navigation of the page's own that a 204 answers: the font must be named as not read in each of the six readings (and the existing retry case still loads the page again with no problem). The nits and test gaps: - **The wait loop checks its deadline** (`seen < list.length && left() > 0`), and is `settleGrowing()` in `lib/engine.mjs`, which the self-test calls. Unit cases: a list that never stops growing ends at its deadline, and a request that never settles makes it false. - **The 250 ms pause is pinned** (mutants N02 and N03): a unit case (a request added 100 ms after the last settles is still waited for), and on the self-served `math` page a two-font chain, the second asked for 100 ms after the first ends, both of which must be hashed. Both corpora run it. - **N05** (a drop on any frame's navigation) now has a fixture that navigates a frame while a main font is pending; the drop itself is gone with the defect above. - **The retry run's 55 s.** `HARNESS_LOAD_TIMEOUT` sets `load()`'s `goto` timeout (a finite number of ms in (0, 600000], else 60 s); the self-test sets 5 s for the run whose first load is held, and asserts the run takes under 45 s. - **The E03 oddity, explained.** The request that failed was the retry's own second `first-held` request: the fixture had no such file, so it answered 404, and Chrome answers a font that 404s and then aborts it (`requestfailed`, `net::ERR_ABORTED`; probed locally). The fixture now serves a real file the second time, and a font that answers 404 is a case of its own (listed with a hash of the body Chrome read, no problem: mutant E2b). - **The option reader** now parses a directive's YAML options with the `yaml` library, so `label: [a]` (a list, no label), `name: >-` (a block scalar, its text the label) and `name:fig` (no key) read as YAML reads them, and a block that is not YAML gives none. Over both corpora's `lectures/*.md` it gives the same 56 labels as before, page for page. - **The untested mutants** each have a unit case: E2b (a 404 font listed), L2b (`ø`), L3 (trailing hyphens), L5b (NFKD, not NFD), L6b (curly quotes), S4 (text inside a `textSkip` element), T2 (an element's text and its `::before` counted apart), TSs3 (a section number outside a heading) and TSm2 (a heading's `.select-none` that is not its number). - **mystmd's labelled tables.** `sourceOf` reads a table's label from the `figure.fig-table` myst-theme draws round a table directive, so a labelled table keys by its label on both stacks. Neither corpus's lectures have a labelled table today (their tables are pipe tables), so no key on the live sites moves; the mystmd fixture's table now keys as the Sphinx one does. - **The fingerprint's limits** (a union over the pages run; frames' web fonts listed, not hashed) are as designed and already in the README; nothing changed. ## The crops (second and third commits) - **What is cropped.** Every shown surface of every counted family, at the six readings, in the page-wide checks' existing loads, after the counts, the metrics and the fonts: Playwright's element screenshot with `animations: "disabled"`, `caret: "hide"` and `scale: "css"`. While each shot is taken, a style (Playwright's screenshot `style`) hides every fixed or sticky element outside the content root, and everything inside it, marked before the shots; its box and the layout stay. Nothing is opened, so folded content is not cropped. - **Paths.** `_harness/crops/<family>/<page>-<viewport>-<scheme>-<n>.png`. A family id that is not `[a-z0-9-]` is refused: no crop, and a crop problem. - **One file per element.** The measuring evaluation records each surface's element, so an element several families select is shot once, under the first family in the table's order, and every family's row names it in `crop`. Distinct elements that only share a box get their own files. - **Left out (decision 6, option (c)).** No crop for `build_info`, nor for a surface whose visible text (`innerText`) holds `Wall time:`, `CPU times:` or `Run Time (s)`. Their metrics rows stay, with `crop` empty; provenance lists each row left out and the patterns. - **`metrics.csv`.** `crop` (the path under `crops/`) and `sha256` (the file's SHA-256) are filled, both or neither; the writer's rules check both. - **`--no-crops`** takes the counts and metrics alone. A run first clears an earlier run's crops (only files named as a crop), as it removes an earlier `counts.csv`. - **Pull requests crop too**: the upload already takes `path: _harness/`, and the deploy job publishes it on Pages at every push to main (decision 7). No workflow step changed; `harness.yml`'s comments and the upload step's name now mention the crops. - **Summary and notices.** The step summary and an "Element crops" notice give the crops, bytes, rows, exclusions, crop problems, the readings' time, and a digest over every crop's path and hash, so two runs compare from their annotations alone. A "Crop digests" notice gives each page reading's and each family's digest, to find which crops moved. - **Provenance.** `metrics.crops` (null in stage 1) gives how the crops were taken, the path rule, the files, bytes, rows and shared rows, the readings' time, the digest and its rule, the patterns, the exclusions and each crop problem; `outputs` lists `crops/`. - **Crop problems warn, never fail.** I applied the owner's ruling for the metrics ("Warn, don't fail", 2026-11-28) to the crops: a shot that fails, a file that cannot be written or hashed, a refused family id, or `crops/` that cannot be cleared or made is a problem of its own kind (`crop`), a "Crop problems" warning, recorded in provenance and the summary. It never fails the job: run.mjs ends with `return errors.length || uncounted.length ? 1 : 0;` (the line as the seventh commit leaves it), which is 1 when a check could not run or a count was not taken and 0 otherwise; a crop problem is neither. `provenance.json` is always written. - **Self-test.** Crops are checked by structure, not bytes, as the self-test runs on macOS and Linux: each file exists, its pixel size is the box's to within 1 px, its hash is the row's, a fixed header is absent, and every PNG is one a row names; the expected metrics name each row's crop path (their `sha256` is left empty). New fixtures: a fixed header over a surface taller than every viewport, two families on one element (`solution` and `solution-dropdown`, which the self-test's drawn table gains), two elements on one box, a `%%time` cell and its output (left out), and a `build_info` page on both fixture sites. Unit cases run the crop step on a page of its own, with a control shot without the style that shows the header, and pin the writer's rule that a crop and its SHA-256 come both or neither; a `run.mjs` case checks provenance, the notices, the digest, `--no-crops`, a crop problem of each kind it can force (exit 0, the warning), and a `crops/` that can be neither cleared nor made. ## The first review, and the owner's ruling on clipped crops (fourth and fifth commits) The first review read this pair at ea8aea0 and d4e3b67. What held: `counts.csv` byte-identical to main, `metrics.csv` identical but for `crop` and `sha256`, every hash its file's with no orphan, the shared engine identical, `yaml` giving the same 56 labels, every carry-over item mended with a test, and no injected fault changing the exit status. The fourth commit answers the rest, and the fifth adds a case a mutation run on it found missing. - **A web font still loading stalled every shot.** Playwright 1.63 waits for the page's `document.fonts.ready` before each screenshot, bounded only by the shot's 15 s, so a font that hung after settling made every shot in its reading fail at 15 s, and enough such readings would outrun the job's `timeout-minutes: 45`: the job would be cancelled, and nothing would upload or deploy, against "warn, don't fail". Now `document.fonts.ready` is raced against 1.5 s before a reading's shots, and fonts still loading skip the reading's crops with one crop problem; a shot that times out stops the reading's crops; and the run's crops stop at a budget, 15 minutes from its start (`HARNESS_CROP_BUDGET`, in ms), so the crops never stall a run. What bounds the whole run is the time limits of the sixth and seventh commits. Self-test: `brokenFontCheck`'s first run, whose fonts are held after settling, must skip each of its twelve readings' crops, one problem each, in under 90 s, and exit 0; unit cases cover a held font, a shot that times out and a spent budget. - **Most of the CI growth was that stall, not the crops.** The self-test's two `brokenFontCheck` runs cropped with fonts held: 42 shots timing out at 15 s each, and no crop. The first now skips its readings' crops at once; the second takes none (`--no-crops`). The step times below are this head's. - **Clipped crops: the owner's ruling, "Crop what's visible (Recommended)" (2026-11-29).** Where an ancestor clips a surface (`overflow` other than `visible`, or paint containment), its crop is what a reader sees at load: the box intersected with every clipping ancestor's padding box, shot with Playwright's page screenshot clipped to that rectangle. `metrics.csv`'s `width` and `height` stay the box; `provenance.json` lists each clipped crop with its box and shown sizes (`metrics.crops.clipped`), and the summary counts them. The case is on the mystmd site: four `cell-output` surfaces per reading, at every reading, sit in `div.qe-collapse__body` (`overflow: hidden`, `max-height` 441 or 369 px) with 1,224 px boxes (`code_cells` n 11 and 12, `long_cells` n 2 and 3), so 24 crops; none on the Sphinx site, whose one clipped surface, the `status` table at phone, is left out as build-varying. A capped output is a fixture on both corpora, and the self-test's size check compares a clipped crop with the shown rectangle. - **Fixed chrome inside the content.** The chrome hidden while a surface is shot is now every fixed element that does not hold that surface, wherever it is (mystmd's `nav.qe-outline` and its top bar sit inside `article.article`, where the old rule kept them), and every sticky element outside the content that does not hold it; a sticky element inside the content stays. The chrome is marked once a reading, and the marks on the surface's own ancestors are lifted for its shot. A sticky bar outside the content and a bar fixed inside it are fixtures on both corpora. - **The nits.** A reading's crop problem is worded "(the reading)", not "(body text)". A `crops/` that cannot be read to clear takes no crop, so no new file sits beside an earlier run's, and is one crop problem. A directive's YAML options are read as written (YAML's failsafe schema), so `name: 2023` is a label again, as the pattern before read it, and a key written twice takes its last value; both corpora still give the same 56 labels. A crop 0 to 2 px over a box whose edges fall between pixels (Playwright takes the enclosing whole pixels) is documented, and the self-test allows +2 px where a size is fractional. `settleGrowing` is false when its deadline comes while its list still grows. The README names the exclusions where it lists the crops. - **The surviving mutants.** K1 (only fixed elements marked) is caught by the sticky bar outside the content; K16 (shots after `crops/` could not be made) by a case that shoots a real surface where `crops/` is a file; C5 by the result of a list that never stops growing. K2 (animations allowed) is now caught by an animation without end, and C7 by a key written twice. ## The cancelled run, and each reading's time limit (sixth commit) The first CI run of the mystmd head b7b66cb (run 46323504631, attempt 1) was cancelled at the job's `timeout-minutes: 45`. Its log, read with the owner's approval (2026-11-30), shows the rendered checks printing every site feature's line and 101 of the 102 page readings' by 2026-11-29 23:41:24Z, then nothing until the cancel at 2026-11-30 00:16:18Z: `mystmd_native` at phone in dark never finished, so nothing was uploaded and no summary was written. - **Where it can hang.** A reading's line is printed only once the reading ends, after its browser context closes, so the log does not say where it stopped. Before that line come its load (60 s, tried twice), its settling (network idle, 20 s; `document.fonts.ready`, no limit; a stable document, 10 s), the scheme check, the error markers, the console and overflow checks, the body text, the 51 families' counts and metrics, the fonts (their requests 15 s; their reading no limit), the crops (each shot 15 s; the evaluations round them no limit) and closing the context (no limit). A Playwright evaluation has no time limit of its own, so a page that stops answering in any call without one holds its reading, and the pool waits on it until the job is cancelled. - **Not reproduced.** Attempts 2 and 3 of that job passed, and 90 local runs of `mystmd_native` alone did not stall: 30 on the live site, 30 on a copy of it served by the harness's own server as CI serves its build, and 30 more of those with every processor core kept busy, each with every Playwright call still pending after 30 s logged (none was). So I cannot name the call that hung, and no call is changed for it. What `mystmd_native` has that no other page has is its two figures that embed a code cell's output (`{figure} #label`, the `figure-from-cell` family): the image is drawn twice, the cell's output and the figure's sharing one `data-mdast-node-id`. Nothing ties that to a stall. - **Each reading's time limit.** Every reading (a feature in one scheme, a page at one viewport in one scheme) now has 6 minutes from opening its context to closing it (`HARNESS_READING_LIMIT` in ms, a finite number in (0, 2700000], bounded as `HARNESS_FONT_WAIT` is). A reading past it is given up and keeps what it had done, and the step it was in settles the rest by the rules there are. A check it had not run is an `error` row naming the limit, as a check that could not run is (exit 1). A family it had not counted is an empty count with an `uncounted` entry, as a count that could not be taken is (exit 1 since the seventh commit, which counts every such entry). The seventh commit also gives the run a limit and settles a crash, so the job now always ends, uploads and summarises. Where it had counted any, the fonts and crops it had not taken are a `fonts` and a crop problem, warnings only, by the owner's ruling ("Warn, don't fail"). The crops it had written stay, named by their rows, and the abandoned crop step takes no further shot. Closing a context and closing the browser wait 10 s at most, and `run.mjs` then exits with the status it computed, its files written; the `build_info` fetch after the readings has 30 s. - **Saying so.** A reading given up says so on its line in the log, with the step it was in, and the summary lists each, as do a warning on the run ("Readings at their time limit") and `provenance.json` (`reading_limit`: the limit, its rule, and `at_limit`, each reading with its step and whether its context closed). So the next stall names its step. - **Self-test.** `limitCheck` runs `run.mjs` four times side by side, with the limit at 30 s, on copies of the good site whose `long_cells` page stops answering at the phone viewport (a loop that never ends): in the checks (its overflow reading), in the counts (the third family's measuring evaluation), in the fonts (their reading) and in the crops (the reading's second shot); in the first run the feature's page also stops answering as it settles. Each run must end and write `provenance.json`; each reading given up must be named with its step, keep what it had done and settle the rest as above; every other reading must be as on the good site. The checks and counts runs exit 1, the fonts and crops runs 0. A unit case pins the limit's parsing. The case adds about 40 s to the self-test. ## The second review: the run's time limit, a crash, and every count before the metrics (seventh to ninth commits) The second review read this pair at 5467471 and 10dc07b. It found the crops sound: the outputs unchanged on both live sites, the hashes and digests right, and the shared engine identical. It also found three defects and some claims the code did not bear out. The seventh commit answers them. - **The run's time limit.** Each reading had a limit and the run had none. So a theme that froze every phone reading (34 on the mystmd site, 32 on the Sphinx site, four at a time), or a browser that stopped answering, would still outrun the job's 45 minutes, one reading's limit after another; the review showed both. The run now has a limit of 25 minutes from its start (`HARNESS_RUN_LIMIT`). No reading starts after it, and each reading's limit is its own 6 minutes or what is left of the run's, whichever is less. A reading not started has its checks as `error` rows and its counts not taken, each naming the run's limit (exit 1). Why 25 minutes: the job's 45 minutes allow up to 3 minutes to set up (about half a minute so far), the self-test (7 minutes on the mystmd corpus; 12 allowed), the run, about a minute to settle the readings at the limit, close the browser, write the files and upload them, and 4 minutes to spare. A normal run takes 3 to 4 minutes. The browser is relaunched for the readings still to start when it has disconnected (it crashed), when a reading's context did not close in 10 s (it stopped answering), or when two readings in a row were given up at their limit; a browser that cannot be relaunched starts no further reading. Both limits take a whole number of ms from 10000 to 2700000, and `provenance.json` records a value refused (`reading_limit.refused`, `run_limit.refused`). - **A crash.** A page that crashed failed every call after it, so each family's count read as "a selector that threw"; and a reading that threw passed through to the run, which exited 2 and wrote nothing. Now a call that fails because the page crashed, or its browser went, stops the reading. A reading that throws is settled as one given up, with its error as the reason and the step it was in. A browser that disconnected is relaunched, and a reading that starts while it is relaunched waits for the new one (the eighth commit). - **Counts not taken exit 1.** A reading given up before its first count wrote one `uncounted` entry for the whole reading (family null), and the exit status did not count it. So a page that stopped after its checks went green with every count empty. run.mjs now ends with `return errors.length || uncounted.length ? 1 : 0;`: 1 when a check could not run or a count was not taken, whatever the cause; else 0. - **A step only the metrics need no longer costs a count.** Every family is counted first, each in an evaluation of its own, and only then measured. The body text is read after the measures, and its columns are filled in after. Splitting the counts from the measures costs one more short evaluation per family. The two find the same surfaces shown, and the tie check names any reading where they do not. A reading given up in a step only the metrics need keeps every count. Each such step it had not finished is a problem of its kind (`measures`, `body text`, `fonts` or `crop`): warnings only. - **The docs.** The README, the workflow's comment and the crops' notes now say what the code does. The crop budget bounds the crops' time; the time limits bound the run's. The exit status is given as the line now stands. - **The nits.** - A selector that threw is told apart from a page reading given up or not started, keyed by page readings alone. - A reading given up while its context was being opened says it had none (`closed: null`). Every step of a reading now stops once the reading is given up, not only the crops. - The crops' time counts a reading given up in its crops. - Provenance's crop-step limit is renamed `crop_step_seconds`, so it can't be confused with `reading_limit.seconds`. - **Self-test.** `limitCheck` now makes six runs side by side, on copies of the good site served by the self-test. Its `long_cells` page stops answering at a chosen reading and step (it asks for a page that never comes, so it answers nothing and uses no CPU), or it crashes or stops the browser: - the checks, and a feature as it settles; - the counts: the first family's, and a later one's; - each step only the metrics need: the measures, the body text, the fonts and the crops; - a crash: the browser killed, and a page's renderer killed; - a browser stopped with SIGSTOP; - the run's own limit. Each run must settle every reading by its step, relaunch the browser where it should, end, and write `provenance.json`. The crops' unit cases add a box that contains its paint, a bordered box (clipped at its padding box), the marks put back after each shot, and a crop budget spent mid-reading. Two things are not forced. The abandoned crop step's own guards would need the stopped browser to resume between the limit and its context's close, and no fixed delay makes that reliable. The scroll before a clipped shot changes nothing in a full-page capture in the document's coordinates on any fixture that has nothing moving with the scroll. ## Numbers **Local, at the sixth commit** (the later commits change none of what follows, as CI's notices and digests below show; Playwright 1.63.0, Chrome Headless Shell 153.0.8010.12, on a Mac: local, not of record). `run.mjs --url https://quantecon.github.io/test-lecture-theme-sphinx/` exits 0 and writes 2,148 crops, 29.3 MB (29,271,145 bytes), named by 2,406 of the 2,478 rows of `metrics.csv` (258 of them another family's file), none clipped. It leaves out 72 rows: `build_info` 42, `Wall time:` 24 (the two `%%time` cells on `code_cells` and their outputs) and `Run Time (s)` 6 (the `status` execution table). There are no crop problems, and no reading reached its time limit. The design's local estimate for option (a′) was 2,148 crops and 29.3 MB: the same. **Against main's code on the live site** (main's run of 2026-11-28; the site and main are unchanged since): `counts.csv` is byte for byte the same; `metrics.csv` is the same in every row and every column but `crop` and `sha256`, which main writes empty; `rendered.csv` is the same in every row, result and detail. **Self-test**: passes on both corpora, locally, at each commit. **CI, at this head** (d465768, run 46436579534, `ubuntu-26.04`, image 20261122.9.1, Chrome Headless Shell 153.0.8010.12). The rendered job passes: - 2,148 crops, 26.0 MB (25,966,516 bytes; the runner's fonts compress smaller than the Mac's), named by 2,406 of the 2,478 rows (258 of them another family's file), none clipped; - 72 rows left out (`build_info` 42, `Wall time:` 24, `Run Time (s)` 6); - no crop problems, no reading given up or not started, and no relaunch; - digest `4c13ebef58f05c51b40dce363433e3f6dc3b48d5b42b7432dc7b87117d6c54cd`. The "Drawn counts" and "Style metrics" notices are the same as the sixth commit's run's and main's last push run's (stage 1, 307c718), but for the time the installed fonts took to hash. So the counts, taken now before the metrics in evaluations of their own, are unchanged, and so are the metrics. **The step times** (this head, the sixth commit 5467471, the fifth commit a995b5c, the first reviewed head ea8aea0, and stage 1 on main): | | This head | 5467471 | a995b5c | ea8aea0 | Stage 1 | |---|---|---|---|---|---| | Self-test | 288 s | 267 s | 244 s | 394 s | 221 s | | "Rendered checks" | 159 s | 155 s | 172 s | 157 s | 106 s | | The job | 8 min 47 s (its setup took 73 s) | 7 min 35 s | 7 min 34 s | 9 min 46 s | 6 min 18 s | **Re-runs.** The review read the reviewed head's no-change re-run's differences on this site as rasteriser noise: 4 crops, at most one colour level, on `div.highlight`'s rounded right edge. Against the sixth commit's run, this run's crops differ only in `code-cell` on `long_cells` (two readings), the same noise. I have not chased it. **Mutation tables** (local; each mutant one edit to a fresh copy of the head, the full self-test run on it until its first mismatch). At the fourth commit: 68 mutants on the Sphinx side and 69 on mystmd. They are the carry-over's 21 (22 on mystmd); the crops' 24, some rewritten where the code moved; the review's K1, K2, K16, K17, K21, C5, C7 and C11 (K8 and C6 no longer apply as written, as the rule and the reading they mutated have changed); and 15 of this round's own (the fonts check, the stop at a timed-out shot, the run's budget, clipping off and on one axis, the lifting of a surface's own ancestors, the old chrome rule, the clipped crops' record, the failsafe schema, the refusal to crop beside an earlier run's files, the wording, a still-growing list, a long fonts grace, a surface clipped whole). Caught: 65 on Sphinx and 66 on mystmd. Of the three survivors on each side, two are equivalent: the run's budget checked before a reading's shots, which the same check in the shot loop answers with the same one problem; and `settleGrowing`'s last wait, true on every path that reaches it now that a list still growing returns false first. The fifth commit's case catches the third, a surface its ancestors clip whole, which no case had. In earlier rounds, every carry-over mutant was caught, and every crop mutant at the third commit. **Mutation table at the sixth commit** (local; each mutant one edit to a fresh copy of the head, run against the unit cases and `limitCheck` alone, so a mutant that only the rest of the self-test would catch counts as surviving): 29 mutants of the time-limit code on each side, 23 caught on each. They are the limit itself (never firing: the self-test hangs, caught at 300 s), each part of what a page reading given up keeps and settles (its rows, the error rows for checks not run, its counts, the empty counts and their `uncounted` entries, each way, its metrics rows, the `fonts` problem, and not one where the fonts were read, the crop problem, and not one where nothing was counted, the crops it had written), a feature's error rows, the steps named, the crop step's progress shared, the limit's upper bound, the exit status for counts not taken, the warning and `provenance.json`'s list. The six that survive on each side are in paths no page can force: a context's or the browser's close without its 10 s bound (a browser that will not close), the context left open at the limit (the browser's close at the end ends it), the abandoned crop step left running (what it does after the limit is never read), a crop written in the instant after the limit kept, and the crop step's result not kept when the limit comes while its context closes. **Mutation table at the seventh to ninth commits.** Local. Each mutant is one edit to a fresh copy of the head, run against the part of the self-test that bears on it: the unit cases and `limitCheck` for the time limits, and the unit cases, the good site and `cropCheck` for the crops. Each runs in a process group of its own, and every process under it is killed when it ends or its 300 s are up. The mutants are the review's L and C (the L ones rewritten where the code moved) and 20 of this round's own (N). | Set | Sphinx caught | mystmd caught | |---|---|---| | Review's L01–L20 | 16/20 | 16/20 | | Review's C01–C24 | 22/24 | not run | | This round's N01–N20 | 18/20 | 18/20 | | **Total** | **56/64** | **34/40** | - **C05, C06, C18 and C20, which survived the review, are caught**, by the new unit cases: a box that contains its paint, a bordered box, a budget spent mid-reading, and the marks put back after each shot. So is L11, by the body-text case. - **N06 (a reading's limit not cut by the run's)** first survived on mystmd, where the features before the run-limit case took about 5 s and its first reading's own limit ended just as the run's came. The ninth commit sets that case's limits so the run's always comes first, and N05, N06, N07 and N20, run again on both sides, are caught. - **L10 and N01 hang the self-test**, and are caught at their 300 s. - **The survivors are in paths no fixture can force, or change nothing:** - L07, L08 and L17 are the abandoned crop step's own guards. Forcing them would need a stopped browser to resume between the limit and the context's close, and no fixed delay makes that reliable. - L19 is a crop problem added when the limit comes while the context closes after the crops finished. - C04 is the crop step's own 300 s, which would need a reading whose crops take that long. - C16 is the scroll before a clipped shot. A full-page capture in the document's coordinates gives the same pixels without it on any fixture with nothing that moves with the scroll. - N09 is a step that ignores the abort. Once a reading is given up its context is closed, so the next call fails as a closed page and stops the reading all the same. - N12 reports `closed: true` where no context existed. No case gives a reading up before its context opens. ## Not changed The build jobs, the deploy and pages jobs, `drawn.yml`, `locators.yml` and the lectures. Pairing the two stacks' crops, and keeping them with a pass, are stage 3 (QuantEcon/project-theme-parity) and QuantEcon/project-theme-parity#8's gallery. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of QuantEcon/project-theme-parity#15 (D19, QuantEcon/project-theme-parity#80). Stage 1 of the families' style metrics and element crops, as the design's stage table gives it, under the owner's decisions 1 to 5 there. The twin is QuantEcon/test-lecture-theme-mystmd#26, in QuantEcon/test-lecture-theme-mystmd on the same branch,
harness/metrics; the shared engine is byte-identical in the two and compared by the engine-drift step, which pairs them by that branch name:lib/*.mjs,run.mjs,selftest/run.mjsand.github/workflows/harness.yml, andpackage.jsonandpackage-lock.jsonless their names (.name, and the lockfile's.packages."".name), which differ.selftest/labels.ymlis the same in both today, but it is fixture data, as the expected files are, and the drift step does not compare it. Branched from main at 2eb02c4. The first commit, 85d5415, built the stage; the second answers a review of it; the third makes a problem with the metrics a warning, never a failed job, by the owner's answer; the fourth to seventh answer a second review, the eighth to tenth a third, the eleventh to thirteenth a fourth, and the fourteenth and fifteenth a fifth, and the sixteenth a sixth. This description is of all sixteen. The shared files include the newlib/labels.mjs._harness/metrics.csv. For every shown surface of every counted family (drawn.yml's non-null selectors) at the six readings, taken in the page-wide checks' existing loads and in the same in-page evaluation as the drawn count, so its rows for a page, family and reading number exactly that reading'sshown(decision 2). The columns arepage, family, viewport, scheme, n, key, width, height, column, overflow, text, font_size, line_height, body_font_size, body_line_height, colour, background, contrast, crop, sha256. The values are raw (decision 4): the dominant text with its font size, line height, colour and composited background (#rrggbb) and WCAG contrast; the box's width, height and overflow (scrollWidth − clientWidth); and the page's body text size, line height and width (the column). A value that cannot be taken is written empty, never 0.cropandsha256are empty until stage 2.nis the surface's place among the family's drawn matches;keyis<kind>:<12 hex>of the normalised TeX, input code, heading text or label (decision 3), or empty, when the gallery falls back ton.The text a reader sees. The dominant text is the style (colour, size, family, weight) that draws the most characters of what the surface draws as text: its text nodes, and the
::beforecontent of the elementstheme.mjs's newglyphsnames. Whitespace and zero-width characters are not counted. Hidden text is left out: whatcheckVisibility()says is not drawn, and what is visually hidden though drawn, in the surface or anything between: a box of 1px or less in a direction it hides its overflow in, aclip: rect(…)that leaves 1px or less on an absolutely placed box, or aclip-path: inset(…)that leaves 1px or less (all four insets read:inset(50% 0 0 0)leaves half,inset(0 0 100% 0)hides). Within the winning style, the tag, size, line height and colours are read on the element that draws the most of it; a theme'stextSkip(span.section-numberin a heading) leaves a heading's number out, so a heading reads as its own text however short beside its number. The first commit read MathJax's assistive MathML and KaTeX's MathML copy, both clipped to nothing, as the dominant text of every display; now everymath-displayrow readsmjx-c(at 21.31 px at desktop), where it read the assistive MathML'smiormowithnormal, and leaves the line height empty: MathJax sets its glyphs' to 0 and places them by padding, so a CSS line height does not describe them (thetableandexerciserows whose dominant text is maths read so too). Text read through theglyphshook has no line height. The font readings follow a glyph's::before, so the rendered fonts now include the maths web fonts.One colour routine.
lib/visual.mjs'sharnessPaintcomposites translucent backgrounds over the first opaque one (over white where none is), and the text colour over that.behave.mjs'scolours(), whichdark-palettereports with, now calls it, on the same elements as before (the content root, the first paragraph and the first link in one): the first commit had moved it to the body text, which changed the text colours to#444444and#d4d4e4, and the second puts the elements back. So the values move only through compositing and the format: they would change for a translucent colour, or a page with no opaque background (composited over white), since the compositing is now the metrics' one routine, as the design asks; neither occurs on either corpus today. Before, on main: light "page rgb(255, 255, 255), text rgb(34, 40, 50), link rgb(0, 114, 188)", dark "page rgb(26, 26, 46), text rgb(243, 244, 245), link rgb(108, 182, 255)". Now: light "page#ffffff, text#222832, link#0072bc", dark "page#1a1a2e, text#f3f4f5, link#6cb6ff": the same colours, as hex. The self-test now pins all three colours in each scheme. Ancestoropacityis not read, as the README says.The theme facts here. The content root is
main.qe-page__content(profile.text, the only.qe-page__contenton every page, so the behaviours read the same element). The body text issection > p:not(.admonition *):not(.proof *):not(#qe-page-author-links)inside it: a paragraph directly in a section and in no box (one proof dropdown is drawn without.admonition), and not the paragraph the theme's script puts the page's author links in after the title, which is set at 18 px at every width and madeintroread 18/27 at tablet and phone where every other page reads 16/24; the self-test now has a boxedsection > p(an exercise's content section) that it must refuse.glyphsismjx-c: MathJax's CommonHTML output draws each glyph as the::beforecontent of anmjx-c, with no text node.sourceOfreads a display's TeX from MathJax's math list (the MathItem whosetypesetRootis the display), a cell's input code without Pygments'span.linenos, a heading withoutspan.section-numberanda.headerlink, its inline maths as its TeX from the math list, and the id at the surface's own label site: the surface, or thediv.mathSphinx puts a display's label on.The label key. A label key comes only from the surface's own label site, where its id is one this stack gives a label the page's source writes (
lectures/<page>.md: a target(label)=,:label:,:name:, alabel:orname:in a directive's YAML options,$$ … $$ (label),\label{…}, a footnote's[^label]; not the front matter), and no label of the page's that either stack would give an id another of its labels takes: both stacks' rules are in the sharedlib/labels.mjs, so(10-step)=and(step)=(bothstepon Sphinx), orGrößeandGrüße(bothgr-eon mystmd), key on neither stack, and a label keys on both or on neither. Each theme'slabelIdssays which ids: on Sphinx the label as written (sphinx-exercise and sphinx-proof), docutils'make_idof it (targets,:name:, footnotes: ASCII-folded, leading digits and hyphens dropped, so(2d-plot)=isd-plot, and(10-step)=and(step)=bothstep, which gives neither a key) and a display'sequation-id; on mystmdcreateHtmlId(normalizeIdentifier(label))from the fork'smyst-common, the same atQE_MYSTMD_SHA(id-2d-plot), and the identifier a footnote'sfn-id carries. The key is the source label itself, whitespace collapsed and lower-cased, so it is the same on both stacks whatever ids each makes, and an id a build generated (docutils'id1,toggle-2,example-3, mystmd'srucnplfZ7R) never becomes a key.run.mjs --labels FILEgives labels in place of the sources (the self-test'sselftest/labels.yml). Over the whole corpus (local, desktop in light), 20 page-families carry a label key on either stack; 16 have the same set of label keys on both; the other four are surfaces only one stack draws with that label: theiid_violationadmonition and theperron-frobeniustheorem (Sphinx only: mystmd drops the:name:and does not put the label on its theorem), the gluedflow_figfigure (Sphinx only) and the two figures ofmystmd_native(mystmd only). Every key, labels included, is identical between the live builds and the earlier build artefacts (Sphinx 8297979, mystmd 30c251fe), on both stacks.The runner and provenance (decision 5). The rendered job's
runs-onisubuntu-26.04, the same line in both corpora.provenance.jsongoes to schema 3 and keeps every schema 2 field (bin/measurereadsschema >= 2). It addsmetrics(the content, body-text and glyph selectors and the heading-number one,text_skip, the key's rules in words, where the labels came from, the rows, the readings taken,tied_to_counts, the empty counts, the faults by kind,crops: null) andenvironment: the runner'sImageOSandImageVersion,/etc/os-release, the platform, the browser build, the maths engines (MathJax.version; KaTeX's version from its stylesheet's.katex-version) andfonts. The fingerprint now follows design 6.3: the SHA-256 of the installed fonts (fc-list --format's file, family, style and version, with a hash of each file's bytes, so a new version or new bytes show; about 90 on CI, 0.3 s for 2,670 locally), the font files the main frames loaded (each with a hash of its bytes), and the platform fonts the measured text rendered with; font files of embedded frames (YouTube's Roboto onfigures, and the ourworldindata chart's fonts in the runs where its lazily loaded frame loads) are listed apart and left out. It is a whole-run union, so--pageschanges it.run.mjsgains--no-metrics,--labels, the metrics in the step summary, a "Style metrics" notice (rows, readings, the tie, keys by kind, empties, faults by kind, the environment, the web fonts rendered), and a "Style metrics problems" warning whenever there is one. A key source that throws is now a fault (it was swallowed), kept beside measure and body-text faults by kind in provenance, the summary and the warning.Metrics problems warn, and never fail the job (the owner's answer on QuantEcon/project-theme-parity#80, 2026-11-28: "Warn, don't fail"). A problem with the real run's metrics, a surface's measures or key source that threw, a body text that could not be read, or metrics that do not tie to the counts, is a "Style metrics problems" warning on the run, and is recorded in
provenance.json(metrics.faults, by kind, andmetrics.tied_to_counts) and the step summary. The exit status is exactly what it was before stage 1,errors.length || threw.length ? 1 : 0, so a problem with the metrics never withholds/_harness/,counts.csvincluded, from the site.run.mjs's header,harness.yml's header comment and the README say so. The self-test still fails on any metrics mismatch with its expected files.Nothing in the metrics can stop the run (the re-review). A bordered table had made
metrics.csv's writer throw and the run exit 2 with no provenance, since Chrome gives a bordered table a client width past its scroll width. Overflow is now at least 0, documented as content wider than the box, and any tag name is a tag. Every metrics step after the page loads is guarded: a value that is not one its column takes is written empty and is ameasuresproblem (sanitiseMetricRows); the labels, the tie, the fingerprint, the writer and the summary each record a problem of their own kind (labels,fonts,writer) if they fail; a measuring evaluation that throws leaves the count to the plain count; andprovenance.jsonis always written. Labels are read only when metrics are taken, provenance names the pages with no source file (metrics.labels.no_source: no page of either corpus is a notebook) and the readings that do not tie (metrics.not_tied), and the main frames' font files carry a hash of their bytes in the fingerprint, which is a union over the pages run. A heading's inline maths is keyed by its TeX on both stacks.Every part that cannot be read is a warned fault (the third review). A part of the fingerprint that cannot be read is a
fontsproblem, so an incomplete fingerprint is never silent: a reading whose rendered fonts or maths engines fail (one per reading), a main-frame font file listed by its address because its bytes could not be read, a main-frame font requested and never answered (a network failure, a redirect to nowhere), or a font response dropped, a main-frame font request not finished in 15 s, each named (every font request is waited for, against one deadline and again while more come in, as Chrome reports a font's answer only once its bytes are in;HARNESS_FONT_WAITsets the wait in ms, a finite number in (0, 600000], else 15 s; a request left behind by a document the reading navigated away from, asload()'s retry does, is no longer the reading's), fc-list missing, failing or listing nothing, and installed font files that cannot be read. A 3xx answer to a font request is no font file: the answer it leads to is hashed, and the hop adds neither a line nor a problem. An embedded frame's fonts, which the fingerprint leaves out, are listed from their request (so one still on its way is listed by its address) and by their hash once read, kept out of the 15 s wait, and are never a problem. The self-test reaches every one of these paths but a font response that cannot be read at all, which is the response listener's own failure and which no page can force. OnlyENOENTmeans a page has no source; any other error readinglectures/<page>.mdis alabelsproblem (metrics.labels.unreadable), and pages with no source are one too, as every page of both corpora has one. Where the labels file fails,labels.fromnames it; wheremetrics.csvcannot be written,metrics.rowsis 0 andmetrics.writtenfalse.The self-test. The fixtures pin every measured box in px, so the expected metrics compare exactly on any platform, at both bases. They now draw maths with its real structure (Sphinx: MathJax CommonHTML glyphs as
::beforecontent with the assistive MathML clipped, and the math list with the inline expression first; mystmd: KaTeX's HTML in two fonts with its MathML copy clipped to 1px and zero-width spaces), two displays keyed out of order across the corpora, page titles and a section heading whose two styles tie, a hide-cell fold, line numbers on one stack's cell and not the other's with the same key, a hidden fold output longer than its input, a translucent text colour, a narrower second body paragraph, a boxedsection > p, source labels, and the citation inside the solution taking no label from it. Unit cases pin the key's rules, the labels a MyST page gives, the tie check holding and failing, the fingerprint and each of its parts, and the measures on a small page of their own (a tie, whitespace and zero-width characters, six ways of hiding text,::beforeglyphs, compositing, an inline box,n, the body text, a key source that throws), and each theme's label sites. Five last cases runrun.mjsitself, each with its faults in provenance and each exiting 0 but thelectures/one, which keeps the drawn table's deliberately broken selector and so exits 1. On a build of the good site whosetypographyforces a problem of each kind a page reading can have (the body text, a surface's measures, a key source, a measuring evaluation, whose family then does not tie, and the fonts' reading), with a bordered table drawing its text in an element whose tag has a.and a_and a line height the writer's rules refuse: 36 faults, six of each, and six readings not tied, the "Style metrics" notice, and every row it measured. With a--labelsfile that does not parse, nofc-listonPATHand ametrics.csvthat cannot be written: a labels, a fonts and a writer problem, no rows written. Without--labels, from alectures/with a MyST page (a label in YAML options, a kernelspecname:in the front matter) and anintro.mdthat is a directory: the page keyed from its source, intro's source and the pages with none as two labels problems. Five times with a stand-infc-listthat writes what--formatasks for, a font file that is not there, a site font whose address answers 301 (hashed as the answer it leads to, no problem), and a frame that loads a font (one through a 301 in the third run, no problem): the fingerprint moves with the installed font's version or bytes and a site font's bytes at the same address, and not with the frame's font or the port. And on a copy of the good site the self-test serves itself (--url), withHARNESS_FONT_WAITat 3 s: ontypography, a font whose answer breaks after its headers, one through a 302 to a port that refuses it, one whose bytes are held back, and one asked for while the harness waits and never finished must each be a fonts problem in each reading (the last two named as not read in 3 s), and fonts through a 302, a 307 and a 308 none, listed as the font they lead to, as must a font whose bytes come while the harness waits, listed with its hash; onintro, with nothing held, a font whose connection fails must be one "never answered" problem in each reading and no "not read", a chain of two fonts that ends within the wait both hashed, and a long-poll that is no font none; the frames' fonts (one that breaks, one never answered, and onintroone held back) must be listed exactly, and be none. A second run readsmath, whose font is held on its first request, so the reading that asks first loads the page again: no fonts problem, and the font hashed. Anfc-listthat lists nothing is a fonts problem in thelectures/run. The fixtures add Sphinx's injected author-links paragraph onintro, a heading with inline maths on each side, with one key in both corpora, a table labelled by:name:(its id docutils'make_idof the label, so it keys by it), and a hidden body paragraph before the first shown one; the unit cases add the key's order past TeX, a heading's maths normalised as TeX, each theme's ids for a label (a leading digit, a display's with one, a non-ASCII letter, a stroked one, an apostrophe, a footnote) and labels one stack gives one id (no key on either), YAML options (with a comment after a value, a#inside one beside the label it shares an id with, and CRLF endings) and front matter, a source missing and one unreadable, the writer's rules, weight and colour in a style, a clip-path's four insets and two, the clip of a box pinned to the viewport, the element that draws the most of the dominant text and the first of two that draw as much, lengths to 1/100 px, measures that throw, the fonts a::beforeis drawn in, the maths engines' versions, each theme's input-less cell, a title number the build wrote against one its author wrote, and a heading shorter than its number, plain or inside its table-of-contents back-link. A missing output is a mismatch, never a crash. The counts stay the same in both corpora but where the stacks draw differently (mystmd's hide-cell block sits inside its fold). The mutation tables: in full on the fifteenth commits, 290 mutants on each side, it caught 269 of 290 on each (the survivors equivalent or out of a fixture's reach, as the README says, with eight small rule cases left for a later round). On the sixteenth commits, a run of the code this round changed: the sixth review's 25 mutants (24 on mystmd), mapped onto this code where it moved, and seven of this table's own for the new rules (the deadline loop, the retry's leftovers, the named late fonts, the wait's bounds, a bare and a quoted#value). It catches 29 of 31, E03, E10 and E18 among them. E16, the frame fonts' 2 s wait made as long as the main one, survives on both sides and is equivalent: it changes only how long a reading takes, as the README says. P38, the moment after each round for a request the last answer led to, is caught on mystmd and survives here: whether the chain of fonts that needs it ends inside the wait depends on how long a Sphinx reading takes to measure.Local runs against the live site (Playwright 1.63.0, Chrome Headless Shell 153.0.8010.12, on a Mac outside the sandbox: local, not of record).
run.mjs --urlexits 0 and writes 2,478 rows over all 96 (16 pages) readings, every reading tied toshown. Keys: tex 228, code 936, heading 660, label 174, none 480. Empty values: text 66, overflow 162 (inline boxes), body text 6 (zreferences, which has no paragraph). Faults: none. Fonts: 11 rendered fonts, including the web fonts MathJax_Main, MathJax_Math and MathJax_Size4 (which the hidden-copy reading never saw), 18 font files in the main frames, each with a hash of its bytes, and 1 in an embedded frame, not fingerprinted; 2,670 installed fonts in 371 files hashed in 0.3 s; MathJax 3.2.2. The labels' new matching gives the same 174 label keys as before. With the author-links paragraph left out, every page with running text reads a body text of 16/24 px at tablet and phone,introincluded, whereintroalone had read 18/27.Pairing on
math(local, both live runs, each of the six readings): the TeX keys anchor all 17 of mystmd's display equations to Sphinx's, and leave one Sphinx display unpaired,n17, thear1-tp-eq2block KaTeX cannot parse; byn, none pair, since the counts are 18 and 17. Over every page and family both sites draw (702 readings, lessbuild_info), key alignment gives 2,178 pairs against 1,716 byn, and wherever the counts agree it pairs exactly asndoes.code_cells' cell 29, which numbers its lines on mystmd, now has one key on both stacks.Not changed: the build jobs, the container digest,
QE_MYSTMD_SHA,lectures/,bin/sync-from-sphinx,sync-check.yml,cache.yml, and the deploy and pages jobs.metrics.csvreaches/_harness/with no change there: the rendered job uploads_harness/whole, and the deploy job downloads it whole intosite/_harness. Crops are stage 2.🤖 Generated with Claude Code
https://claude.ai/code/session_01WT8bMcHqHDAeUKbY94TYzg