Skip to content

corpus: 12 real-submission documents + 43 minimal divergence probes - #258

Merged
GoKubar merged 1 commit into
mainfrom
agent/linux-unknown-unknowns/corpus-widening
Sep 14, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/linux-unknown-unknowns/corpus-widening

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

What this is

The corpus was 10 real-world fixtures plus per-feature suites. Several bugs
found today were found only because a lane wandered outside it. This widens the
net systematically: 12 documents that look like what people actually submit,
and 43 minimal reproducers cut out of them, all measured against pdflatex
(TeX Live 2025) with the repo's existing oracle tooling.

No engine fix is included. The value here is the map.

Documents added — fixtures/real-world/ (+12)

A maths problem set, a physics lab report, a two-column conference paper, a
thesis chapter split over \input files, a 12 pt document with no amsmath,
one with lmodern, one with no packages at all, plus siunitx/booktabs
tables, a listings manual, an enumitem worksheet, a hyperref/ToC document
and a natbib review. Package set covered: amsmath, amssymb, graphicx,
booktabs, hyperref, geometry, enumitem, siunitx, listings, natbib.

Every one of the twelve diverges from pdflatex. Four differ in page count:

fixture pdflatex pages / overfull render pages
conf-paper 4 / 0 2
thesis-chapter 5 / 0 3
lab-report 3 / 0 2
twelvept-plain 3 / 0 4

Reproducers added — fixtures/divergence-probes/ (+43)

One construct per document. 20 of the 43 show no divergence at all — every
aligned word within 0.01 bp — and are kept as the regression floor
(min-maketitle, min-chapter, min-toc, min-twocolumn, min-tabular,
min-quote, min-curly-quote, min-footnote, the simple list probes,
min2-fence-* at 10 pt, …). min-twocolumn aligns all 439 words at ≤0.01 bp.

These are not in the default corpus run; pass
--fixtures fixtures/divergence-probes explicitly.

Ranked findings

Ranked by how common the construct is, not by how large the error is.
Full table with per-probe numbers in
fixtures/divergence-probes/README.md.

# finding measured reproducer
1 abstract body is set at body size and full measure body below rises 24.58 bp; abstract in LMRoman10-Regular at x 72.000 where pdflatex uses SFRM0900 at x 96.907 min-abstract
2 a tabular inside a table float is not drawn 9 words missing; body below rises 38.06 bp min-float-table
3 every \footnote in a document that also has a float is dropped ref 51 words, cand 33 min-footnote-float
4 \paragraph run-in heading not bold, indented by \parindent (+14.94 bp), 13.94 bp of space above missing per occurrence min-paragraph
5 cmex10 extensible pieces paint nothing grown ( ) { } √ and cases braces silently absent min-huge-fences, min2-cases, min-sqrt-tall, min-norms
6 \subsubsection is not numbered heading text 35.00 bp too far left min3-subsubsection
7 natbib \citet/\citep unsupported 29 reflowed words, median dx +60.58 bp min-natbib
8 \renewcommand{\baselinestretch} is undefined leading not stretched, max dy 11.96 bp min3-baselinestretch
9 description body not indented by \leftmargin dx −24.91 bp, list 11.96 bp short min-description
10 12 pt \bigl…\Biggl displays too tall 5.98 bp per display; identical probe at 10 pt is exact min-bigdelim-12pt
11 \pagestyle, \hypersetup, \lstset, \small, \bfseries rejected in the preamble error diagnostics min2-pagestyle, min2-preamble-switches
12 \hrulefill not set Date: lands 198.51 bp left min-hrulefill
13 \langle/\rangle → empty box no math glyph for '〈' min-langle
14 two lists separated by a blank line second list 9.96 bp low min2-itemize
15 flushright/flushleft 9.96 bp vertical offset min3-verse-flushright

Notably not a layout bug despite 24 error diagnostics: \newblock recovers
to within 0.03 bp (min-newblock). It is noise, not damage — worth
downgrading relative to its occurrence count.

References

Generated locally with TeX Live 2025
(pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/nixos.org),
SOURCE_DATE_EPOCH=0 FORCE_SOURCE_DATE=1, two passes). Every new sidecar
carries "reference_engine": "TeX Live 2025". No committed MacTeX-generated
reference or sidecar was regenerated or overwritten
— git status showed no
modification to any pre-existing fixture file.

One tooling fix

tools/visual-oracle/rank.py raised KeyError: 'differing' on every run on
this host: linux-primary has no pdftoppm and no Ghostscript, so every page
came back compared but unrasterised and the report writer assumed pixel data.
It now reports "pixels: not compared (no rasterizer on this host)". The 8
existing tools/visual-oracle tests and the 6 tools/real-world-corpus tests
pass.

Gates

  • amsmath oracle: 59/59 within 0.5 bp
  • HW1, HW2: 3 pages each, 0 errors, 0 overfull
  • the 10 pre-existing fixtures: unchanged (no engine code touched)
  • zero font-FAILURE diagnostics on 9 of the 12 new documents

Honest limits

  • Word geometry only. No rasterizer exists on this host (pdftoppm, gs,
    pdftotext, qpdf, mutool all absent), so no pixel comparison was run.
  • The bundled jknappen/ec has no ectt*.tfm, so \texttt is measured on
    substituted ec-lmr* metrics. listings-manual, hyperref-toc and
    siunitx-tables therefore report ec_metrics_unavailable: their word
    positions are not a measurement of line breaking.
    \texttt was removed from
    the probes so none of the ranked numbers above depend on it.
  • Math words rarely align word-for-word (the reference splits math into
    per-glyph runs), so a word-count gap inside a display is treated as evidence
    only when a producer diagnostic says something was not drawn.
  • \includegraphics reports no project root was supplied with the request —
    that is a harness limitation, not an engine finding, and is excluded from the
    ranking.

What I would fix next

The abstract environment (#1), then float bodies and dropped footnotes
(#2, #3)
. #1 appears in 5 of 12 documents and in essentially every paper and
report ever submitted, and it is a bounded change: set the body in \small at
the class's abstract margins. #2 and #3 are worse per occurrence because they
are silent content loss — a table or a footnote that simply is not there,
with no visible cue to the user that anything is missing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

The corpus was 10 fixtures plus per-feature suites, so whole classes of
divergence were invisible to it. This widens the net with documents that look
like what people actually submit, then cuts each divergence down to a one-file
reproducer so the next lane can start from the repro instead of the document.

fixtures/real-world/ (+12): a maths problem set, a physics lab report, a
two-column conference paper, a thesis chapter split over \input files, a
12 pt document with no amsmath, one with lmodern, one with no packages at
all, plus siunitx/booktabs tables, a listings manual, an enumitem worksheet,
a hyperref/ToC document and a natbib review. All twelve diverge somewhere.

fixtures/divergence-probes/ (+43): one construct per document, each measured
against pdflatex. 20 of them show no divergence at all (every aligned word
within 0.01 bp) and are kept as the regression floor.

Measured with tools/visual-oracle/rank.py (word geometry) and
tools/real-world-corpus/run.py (diagnostics, page counts). Highest-value
findings, ranked by how common the construct is rather than by error size:

  1. abstract          body below rises 24.58 bp; body set 10 pt full-measure
                       where pdflatex uses 9 pt indented   (5 of 12 documents)
  2. float bodies      a tabular inside a table float is not drawn at all;
                       body below rises 38.06 bp
  3. footnotes+floats  every footnote in a document with a float is dropped
  4. \paragraph        not bold, indented by \parindent (+14.94 bp), and
                       13.94 bp of space above it missing
  5. cmex10 assembly   grown ( ) { } sqrt and cases braces paint nothing
  6. \subsubsection    the 1.1.1 number is missing; text 35.00 bp too far left
  7. natbib            \citet/\citep unsupported: 29 reflowed words
  8. \baselinestretch  undefined; leading not stretched (11.96 bp)
  9. description       list body not indented by \leftmargin (-24.91 bp)
 10. 12 pt \Bigl       display 5.98 bp too tall per display; exact at 10 pt

References here were generated locally with TeX Live 2025 and are labelled
"reference_engine": "TeX Live 2025" in every new sidecar. No committed
MacTeX-generated reference or sidecar was regenerated or overwritten.

tools/visual-oracle/rank.py: report a page with no pixel data as "not
compared" instead of raising KeyError. linux-primary has no pdftoppm and no
Ghostscript, so every page came back compared-but-unrasterised and the report
writer crashed. Geometry-only runs now work; the 8 existing unit tests pass.

Gates: amsmath oracle 59/59 within 0.5 bp; HW1 and HW2 3 pages, 0 errors,
0 overfull; the 10 pre-existing fixtures unchanged (no engine code touched).

No engine fix is included: this change is the map, not the repair.

Implementation-Agent: linux-unknown-unknowns (Claude Code, Opus 5)
Commit-Executor: linux-unknown-unknowns (direct agent Git execution)
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 01:35
@GoKubar
GoKubar merged commit de2eb66 into main Sep 14, 2026
20 checks passed
GoKubar added a commit that referenced this pull request Sep 14, 2026
… geometry

Two of the corpus lane's ranked divergences (#258), both entirely inside
this crate, both fixed by reading what the class file says instead of a
constant.

**`\subsubsection` was never numbered** (#258 rank 6, `min3-subsubsection`,
heading text 35.00 bp too far left). `adapt_cached` had two readings of one
counter: the body heading used `options.default_secnumdepth`, a flat `2` for
every class, while the contents list already resolved article.cls line 255
`\setcounter{secnumdepth}{3}` vs report/book.cls `{2}`. So an `article`
numbered its `\subsubsection` in the ToC and not in the body. The heading now
reads `ResolvedDocument::secnumdepth` (class-geometry's transcription of the
class's own `\setcounter`) and `toc_secnumdepth` is that same value -- one
counter, one reading. An explicit `\setcounter{secnumdepth}{n}` still wins,
and a document with no `\documentclass` still keeps the caller's default.

**`description` was invisible to the list geometry** (#258 rank 9,
`min-description`, dx -24.91 bp and the list 11.96 bp short). `list_stack_at`,
`gap_has_list_end` and `list_env_after_begin` matched only
`itemize`/`enumerate`/`thebibliography`, so a `description` item fell through
to the `enumerate` defaults. article.cls lines 360-365 are now transcribed:

    \list{}{\labelwidth\z@ \itemindent-\leftmargin
            \let\makelabel\descriptionlabel}
    \newcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bfseries #1}

`ListGeom` gains `label_style: ItemLabel` (`Llap` = latex.ltx's
`\makelabel##1{\hss\llap{##1}}`, `Description` = the above). For
`Description`, `\@item`'s `\hskip\itemindent \hskip-\labelwidth
\hskip-\labelsep` with `\labelwidth\z@` and `\itemindent-\leftmargin`, plus
the label box's own leading `\hspace\labelsep`, cancel to a single
`-\leftmargin`: the term is set flush on the left margin in the bold body
face and the item text follows one `\labelsep` after it, while the wrapped
lines still hang at `\@totalleftmargin`. `\topsep`/`\itemsep`/`\parsep` come
from the existing `\@list<i>` path, which was already environment-agnostic.

**A multi-word `\item[...]` label was one shaped run**, so its interword
spaces took the *font's* `space` advance rather than TeX's `\fontdimen2` --
1.91 bp per space too wide in Latin Modern Bold at 10 pt, which is what was
left of `min-description` after the geometry was right. `label_items` now
sets each word as its own box with `\fontdimen2` between them, which is what
an `\hbox` packed at natural width does. Single-word labels (every bullet,
every `\labelenum<i>`, every `thebibliography` tag) are unchanged.

Measured against the corpus lane's reproducers (#258 @ c051d56, TeX Live
2025 references, geometry only -- this host has no rasterizer), candidate vs
reference word origins in bp:

| probe | before | after |
|---|---|---|
| `min3-subsubsection` | max \|dx\| 35.00, 20/24 words within 0.5 bp | max \|dx\| **0.75**, 22/24 (the residual is the `\verb` run on substituted `ectt` metrics) |
| `min2-headings` | max \|dx\| 35.00, 37/40 within 0.5 bp | max \|dx\| **0.01**, **41/41** |
| `min-description` | max \|dx\| 24.91 / \|dy\| 11.96, 6/38 within 0.5 bp | **0.01 / 0.00**, **38/38** |
| `min-toc`, `min-chapter` | exact | unchanged |
| `min2-itemize`, `min2-nested-lists`, `min3-itemize-only`, `min3-enumerate-only`, `min3-itemize-multipar`, `min4-itemize-wrap` | — | unchanged to 0.01 bp |

New tests: `tests/sectioning_depth.rs` (article numbers `\subsubsection`,
report does not, an explicit `\setcounter` still wins) and
`tests/description_list.rs` (term at 72.000, second term word at 99.894, item
text at 128.843, wrapped line at 96.907 -- the pdflatex coordinates of
`min-description` -- and the term in the bold face, the body not).

Implementation-Agent: Claude Opus 5 (engine layout lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 14, 2026
#258 rank 8 (`min3-baselinestretch`, max |dy| 11.96 bp): the macro was not
read at all, so a document that asks for one-and-a-half or double spacing was
set at single spacing throughout.

`\baselinestretch` is not a length the body applies once. latex.ltx defines
`\def\baselinestretch{1}` and `\@setfontsize` ends with

    \baselineskip\baselinestretch\baselineskip

so *every* `\@setfontsize` -- `\normalsize`, `\small`, `\footnotesize`, the
`\Large` of a `\section`, the `\LARGE` of `\@maketitle`, the `\huge` of
`\chapter` -- multiplies the leading of the size it selects. It does not
touch `\lineskip`/`\lineskiplimit` (the `.clo`s' `\normallineskip`) or the
fixed `\setlength`s such as `\footnotesep` and `\skip\footins`. So this is
implemented where sizes are selected, not at one site:

- `Stylesheet` gains `baselinestretch` and `set_baselinestretch`, which
  scales the leadings it already holds (the body's and all three headings');
- `FootnoteParams::of`, the three `class_geometry::FontSize::metrics`
  closures (`\chapter`, `\part` in flow and on its own page, `\maketitle`)
  and `table_box`'s non-body-size `\strutbox` scale their own table's value
  through `Stylesheet::stretched`;
- everything else already reads `Stylesheet::baselineskip_pt` and follows.

`adapter::baselinestretch` reads the factor from the source the way
`\setlength{\parskip}` is already read: `\renewcommand{\baselinestretch}{f}`
with a braced or unbraced first argument, the `*`-form, `\def`,
`\newcommand`/`\providecommand`, and `\linespread{f}`, which latex.ltx
defines as exactly `\renewcommand{\baselinestretch}{f}\@currsize`. The last
setting in source order wins, as for `\setlength`. A non-numeric or
non-positive argument is ignored rather than guessed at.

Measured against the corpus lane's reproducers (#258 @ c051d56, TeX Live
2025 references, geometry only), candidate vs reference word origins in bp:

| probe | before | after |
|---|---|---|
| `min3-baselinestretch` | max \|dy\| 11.96, 19/42 words within 0.5 bp | **0.01 / 0.00**, **42/42** |
| `min-footnote`, `min-maketitle`, `min-chapter` | exact | unchanged |

The 10 pre-existing real-world fixtures produce a **byte-identical**
rendering-v2 display list against a control build of this branch's base
(`hw1`, `hw2`, `cv`, `letter`, `lecture-notes`, `math-sheet`, `inline-math`,
`input-bibliography`, `article-twocolumn`, `unicode-accents`): none of them
sets the macro, and with the factor at 1 every multiplication is the
identity.

New `tests/baselinestretch.rs`: 1.5 gives the probe's measured 17.932 bp body
pitch with the first baseline still where `\topskip` puts it; `\linespread`,
the unbraced form and the last-wins rule agree exactly; a `\section` heading's
and a footnote's own leadings scale by the same 1.5; and
`\renewcommand{\arraystretch}` is not mistaken for it.

Implementation-Agent: Claude Opus 5 (engine layout lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 14, 2026
#258 rank 4 (`fixtures/divergence-probes/min-paragraph`): the heading was not
bold, sat `\parindent` in (+14.94 bp) and was missing 13.94 bp of space above
it, per occurrence.

`Stylesheet` knew only three heading levels -- `section_spec(level).expect(
"levels 1..=3")`, `headings: [HeadingStyle; 3]`, `heading()` clamping to 3 --
and threw the one thing that distinguishes levels 4 and 5 away:
`SectionAfter::RunInEm` was mapped to `Skip::ZERO`, so even if a level-4
heading had arrived it would have been set as a display `\subsubsection`.
The table is now the class's five (article.cls lines 302-321) and
`HeadingStyle` carries `\@startsection`'s `#3` (`indent_pt`,
`\subparagraph`'s `\parindent`) and its `#5` when non-positive
(`run_in_em`).

A run-in heading is not a vertical block at all. `\@sect` stores it in
`\@svsechd` instead of setting it, and `\@xsect` installs an `\everypar`
that fires on the *next* paragraph: it drops that paragraph's `\parindent`
box (`{\setbox\z@\lastbox}`), unboxes the heading and adds `\hskip -#5`.
`adapter::RunInHeading` holds the heading for exactly that long --

- the items are built with the compiler's own weights
  (`items_for_weighted`), because unlike `heading_block` the paragraph they
  land in is not bold at its base, so `\bfseries` has to reach them;
- `#3` goes in front as an `Item::HSpace` and `\hskip -#5` after as
  `Item::Quad`, which is evaluated in the paragraph's own font, as
  `\everypar` is;
- `\addvspace{#4}` (`3.25ex`) rides along as the paragraph's
  `addvspace_before`, so it still collapses against a preceding skip the way
  `\addvspace` does;
- the paragraph is not indented and is not joined onto the previous one;
- a heading with nothing to run into (a heading, rule, picture or the end of
  the document follows) is flushed as an unindented paragraph of its own.

**Depends on the compiler-side PR and a vendor re-pin.** `vendor/compiler`
does not emit `Block::Heading` above level 3 yet, so this arm is inert
against the current pin -- the code builds and every existing test is
unchanged either way. `tests/run_in_headings.rs` is therefore behind the
`run-in-headings` feature (off by default, documented in `Cargo.toml` exactly
as `amsmath-inline` and `request-date` were before their re-pins); turn it on
in `default` when vendor/compiler carries the levels.

Measured with `vendor/compiler` mirrored locally from the compiler PR (that
mirror is **not** part of this commit), against the reproducer's TeX Live
2025 reference, geometry only -- this host has no rasterizer:

| probe | before | after |
|---|---|---|
| `min-paragraph` | max \|dx\| 14.94 / \|dy\| 27.87 bp, 27/74 words within 0.5 bp | **0.01 / 0.01**, **74/74** |
| a local `\paragraph` + `\subparagraph` + trailing-`\paragraph` probe (90 words) | — | max \|dx\| 0.01 / \|dy\| 0.01, **90/90** |

`cargo test --release --features run-in-headings`: 4 new tests pass (the
heading opens the next paragraph's first line at x 72.000 / baseline 141.629
with the body resuming at 171.438; it is bold and `\normalsize`;
`\subparagraph` starts at 86.944 = one `\parindent` in; a trailing
`\paragraph` is still set). Without the feature the whole suite is unchanged,
0 failed.

Against a control build of this branch's base, with the re-pin *absent*, the
rendering-v2 display list of all 22 `fixtures/real-world` documents is
byte-identical, and amsmath is 59/59 within 0.5 bp with HW1/HW2 at 3 pages,
0 errors, 0 overfull.

Implementation-Agent: Claude Opus 5 (engine layout lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 14, 2026
…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
d-q222 added a commit that referenced this pull request Sep 14, 2026
…in the preamble (GH#321)

The remainder of #258's ranked finding 11. Probe min2-pagestyle declares
\pagestyle{empty} in the preamble, and the compiler rejected it with "\pagestyle
is not supported in the document preamble".

The three commands already had body arms that are honest no-ops (there is no
header or footer rendering yet), but those arms came after the
`_ if has_document && !in_body => unsupported_preamble` catch-all. They now
sit with the other preamble-or-body arms (\numberwithin, \sisetup,
\graphicspath), unchanged.

tests/preamble_page_commands.rs: all four preamble spellings report nothing
and lay out identically to a preamble without them, and the committed
min2-pagestyle probe compiles with no errors. Both tests fail against main's
parser.rs and pass with this change.

Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan)
Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback)
Co-authored-by: d-q222 <[email protected]>

Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
d-q222 added a commit that referenced this pull request Sep 14, 2026
The symbol table mapped them to the deprecated U+2329/U+232A, which
NFC-normalise to CJK U+3008/U+3009; math-layout knows only U+27E8/U+27E9
(cmsy "68/"69), so the pipeline drew empty boxes ("no math glyph for
'〈'"), and symbol_class did not list U+2329, so a bare \langle was spaced
as Ord. \left\langle already used U+27E8.

The base-14 path keeps its glyphs: Adobe Symbol names them angleleft and
angleright at U+2329/U+232A, so export encodes U+27E8/U+27E9 as Symbol
0xE1/0xF1 and layout shapes them through the same substitution as the
lunate epsilon.

Refs #335, #258 rank 13 (fixtures/divergence-probes/min-langle)

Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro)
Commit-Executor: daniel-vpclaude (direct git)
Co-authored-by: d-q222 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
GoKubar pushed a commit that referenced this pull request Sep 14, 2026
)

The symbol table mapped them to the deprecated U+2329/U+232A, which
NFC-normalise to CJK U+3008/U+3009; math-layout knows only U+27E8/U+27E9
(cmsy "68/"69), so the pipeline drew empty boxes ("no math glyph for
'〈'"), and symbol_class did not list U+2329, so a bare \langle was spaced
as Ord. \left\langle already used U+27E8.

The base-14 path keeps its glyphs: Adobe Symbol names them angleleft and
angleright at U+2329/U+232A, so export encodes U+27E8/U+27E9 as Symbol
0xE1/0xF1 and layout shapes them through the same substitution as the
lunate epsilon.

Refs #335, #258 rank 13 (fixtures/divergence-probes/min-langle)

Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro)
Commit-Executor: daniel-vpclaude (direct git)

Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
GoKubar pushed a commit that referenced this pull request Sep 14, 2026
…in the preamble (GH#321) (#322)

The remainder of #258's ranked finding 11. Probe min2-pagestyle declares
\pagestyle{empty} in the preamble, and the compiler rejected it with "\pagestyle
is not supported in the document preamble".

The three commands already had body arms that are honest no-ops (there is no
header or footer rendering yet), but those arms came after the
`_ if has_document && !in_body => unsupported_preamble` catch-all. They now
sit with the other preamble-or-body arms (\numberwithin, \sisetup,
\graphicspath), unchanged.

tests/preamble_page_commands.rs: all four preamble spellings report nothing
and lay out identically to a preamble without them, and the committed
min2-pagestyle probe compiles with no errors. Both tests fail against main's
parser.rs and pass with this change.

Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro plan)
Commit-Executor: daniel-vpclaude, direct git (Cursor-limit fallback)
Co-authored-by: d-q222 <[email protected]>

Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

GH-PREAMBLE-LENGTHS checkpoint

  • SHA: ae37132da0b391ae5005300db9fbda7fd6031731 (on agent/daniel-parent/preamble-lengths; prior f5e3caea pinned the failing diagnostics)
  • Done: compiler accepts preamble \setlength, \addtolength (via \let\addtolength\flashtexundefined so it is not \advance), and \len=<dimen> / \len <dimen> for the listed page-geometry and paragraph lengths. Inventory + Mac copy regenerated. Unparsable dimensions still diagnose.
  • Results (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen, cargo test --manifest-path crates/compiler/Cargo.toml): lib ok. 327 passed; 0 failed; 0 ignored; preamble_lengths ok. 7 passed; supported_latex ok. 8 passed; full crate green with 4 ignored (hw2_gate, pinned_fixtures, recovery, unsupported_inventory).
  • Next: pipeline DocumentSetup/adapter applies those lengths (PR 2).

@d-q222

d-q222 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

GH-PREAMBLE-LENGTHS checkpoint

  • SHA: 245fc9599c08bb066bb66e60fb9a361061e0e32b (tip of agent/daniel-parent/preamble-lengths)
  • Done: crates/render-pipeline/src/adapter.rs walks the preamble after class+geometry resolve and applies \setlength / \addtolength / TeX assignments in source order (geometry last-wins). Rebuilds PageFrame keeping the original PDF media. Oracle tests vs TeX Live 2026 pdflatex \pdfsavepos (4 docs + geometry order). No vendor/compiler edits.
  • Results (CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen, fonts from apps/mac/Fonts): preamble_lengths_oracle ok. 5 passed; 0 failed; 0 ignored; lib ok. 110 passed; 0 failed; 0 ignored; full render-pipeline 272 passed; 0 failed; 2 ignored (incremental slow, math_symbols). Compiler crate unchanged: lib 327, preamble_lengths 7.
  • Next: daniel-parent reviews and splits compiler (through ae37132d) vs pipeline (245fc959) PRs. No further implementation on this lane unless review finds a gap.

d-q222 added a commit that referenced this pull request Sep 14, 2026
Pin scan_dimen §458 ratios: 1bp is 72.27/72 pt, not 1pt; dd/cc/sp/mm/cm/in
use TeX's exact factors; 1ex uses CMR_EX_PER_EM (the compiler has no TFM).

cargo test --manifest-path crates/compiler/Cargo.toml --lib dimen_parsing_supports_the_common_units:
test result: FAILED. 0 passed; 1 failed (left Some(1.0), right Some(1.00375)).
cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths preamble_parskip_one_bp:
test result: FAILED. 0 passed; 1 failed (same).
Next: convert bp and the other units in parse_dimen_pt_at; switch ex from 0.5em.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
parse_dimen_pt_at now uses §458 ratios (1bp = 72.27/72 pt) and CMR_EX_PER_EM
for ex, with a comment that the compiler has no TFM unlike the pipeline.

cargo test --manifest-path crates/compiler/Cargo.toml --lib dimen_parsing_supports_the_common_units:
test result: ok. 1 passed; 0 failed; 0 ignored.
cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths:
test result: ok. 8 passed; 0 failed; 0 ignored.
Next: failing test for \setlength{\parskip}{\textwidth} (item 6).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
The review document \setlength{\parskip}{\textwidth} currently produces no
diagnostic and does not apply a value (messages empty).

cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths preamble_parskip_length_reference:
test result: FAILED. 0 passed; 1 failed (missing unsupported length expression in []).
Next: warn or resolve that assignment in apply_length_value.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Resolve a reference when the compiler already knows the length (parskip,
fboxsep, fboxrule). Otherwise diagnose unsupported length expression for
parskip/parindent; page-geometry refs stay accepted for the pipeline.

cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths:
test result: ok. 9 passed; 0 failed; 0 ignored.
Next: pipeline failing tests for addtolength overwrite (item 1).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Review document: setlength 10pt then addtolength 5pt. TeX uses 15pt;
setlength_in after apply_preamble_lengths leaves 10pt. Body setlength
is pinned on the same test.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib addtolength_parindent_accumulates:
test result: FAILED. 0 passed; 1 failed (got 10).
Next: make apply_preamble_lengths the source of truth for parindent/parskip.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Stop the post-pass setlength_in scan from clobbering accumulated
\addtolength results. Body \setlength{\parindent} still runs through
the same source-order walk.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib parindent:
test result: ok. 2 passed; 0 failed; 0 ignored.
Next: failing test for \parskip stretch after addtolength (item 2).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Review document: \addtolength{\parskip}{6pt} must keep article's plus 1pt.
The adapter currently copies a fixed skip (stretch 0).

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib addtolength_parskip_keeps_class_stretch:
test result: FAILED. 0 passed; 1 failed (stretch 0).
Next: copy full glue; parse plus/minus on \setlength{\parskip}.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
\addtolength{\parskip}{6pt} keeps article's plus 1pt. A \setlength with
an explicit plus/minus keeps those glue components; a plain value is fixed.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib addtolength_parskip_keeps_class_stretch:
test result: ok. 1 passed; 0 failed; 0 ignored.
Next: failing test for geometry paperwidth MediaBox (item 3).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
With geometry, \setlength{\paperwidth}{5in} must change the PDF MediaBox;
without it the engine default (US Letter) stays. Currently both keep Letter.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib geometry_setlength_paperwidth_updates_mediabox:
test result: FAILED. 0 passed; 1 failed (Sp(40258437) vs Sp(23681433)).
Next: rebuild PageFrame media from paper size when geometry is loaded.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
When geometry is loaded, rebuild PageFrame media from the current
\paperwidth/\paperheight (driver behaviour at \begin{document}).
Without geometry the engine default MediaBox is kept.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib geometry_setlength_paperwidth_updates_mediabox:
test result: ok. 1 passed; 0 failed; 0 ignored.
Next: failing test for subparagraph indent after \parindent=0pt (item 4).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Review document: \setlength{\parindent}{0pt} then \subparagraph. Class
heading specs still hold the class default 15pt (983040sp).

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib subparagraph_indent_follows_final_parindent:
test result: FAILED. 0 passed; 1 failed (Sp(983040) vs Sp(0)).
Next: re-derive sections::headings after preamble length assignments.
class-geometry is not edited.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Call sections::headings on the assigned params so \subparagraph indent
follows the final \parindent. class-geometry is not edited.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib subparagraph_indent_follows_final_parindent:
test result: ok. 1 passed; 0 failed; 0 ignored.
Next: failing tests for preamble scan comments, groups, macros (item 7).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Review documents: commented \\begin{document}, % inside a dimen group,
newcommand bodies, brace-group assignments, and \\begin {document}
whitespace. Two #[ignore] tests record \\input and \\@setlength limits.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib preamble_scan:
test result: FAILED. 0 passed; 5 failed; 2 ignored.
Next: comment-aware document boundary, strip group comments, skip depth>0.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Find \begin{document} via find_command (comments and \begin {document}
whitespace). Strip % comments in dimension groups. Skip assignments in
macro bodies and brace groups deeper than top level. \input and
\@setlength remain known limits with ignored tests.

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib preamble_scan:
test result: ok. 5 passed; 0 failed; 2 ignored.
Next: full compiler/pipeline suites, pdflatex oracles, merge origin/main.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Document that \@setlength after \makeatletter is intentionally unparsed.

No tests re-run; comment only. Next: compiler/pipeline suites and merge.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
TeX Live 2026: with geometry, \pdfpagewidth=361.34999pt after
\setlength{\paperwidth}{5in}; without geometry \pdfpagewidth=614.295pt
(US Letter) while \paperwidth is 5in.

cargo test compiler --lib: ok. 327 passed; preamble_lengths: 9 passed;
supported_latex: 8 passed; full compiler suite green (4 ignored).
render-pipeline --lib: ok. 119 passed; 2 ignored; preamble_lengths_oracle:
5 passed; full pipeline suite green.
Next: git merge origin/main (#404 adapter.rs).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Merged origin/main with ort; no conflicts. #404 auto-merged into adapter.rs
(run-in paragraph/subparagraph headings). class-geometry was not edited.

Commands and test result: lines:
- cargo test --manifest-path crates/compiler/Cargo.toml --lib dimen_parsing
  test result: ok. 1 passed; 0 failed; 0 ignored
- cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths
  test result: ok. 9 passed; 0 failed; 0 ignored
- cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib adapter::tests
  test result: ok. 25 passed; 0 failed; 2 ignored
- cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
  test result: ok. 119 passed; 0 failed; 2 ignored
- cargo test --manifest-path crates/render-pipeline/Cargo.toml --test run_in_headings
  test result: ok. 3 passed; 0 failed; 0 ignored
- cargo test --manifest-path crates/render-pipeline/Cargo.toml --test preamble_lengths_oracle
  test result: ok. 5 passed; 0 failed; 0 ignored

The two ignored adapter tests are known limits (\input preambles; \@setlength).

Next step: push this lane branch. No further code changes.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
…length refs

Add a ~1MB many-\setlength time bound (observed 63s on the quadratic
brace_depth prefix rescan), a newcommand-body \begin{document} case that
currently leaves textwidth at the article default 345pt, and a compiler
test that \setlength{\textwidth}{\paperwidth} currently emits no diagnostic.
Supported-input tests now assert result.diagnostics is empty.

cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths
(CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen):
test result: FAILED. 9 passed; 1 failed; 0 ignored
(preamble_page_length_reference_is_not_silently_ignored: got [])

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib preamble_scan_skips_begin_document_in_macro_body:
test result: FAILED. 0 passed; 1 failed
(got textwidth 345)

cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib preamble_scan_is_linear_in_source_length:
test result: FAILED. 0 passed; 1 failed
(1000047 bytes took 63.259s)

Next: linear preamble scan, skip macro-body \begin{document}, warn on
unresolved page-length refs.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
…ge-length refs

Walk the preamble once with CmdScan (brace depth, comments, escapes) instead
of brace_depth(&source[..at]) per command. document_begin_offset uses the
same skip as the assignment scan. Unresolved length refs (including
\setlength{\textwidth}{\paperwidth}) emit the existing unsupported length
expression warning. read_group is kept: matching_brace does not skip
comments or return inner bytes.

CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen
cargo test --manifest-path crates/compiler/Cargo.toml --test preamble_lengths:
test result: ok. 10 passed; 0 failed; 0 ignored
cargo test --manifest-path crates/compiler/Cargo.toml --lib dimen_parsing:
test result: ok. 1 passed; 0 failed; 0 ignored
cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib adapter::tests:
test result: ok. 27 passed; 0 failed; 2 ignored
(preamble_scan_is_linear_in_source_length: ~1MB in the 0.10s module run;
was 63.259s on the quadratic scan)

Next: reword preamble_lengths_oracle.rs so it does not claim a live
pdflatex oracle; then merge origin/main and full suites.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Reword preamble_lengths_oracle.rs so glyph positions cite the TeX Live
2026 measurements recorded at 245fc95, and line-width expects cite
Sp::parse / article size10.clo arithmetic. The tests do not run pdflatex.

CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen
Comment-only change; tests not re-run in this step.

Next: git fetch origin main && git merge origin/main, then full compiler
and render-pipeline suites (quote lib counts).

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
d-q222 added a commit that referenced this pull request Sep 14, 2026
Merged origin/main with ort; no conflicts. Incoming pipeline tests
displaystyle_switch and hyphenated_fragment_units did not touch adapter.rs
preamble scan.

CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen

compiler --lib:
test result: ok. 327 passed; 0 failed; 0 ignored
compiler --test preamble_lengths:
test result: ok. 10 passed; 0 failed; 0 ignored
compiler --test supported_latex:
test result: ok. 8 passed; 0 failed; 0 ignored
compiler full crate: all binaries green; 4 ignored
(hw2_gate, pinned_fixtures, recovery, unsupported_inventory)

render-pipeline --lib:
test result: ok. 121 passed; 0 failed; 2 ignored
(the 110 vs 119 report mismatch: 110 was 245fc95 before this branch's
adapter tests; 119 was a610cba; 121 is 119 plus the two new scan tests.
Ignored: \input preambles; \@setlength)
render-pipeline --test preamble_lengths_oracle:
test result: ok. 5 passed; 0 failed; 0 ignored
render-pipeline full crate: all binaries green; 2 further ignored
(incremental, math_symbols)

Next: push this lane branch. Lane owner splits PRs.

Implementation-Agent: cursor-agent cursor-grok-4.6
Commit-Executor: cursor-agent
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>
GoKubar pushed a commit that referenced this pull request Sep 14, 2026
…h \setlength/\addtolength (#433)

The pipeline half of lane #258, split from agent/daniel-parent/preamble-lengths
@ 695dfaa (20 reviewed WIP commits). The compiler half is its own PR.

- Preamble assignments to \textwidth, \textheight, the margins, \headheight,
  \headsep, \footskip, \paperwidth/\paperheight, \parindent and \parskip are
  applied to the page frame. \addtolength accumulates, and \parskip keeps its
  glue stretch and shrink.
- With geometry, paper-size assignments set the PDF MediaBox; without it they
  only move the frame, as in LaTeX.
- Heading specs are re-derived when \parindent was assigned.
- The scan is one linear pass that skips % comments, braces and
  \newcommand/\renewcommand/\def bodies (including a \begin{document} inside
  one) and honours group scope. A 1 MB source went from 63 s to under the test
  bound.

What was run (CARGO_TARGET_DIR=target-verify, against the current vendored compiler pin):
test result: ok. 121 passed; 0 failed; 2 ignored  (render-pipeline --lib)
test result: ok. 5 passed; 0 failed; 0 ignored    (--test preamble_lengths_oracle)

Known limits (ignored tests): \input-ed preamble files, \@setlength. Length
references use final geometry rather than source order.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa)
Commit-Executor: daniel-parent (split into compiler and pipeline PRs)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
GoKubar added a commit that referenced this pull request Sep 14, 2026
…s (rebase of #432 onto current main) (#473)

* compiler: preamble \setlength, \addtolength and TeX length assignments

The compiler half of lane #258, split from agent/daniel-parent/preamble-lengths
@ 695dfaa (20 reviewed WIP commits). The render-pipeline half is its own PR.

- \setlength and \addtolength are accepted in the preamble, along with direct
  TeX assignments (\parindent=10pt) to the page and paragraph lengths; plus/minus
  glue is parsed.
- Units use TeX's scan_dimen factors: bp is 1.00375pt (it was treated as pt),
  plus dd, cc and sp; ex uses the cmr x-height.
- An unresolved length reference, including a page length such as
  \setlength{\textwidth}{\paperwidth}, warns instead of being silently dropped.
- The inventory is regenerated; both supported-latex.json copies are byte-identical.

What was run (CARGO_TARGET_DIR=target-prelen): cargo test --manifest-path crates/compiler/Cargo.toml
test result: ok. 327 passed; 0 failed; 0 ignored  (lib)
test result: ok. 10 passed; 0 failed; 0 ignored   (preamble_lengths)
All other test binaries ok, 0 failed.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa)
Commit-Executor: daniel-parent (split into compiler and pipeline PRs)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* wip(#432): keep user-defined skip registers out of parser addtolength

HOST_PRELUDE no longer undefines \setlength/\addtolength. When the target
is already defined (\newlength skip), the kernel assignment/\advance runs
so \the can read it back. Undefined preamble lengths still pass through
as host commands mapped back to \setlength/\addtolength with the full
csname. \parindent TeX assignment and \addtolength are silent in the
preamble; \setlength{\parindent}{nonzero} still warns.

Ran: cargo test --manifest-path crates/compiler/Cargo.toml --test
kernel_untested_a addtolength
  before: FAILED 0 passed; 1 failed (Missing number; \addtolength{\\})
  after:  ok. 1 passed; 0 failed; 0 ignored; 0 measured; 20 filtered out
  cargo test --test preamble_lengths
  test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Next: full compiler crate tests and render-pipeline --lib.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* wip(#432): full compiler crate and render-pipeline lib green

ASCII-only wording in the HOST_PRELUDE comment. No behaviour change.

Ran: CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen
  cargo test --manifest-path crates/compiler/Cargo.toml
    every test result: ok (lib: 331 passed; 0 failed;
    kernel_untested_a: 20 passed; 0 failed; 1 ignored)
  cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
    test result: ok. 121 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out

Next: push this lane branch. No remaining acceptance gaps.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Cursor <[email protected]>
GoKubar added a commit that referenced this pull request Sep 14, 2026
… (rebase of #407, + inventory sync and duplicate-attribute fixes) (#474)

* compiler: accept `\paragraph`/`\subparagraph` instead of erroring on them

`\paragraph` and `\subparagraph` raised `\paragraph is not supported by
this compiler version`. That diagnostic is stale: they are `\@startsection`
with a *negative* after-skip (article.cls 406-414), and `\@xsect`'s
negative branch never sets the head as a block of its own — it arms
`\everypar`, throws away the following paragraph's `\parindent` box and
sets the head into that paragraph's first line instead. The render pipeline
lays them out correctly from the source, so the error was reporting a gap
that no longer exists.

The right thing for this layer is therefore to take the star and the
optional short title and then get out of the way: the braced title falls
through to the main token loop as ordinary body text, which is exactly the
material LaTeX runs into the following paragraph, in the right place and
with the right spans. `flush_paragraph` is deliberately not called, for the
same reason — a run-in head does not start a new paragraph.

**No geometry changes.** Measured on the 22-document real-world corpus with
the vendored compiler patched to this change (local only; never committed):
dx 85.17%, dy 65.74%, both 59.46%, 14002 aligned words, page counts 20/22 —
identical to the same build without it, to the last word. What changes is
that `fixtures/real-world/ps-calculus` no longer reports four
`unsupported_feature` errors, and a probe of all three forms reports none.

`\paragraph*[short]{...}` is left alone: `\@startsection`'s starred form
takes no optional argument, and pdflatex itself typesets the brackets there
(`[Short]Solution.`), so there is no oracle behaviour to match.

Inventory: both commands move out of `KNOWN_UNIMPLEMENTED_COMMANDS` into
`BUILT_INS` and the supported-LaTeX inventory; the generated artefacts
(`docs/user/compiler.md`, `supported/supported-latex.json`,
`supported/coverage.md`) are regenerated with
`crates/compiler/scripts/render_supported_latex.sh`.

**A vendor re-pin is required** for the rendered corpus to see this:
`crates/render-pipeline/vendor/compiler` is a frozen snapshot (`e44d5917`)
and is deliberately not touched here. The pipeline side of this feature is
a separate PR and needs no re-pin — it reads the command back from the
source, so it works against the existing pin either way.

`cargo test --release --no-fail-fast` on crates/compiler: 583 passed, 0
failed, 4 ignored (was 577; the new `run_in_headings_are_accepted_...`
test plus the two doc/inventory gates).

Implementation-Agent: Claude Opus 5 (lane nixos-graphics-sectioning, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)

* compiler: preamble \setlength, \addtolength and TeX length assignments (rebase of #432 onto current main) (#473)

* compiler: preamble \setlength, \addtolength and TeX length assignments

The compiler half of lane #258, split from agent/daniel-parent/preamble-lengths
@ 695dfaa (20 reviewed WIP commits). The render-pipeline half is its own PR.

- \setlength and \addtolength are accepted in the preamble, along with direct
  TeX assignments (\parindent=10pt) to the page and paragraph lengths; plus/minus
  glue is parsed.
- Units use TeX's scan_dimen factors: bp is 1.00375pt (it was treated as pt),
  plus dd, cc and sp; ex uses the cmr x-height.
- An unresolved length reference, including a page length such as
  \setlength{\textwidth}{\paperwidth}, warns instead of being silently dropped.
- The inventory is regenerated; both supported-latex.json copies are byte-identical.

What was run (CARGO_TARGET_DIR=target-prelen): cargo test --manifest-path crates/compiler/Cargo.toml
test result: ok. 327 passed; 0 failed; 0 ignored  (lib)
test result: ok. 10 passed; 0 failed; 0 ignored   (preamble_lengths)
All other test binaries ok, 0 failed.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa)
Commit-Executor: daniel-parent (split into compiler and pipeline PRs)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz

* wip(#432): keep user-defined skip registers out of parser addtolength

HOST_PRELUDE no longer undefines \setlength/\addtolength. When the target
is already defined (\newlength skip), the kernel assignment/\advance runs
so \the can read it back. Undefined preamble lengths still pass through
as host commands mapped back to \setlength/\addtolength with the full
csname. \parindent TeX assignment and \addtolength are silent in the
preamble; \setlength{\parindent}{nonzero} still warns.

Ran: cargo test --manifest-path crates/compiler/Cargo.toml --test
kernel_untested_a addtolength
  before: FAILED 0 passed; 1 failed (Missing number; \addtolength{\\})
  after:  ok. 1 passed; 0 failed; 0 ignored; 0 measured; 20 filtered out
  cargo test --test preamble_lengths
  test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Next: full compiler crate tests and render-pipeline --lib.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

* wip(#432): full compiler crate and render-pipeline lib green

ASCII-only wording in the HOST_PRELUDE comment. No behaviour change.

Ran: CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-prelen
  cargo test --manifest-path crates/compiler/Cargo.toml
    every test result: ok (lib: 331 passed; 0 failed;
    kernel_untested_a: 20 passed; 0 failed; 1 ignored)
  cargo test --manifest-path crates/render-pipeline/Cargo.toml --lib
    test result: ok. 121 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out

Next: push this lane branch. No remaining acceptance gaps.

Open questions: none.

Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast
Commit-Executor: cursor-agent (direct git commit)
Lane-Owner: daniel-parent (mac-m5pro-dq222)
Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: d-q222 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@GoKubar
GoKubar deleted the agent/linux-unknown-unknowns/corpus-widening 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.

2 participants