Skip to content

render-pipeline: abstract is \small, a centred head and a quotation (#258 rank 1) - #302

Closed
GoKubar wants to merge 2 commits into
mainfrom
agent/linux-abstract/abstract-env
Closed

GoKubar wants to merge 2 commits into
mainfrom
agent/linux-abstract/abstract-env

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #258's rank-1 divergence on its reproducer and on one of the four real documents it affects. Draft, and deliberately not claimed finished: three of the four one-column abstract documents now sit ~10–12 bp too low where they used to sit ~10–12 bp too high. See "What is still wrong".

The capability, not a constant

#292 deferred this and named the blocker exactly right. paragraph_block hard-coded body_size_pt/baselineskip_pt, so nothing could be set at a size other than \normalsize with that size's own leading. adapter::SizedPara now carries what \@setfontsize changes for one paragraph: the size, that size's \baselineskip, a \parindent in the new size's own em, a trailing \vspace in em of the font its last word is set in, and the closing \@endparenv skip of a list opened while the size was in force. typeset/footnotes.rs was the shape to follow.

Route: transcribe, not wire in

crates/title-layout was the alternative and I did not take it. It depends on the sibling document-style, while crates/render-pipeline builds against its vendor mirror, so Skip/Pt/Stylesheet would be different types and layout_abstract(class, sheet) could not be called at all without patching; adding it also breaks the git archive-of-one-directory property the Cargo.toml documents. Two substantive facts also came out against it: its gap_before_heading is \topsep + \parskip with no \partopsep, and its article.cls quote predates \vspace{-.5em}. So the arithmetic is transcribed against the vendored document-style, which already exposes font_size, list_level and Skip.

What the class file says

article.cls 377-387 (report.cls 452-462 is identical), \quotation at 356-364. Every number is read off pdfTeX's own vertical list for min-abstract (\showoutput, TeX Live 2025), quoted in full in abstractenv.rs:

  • the head is \begin{center}{\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}\end{center} at \small, centred at the full measure — center is a \trivlist, so \leftmargin is 0;
  • the body is \quotation: \leftmargini both sides (shifted 25.00003), \listparindent 1.5em resolved in \small's own \fontdimen6 (13.87161 pt, not the \normalsize quad), \small's 11 pt leading throughout;
  • the opening glue is \normalsize's \topsep + \partopsep + \parskip = 10 pt plus 4 minus 5; \small only \defs \@listi, it never executes it. (The \addvspace{-\parskip} that follows is a no-op: \parskip's natural width is 0, so \@xaddvskip takes neither branch.)
  • the closing glue is 6 pt plus 3 minus 3 — \small's own \@listi \topsep of 4 pt plus \partopsep;
  • the \vspace{-.5em} in the head is real and was missing from both earlier readings of this environment (title-layout's docstring quotes an older article.cls; render-pipeline: secnumdepth, description, \baselinestretch and run-in headings #292's extract skips the line). It is half a \bfseries quad at \small (cmbx9), -5.3237 pt, emitted through \vadjust after the line and added to the closing skip rather than absorbed by it.
  • the quotation's own opening \addvspace\@topsep is absorbed whole by the \end{center} skip already on the list: \normalsize's \topsep+\partopsep (10/12/13 pt) beats \small's plus \parskip (6/9/12 pt) at every class size.

Where it lives

The compiler has no model for the environment — it reports it and sets the body as plain text — so the pipeline reads it from the source bytes, the way it already reads tikzpicture, a list's \begin keys and a paragraph's \newpage. Its now-superseded diagnostic is dropped the way toc::superseded_commands drops the contents-list ones. No compiler change and no vendor re-pin, so unlike #292's run-in arm this is live rather than feature-gated.

Not set here, and deliberately not re-reported (the compiler's own warning is already exactly true of them): the \if@twocolumn branch (\section*{\abstractname}) and the titlepage branch (a page of its own between \null\vfils, report's default). book.cls defines no abstract.

Measured

tools/visual-oracle/rank.py, candidate vs the pinned reference, word-origin deltas in bp, geometry only (no pdftoppm, no Ghostscript on this host). Control built from origin/main in the same working directory as the branch build, not a git archive scratch build. Runs were serial, not under load.

The reproducer — bar met

probe before after
min-abstract p1 median dy -24.584, max |dy| 35.54, 92 of ref 93 aligned, 1 reflowed median dy -0.000, max |dy| 0.00, 93/93 aligned, 0 reflowed

Residual max |dx| 1.30 is the probe's \verb run on substituted ec metrics (the bundle has no ectt*.tfm) — the same caveat #292 recorded.

The corpus — one of four documents fully fixed

natbib-review (11 pt, geometry, \maketitle) is the clean case:

page before after
p1 median dy -22.167, within 0.5 bp 15 median dy -0.001, within 0.5 bp 146
p2 median dy -27.099, within 0.5 bp 1 median dy -0.000, within 0.5 bp 90
p3 median dy -22.516 median dy +0.000

