Repository navigation
Embed environ.sty and trimspaces.sty: an abstract was losing its first LETTER - #482
tannevaled wants to merge 1 commit into
Conversation
…t LETTER
acmart.cls:284 does \RequirePackage{environ} and builds five of its environments on
\Collect@Body — abstract (:1661), translatedabstract (:457), sidebar (:959),
marginfigure (:963), margintable (:974). NINE corpus papers bundle the real
acmart.cls, so they run the class rather than this engine's acmart emulation, and for
all nine \Collect@Body was undefined: 2301.08336, 2304.01951, 2304.11274, 2311.00921,
2311.07602, 2404.09749, 2405.20319, 2407.13726, 2407.15192.
⛔ The cost was not a missing environment. With \Collect@Body skipped, the
\@saveabstract right after it grabbed the FIRST TOKEN of the abstract as its own
argument and discarded it. On 2311.00921 the abstract began
tructured dense matrices result from boundary integral problems in …
where the reference reads "Structured". Measured: "Structured" 0 -> 1, against the
reference's 1. ⭐ One character is exactly the size of defect that Σ cannot see and
that the channel census reports as one undefined command — which reads as costing
nothing at all.
Neither file needed a line of Go. \Collect@Body is 60 lines of \@envbody token-register
work, and embedding the pair introduced NO new undefined command on any paper (checked
by diffing the whole -report-skipped list before and after: \Collect@Body left, nothing
arrived).
Provenance: both taken from the tectonic bundle cache, bundle
6ffe055852f8faf66c0acbe1a7fb27f87b869a90bad1204f3bf4d9683f597c7c — the same files
tectonic read when it built refpdf/.
⛔ NOT from a corpus paper's directory, and the check that says why. 2606.19617 bundles
both; its environ.sty is byte-identical to the bundle's and its trimspaces.sty is NOT
(the paper's copy is missing a four-line filecontents header). Same version, same
macros, different bytes. A .sty shipped inside a paper is whatever that author had.
⛔ Named and not fixed: \trim@spaces does not trim the LEADING space.
\edef\x{\trim@spaces{ PADDED }} tectonic "[PADDED]" engine "[ PADDED]"
and the cause is not the obvious one. Every piece of the \romannumeral-`\q trick was
checked against tectonic and AGREES: \romannumeral of a negative number expands to
nothing, \number-`\q is -113, the optional space after a scanned number is skipped, a
macro is expanded while the scanner looks for further digits, and an expansion
beginning with a space gives "A[ Z]" on both. The remaining suspects are the catcode-3
`Q` the package sets as its delimiter and \newcommand's grab of an argument that starts
with a space. acmart's abstract does not need it — that path is fixed and matches the
reference — so it is left as its own change, written down in the test rather than
asserted there.
Co-Authored-By: Claude Opus 5 <[email protected]>
⛔ NOT mergeable: this unmasks a larger loss. Moved to draft.The one-letter fix is real and stands —
⛔ And Σ went DOWN
Σ improved by one and the glyph total rose by 870 while four papers each lost over a thousand words. What is actually happeningPage 1 becomes blank on The abstract itself is intact (151 words, \long\def\@saveabstract#1{… \long\gdef\@abstract{#1}} % acmart.cls:1662
\def\@mkabstract{… \ignorespaces\@abstract\par …} % acmart.cls:2801— and What was ruled out
The embedded files, their provenance and the 🤖 Generated with Claude Code |
\twocolumn[span] appended a column region at the current end of the main vertical
list even when the region it thereby CLOSED held nothing that puts ink on a page.
Regions are page-aligned, so that empty region is a page.
⛔ All nine corpus papers that bundle the real acmart.cls lost page 1 to this. acmart's
\maketitle is \twocolumn[\box\mktitle@bx] (acmart.cls:2319-2343, once per format), and
at that moment the list held exactly three nodes: two pageStyleNode and a zero-width
glueNode. Reproduced in seven lines with the bundled class —
\documentclass[sigplan,nonacm]{acmart}
\begin{document}
\title{TITREICI}
\author{Alice Un}
\affiliation{\institution{INSTITUTUN}\country{PAYSUN}}
\maketitle
\section{Intro}CORPSICI
\end{document}
— gave 2 pages with a BLANK page 1 and the title on page 2, where [acmsmall] (one
column, no \twocolumn) was correct. With this change it is one page with the title on
it. TeX does not ship an empty page either, so this is the faithful behaviour and not
a special case: the spanning region now starts where the contentless material starts
and carries those marks along.
mvlHasContent lists the INVISIBLE node types explicitly and treats everything else as
content. A list of what does not count would inherit its own blind spot — a node type
added later would be silently invisible, and a page quietly dropped is a failure
nobody would go looking for. This way an unknown node keeps its page.
⛔ On its own this changes no corpus paper, and the commit does not pretend otherwise.
Those nine papers leak their abstract out BEFORE \maketitle (acmart stores it through
\Collect@Body, which needs environ.sty — see #482), so their list does hold ink at the
switch and this branch is not taken. It is the companion of that change: measured with
both, 2304.01951 lands EXACTLY on its reference's 10 pages with 812 words on page 1
against the reference's 827, and 2404.09749 reaches 952 against 951. #482 is still a
draft for an unrelated loss.
⛔ The test asserts the REGION LIST, not the page. A first version asserted that the
title is on page 1 and it PASSED against the unfixed engine: the witness cannot load
acmart.cls, and without acmart's geometry the pager happens to fit the empty region and
the span onto one page anyway. Two regions are the defect; a blank page is what they
cost a real document. The second test holds the other direction — material that does
put ink on the page must keep a region of its own — so the fix cannot over-reach.
Co-authored-by: Claude Opus 5 <[email protected]>
Six hypotheses falsified, and where the search now stands#484 has landed and is this PR's companion — with both,
What is establishedTurning the collection off restores everything. It is not uniform across the nine, and not by format either:
⛔ The shape of the loss on The per-page counts sum to the total, so nothing is double-read: pages 7 and 10 genuinely carry ~1.7 pages of material and ~1141 words are never drawn. The first blank page is #484's defect and is now fixed; the overfull pages and the missing words are not. Next place to look, given all of the above: the pager, not the collection. Something about a region whose span is placed makes The embedded files, their provenance, the first-letter fix and the 🤖 Generated with Claude Code |
Judged against the REFERENCE, not against our own previous buildThe earlier numbers here compared the treatment to
Missing content against the reference goes 196 → 921 and 1193 → 2111. The "extra" column does improve on So the regression is real by the right judge, and this stays a draft. Two further discriminators ruled out since the last comment:
🤖 Generated with Claude Code |
|
The A/B this PR promised, ten days late — and it says do not merge as it stands. Rebased onto current
That looks neutral-to-good. The character counts do not:
So the change does two things at once. Where the base duplicated an abstract it now sets it once, which is the fix this PR is for — All four bundle the real The shape to suspect first is the one this repo has been bitten by before: Leaving this open and unmerged. The next step is a witness on 🤖 Generated with Claude Code |
…ad found (#618) This reverts d9d2d2a (#616). The defect it fixes is real; what it costs is larger, and I merged it on a measurement that could not see the cost. WHAT #616 CLAIMED, AND WHY THE EVIDENCE WAS WRONG. It read the ink — the count of glyph paths drawn — and found it RISING on the two papers whose page count fell most: +959 and +1076 glyphs. I took that as proof that no content was lost and that the shorter page counts were denser typesetting. Ink cannot tell "drawn in different places" from "drawn on top of itself". `measure pagedens` can, and on 2304.11274 against its reference it says: page ours reference interline step 1 742 / 65x2 630 / 51x2 9.31 / 11.96 3 345 / 27x2 716 / 91x2 11.96 / 11.54 4 220 / 18x2 648 / 48x2 11.96 / 11.96 5 175 / 13x2 867 / 56x2 11.96 / 11.96 6 1004 / 75x2 603 / 42x2 9.77 / 11.96 Three pages nearly empty, three overfull with the interline step CRUSHED to 9.31 and 9.77pt where every other page of the same document is at 11.96. That is content overlaid, not paginated — exactly what #482 reported on 2026-09-27 and the reason it has stayed a draft for three weeks. MEASURED BOTH WAYS, same binary base, same fonts: paper with #616 reverted reference 2304.11274 10p / 6123w 13p / 7466w 12p / ~7756w 2405.20319 10p / 9217w 15p / 11116w 14p 2404.09749 6p / 5873w 10p / 6768w 8p 2304.01951 10p / 9555w 15p / 11595w 10p / 10930w Against the reference's word count, 2304.11274 goes from 79% to 96%. ISOLATED, and reproducible in one line. Neutralising the collection restores everything: \makeatletter\renewenvironment{abstract}{}{}\makeatother → 13 pages, 7406 words (with the collection: 10 pages, 6123 words) So the collection is the trigger and the mechanism is DOWNSTREAM of it: acmart stores the abstract in \@abstract and emits it from \@mkabstract inside the title block. WHAT THIS COSTS TO REVERT, said plainly: 2304.01951 goes back to 15 pages against a reference of 10. That paper has TWO \begin{abstract}, and the collection removed the duplicate, which is how it landed exactly on 10. It also had 11595 words against the reference's 10930 — 106%, i.e. too MUCH content — so what the revert restores there is a duplication. Three papers keep their content; one keeps a duplicate. That is the better trade, and it is the one #482 reached independently. Nine hypotheses are now falsified between #482 and this session, including three of mine today: teaserfigure (acmart.cls:2065 is a SIXTH \Collect@Body environment #482 had not listed, and it correlates with the two biggest losers — neutralising it changes 6123 words to 6065, so it is not the cause), the re-splice-as-source reading, and the double group close. All of it goes back into #615. Co-authored-by: Claude Opus 5 <[email protected]>
|
Closing: the defect this draft found is fixed, by a different route, in #639. This PR embedded What the comments here were seeing has a name now. #639 implements The three weeks this spent as a draft are the reason the second attempt had somewhere |
acmart.cls:284does\RequirePackage{environ}and builds five of its environments on\Collect@Body::1661abstract:457translatedabstract:959sidebar:963marginfigure:974margintableNine corpus papers bundle the real
acmart.cls, so they run the class rather than this engine's acmart emulation, and for all nine\Collect@Bodywas undefined:2301.08336,2304.01951,2304.11274,2311.00921,2311.07602,2404.09749,2405.20319,2407.13726,2407.15192.⛔ The cost was one letter
With
\Collect@Bodyskipped, the\@saveabstractright after it grabbed the first token of the abstract as its own argument and discarded it. On2311.00921:ours, before
reference
Structured⭐ One character is exactly the size of defect Σ cannot see, and the channel census reported it as one undefined command — which reads as costing nothing.
No Go needed, and nothing new broke
\Collect@Bodyis 60 lines of\@envbodytoken-register work. Embedding the pair introduced no new undefined command on any paper — checked by diffing the entire-report-skippedlist before and after:\Collect@Bodyleft, nothing arrived.Provenance: the bundle that built the references
Both files come from the tectonic bundle cache, bundle
6ffe055852f8faf66c0acbe1a7fb27f87b869a90bad1204f3bf4d9683f597c7c— the same files tectonic read when it producedrefpdf/.⛔ Not from a corpus paper's own directory, and here is the check that says why.
2606.19617bundles both; itsenviron.styis byte-identical to the bundle's and itstrimspaces.styis not — the paper's copy is missing a four-linefilecontentsheader. Same version, same macros, different bytes. A.styshipped inside a paper is whatever that author happened to have.⛔ Named and deliberately not fixed:
\trim@spacesand the leading space[PADDED][ PADDED]And the cause is not the obvious one. Every piece of the
\romannumeral-\q` trick was checked against tectonic and they agree:\romannumeralof a negative number expands to nothing\number-\qis-113`A[ Z]on bothThe remaining suspects are the catcode-3
Qthe package installs as its delimiter, and\newcommand's grab of an argument that begins with a space. acmart's abstract does not need it — that path is fixed and matches the reference — so it is left as its own change, written down in the test rather than asserted there, so the test stays green and the finding stays visible.Testing
go test -count=1 ./...green. Break check built fromHEAD^withgit archiveand the new tests dropped in: both fail there, on\Collect@Bodyand\trim@spacesbeing undefined.A/B measurement follows in a comment.
🤖 Generated with Claude Code