Skip to content

render-pipeline: the abstract's opening skip is \addvspace, and the two-column branch is a \section* (#258 rank 1) - #376

Merged
GoKubar merged 3 commits into
mainfrom
agent/linux-abstract/abstract-env-v2
Sep 14, 2026
Merged

GoKubar merged 3 commits into
mainfrom
agent/linux-abstract/abstract-env-v2

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Finishes #258's rank-1 divergence. Supersedes #302 (same lane; #302's two commits are rebased onto current main here, because main refactored Block::Paragraph into Context::build_paragraph and typeset float bodies in the meantime). #302 is left open and unforced; close it in favour of this.

#302 set the one-column abstract and stopped, deliberately, with three documents ~10–12 bp too low. This is what that residual was, plus the two-column branch it flagged for the Commander.

The residual was not a line count

#302's live hypothesis was that +11.96 bp ≈ \small's \baselineskip at 11pt meant the abstract body was one \small line taller than pdfLaTeX's. It is not. The abstract's line count is right in every document: in lab-report the head itself is already 12.021 bp low and every body line follows it by exactly the same amount. The gap that is wrong is the one before the head — date baseline to Abstract baseline:

pdfTeX #302 delta
plain-article (10 pt) 36.0005 pt 45.9999 pt +9.9994
lab-report (11 pt) 40.4250 pt 52.4249 pt +11.9998

10 pt and 12 pt are exactly \topsep + \partopsep at those class sizes (size10.clo 8+2, size11.clo 9+3) — one whole \@topsep too many, not a line.

Why: \@item opens with \addvspace, not \vskip

\@maketitle ends \par \vskip 1.5em — 15 pt at a 10 pt base, 16.425 pt at 11 pt (1.5 em of cmr10 at 10.95 pt). The environment opens with \addvspace{\@topsep}, and \@xaddvskip keeps whichever of it and \lastskip is larger. 15 > 10 and 16.425 > 12, so after \maketitle the environment contributes no skip of its own at all, and the distance is

\@topsepadd (\end{center} of \@maketitle) + 1.5em + \small's own \baselineskip

= 10 + 15 + 11 = 36 pt and 12 + 16.425 + 12 = 40.425 pt — the two reference numbers exactly. The pipeline was adding env_skip unconditionally.

\@item's other branch fell out of the same reading and is fixed here too: under \if@nobreak — right after a heading, where \@afterheading set it — \@nbitem runs instead of \addvspace{\@topsep}, and its \addvspace{\@outerparskip - \parskip} followed by the list's own \parskip leaves exactly \lastskip. pdfTeX's own list for a 12 pt quote after \subsection:

\glue 7.74811 plus 1.03305          \subsection's 1.5ex after-skip
\glue -7.74811 plus -1.03305        \@nbitem's \addvspace removes it
\glue 2.74811 plus -0.46695 minus -1.0
\glue(\parskip) 5.0 plus 2.5 minus 1.0

net 7.74811 pt — the heading's own after-skip, with \@topsep (13 pt at 12 pt) nowhere. twelvept-plain has that shape and is 13 pt too low on main; its scratch reproducer goes from +12.960 bp to +0.009.

natbib-review was never right

#302 measured it at median dy −0.001 on all three pages and treated that as the proof the abstract landed exactly. It was two errors cancelling: its head was 11.955 bp low and its abstract is one \small line short because \citep is unresolved (natbib is not implemented; 38 compiler errors). Line-for-line, reference 1 Introduction at y=334.068 and candidate at y=334.068 — with six reference body lines against five candidate ones. With the skip fixed the head is within 1.005 bp (page shrink, because the candidate's page 1 overflows for the same natbib reason) and the document reads an honest −14.123 rather than a coincidental zero.

The two-column decision

conf-paper and article-twocolumn are both 10pt,twocolumn, so the \if@twocolumn branch cannot be set for one without the other. What pdflatex actually does, read off the pinned MacTeX references:

head body
conf-paper p1 SFBX1440 (14.35 bp) at x = 54.00, the column's left edge, y = 177.724 SFRM1000 (9.96 bp), column measure
article-twocolumn p1 SFBX1440 at x = 54.00, y = 191.672 SFRM1000 from y = 213.606

That is \section*{\abstractname} exactly as article.cls 379 says: an unnumbered \Large\bfseries head at the column measure, the body as ordinary \normalsize paragraphs — no \small, no quotation, no centring. It is set as that here, and the first body paragraph is unindented because \section*'s before-skip is negative (\@afterindentfalse).