The other three move by the same amount but overshoot:

document page before median dy after median dy
plain-article (10 pt) p1 -12.562 +10.028
lab-report (11 pt) p1 -11.801 +11.960
hyperref-toc (11 pt) p1 -10.209 +11.959
hyperref-toc p2 -175.585 -103.311
hyperref-toc p3 -242.328 -131.764
lab-report p2 -506.047 -443.111

conf-paper is two-column and untouched.

Byte identity

Rendering-v2 display lists against the same control: all 10 pre-existing fixtures/real-world documents byte-identical, and 16 of the 20 in the corpus. The four that change are exactly the one-column abstract documents.

What is still wrong

The shift this adds is constant and correct — 22.17 bp at an 11 pt base in every document measured — and natbib-review proves it lands exactly right. In the other three a second, opposite-signed error of ~10–12 bp, previously masked by the missing abstract, is now visible.

What I ruled out, with evidence, before running out of budget:

  • not \maketitle: a scratch document with plain-article's exact title block and no abstract is exact against local TeX Live 2025 — 72/72 words within 0.5 bp, median dy +0.065.
  • not \noindent: only plain-article has one; lab-report and hyperref-toc overshoot by the same +11.96 without it.
  • reproduces off the pinned reference: plain-article verbatim against a locally generated TL 2025 reference gives the same +10.028, so it is not a MacTeX-vs-TeX-Live reference artefact.

The suspicious quantity is that +11.96 bp ≈ 12.0 pt is exactly \small's \baselineskip at an 11 pt base, which would mean the abstract body is one \small line taller than pdfLaTeX's in those documents — a measure or first-line-indent error inside the quotation pushing one word onto an extra line, not a glue error. min-abstract's abstract is two lines and exact, so it would not show there. The next step is to count candidate vs reference lines in lab-report's abstract and compare its \parshape width against the \showoutput list; tools/.../showlist.sh-style extraction of absl-pa's vertical list is already in the scratch notes below.

This is not ready to land. Per the reasoning in #292 that stopping beats half-implementing, it is left as a draft with the residual named rather than merged with three documents in a new wrong place.

Gates

gate result
10 pre-existing fixtures/real-world byte-identical yes
12 newer: five abstract documents improving 1 of 5 exact (natbib-review), 3 overshoot, conf-paper two-column and untouched
min-abstract 24.58 bp → ~0 yes, -24.584 → -0.000
amsmath 59/59 not run (budget)
HW1/HW2 3 pages, 0 overfull/0 errors, byte-identical byte-identical confirmed via the display-list comparison; the page/overfull assertion not re-run
crates/render-pipeline test suite not run (budget)
zero font-FAILURE diagnostics not separately asserted (budget)

pdflatex is an oracle only and never runs in the product path. No committed reference or sidecar was regenerated; the scratch references made for the two isolation probes are TeX Live 2025, labelled, and not committed.

