Skip to content

Integration candidate: kabir-claude queue 2026-09-13b - #178

Closed
GoKubar wants to merge 102 commits into
mainfrom
agent/kabir-claude/integration-2026-09-13b
Closed

GoKubar wants to merge 102 commits into
mainfrom
agent/kabir-claude/integration-2026-09-13b

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

WIP, paused for session handoff. Not ready to merge. For the Commander's review once complete; never push to main from here.

Resume notes

  • Branch: agent/kabir-claude/integration-2026-09-13b
  • Tip: 407df784
  • Base: origin/main 89e49fed, merged in at a51ccb7f (main had moved 18 commits past the old base bffd168a).
  • Machine: NixOS PC, TeX Live 2025 (not MacTeX), CARGO_BUILD_JOBS=8. No committed oracle data was regenerated; any locally generated reference is indicative only.
  • Merge log: docs/evidence/integration-2026-09-13b/merge-log.md — full per-merge account, including why render-pipeline: algorithm floats and algorithmic/algpseudocode lists (oracle 16/22 exact; needs #159 re-pin) #162 is not merged.
  • Helpers: docs/evidence/integration-2026-09-13b/tools/ (m.py, resolve.py, measure.py, residuals.py, repin.sh, fontenv-nixos.sh).

Stage 2 re-pins are still deliberately uncommitted

Re-create after any checkout, and after every merge:

sh docs/evidence/integration-2026-09-13b/tools/repin.sh \
   compiler math-layout paragraph-layout microtype \
   tex-expansion tex-text-encoding tex-boxes

Verified: none of this session's nine commits touches crates/render-pipeline/vendor.

Read this first: the gate numbers every lane has been reporting were unsound

Two independent bugs, both of the same shape — a run that measured nothing reported success. Both are fixed here (af0a8d5c, d1364cff, ac86d82e); other machines should pick them up.

1. The oracle harnesses discarded the caller's font environment. Five corpus harnesses built the subprocess environment as

env = dict(os.environ, FLASHTEX_FONT_DIRS=args.fonts, FLASHTEX_TFM_DIRS=args.fonts)

dict(os.environ, KEY=value) overrides KEY, so a correctly exported FLASHTEX_TFM_DIRS was thrown away — and replaced with the outline directory, which holds no .tfm at all. The renderer fell back to OpenType advances, and the pass verdict never consulted the diagnostics the harness had already collected. The same binary reads 0/59 or 59/59 on amsmath depending only on whether metrics resolve, and the bad run still exits "recovered".

New shared module tools/visual-oracle/fontenv.py: an exported value always wins; --fonts/--tfm-dirs take colon lists; unset metrics dirs are derived by walking <fonts>/texmf (so --fonts alone now works, which it could not before — the renderer's bundle roots are <exe>/../Resources/texmf and <exe>/texmf, not <fontdir>/texmf); and any font diagnostic fails the fixture loudly. Applied to amsmath_corpus, amssymb_corpus, tabular_corpus, xcolor_oracle, display-placement, tools/real-world-corpus/run.py (which now also exits non-zero) and this lane's measure.py.

There are two font-resolution paths and the environment feeds only one: the rooted required-metrics reader accepts only an exe-relative texmf tree and refuses symlinked components. Machines disagree about whether the env alone satisfies it — it did here, it does not on the kernel-math lane's box. That is exactly why the gate asserts on diagnostics, not on configuration. Documented in fontenv.py.

2. cargo test was silently skipping most of the render-pipeline suite. lm_available() is guarded on ~110 times across 40 test files, always as if !lm_available() { eprintln!("skipping"); return; }. libtest captures eprintln!, so without Latin Modern those tests neither failed nor printed — they just did not run.

Measured here: 187 passed / 1 failed with no FLASHTEX_* set, 177 passed / 11 failed with fonts configured. The first number is hollow, not better.

lm_available now panics with an actionable message; FLASHTEX_ALLOW_FONTLESS_TESTS=1 restores the old skip for a deliberately fontless environment. CI already exports the font variables, so CI is unaffected. This is what let cargo test --test incremental pass without ever executing.

Merged this session

origin/main 89e49fed, then #156, #160, #168, #167 — each merged individually, gates re-run, then committed.

Stage 3 is now 14 of 16: #135, #138, #154, #151, #152, #171, #157, #165, #158, #170, #156, #160, #167, #168.

Almost every conflict was a misalignment, where git shared a common tail between this branch's additions and the PR's, so each side ended mid-construct and a plain "keep both" would not compile. Each was rebuilt as complete separate pieces — the technique the merge log records for #154 and #170.

Three findings worth carrying to other lanes:

#162 is NOT merged — it needs a lane, not a merge

Attempted and aborted cleanly; nothing committed.

#162's float-box layout is built on the float model that #135 replaced. This branch's floatpage.rs sets a float body through set_box/flush_line (a bx/line/HItem model); #162's is the earlier y/prev_depth/elems model and has no set_box/flush_line at all. git made that look mergeable and silently spliced #162's four new FloatPart arms into the middle of addvspace, over that function's tail, with no conflict marker.

Merging it also needs FloatSpec::wide on its FloatKind::Algorithm spec, a Block::Algorithmic arm in floats.rs, Elem::Rule handling in the page builder, and its four FloatPart kinds re-expressed in the set_box/flush_line model.

That is engineering on float-body layout, not integration — the same call the previous integrator made for #145. Please assign it a fresh lane with the float owner.

#145 remains deliberately unmerged

Unchanged from the previous session: main implements monospace via NFSS TextFamily::Mono, and merging #145 mechanically would reintroduce a rival font-selection model and revert main's \tableofcontents/\verb support.

Gate numbers at 407df784

NixOS PC, TeX Live 2025, bundled symlink-free tree plus the nix-store ec for ectt*. Every number taken with the fixed harness and reporting zero font diagnostics.

gate result
amsmath corpus 59/59
amssymb corpus 38/39
tabular corpus 59/59
xcolor oracle 28/28
graphics oracle 24/24
display-placement 33/36 (the 3 are real content differences)
theorem oracle pass
multicol oracle pass
siunitx oracle 36/39 exact (3 pending, each naming its dependency)
bibliography oracle 20/21 (1 documented residual)
thebibliography oracle pass
HW1 / HW2 3 pages each, 0 overfull, 0 errors, 0 diagnostics
real-world corpus 10/10 recovered, every page count = its committed MacTeX reference

cargo test --release in render-pipeline with fonts configured: 11 failures, none attributable to this session.

Eight of them also fail on unmerged origin/main — controlled by checking out origin/main in this worktree and running the same suite: the four NewCM math_symbols controls, metrics_provenance, font_families_oracle, footnotes_oracle, page_frame_oracle. The other three (float_bodies, headings, list) have no baseline on a non-MacTeX host and do not exist on main.

page_frame_against_pdflatex was not on the previous session's known-failure list; it is now measured as pre-existing, failing identically on unmerged main, with mismatches confined to running-head small-caps x positions while every page count, edge and body line matches.

Next steps

  1. render-pipeline: algorithm floats and algorithmic/algpseudocode lists (oracle 16/22 exact; needs #159 re-pin) #162 — needs its own lane (above).
  2. render-pipeline: verbatim, verb and listings as LaTeX sets them #145 — still needs an owner's decision.
  3. FT-065 perf bench — not re-run this session.
  4. Note for whoever merges: draft PRs compiler: \colon as math punctuation, \mathbb as a real msbm alphabet, the largesymbols operators and \neg #180/render-pipeline: \colon keeps its punctuation class through the atom-class re-read #181 (\colon as \mathpunct, \mathbb outside A–Z, kernel big operators) are based on main independently and touch math atom classes; they were not in this queue.

GoKubar and others added 30 commits September 13, 2026 06:23
…, float bodies)

article-twocolumn rendered 1 page (pdflatex 2) and cv 2 pages (pdflatex 1).

cv: enumitem `\begin{itemize}[nosep,...]` keys were never read; only
`\setlist` reached `list_seps`, so every item kept article's `\itemsep`/
`\parsep`/`\topsep`. The list's own `\begin` options now apply after
`\setlist` (`nosep` zeroes all four skips, `noitemsep` `\itemsep`/`\parsep`,
explicit keys as before; a shortlabels template is not read as keys).

article-twocolumn:
- `\maketitle` in a two-column article is `\twocolumn[\@maketitle]`
  (`\@topnewpage`): the title parts are now set at `\textwidth` above both
  columns of page 1, whose `\@colht` is `\textheight` less the box
  (`\null\vskip2em` title `\vskip1.5em` authors `\vskip1em` date
  `\vskip1.5em`, `\LARGE`/`\large` baselineskips). The adapter marks the
  lowered title paragraphs (`Doc::title_parts`); the page builder and float
  placer take a per-column height (`break_pages_cols`, `paginate`'s
  `first_colht`), and page-1 lines and float items are shifted below the box.
- two-column `abstract` is article's `\section*{\abstractname}`.
- graphicx `demo`: `\includegraphics` is a black rule of the requested width
  and height (150pt x 100pt default), no file read, no image_unavailable.
- a `tabular` inside a float keeps its box height (struts x `\arraystretch`,
  `\hline`, booktabs rules, `[c]` on the axis) from the compiler's tabular
  model; cells/rules are still not painted (reported).

Result (pdflatex MacTeX 2026 oracle): article-twocolumn 2 pages, title
baseline 95.8 vs 95.9pt, first author row 124.7 vs 124.8pt, page 2 last line
matches; cv 1 page, first/last line match. hw1, hw2, input-bibliography,
lecture-notes, letter, math-sheet, unicode-accents display lists
byte-identical to a630863. cargo test --release green (page_frame included).

Remaining article-twocolumn page-1 offset (+12.7pt, one line per column) is
the compiler's one-author-per-line `\and` (pdflatex: side-by-side tabulars)
plus unsupported `\TeX`/`\LaTeX` text changing line breaks.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude realworld page counts, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…ecounts' into agent/kabir-claude/float-tables
…izes)

A float body is now set like the main flow instead of only
\includegraphics/\caption: the body bytes are parsed on their own (preamble
kept; \caption/\includegraphics become \par, \label spaces, offsets kept)
and every paragraph (text, tabular via table.rs with cells and rules
painted, \centering/center) is placed in the float's \vbox in source order
with the captions and graphics:

- \@parboxrestore: no \parindent, \parskip 0, \sloppy (captions too);
  \@floatboxreset \normalsize + \@setminipage: \addvspace does nothing until
  the first paragraph or caption, so a leading center adds no \topsep while
  \end{center} adds \@topsepadd.
- \@caption is \normalsize with \abovecaptionskip before and
  \belowcaptionskip after, above or below the table.
- top-level \small/\footnotesize/... set the \baselineskip of what follows;
  paragraphs use their own size's \baselineskip.
- \vspace before a paragraph; figure*/table* use \textwidth as \hsize.
- the adapter's environment skips are kept only where the float body itself
  holds \begin/\end of a paragraph-shape environment (in the isolated body
  its gap scan reached the preamble's \begin{document}).
- lists, display math, headings and tikzpicture in floats are reported
  (float_content_unsupported) instead of the old tabular height placeholder.

Oracle: fixtures/float-tables (14 pdflatex MacTeX 2026 fixtures, generator
make_fixtures.py + oracle.py reusing the tabular corpus extraction);
tests/float_tables_oracle.rs: 14/14 within 0.5 bp words, 0.1 bp rules.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float tables, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…ion commands

- A tab in verbatim/\verb is one space (latex.ltx \@vobeytabs: ^^I is
  \@xobeytab = \@xobeysp; the visible space under the star form), not an
  8-column tab stop.
- \lstinline[<keys>]<c>...<c> and \lstinline{...} are lexed like \verb
  (one Verb token over the whole invocation; listings.sty \lstinline@,
  \lst@InlineG), so the code no longer leaks as text.
- \lstset, \lstdefinestyle, \lstloadlanguages set no text; \lstinputlisting
  lists a project document as Block::Verbatim.
- lstlisting/\lstset keys: only keys outside LISTING_KEYS (the ones the
  render pipeline lays out) are reported, by name.
- \verb read inside a heading/caption argument reports LaTeX's
  "\verb illegal in argument".
- listings is a supported package; inventory, docs and coverage regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude verbatim fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…mark records

hyperref in the product path: \usepackage[..]{hyperref} and \hypersetup
options, \autoref/\autopageref/\nameref, \hyperref, \hyperlink,
\hypertarget, \hyperdef, \phantomsection, \texorpdfstring, \pdfbookmark,
starred references, the autoref name table and NoHyper. Parsed::hyperref
records links (span, class, target), named destinations and bookmarks for
PDF export. table captions and enumerate \label values follow article.cls.

32 pdflatex oracle cases (expected data + generator, no TeX in cargo test)
match on destinations, link targets, /Border, /C, link text, outlines,
Info and colorlinks colours. hyperref coverage 2/132 -> 35/132.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude hyperref coverage, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
\mbox, \makebox, \fbox, \framebox, \parbox, minipage, \raisebox,
\phantom/\hphantom/\vphantom, \smash, \llap/\rlap, \strut, \hss,
\newsavebox/\sbox/\savebox/lrbox/\usebox and \newlength with
\settowidth/\settoheight/\settodepth parse into Inline::Box,
Inline::SetLength and Inline::LengthGlue (src/boxes.rs). Dimensions keep
their decimal digits and unit so the typesetter converts them exactly
(crates/tex-boxes); \parbox/minipage keep paragraphs and alignment. The
Core 14 layout places box content inline. Supported inventory regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude box commands, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…o-column wide floats

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Resolved parser.rs (P initialiser: hyperref fields + column_types;
package_matches_layout: hyperref + array arms) and regenerated the
supported-LaTeX artefacts. Fixed the links proposal path in the oracle
test docs.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude hyperref coverage, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Rebase of #123 (realworld page counts + float-table bodies) and the float-bodies work onto main, keeping #122's \maketitle design: lower_blocks(stash_titles) with Block::Title, break_pages_shortened and top_title. #123's own twocolumn-title path (Doc::title_parts, break_pages_cols, span_title) is dropped; floats are threaded on top: paginate takes #122's shortened first page (first_colht) and float items are shifted below the \twocolumn[\@maketitle] box instead of the old 'floats do not shorten' warning. #123's nosep lists and two-column abstract are kept (lower_blocks gains a twocolumn flag).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Implementation-Agent: Claude Opus 5 (subagent kabir-claude box commands, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…s off main-flow list residuals

floatpage::paginate now sets each text column \vbox to\@colroom like pagebuild::break_pages (shrink when too tall, stretch under \flushbottom at an ordinary break): pdflatex page 1 of a two-column document is identical with and without a figure*, and ours drifted 0.44bp per paragraph. Float-body fixtures 01/02 move to 10pt and 03 to enumerate, 20 to a paragraph in table*: the 12pt list \leftmargin (2.5em taken at 12pt instead of the font quad), two-column \leftmargini (2em), consecutive lists and description labels are main-flow list residuals, reproduced without floats. floats unit test accounts for the Space piece.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Implementation-Agent: Claude Opus 5 (subagent kabir-claude box commands, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>

# Conflicts:
#	crates/compiler/src/parser.rs
#	docs/user/compiler.md
…racle 20/20

\@make@normalcolbox unvboxes the text, the top floats with \floatsep/\textfloatsep (\@cflt) and the bottom floats (\@cflb) into \vbox to\@ColhT, so under \flushbottom the separators stretch with the text glue (fixtures/float-bodies 16: a column figure[t] in a two-column page). tests/float_bodies_oracle.rs no longer ignored: 20/20 within 0.5bp words and 0.1bp rules against pdflatex (MacTeX 2026).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Sets the compiler's Inline::Box / SetLength / LengthGlue (\mbox, \makebox,
\fbox, \framebox, \parbox, minipage, \raisebox, phantoms, \smash, laps,
\strut, \hss, saved boxes, \settowidth & co.). Content is measured with the
existing hbox/paragraph layout (parbox/minipage lines broken at the box
width under \@parboxrestore), each measured line enters crates/tex-boxes as
an opaque box tagged with a whatsit, the latex.ltx macro runs on it
(frames with \fboxsep/\fboxrule, [l|c|r|s] and [t|c|b] placement with
\vcenter/\vtop, \raisebox height/depth, interline glue), and ship_out gives
every line position and frame rule to the sp; the record reuses the table
record for painting. Lines inside boxes re-set their finite glue as hpack
does (paragraph-layout sets loose lines with \emergencystretch included).

Oracle: fixtures/boxes (37 fixtures, tools/box-oracle/oracle.py, references
from pdflatex, cargo never runs TeX): 36/37 match (words 0.5 bp, rules
0.1 bp); known difference: minipage
footnotes. Depends on the compiler box-commands PR (vendor re-pin).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude box commands, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…rivlist skips, labels)

- em lengths are the body font's quad (\fontdimen6: cmr12 11.74988pt),
  \leftmargini 2em in twocolumn (article.cls \if@twocolumn)
- \@endpe after \end{itemize|enumerate}: no indent on the next paragraph
- \@endparenv skips use the closed list's own level and combine with the
  next \item/\begin as \addvspace (max, not sum); \begin after \end{env}
  reads in vertical mode (\partopsep); negative \@nbitem after headings
- enumitem \begin keys: nosep, noitemsep, topsep/partopsep/itemsep/parsep,
  labelsep; key lists no longer read as shortlabels templates
- article labels by \@itemdepth/\@enumdepth (bullet, bold en dash,
  asterisk, cdot; arabic/alph/roman/Alph) with cmsy metrics for symbols
- list_corpus: 39 pdflatex fixtures + oracle.py; list_oracle gate (24)

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
latex.ltx defines \@footnotetext with \long: a blank line inside
\footnote{...} or \footnotetext{...} is a paragraph break in the note.
The parser closed the argument at the blank line instead, reported a
missing brace and an unmatched '}', and moved the rest of the note into
the host paragraph. The argument now uses long_required_group; an
argument that is never closed is still closed at the end of its first
paragraph.

Found by the render-pipeline footnote oracle (fixture 14-multipar-note).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude footnotes render, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…t 28/39

- quotation: \listparindent = \itemindent = 1.5em (article.cls), told
  apart from quote by the enclosing environment in the source
- oracle.py reads label runs glyph by glyph (all label glyphs share the
  \item span, so cluster bytes misspelled them)
- list_oracle gates 28 fixtures; the 11 pending ones name their cause

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…er pipeline)

upquote changes the quote glyphs and label needs lstnumber references,
neither of which the render pipeline sets; they are now reported with the
other unimplemented listings keys instead of being accepted silently.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude verbatim fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
…tion specs (oracle 36/41)

Run-in \paragraph/\subparagraph, \@hangfrom hang indents, the class
secnumdepth default and body \setcounter{secnumdepth}, numbered deep
levels with the bold \quad, and \@nbitem's negative \addvspace after a
heading. Oracle: tools/headings-oracle (41 pdflatex fixtures).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude heading fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
… minipage footnote marks

\thanks in \title/\author/\date becomes an Inline::Footnote at its place in the title block, numbered \@fnsymbol\c@footnote in title, author, date order (U+2217, U+2020, U+2021, section, pilcrow, U+2016, then doubled; a tenth is diagnosed and printed arabic); \maketitle ends with \setcounter{footnote}{0}. The old strip-with-warning path is gone.

report/book: \chapter[*][short]{title} is parsed. The numbered form steps chapter and resets section, footnote, figure and equation (\@addtoreset); \thesection, figure captions and equation numbers print as <chapter>.<n> once a chapter exists. The title stays a bold paragraph (the renderer owns the head layout and strips it by source range); article keeps diagnosing \chapter.

minipage: \footnote/\footnotetext inside use mpfootnote (zeroed at each \begin{minipage}, \alph marks); \footnotemark keeps footnote.

Includes PR #142 (footnote argument parsed as \long).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude footnotes 2, mac-m5pro-kabir)

Commit-Executor: Claude Code direct Git

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
… description, verse)

Block::ListItem gains `lists` (every enclosing \list environment, outermost
first: environment, kind depth, enumitem keys in application order, \begin
span) and `item` (ItemLabel: explicit \item[...] content/text/span, article
\labelitem symbol, single-counter label with value/style/prefix/suffix after
start=/resume, template, empty). Block::Styled gains `lists` and
`line_break_before` (verse's \\ = \@centercr ends the paragraph; its [dimen]
and star are kept).

New: description (bold \descriptionlabel terms), verse, \item[label] (does
not step the counter), enumitem options parsed as keys ([noitemsep] is no
longer label text), start/resume/resume*/series, label*, \setlist[env,level]
targets, nested article labels per \@itemdepth/\@enumdepth, quote inside an
item reported as Styled with both frames.

Provenance: latex.ltx 15848-16073, article.cls 344-410, enumitem.sty
244-1157 and 1787 (cited in src/parser/lists.rs). Supported inventory
regenerated; cargo test --release green (tests/list_structure.rs: 9 new).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list structure, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…no, \tag*, after headings, lists; oracle 29/36)

Display rules of TeX 1145/1199-1205 and amsmath's \mathdisplay, measured
by a new 36-fixture pdflatex oracle (fixtures/display-placement; main 19/36):

- amsmath leqno: numbers left, normal skips (1203); fleqn: formula at
  \@mathmargin, tags per \emdf@R/\emdf@L; align/gather under both.
- primitive $$ ... \eqno/\leqno $$ numbers (read from source).
- \tag* without parentheses; counter numbers formatted in the adapter.
- a display right after a heading sets no empty line (1145).
- text after a display carrying \label, and displays inside quote and
  list items, continue the paragraph (no indent, short skips).
- the short-skip test is d + s <= \predisplaysize, not a too-wide flag.

Not yet: glue shrink of too-wide formulas (math-layout glue has no shrink),
\numberwithin/subequations (compiler counter), \tag{$..$}, nested list
labels. amsmath corpus 42/42; HW1/HW2 byte-identical to main.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude display math placement, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…lues

Replays xcolor 3.02's TeX dimension arithmetic (lshift/rshift re-reads,
rdivide, calc N/C/D/M/S/T, UCR/BG) on tex.web's round_decimals and
print_scaled, so every operand matches pdfTeX; named sets generated from
dvipsnam.def, svgnam.def and x11nam.def. Oracle: 982 expressions across
9 package setups pinned from pdflatex (TeX Live 2026), all exact.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude xcolor support, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Resolves parser.rs against the expansion pass (Rc token stream: token_mut); supported inventory regenerated; cargo test --release: 404 passed, 0 failed.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list structure, mac-m5pro-kabir)

Commit-Executor: Claude Code direct Git

Co-Authored-By: Claude Opus 5 <[email protected]>
…ucture-pipeline

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list structure, mac-m5pro-kabir)

Commit-Executor: Claude Code direct Git

Co-Authored-By: Claude Opus 5 <[email protected]>
Titles holding $...$ are re-read as body text (the compiler sets their
math as plain text and drops \alpha); math set at a heading's size uses
\DeclareMathSizes and the lmodern designs for that size
(TexMathMetrics::for_text_size). Run-in titles keep their math.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude heading fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…:pack_to

Inter-atom spacing now carries plain.tex's muskips in full (plain.tex
373-375, kept by LaTeX): \thinmuskip 3mu, \medmuskip 4mu plus 2mu minus
4mu, \thickmuskip 5mu plus 5mu, scaled by the style's math unit like
tex.web 716 math_glue. Explicit glue atoms gain plus/minus components
(Atom::glue_flex with MathFlex in mu, pt or fil/fill/filll units;
Atom::hfill/hfil). BoxKind::Glue carries the resolved Flex stretch and
shrink.

MathBox::glue_totals exposes an hlist's natural width and total stretch
and shrink per order (tex.web 656); MathBox::pack_to(width) sets the glue
like hpack(p, w, exactly) (649-667): highest order wins, finite shrink is
capped at its total (glue set 1.0) with the excess reported as overfull,
and later children move by the accumulated glue change. Displays wider
than \displaywidth can now be squeezed as in tex.web 1199-1201.

Oracle: tests/glue_set/glue-set.log, pdfTeX 1.40.29 \showbox of eight
hboxes (natural, shrink, stretch, overfull, fill, pt glue, text and script
styles); tests/glue_set.rs reads it and checks glue components, totals,
glue set ratio (in sp) and glyph positions. math-layout: 43 tests pass.
Existing Atom::glue/MathBox::glue keep their signatures (rigid glue).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude math glue + numbering, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…dhere

Theorem-like environments now carry the structure a faithful layout needs,
as non-breaking side tables on Parsed:

- Parsed::theorems: one TheoremRecord per instance (kernel \newtheorem,
  amsthm \newtheorem, proof) with kind, \begin[note] and \end spans,
  name/number/note, swap, head/note/body fonts, head punctuation, head
  space (kernel \labelsep, amsthm \thm@headsep glue, { }, \newline),
  indent and \thm@preskip/\thm@postskip.
- Parsed::qed_marks: every end-of-proof symbol (\end{proof}, text
  \qedhere, \qedhere inside a display, \qed) with its placement.

Heads follow the sources: without amsthm, latex.ltx \@BeginTheorem
({\bfseries Name Number (Note)}, no period, italic body); with amsthm,
\thm@headfont Name Number, the note in \thm@notefont, \thm@headpunct in
the head font. New: \newtheoremstyle (amsthm.sty 236-272), \swapnumbers,
amsmath \numberwithin, [within] on any counter (theorem numbering moves
onto xref::Counters, new Counters::set_within), \renewcommand of
\proofname/\qedsymbol, \@addpunct for proof headings, \qedhere (text and
math mode). Supported inventory regenerated.

Tests: tests/amsthm.rs 26 (was 17); compiler cargo test all green except
supported_latex::canonical_names_outside_the_inventory_are_diagnosed,
which fails identically on origin/main (built-in \and reaches
unsupported; pre-existing). clippy --lib and touched tests -D warnings
clean (main.rs has a pre-existing clippy error).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude theorem fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
\definecolor/\providecolor/\xdefinecolor/\colorlet/\definecolorset/
\DefineNamedColor/\selectcolormodel, \color and \textcolor (TextStyle::color,
scoped by the existing style stack like pdfTeX's colour stack), colours
inside math (Inline::Math::color and color_ranges), \colorbox/\fcolorbox
(Inline::ColorBox with \fboxsep/\fboxrule), \pagecolor (Parsed::page_color).
Canonical list gains the xcolor.sty set; inventory regenerated
(194/1003 -> 208/1074, xcolor 14/71). cargo test --release: 384 passed.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude xcolor support, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…e 38 heading fixtures

report/book \@chapter in two-column mode sets \@makechapterhead in a
\textwidth box at the top of the page and lowers \@ColhT by its height
plus \dbltextfloatsep (latex.ltx \@topnewpage); pagebuild::break_pages_tops
shortens the columns of any page that starts with such a box. Not with
floats, contents lists (\onecolumn) or an openright \cleardoublepage after
other material (kept as before). Heading oracle: 38/41 fixtures gated exact.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude heading fidelity, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar and others added 13 commits September 13, 2026 11:52
Clean merge. math-layout 43 tests pass; compiler unchanged.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Conflicts against #148: MathBox::glue_flex (SourceTag plus stretch/shrink) and the mathlist.rs imports. math-layout 54 tests pass.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…merges

Every stage 1 merge took main's side of the generated inventory and deferred
the regeneration to the end of the stage. Running
crates/compiler/scripts/render_supported_latex.sh picks up #131, #137, #144,
#147, #149, #150, #153, #155, #159, #163, #164, #166 and #169, so
supported_latex::generated_artifacts_are_current passes again.

The TeX Live-derived canonical denominator is deliberately untouched: this
machine has TeX Live 2025, not the MacTeX the committed file was pinned from.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
#135 splits build() into a reusable layout_blocks(doc_blocks) -> Flow so float
and minipage bodies are set by the same code, while main had added two-column
bookkeeping (page_start_blocks, wide_blocks, clears) computed in what is now
layout_blocks but consumed in what is now build_with_floats, reading a
doc.page_starts that layout_blocks no longer receives. Carried it across the
split: layout_blocks takes page_starts, Flow carries the three vectors, and the
float-body call site passes an empty slice.

floats.rs took #135's Prep body builder over main's inline piece loop.

Vendor re-pins for this stage stay uncommitted by instruction; see
docs/evidence/integration-2026-09-13b/tools/repin.sh.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Conflicts: adapter.rs Item enum (shared brace) and span_of or-pattern; typeset.rs Context::new. Renumbered #138's incremental hash tags 10..13 to 12..15, which collided with main's Footnote/Kern. Repointed flashtex-tex-boxes at vendor/tex-boxes to match the vendored compiler and avoid a lockfile package collision.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Both sides restructured the same column placement in floatpage.rs: #154's footnote-aware \@makecol branch, main's column glue setting and two-column offset. Took #154's structure and re-applied main's glue_adj/floatsep/off inside both branches, checked against the three merge stages. paginate now carries first_colht as well as text_blocks/ins; #154's warning about twocolumn+floats was dropped because main's first_colht is the fix for it.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Two feature overlaps with #154 resolved in favour of the more general side: #151's for_text_size/math_fonts_at supersede #154's at_text_size (removed, with its duplicate field and math_box arity restored to #151's wrapper plus math_box_sized). break_pages_inserts and break_pages_tops remain separate page builders; footnotes win and the combination now warns. layout_blocks gained has_floats and Flow gained chapter_tops, as #135's split requires.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Took #152's list refactor (class_seps/apply_sep_keys/is_key_list, env_shape, three-tuple list_stack_at) over main's inline loop, but kept main's outer_parskip default and #135's hsize() for paragraphs inside float and minipage boxes; style.rs keeps #151's five headings and the class labelsep alongside #152's em_pt.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
#171 predates #151/#152 in every conflicting region; its three residual fixes were grafted onto the newer structure: parse_dimen_in/ec_em_ex threaded through #152's apply_sep_keys and list_labelsep, and the item-label protrusion kern plus label_recs bookkeeping added to #152's multi-word label box.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Kept #157's label-only empty line before a display together with main's stretched_left predisplaysize. The merge log also records why #145 was aborted rather than merged.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Clean merge; supplies MathBox::tag throughout. #157's new squeezed-display MathBox literal takes SourceTag::NONE, like #165's synthetic glue.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Kept main's per-glyph math paint (an inner xcolor range wins) and made MathRec::paint_of fall back to the formula's own colour instead of black, so #158's whole-formula colour is not dropped. ColorBox hash tag moved off Item::Kern's 11 to 16; adapter Item/BoxItem/LengthItem/ColorBoxItem and the four inline arms written out around git's shared braces.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
main added \caption[short]{..} to floats::Piece::Caption (latex.ltx
\@caption#1[#2]#3 writes #2 to the list of figures/tables) while #135's
Prep::parts predates the field. The float body sets only the caption that
appears on the page, so short is ignored there.

render-pipeline is now blocked by exactly one thing: the Inline::Graphic and
Inline::Transform arms owed by #170. The merge log records the worked-out
resolution for #170's display-wire half.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar and others added 11 commits September 13, 2026 12:43
Reconstructed, not textually merged: 38 conflicts across 11 files. Part 1 (display wire) follows the merge log: transforms joins main's display::Wire and the parallel *_caps family is dropped. Part 2 (float bodies, adapter/typeset arms) rebuilt from the three merge stages as #154 was, because #135 and #170 both rewrote that code. graphics_oracle 24/24 vs MacTeX; render-pipeline builds for the first time since stage 2.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…ge 2, and the NixOS font environment the gates require

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…fail on font diagnostics

Five corpus harnesses built their subprocess environment as

    env = dict(os.environ, FLASHTEX_FONT_DIRS=args.fonts, FLASHTEX_TFM_DIRS=args.fonts)

which is wrong twice over, and the two mistakes hid each other.

`dict(os.environ, KEY=value)` *overrides* KEY, so an operator who had
correctly exported FLASHTEX_TFM_DIRS at a real metrics tree had it silently
thrown away. The value it was replaced with is the *outline* directory
(apps/mac/Fonts), which contains .otf files and no .tfm at all -- and
`--fonts <dir>` cannot reach the bundled metrics either, because the
renderer's bundle-relative texmf roots are <exe>/../Resources/texmf and
<exe>/texmf, not <fontdir>/texmf. So the renderer found no metrics and fell
back to OpenType advances.

That fallback should have been loud. Instead the pass verdict never consulted
the diagnostics the harness had already collected, so a run whose geometry the
renderer itself describes as "not the reference geometry" scored as a pass or,
where positions did move, as a corpus failure. The same binary reads 0/59 or
59/59 on amsmath depending only on whether metrics resolve, and the bad run
still exits "recovered". Every lane on every machine measuring through these
harnesses was affected.

New shared module tools/visual-oracle/fontenv.py:

- render_env() treats --fonts/--tfm-dirs as defaults for an *unset* variable,
  never an override; an exported value always wins. Both accept colon lists.
- When the metrics dirs are neither exported nor passed, tfm_dirs_for() walks
  <fonts>/texmf for directories that actually hold .tfm files, so --fonts
  alone now works (amsmath 59/59 with no environment at all, where before it
  could not resolve a single metric).
- font_diagnostics() matches the codes that mean the geometry is not the
  reference one: font_unavailable, required_metrics_unavailable, tfm_missing,
  ec_metrics_unavailable, math_font_unavailable, math_metrics_opentype.
  Any hit fails the fixture and prints why, with the resolved directories.
  font_outline_substituted is advisory: it changes the outline, not the
  metrics these harnesses compare.
- Each harness now prints the resolved directories once, and records them in
  its --json summary, so a gate number carries its own provenance.

Measured on this branch (NixOS PC, TeX Live 2025, bundled symlink-free tree
plus the nix-store ec for ectt*; no committed oracle data regenerated):
amsmath 59/59, amssymb 38/39, tabular 59/59, xcolor 28/28,
display-placement 33/36 -- all with zero font diagnostics. Pointing the
metrics dirs at the outline dir, as the harness used to do to itself, now
fails every fixture with FONT-ENV FAILURE instead of scoring it.

This only affects the oracle subprocess environment. It deliberately does not
touch `cargo test`, which must run with no FLASHTEX_* exported at all --
render-pipeline has four tests that render a deliberate without-NewCM control.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Main moved 18 commits past this lane's base (bffd168): the `flashtex` CLI,
inline-math line breaking (a2f85bf, 2c37374), entry-document command order
before `\input` (c1e3bab), thebibliography label geometry (ea4f383) and
enumitem keys in a list's own optional argument (ec10bc6).

15 conflicts: 3 in typeset.rs, 12 in adapter.rs. None of the vendored crates
changed on main, so the stage-2 re-pin at b1f5791 is still exact.

typeset.rs

- `MathRec`'s new fields are additive on both sides: this lane's
  `span_paints` (#165/#158) and main's `inline_breaks`/`continues`. Both kept,
  in the struct and in the initialiser.
- The `AItem::Math` arm was a real disagreement: this lane calls
  `math_box_sized(.., size)` then paints one `math_run`; main calls
  `math_box` then `math_pieces`. `math_pieces` already falls back to exactly
  one `math_run(root, size, span)` when `inline_breaks` is empty, so main's
  loop subsumes this lane's body. Resolved to main's structure with this
  lane's size-aware constructor, which is the one thing main's `math_box`
  drops (it hard-codes `style.body_size_pt`, wrong where the surrounding run
  is not body size).
- `BoxKind::Glue { mu }` no longer matches: this lane's math-layout carries
  real TeX glue components (tex.web 716 `math_glue`). main's `math_pieces`
  predates them and derives stretch/shrink from `mu` by plain.tex's muskip
  values, which is what its pdflatex line-break oracle measured, so the
  derivation is kept unchanged and the new fields are ignored (`{ mu, .. }`).
  Replacing it with the real components is a follow-up, not a merge decision.

adapter.rs — both sides independently rewrote the list-separation model

- Both implemented the *same* enumitem feature: applying the keys of a list's
  own `\begin[<keys>]` after every `\setlist`. This lane factored it into
  `class_seps` + `apply_sep_keys` + `list_seps(.., options, ..)`; main
  inlined it in a `list_seps`/`list_seps_with` pair. This lane's is a
  superset -- it also resolves `em`/`ex` against the EC body font (93d5573)
  -- so its structure stands and main's two wrappers are dropped. With that,
  `list_seps_with` has no callers left.
- Main's `gap_has_list_end` reaches only the innermost closed list; this
  lane's `list_end_skip` walks every list closed in the gap with per-level
  `begin_vmode` and `\addvspace` max semantics. This lane's is kept.
- Main's thebibliography coverage is preserved instead through `LIST_ENVS`,
  which now takes the union of both sides: `itemize`, `enumerate`,
  `description` (this lane) and `thebibliography` (main). All four are
  `\list`s, so all four count for `\@listdepth`. `list_env_after_begin` and
  `list_end_adjust` now test against `LIST_ENVS` rather than repeating the
  names, so the three predicates cannot drift apart again.
- Main's special case for thebibliography's `\begin{thebibliography}{99}`
  argument is unnecessary here: `is_key_list("99")` is already false (no `=`,
  no enumitem key), so this lane's stack passes it through harmlessly.
- `\@nbitem` after a heading: took main's ea4f383, which is the deliberate
  newer decision -- a non-negative `\addvspace{\@outerparskip - \parskip}`
  adds to the heading's after-skip rather than maxing with it.
- `BodyCommand`: both sides add variants (`RunIn`/`SecNumDepth` here,
  `Input` on main); all kept.
- git had also misaligned a doc comment, leaving `body_commands`' docs
  stranded above `math_title_spans`. `math_title_spans` now carries its own,
  and `body_commands` gets main's (which documents `\input`/`\include`).

Gates after the merge (NixOS PC, TeX Live 2025, bundled symlink-free tree
plus the nix-store `ec` for `ectt*`; no committed oracle data regenerated).
Every number below was taken with the fixed harness, which fails on any font
diagnostic, and all of them report zero:

- amsmath 59/59, amssymb 38/39, tabular 59/59, xcolor 28/28,
  display-placement 33/36 (the 3 are real content differences, not fallback).
- HW1 and HW2: 3 pages each, 0 overfull, 0 errors, 0 diagnostics of any kind.
- real-world corpus 10/10 recovered (main's a2f85bf adds `inline-math`),
  every page count equal to its committed MacTeX reference, 0 font-fatal
  diagnostics. `font_outline_substituted` appears twice on article-twocolumn
  and once on input-bibliography: advisory only, outlines not metrics.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…d the real-world corpus fails on substituted metrics

Two more instances of the same bug the oracle harnesses had: a run that
measured nothing still reported success.

`cargo test` skipped most of the render-pipeline suite without saying so

`lm_available()` is guarded on ~110 times across 40 test files, always as
`if !lm_available() { eprintln!("skipping: ..."); return; }`. libtest captures
`eprintln!`, so with no Latin Modern resolvable those tests neither failed nor
printed anything -- they just did not run, and the suite reported ok. On this
machine the difference is stark: with no `FLASHTEX_*` set the suite reads
187 passed / 1 failed, and with fonts configured 177 passed / 11 failed. The
first number is not a better result, it is a hollow one.

Both definitions of `lm_available` (tests/common/mod.rs and tests/cli_e2e.rs,
which between them back every call site) now panic with an actionable message
instead of returning false. A genuinely fontless environment can still skip,
but has to ask: `FLASHTEX_ALLOW_FONTLESS_TESTS=1` restores the old behaviour.
CI already exports `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS`, so CI is
unaffected.

This is what made `cargo test --test incremental` -- the test that matters
most for cache work -- capable of passing without ever executing.

`tools/real-world-corpus/run.py`

- Font directories now go through `tools/visual-oracle/fontenv.py`, so an
  exported `FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` wins and, when the
  metrics directories are not given, they are derived by walking
  `<fonts>/texmf` rather than defaulting to the `lm` directory alone.
- Any font diagnostic is now reported per fixture, listed in its own section
  of the report, and makes the run exit non-zero. It previously printed
  `recovered pages=3` and exited 0 whether or not the renderer had
  substituted metrics -- so the corpus could agree with every committed page
  count while comparing geometry the reference never produced.

Verified on hw1: with the correct metrics environment the run reports 6
diagnostics, none font-fatal, and exits 0; with the metrics directory pointed
at the outline directory it reports 17, names all 15 font diagnostics, and
exits 1. Before this change both runs exited 0 and both said "recovered".

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
16 conflicts (adapter.rs 10, typeset.rs 5, incremental.rs 1). All but one were
misalignments: git shared common tails between this branch's additions and
#156's, so each side ended mid-construct and a plain "keep both" would not
compile. Rebuilt as complete separate pieces, as the merge log records for
#154 and #170.

- `Item` / `BoxRec` / `AItem` / `Paragraph`: both sides add variants and
  fields (#156's Glue, Rigid, Penalty, EmptyBox, Qed, Rules, LocalRule,
  `theorem_head`). Kept from both, with the enclosing enum, struct and match
  arms closed explicitly where git had shared a brace.

- **Incremental cache tags renumbered.** #156 numbered its five new
  `hash_items` arms 10-14, which this branch already uses for
  Footnote/TextBox/SetLength/LengthGlue/HSs. These tags key the incremental
  layout cache, so a collision serves one item's cached layout for another --
  the same hazard #170 hit, fixed the same way. #156's are now 19-23, the
  first free run. The two pre-existing collisions (Logo/Table at 9,
  Footnote/Rule at 10) are left for #182, which replaces the hand-numbering
  with `mem::discriminant`.

- `\qedhere` in a display: #156's block computes e/q before the display is
  placed, so it goes ahead of #157's fleqn/§1201 squeeze rather than the
  plain §1199 centring #156 carried with it. The symbol is built into a
  `NumberBox` (this branch's representation, which is where display_block
  reads the height and depth from) instead of #156's bare `(run, rec)` pair.

- `\addvspace`: kept main's `\@xaddvskip` rule (a negative amount after a
  non-negative `\lastskip` is added to it) together with #156's flex, so the
  surviving skip keeps its own stretch and shrink.

- `gap_has_list_end` came back. The origin/main merge had dropped it as
  having no caller; #156's theorem-skip code needs it. It is now written in
  terms of `LIST_ENVS` so it cannot drift from the other list predicates.

The one real disagreement, found by measurement, not by reading

#156 guards display continuation with `*prev_style == ParaStyle::Plain &&
prev_list.is_none()`. Merged as written, display-placement fell from 33/36 to
31/36: every new failure was a display inside a list or a quote, shifted 12
to 20 pt vertically (`20-enumerate-nested-display`, `29-quote-display`, and
`19-itemize-display` got worse).

Those two conjuncts are #156's older, coarser form of two conditions this
branch already states more precisely two lines above -- `same_list` (which
compares level and margins, not merely "no list") and `styled.unwrap_or_
default() == *prev_style`. Keeping them disabled display continuation inside
every list. Only `&& !theorem_head`, the genuinely new theorem condition, is
kept; display-placement is back to 33/36.

Gates (NixOS PC, TeX Live 2025, bundled tree plus nix-store `ec`; no
committed oracle data regenerated; zero font diagnostics on every run):

- amsmath 59/59, tabular 59/59, display-placement 33/36 -- all unchanged.
- theorem_oracle passes (#156's own corpus, MacTeX references).
- real-world 10/10 recovered, every page count still equal to its committed
  reference. lecture-notes drops from 7 diagnostics to 6: a theorem construct
  that was recovered is now supported.
- `cargo test --release` in render-pipeline: the same 11 known failures as
  before this merge, no more. Eight of them also fail on unmerged
  origin/main on this machine (the four NewCM controls, metrics_provenance,
  font_families_oracle, footnotes_oracle, page_frame); the other three
  (float_bodies, headings, list) have no baseline on a non-MacTeX host.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
5 conflicts (typeset.rs 4, lib.rs 1), plus the usual catching-up where #160
branched before several of this lane's changes.

- `Context`: #160's `multicol: multicol::State` field and initialiser join
  this branch's; in lib.rs `multicol::attach` is added to this branch's
  Context setup, which reads the original (unmasked) sources for float
  bodies and also installs the maths colours and graphics environment.

- `build_with_floats`: git had aligned #160's copy of the signature against
  this branch's `stretched_left`/`Flow`/`layout_blocks`, so the conflict
  looked like two functions claiming one body. Kept this branch's block and
  injected #160's `multicol::outer_doc` early return into the one real
  `build_with_floats` instead.

- Pagination: #160's `multicol::paginate` branch runs before the float
  branches; `images` stays mutable, which the float path needs.

`multicol.rs` predates three later changes and did not compile against them:

- `Block::Paragraph` gained `addvspace_flex` (#156) and `shape` (the list
  shape work). `split_paragraph` now carries both across the split -- the
  first half keeps the original's leading glue and shape, the second starts
  mid-paragraph with no leading glue but the same shape.
- `Doc` gained `default_color`, `math_colors` and `page_color` (#150/#158).
  The synthesised outer and per-column documents inherit the outer
  document's colour state rather than defaulting it, so a `multicols` body
  inside `\color` keeps its colour.
- `rec_span` did not cover `BoxRec::ColorBox`/`Graphic`/`Transform`/`Rules`.
  They are listed explicitly rather than wildcarded, so the next variant is
  caught here too instead of silently losing its span (which is what feeds
  the column-break search).

Gates (zero font diagnostics on every run): multicol_oracle passes,
theorem_oracle passes, amsmath 59/59, tabular 59/59, display-placement
33/36, real-world 10/10 recovered with every page count still equal to its
committed reference. `cargo test --release` in render-pipeline: the same 11
known failures, no more.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
The environment variables feed the general discovery list; the rooted
required-metrics reader only accepts a texmf tree relative to the executable
and refuses symlinked components. A correct environment is therefore not
always sufficient, and neither path announces itself -- which is why the gate
asserts on `font_diagnostics` being empty rather than on the configuration:
that catches whichever path failed.

Reported by the kernel-math lane, whose machine needs the exe-relative texmf
copy; on this one the env alone satisfied the reader (amsmath 59/59 with it,
a loud required_metrics_unavailable without). The note records both so the
next person does not conclude the environment is broken.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
No conflicts: #168 is an oracle and its fixtures, with no pipeline source
changes. The compiler side it needs (siunitx) came in with #159 in stage 1,
so the vendored compiler already satisfies it.

One change was needed. #168 carries a `PENDING` list of fixtures that must
*still* differ from pdfLaTeX, each naming the work it waits on, so the entry
is removed when that work lands. `39-heading.tex` waited on heading math --
"the pipeline sets a `$...$` formula in \section at the heading size but an
Inline::Math whose span starts at a command at the body size". That landed on
this branch with #151, so the fixture now matches and the test failed with
"39-heading.tex now matches: remove it from PENDING", exactly as designed.
Removed; the oracle passes.

siunitx is now 36/39 exact against the committed MacTeX references, up from
the 35/39 the PR reports. The three still pending are unrelated to siunitx
and name their own dependencies: 34-paragraph (math glue stretch in line
justification, PR #148), 37-ang-minutes (`\prime` drawn from Latin Modern
Math at 2.169pt where pdfLaTeX's cmsy7 prime is 2.306pt), 38-power-on-letter
(no upright fam0 Latin math character, so a power on a one-letter unit sits
0.78 bp high).

`cargo test --release` in render-pipeline: the same 11 known failures, no
more. Zero font diagnostics on every gate.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
15 conflicts (adapter.rs 12, typeset.rs 3), plus one API collision that git
did not flag at all.

#167 and #156 both extended `adapter::Item` with variants called `Glue` and
`Penalty`, with different shapes, and git auto-merged both definitions into
the enum without a conflict marker -- the build was the only thing that
noticed.

- `Penalty { penalty: i32 }` and `Penalty { value: i32 }` are the same thing
  under two field names; #167's emitters now use #156's, and its duplicate
  `hash_items` arm (tag 31) is gone, since #156's Penalty is already tag 21.
- `Glue` is not the same thing. #156's is `\thm@headsep`: points plus
  interword spaces of a given style. #167's is `\newblock`'s
  `\hskip .11em\@plus.33em\@minus.07em`: scaled by the font's quad, which is
  not known until typesetting. Neither can be expressed in the other, so
  #167's keeps its own variant as `Item::EmGlue`, with tag 30 (no collision
  with 19-23). It has exactly one emitter, so the rename is contained.

The rest, where #167 branched before this lane's list work:

- `ListGeom`: #167's `bibliography: Option<BibItemGeom>` joins this branch's
  `labelsep`/`label_bold`/`label_math`/`description`/`llap`, and the item
  builds one ListGeom carrying all of them. #167 called the three-argument
  `list_margins`; this branch's takes the twocolumn flag.
- `list_seps` had since been refactored into `class_seps` + `apply_sep_keys`
  + a version taking the list's own `\begin` options, so only #167's new
  `natbib_bibsep` is taken (natbib.sty 641-647: `\bibsep` is `\@listi`'s
  `\itemsep` plus `\parsep`), applied on top of the computed separations.
- The list-environment predicates already cover `thebibliography` through
  `LIST_ENVS`, so #167's three hand-written copies of the name list are
  dropped in favour of it.
- Item label layout: #167 still carried the `label_box` version that #152
  replaced with `label_words`/`label_bold`/`label_math`. Its bibliography
  branch is kept and its copy of the general branch dropped, so the two
  paths are `if bibliography { ... } else if label { ...this branch's... }`.
  The bibliography branch now passes the label's font to `label_box`, which
  gained those arguments with the list work.
- `theorem_items` (#156) still wraps the paragraph's items; #167's
  `bibliography_space_factors` (`\sfcode`\.\@m`, so the space after "Knuth."
  is an ordinary interword space) runs on the result.

Two markers came off, both because the work they waited on is already here

`bibliography_oracle` kept 14 fixtures behind `oracle_after_repin!`, ignored
with "needs the vendored compiler re-pinned to natbib citations and .bbl
input". Stage 1 re-pinned it, and all 14 pass, so the macro is gone and they
run. The oracle is 20 passing of 21; the one still ignored is the residual
#167 itself documents (`\Citet` upper-cases through natbib's `\NAT@Up`,
whose group ends between `V` and `an`, so pdfTeX sets no `Va` kern and the
pipeline does: 0.83 bp).

Gates (zero font diagnostics on every run): bibliography_oracle 20/21,
thebibliography_oracle passes, theorem_oracle, multicol_oracle and
siunitx_oracle pass, amsmath 59/59, tabular 59/59, display-placement 33/36,
real-world 10/10 recovered with every page count still equal to its
committed reference. `cargo test --release` in render-pipeline: the same 11
known failures, no more.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…#167 #168), and why #162 needs a lane

Records this session in the merge log: the oracle-harness bug that was
falsifying gate numbers for every lane, the parallel silent-skip in
`cargo test`, the four stage-3 merges with the techniques each needed, and
the measured reason #162 is a reconstruction rather than a merge.

Also records the control that separates pre-existing failures from this
session's work: eight of the eleven render-pipeline failures reproduce on
unmerged origin/main in this worktree, and the other three have no baseline
on a non-MacTeX host. page_frame_oracle, which the previous session's list
did not mention, is measured here as pre-existing.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded — the work is already on main.

Replacement: its queue landed as the integration/2026-09-13b..m merges; body says "Not ready to merge"

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/kabir-claude/integration-2026-09-13b 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