article-twocolumn is one of the ten pre-existing byte-identical fixtures and its bytes change here, deliberately, because they are wrong independently of the abstract. On main the candidate draws the full-width title block at y = 95.838–152.622 and then sets the abstract body inside it, at y = 124.622 / 136.578 / 148.533 in column 1, with the class's Abstract head absent altogether. The overlap is the limitation the pipeline already reports — \twocolumn[\@maketitle] with floats does not shorten the first page's columns by the title box (typeset.rs: let shift = if floats.is_empty() { height } else { 0.0 }) — and both fixtures have floats. Adding the head does not fix that, and I have not attempted it here; it belongs with the float paginator. It does move both pages measurably closer:

main this
article-twocolumn p1 median dy −89.923, 36 reflowed words −68.102, 3 reflowed
conf-paper p1 median dy −140.517, 83 reflowed, 641/652 aligned −118.696, 77 reflowed, 642/652

conf-paper gains one overfull_vbox (page 1, 2.25 pt): the extra head line in a column the float path will not shorten. That is the same limitation surfacing, and it is reported rather than hidden.

Measured

tools/visual-oracle/rank.py, candidate vs the pinned references, geometry only (no pdftoppm, no Ghostscript on this host). Control built from origin/main in the same working directory as the branch build, serial runs, zero font-failure diagnostics.

document page main this
min-abstract 1 −24.584, 26 within 0.5 bp −0.000, 78, 93/93 aligned, 0 reflowed
plain-article (10 pt) 1 −12.562, 14 +0.065, 160
lab-report (11 pt) 1 −11.801, 23 +0.005, 164
hyperref-toc (11 pt) 1 −10.209, 12 +0.004, 490
natbib-review (11 pt) 1 −22.167, 15 −14.123, 15
conf-paper (two-column) 1 −140.517 −118.696
article-twocolumn 1 −89.923 −68.102
twelvept-plain 2 −7.382, 25 −3.566, 52

Every other page of every other fixture is unchanged to the digit. Of the 41 divergence probes, only min-abstract moves at all, and it moves to exact.

Gates

gate result
10 pre-existing fixtures/real-world byte-identical 9 of 10; article-twocolumn changed deliberately, measured above
five abstract documents improving yes, all five, numbers above
min-abstract 24.58 bp → ~0 yes, −24.584 → −0.000
amsmath 59/59 59/59 within 0.5 bp
tabular 106/106 106/106 (words 0.5 bp, rules 0.1 bp)
HW1/HW2 3 pages, 0 overfull, 0 errors yes, 3 and 3 via flashtex-render (v1 and v2 payloads agree), 0 errors, 0 overfull. flashtex-compiler was not built or run in this lane, so the assignment's note that it reports 4 for HW2 is carried forward unverified, not measured here.
crates/render-pipeline suite green, 49 test binaries, 0 failed
divergence probes not worse yes, only min-abstract changes
zero font-failure diagnostics yes; the math_resource_profile and missing_glyph warnings are unchanged from main

tests/abstract_env.rs pins all four facts — the two \@item branches, the \small/quotation shape, and the two-column \section* — against the \showoutput glue quoted in the test.

Still open, named

  • plain-article's overfull_vbox on page 2 (11.83 pt) is unchanged: the abstract fix neither resolved nor moved it, and page 2's median dy is +3.929 before and after. It is not an abstract problem.
  • \twocolumn[\@maketitle] with floats (above) — the dominant remaining error in both two-column documents.
  • natbib-review's residual 1.005 bp is page shrink caused by the unimplemented natbib, not by this environment.
  • The titlepage branch is still not set; the compiler's own limitation stands for it, and book.cls defines no abstract at all.

pdflatex is an oracle only and never runs in the product path. No committed reference or sidecar was regenerated; the scratch probes are TeX Live 2025 (pdfTeX 3.141592653-2.6-1.40.27), labelled, and not committed.

GoKubar and others added 3 commits September 14, 2026 06:02
…ion`

`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
… two-column branch is a `\section*`

Finishes #258's rank-1 divergence. #302 set the one-column `abstract` and
left three documents ~10-12 bp too low; this is what that residual was.

**Not one `\small` line too many.** The abstract's own line count is right
in every document: in `lab-report` the head itself is already 12.021 bp low
and every body line follows it by the same amount. The gap that is wrong is
the one *before* the head, date baseline to `Abstract` baseline:

| | pdfTeX | #302 | delta |
|---|---|---|---|
| `plain-article` (10pt) | 36.0005pt | 45.9999pt | **+9.9994** |
| `lab-report` (11pt) | 40.4250pt | 52.4249pt | **+11.9998** |

10pt and 12pt are exactly `\topsep + \partopsep` at those class sizes. The
environment opens with `\addvspace{\@topsep}` (`\@item`), not `\vskip`, and
`\@maketitle` ends `\par \vskip 1.5em` — 15pt at a 10pt base, 16.425pt at
11pt (1.5em of cmr10 at 10.95pt). `\@xaddvskip` keeps the larger of the two,
so after `\maketitle` the environment contributes nothing and the distance is
`\@topsepadd` + `1.5em` + `\small`'s own `\baselineskip`: 10+15+11 = 36 and
12+16.425+12 = 40.425, the two reference numbers exactly.

`\@item`'s other branch came out of the same reading: under `\if@nobreak`
(right after a heading) `\@nbitem` runs instead, and its
`\addvspace{\@outerparskip - \parskip}` plus the list's `\parskip` leaves
exactly `\lastskip`. pdfTeX's list for a 12pt `quote` after `\subsection`
is `\glue 7.74811 / \glue -7.74811 / \glue 2.74811 / \glue(\parskip) 5.0` —
net 7.74811, the heading's own after-skip, with no `\@topsep` anywhere.
`twelvept-plain` has that shape and is 13pt too low on main.

**`natbib-review` was never right.** #302 measured it at median dy -0.001,
but that was two errors cancelling: its head was 11.955 bp low *and* its
abstract is one line short because `\citep` is unresolved. With the skip
fixed its head is within 1.005 bp — page shrink from the natbib limitation —
and the document is honestly -14.123 instead of a coincidental zero.

**Two-column.** article.cls 378-379 is `\section*{\abstractname}`: an
unnumbered `\Large\bfseries` head at the column measure, the body as
ordinary `\normalsize` paragraphs. pdfLaTeX's `conf-paper` reference sets it
in `SFBX1440` at x=54.00, the column's left edge, and the body in
`SFRM1000`. It is now set as that. This changes `article-twocolumn`, one of
the ten pre-existing byte-identical fixtures, deliberately: its current
bytes are wrong independently of the abstract — the candidate's abstract body
sits at y=124.6/136.6/148.5 inside the full-width title block it draws at
y=95.8-152.6, and the head the class produces is absent altogether. The
overlap is the already-reported `\twocolumn[\@maketitle]`-with-floats
limitation, not this. With the head the page is measurably closer:
median dy -89.923 -> -68.102 and reflowed words 36 -> 3.

Measured with `tools/visual-oracle/rank.py`, geometry only (no rasterizer on
this host), candidate against the pinned references, control built from
`origin/main` in the same working directory, serial runs.

| document | page | main | this |
|---|---|---|---|
| `min-abstract` | 1 | -24.584, 26 within 0.5bp | **-0.000**, 78, 93/93 aligned |
| `plain-article` | 1 | -12.562, 14 | **+0.065**, 160 |
| `lab-report` | 1 | -11.801, 23 | **+0.005**, 164 |
| `hyperref-toc` | 1 | -10.209, 12 | **+0.004**, 490 |
| `natbib-review` | 1 | -22.167, 15 | **-14.123**, 15 |
| `conf-paper` | 1 | -140.517 | **-118.696** |
| `article-twocolumn` | 1 | -89.923, 36 reflowed | **-68.102**, 3 reflowed |
| `twelvept-plain` | 2 | -7.382, 25 | **-3.566**, 52 |

Nine of the ten pre-existing real-world fixtures are byte-identical
(`article-twocolumn` as above); the other newer fixtures that change are
exactly the abstract documents plus `twelvept-plain`. Of the 41 divergence
probes only `min-abstract` moves at all. amsmath 59/59, tabular 106/106,
HW1/HW2 3 pages each via `flashtex-render` with 0 errors and 0 overfull, the
`crates/render-pipeline` suite green (49 binaries, 0 failed).

pdflatex is an oracle only and never runs in the product path. No reference
or sidecar was regenerated.

Implementation-Agent: Claude Opus 5 (lane linux-abstract, linux-primary)
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 marked this pull request as ready for review September 14, 2026 10:37
@GoKubar
GoKubar merged commit bca6ce5 into main Sep 14, 2026
19 of 20 checks passed
@GoKubar
GoKubar deleted the agent/linux-abstract/abstract-env-v2 branch September 16, 2026 04:17
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