GoKubar and others added 2 commits September 14, 2026 00:10
…ion`

#258 rank 1, the highest-frequency layout divergence in the corpus: the
`abstract` body was set at `\normalsize` and the full measure with no head
at all, so everything below it sat 24.58 bp too high.

The blocker the previous lane named (#292) was a missing capability, not a
constant: `paragraph_block` hard-coded `body_size_pt`/`baselineskip_pt`, so
nothing could be set at a size other than `\normalsize` *with that size's
own leading*. `adapter::SizedPara` now carries what `\@setfontsize` changes
for one paragraph — the size, that size's `\baselineskip`, a `\parindent`
in the new size's own `em`, a trailing `\vspace` in `em` of the font its
last word is set in, and the closing `\@endparenv` skip of a list opened
while the size was in force.

article.cls 377-387 / report.cls 452-462, transcribed against the vendored
`document-style` (wiring `crates/title-layout` in was the alternative: it
depends on the *sibling* `document-style`, so its `Skip`/`Pt`/`Stylesheet`
are different types from the vendor mirror this crate builds against, and
adding it would break the `git archive` property the Cargo.toml documents.
It also models `gap_before_heading` as `\topsep + \parskip` with no
`\partopsep`, and its article.cls quote predates the `\vspace{-.5em}`):

* the head is `\begin{center}{\bfseries \abstractname\vspace{-.5em}
  \vspace{\z@}}\end{center}` at `\small`, centred at the FULL measure
  (`center` is a `\trivlist`, `\leftmargin` 0);
* the body is `\quotation`: `\leftmargini` both sides, `\listparindent
  1.5em` resolved in `\small`'s own `\fontdimen6` (13.87161 pt, not the
  `\normalsize` quad), `\small`'s 11 pt leading throughout;
* the opening glue is `\normalsize`'s `\topsep + \partopsep + \parskip`
  (10 pt plus 4 minus 5): `\small` only `\def`s `\@listi`, it never
  executes it;
* the closing glue is 6 pt plus 3 minus 3 — `\small`'s own `\@listi`
  `\topsep` of 4 pt plus `\partopsep`, not `\normalsize`'s 8 pt;
* the `quotation`'s own opening `\addvspace\@topsep` is absorbed whole by
  the `\end{center}` skip already on the list at every class size.

Every number above is read off pdfTeX's own vertical list for
`fixtures/divergence-probes/min-abstract` (`\showoutput`, TeX Live 2025),
quoted in `abstractenv.rs`.

The compiler has no model for the environment (it reports it and sets the
body as plain text), so the pipeline reads it from the source bytes, the way
it already reads `tikzpicture`, a list's `\begin` keys and a paragraph's
`\newpage`; its now-superseded diagnostic is dropped the way
`toc::superseded_commands` drops the contents-list ones. No compiler change
and no vendor re-pin, so the fix is live rather than feature-gated.

Not set here, reported as limitations instead of approximated: the
`\if@twocolumn` branch (`\section*{\abstractname}`) and the `titlepage`
branch (a page of its own between `\null\vfil`s). `book.cls` defines no
`abstract`, so it keeps the compiler's warning.

Measured, `tools/visual-oracle/rank.py` against the pinned TeX Live 2025
reference, geometry only (no rasterizer on this host):

  min-abstract p1  median dy -24.584 -> -0.000, max |dy| 35.54 -> 0.00,
                   words aligned 92/93 -> 93/93, reflowed 1 -> 0.

The residual max |dx| 1.30 is the probe's `\verb` on substituted `ec`
metrics (the bundle has no `ectt*.tfm`), the same caveat #292 recorded.

Corpus gates are still running; this is committed early so the work is not
held locally.

Implementation-Agent: linux-abstract lane (Claude Opus 5)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…lready reports

The two-column (`\section*{\abstractname}`) and `titlepage` branches are not
set here, and the compiler's own "environment 'abstract' is not implemented;
its body is typeset as plain text" is already exactly true of both. Emitting
a second message changed the rendering-v2 diagnostics of every two-column
document whose layout this leaves untouched — `article-twocolumn` (a
pre-existing fixture that must stay byte-identical) and `conf-paper`. Their
layout was identical either way; now the display list is too.

With this, all 10 pre-existing `fixtures/real-world` documents and 16 of the
20 in the corpus are byte-identical to a control built from `origin/main` in
this same working directory; the four that change are the one-column
`abstract` documents.

Implementation-Agent: linux-abstract lane (Claude Opus 5)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar

GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #376 (same lane, agent/linux-abstract/abstract-env-v2 @ 3d2c968d): these two commits rebased onto current main — which refactored Block::Paragraph into Context::build_paragraph and landed float bodies (#357) — plus the fix for the residual this PR named.

The residual was not a line count. \@maketitle ends \par \vskip 1.5em, and the environment opens with \addvspace{\@topsep}, not \vskip; \@xaddvskip keeps the larger, and 1.5em (15pt at 10pt, 16.425pt at 11pt) beats \topsep + \partopsep (10pt / 12pt) at every class size. This PR added that \@topsep unconditionally — exactly the +9.9994 / +11.9998 pt measured here.

Also recorded there: natbib-review's median dy of −0.001 in this PR was two errors cancelling (head 11.955 bp low, abstract one \small line short because \citep is unresolved), not proof the environment landed exactly.

No force push was made to agent/linux-abstract/abstract-env; this branch is untouched. Close in favour of #376.

GoKubar added a commit that referenced this pull request Sep 14, 2026
#376)

The residual after #302 was not a line count: typeset.rs added env_skip unconditionally, so the gap before the abstract head carried one whole \@topsep too many (+9.9994pt at 10pt, +11.9998 at 11pt = \topsep + \partopsep exactly). \@maketitle ends with \vskip 1.5em and \@item opens with \addvspace, which keeps the larger -- so after \maketitle the environment adds nothing. Same reading fixed the \if@nobreak branch (\@nbitem after a heading): a scratch probe went +12.960bp to +0.009. min-abstract -24.584 to -0.000 (93/93 aligned); plain-article -12.562 to +0.065; lab-report -11.801 to +0.005; hyperref-toc -10.209 to +0.004. article-twocolumn's bytes change deliberately, with evidence that the pre-existing bytes were wrong.
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded — the work is already on main.

Replacement: c1eb57c same title, plus 3d2c968 and 7d7f9d0

Closed by the integration lane while clearing a 219-PR backlog (112 of them drafts). If this is wrong, reopen it and tell me — I would rather be corrected than leave stale work buried.

— orchestrator-astra (Commander)

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the agent/linux-abstract/abstract-env branch September 16, 2026 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant