Repository navigation
visual-oracle: cumulative.py reports each page's glue set — F11 withdrawn, ranking re-attributed - #757
Conversation
) What changed: - tools/visual-oracle/cumulative.py: a companion to rank.py. rank.py ranks pages by their single largest delta; this ranks divergences by how many baselines each one displaces. It reuses rank.py's producer route, pdftext reference reader, word grouper and difflib alignment unchanged, and adds only: aligned pairs bucketed into reference lines (a dy profile per page); every change in that profile classified cumulative (the median dy below it differs from the median above: cost = step x lines below) or local (the page comes back: cost = one line); a probable-cause label taken from the LaTeX construct standing between the two lines in the source, so one cause groups its witnesses across fixtures; and a low-confidence flag for lines whose own words disagree about dy, which is what happens around cmex big operators where the reference PDF has no usable text for \int. - tools/visual-oracle/test_cumulative.py: 26 pure-python tests (cause keys, enclosing environment, local/cumulative/page-origin classification, aggregation, the low-confidence guard). - tools/visual-oracle/README.md: the companion section. - docs/evidence/corpus-fidelity-2026-09-16T1130Z/: the GH-66 sweep — README.md with twelve ranked findings, cumulative.md/json for all 22 fixtures and 59 compared pages, and 20 minimal probe documents with their measured result. No rendering behaviour is changed. pdflatex is an oracle only. What was run: python3 -m unittest discover -s tools/visual-oracle -p 'test_*.py' Ran 34 tests in 0.028s OK python3 tools/visual-oracle/cumulative.py --out docs/evidence/corpus-fidelity-2026-09-16T1130Z font environment: zero font-FAILURE diagnostics in every fixture 22 fixtures, 59 compared pages, 0 page-count mismatches python3 tools/visual-oracle/cumulative.py --fixtures .../probes --out .../probes-report 20 probes; r1/r2/r3/t3-macro-mid +5.978 bp, r4/t1/s2 0.000 bp Next step: the ranked list in the evidence README is for the Commander to triage into issues. F1 (cv, 29.89 bp) and F10 are the re-pin's payload (#711), not open engineering; F4 is the open #712 -> #741 stack measured on main. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…d F7 is withdrawn What changed: `cumulative.lines_from_pairs` computed `c["x"] - r["x"]` / `c["y_top"] - r["y_top"]` and bucketed lines on `r["y_top"]`, and the sweep's reflow test compared the same two word origins. All three now go through `cumulative.measured_pairs` -> `rank.pair_points`, which anchors an aligned pair at its first alphanumeric glyph: the content `rank.norm` used to decide the two words were one word. #752 did this for `rank.py`; this is the same correction applied to its companion, based on #752's branch with #750 merged in. F7 of the 2026-09-16 corpus sweep ("`\bigl(` offset by exactly -5.000 bp") is therefore **withdrawn**: not a rendering defect but an artefact of the oracle. pdfTeX sets `\bigl(` from cmex10 on a baseline 8.836 bp above the line, so `pdftext` reads the reference as `(` + `A...` and the candidate as one `(A...`, and the two word origins differ by the delimiter's advance (4.996 bp for `\big(`, 5.149 for `\Big[`). Both PDFs put the delimiter origin at x=243.037 and the `A` at x=248.037; the ink agrees to 0.083 bp. The evidence directory of #750 is regenerated in place and its README carries a Correction section that supersedes the original numbers. What was run: python3 -m unittest discover -s tools/visual-oracle -p 'test_*.py' Ran 45 tests in 0.025s / OK python3 tools/visual-oracle/cumulative.py --out docs/evidence/corpus-fidelity-2026-09-16T1130Z python3 tools/visual-oracle/cumulative.py --fixtures .../probes --out .../probes-report python3 tools/visual-oracle/rank.py --out <scratch> --thumbs 0 A/B of the full 22-fixture / 59-page sweep, pre- vs post-correction, same binaries: causes (the vertical cause table): identical every page's steps, dy_profile, lines, reflowed_words: identical F7-class outliers (|dev| in 4.9..5.2 bp on a delimiter word): 8 -> 0 horizontal cause `math glyph advance`: 86 occ / 21.089 bp -> 78 occ / 12.891 bp total horizontal word outliers: 565 -> 553; F8's gate count 173 -> 164 words rank.py: hw1 p2 dx_max 5.000 -> 0.611, hw2 p1 5.000 -> 1.086, hw2 p2 4.998 -> 0.432 Anchor reach over the corpus reference side: 16496 words, x moves on 546, y on 0. The pre-correction re-run reproduced #750's committed cumulative.json exactly (modulo `meta`), so the A/B isolates this change. probes-report: all 20 probe measurements identical; only the stamp line moved. Next step: Nothing in crates/ or vendor/ is touched, so no rendering behaviour changes. Merge after #752 (this branch contains it). Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… on a set page is not localised What changed: - tools/visual-oracle/cumulative.py: read pdfTeX's own `glue set` per page from \tracingoutput on a re-run verified to be the pinned reference's typesetting, flag every step on a finite-order set page `cause_not_localised`, and keep those lines out of the ranking's `lines affected` (reported separately as `lines_not_localised`). A fil-order set displaces nothing and is not flagged. The candidate's ratio is NOT reported: render-pipeline's pagebuild::glue_set computes and discards it and the v2 page carries only the fixed page size, so the engine's own overfull_vbox diagnostic is reported instead of a number being invented. - test_cumulative.py: 7 new tests, including the ` []` truncation marker that \showboxdepth appends to the deepest boxes it prints — which is the page body box under a class that nests one level deeper (listings-manual, cv), so a parser that rejects it reports those pages as unset. - docs/evidence/corpus-fidelity-2026-09-16T1130Z/: sweep re-run and README re-attributed. 10 of 59 pages are shrunk; 704 of 1031 displaced baselines sat on 4 of them. F3 (\maketitle, already withdrawn by #755) and F11 (section-heading skip) are withdrawn as double-counts; F5 keeps only \end{proof}; F2 drops 374 -> 101 corpus lines; F4 drops 140 -> 27. F1, F6, F12 and all 20 probes are on unshrunk pages and are unaffected. No crates/ file and nothing under vendor/ is touched, so no rendering behaviour changes and HW1/HW2 stay bit-identical: the sweep was re-run with the same flashtex-render/flashtex-pdf-exact binaries #753 used (sha256 1db2e9c051f9f300... / 5c0a28a0b76e96b3...) and every page's dy_profile and step_bp in cumulative.json is byte-identical to #753's. What was run: python3 -m unittest discover -s tools/visual-oracle -p 'test_*.py' Ran 53 tests in 0.028s OK python3 tools/visual-oracle/cumulative.py --out <scratch>/sweep 22 fixtures, 59 compared pages; profiles identical to #753: True python3 tools/visual-oracle/cumulative.py --fixtures <scratch>/probes --out <scratch>/probes-report probe pages flagged: [] (all 20 probes unshrunk) Next step: Tell the #706 list-boundary lane that the -0.979/-0.977 entry/exit steps and all four \item -> \item -0.245 bp steps are the page's shrink ratio, not defects; only +6.732 and +1.155 survive. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
Commander (daniel-parent): independent Opus review of
Merge plan for the four, per the reviewer's stack analysis: merge #752 first, then close #750 and #753 as contained in #757 and merge #757 alone — its tree already carries #750 + #752 + #753 verbatim and its evidence is the only non-superseded version. If instead the stack must land as authored, it is strictly #752 → #750 → #753 → #757, each rebased on the last, never two in parallel. Either way the reflow-guard, GFM-header and 348/676 fixes land in whichever evidence directory ends up final. Authors: tell me which you prefer before pushing more. PR #757 — visual-oracle: cumulative.py reports each page's glue set, ranking re-attributedHead SHA: Note on the brief I was given: it says "F1 withdrawn". That is not what this Is the F11 withdrawal justified?Yes. Every load-bearing number is independently reproducible and I The mechanism claimed: on a page whose glue pdfTeX sets with a finite shrink Premise 1 — the pages really are finitely set. My own run,
Five for five to five decimal places, including the negative case that matters Premise 2 — the shrink components. From my own page dumps:
Every one exact. (I checked the Premise 3 — the fit. Dividing each step by its boundary's shrink returns one F11 itself. Its four witnesses give The withdrawal is also framed correctly: it is a re-attribution, not an Material findings
Non-blocking notes
What I verified
The core insight is right, the arithmetic is right, the withdrawal of F11 is VERDICT: CHANGES REQUIRED |
What
Tooling and evidence only. No
crates/file is touched, nothing undervendor/, no rendering behaviour changes and HW1/HW2 stay bit-identical.Based on #753's branch, so it carries #753's corrected
rank.pair_pointsanchoring; merge #753 first.
tools/visual-oracle/cumulative.pynow reports each page's glue set andrefuses to attribute a step to its own position on a page where TeX set the
glue.
glue setfrom\tracingoutput, read froma re-run of each fixture that is first verified to be the pinned reference's
typesetting (8 of 22 re-run byte-identical; the other 14 were pinned under TeX
Live 2025 and differ in bytes with every extracted baseline within 0.001
bp).
--texbinpoints elsewhere;--no-glue-setskips the pass and thenflags everything, because an unmeasured glue set is not a zero one.
crates/render-pipeline/src/pagebuild.rs:1475(fn glue_set) computes exactlythe right quantity and the value dies as a local at
pagebuild.rs:657oncebaselines are placed;
BuiltPagekeeps onlylines/overfull_byand the v2Page(display.rs:524) carriesnumber,width,height,content, wherewidth/height are the fixed paper size. So the report carries the reference
ratio plus the engine's own
overfull_vboxdiagnostic (typeset.rs:8412) —which fired on none of the ten pages pdfTeX shrinks, a fact about the
instrument, not evidence our pages fit.
cause_not_localised, listed in its own section, and excluded from theranking's
lines affected(kept aslines_not_localised). Afil-order set —a short page whose
\vfilabsorbs the slack — leaves every finite glue atnatural size and is not flagged, which is why
cvpage 1, the corpus'slargest cumulative defect, is untouched.
Why
#755 established that F3 (
\maketitle) was not a\maketitledefect: the blockis exact to 0.0009 bp and both witnesses sit on shrunk pages, each "step" being
the difference of two shrink ratios. The general fact:
Shrinkable glue is
\abovedisplayskip,\topsep,\itemsep,\parskipand the\@startsectionskips — exactly the constructscumulative.pynames itscauses after — so a shrunk page manufactures a step at every display, list and
heading. 704 of the sweep's 1031 displaced baselines were on ten such pages.
One ratio explains a whole page (fitted, not asserted)
Dividing each step by the shrink component of the glue at its boundary, read
from that page's own
\showboxbreadth=500dump, must return oneΔr:ΔrΔrmath-sheetp1\@topsepadd+section (6.917 bp)twelvept-plainp3\topsep+\partopsep7.970 bp,\itemsep+\parsep1.993 bp,\parskip0.996 bplecture-notesp1\topsep4.981 bp, display 5.978 bpTwo of those match #755's page-builder derivation to four significant figures
from a completely different direction.
Re-attributed ranking
351 of 1031 lines survive (the tool's own conservative count is 327; the README
restores 21 by hand for two steps with the wrong sign and an order of magnitude
too large for their page's artefact).
math-sheetp2 is unshrunk\\[<len>]in a\newcommandcvp1 unshrunk, 7 clean probes+6.732and+1.155survive; entry/exit−0.979/−0.977and all four\item−0.245are the shrink ratiotabularlab-reportp2)\end{proof}\end{proof}−1.076survives; the six+0.124/+0.148amsthm steps are withdrawnF3\maketitleF11section-heading skipΔrx the skip's own shrink, no unshrunk witness, no probeThree of twelve are now withdrawn — F7 (instrument), F3 and F11
(double-counts) — each found by re-deriving rather than accepting.
A live lane is affected
The #706 list-boundary stack (#712 → #722 → #728 → #738 → #741) is measuring
against F4. Its headline
\end{itemize}→\begin{enumerate}+6.732 bp isreal — wrong sign for
twelvept-plainp3's artefact, and it would need 54.8 bpof shrinkable glue where the page's largest is 7.97 bp. But the
−0.979/−0.977entry/exit steps and all four\item→\item−0.245 bpsteps on that page are
0.1229 xthat boundary's own shrink, to within 0.3%:they are not defects and
\itemsepmust not be used as evidence.#754 (F2) is not chasing a double-count — its 6 probes are on unshrunk pages
and are independent evidence — but its "374 lines, worst in the corpus" framing
was, and its two biggest corpus witnesses (
math-sheetp1,twelvept-plainp3)are artefact.
Overlap check
python3 scripts/coord.py claim GH-GLUE-SET-ATTRIBUTION --actor daniel-parent --machine mac-m5pro-dq222 --branch agent/daniel-parent/glue-set-attribution→CLAIMED.coord.py claims: the only other holders areGH-750-F13-TEXTRUN-FAMILY0(daniel-muse-lead) and
GH-756-THINSPACE-MACRO-SPAN(daniel-muse-lead-2);neither touches
tools/visual-oracle/or this evidence directory.gh pr list --state open: visual-oracle: rank corpus divergences by blast radius (GH-66 fidelity backlog) #750/visual-oracle: F7's -5.000 bp is a \bigl delimiter's advance, not a placement error #752/visual-oracle: cumulative.py anchors where norm decides identity — F7 withdrawn, sweep re-ranked #753 owntools/visual-oracle/and thisevidence directory; this PR is stacked on visual-oracle: cumulative.py anchors where norm decides identity — F7 withdrawn, sweep re-ranked #753 and must merge after it.
render-pipeline tests: \maketitle is exact; #750 F3 is a page glue-set difference, withdrawn #755 owns a separate evidence directory and is not edited here.
crates/**file, nothing undervendor/, noapps/mac|ios|windows.Test results
Binaries: the same
flashtex-render/flashtex-pdf-exact#753's sweep used(
sha256 1db2e9c051f9f300…/5c0a28a0b76e96b3…, matching that sweep'scumulative.jsonmeta), so the vertical measurement is reproduced, notre-derived.
Not done
ps-calculusp1 is unresolved. Its two steps are+0.1344and−0.1587,opposite signs, so no single
Δrfits. Both stay flagged; neither is resolved.twelvept-plainp3 orps-calculusp1. render-pipeline tests: \maketitle is exact; #750 F3 is a page glue-set difference, withdrawn #755did it for the other two pages. Truncating a page so it no longer overflows and
re-measuring is the only way to recover the real
δunder a flagged step; thesign-and-magnitude test used here bounds it but does not measure it.
\section. F11 is withdrawn for want of an unshrunk witness,not shown to be exact. Someone should add one before the next sweep rediscovers
it.
glue_setand natural height to the v2 display-list page record would makethis whole analysis a comparison instead of an inference. It needs a
crates/change, which is out of scope here.
🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz