Repository navigation
render-pipeline: longtable, multirow, cmidrule trims and colortbl fills (rebase of #176 onto current main; + the gate that was not measuring them) - #251
Merged
Conversation
This was referenced Sep 14, 2026
Paused for usage. Converts the compiler's new table fields (PR #173) into the pipeline's TableItem: row colour/nobreak/kill, cell colour/multirow, column colour, cmidrule kerns, addlinespace, specialrule, morecmidrules, rule colours, longtable sections/captions/page breaks, and the `||` doublerulesep gap as its own material. layout(), typeset's table_box and the tests are not updated yet, so the crate does not compile against the re-pinned compiler; it needs vendor/compiler re-pinned to 484cb11 (#173). Implementation-Agent: Claude Opus 5 (subagent kabir-claude table packages, 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
…ement and colortbl fills (tabular oracle 59/59 + 18/20 new) Implements table.rs layout for the compiler fields of #173: kill rows, booktabs' \@BTrule/\@BTendrule/\@xcmidrule rule classes (specialrule and addlinespace as class 2, \cmidrulesep after \morecmidrules), explicit cmidrule kerns, \arrayrulecolor on every rule kind, \doublerulesepcolor gaps, and colortbl fills per \CT@@Do@color (cell over row over column, overhangs from \col@sep then column then row). typeset: multirow boxes per multirow.sty 168-201, fills painted under the entries, colours resolved by a minimal xcolor stand-in (tablecolor.rs) until #150 lands. The tabular oracle compares rule and fill colours; fixtures 60-79 with MacTeX 2026 references. Needs vendor/compiler re-pinned to #173. longtable follows. Implementation-Agent: Claude Opus 5 (subagent kabir-claude table packages, 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
…to the preamble (tabular oracle 78/79) colortbl's \@arrayrule and \@classvi add {\CT@arc@\vline} and {\CT@drsc@\vrule\@width\doublerulesep} with \@addtopreamble's \edef, so a mid-table \arrayrulecolor only recolours \hline/\cline (fixture 75). Implementation-Agent: Claude Opus 5 (subagent kabir-claude table packages, 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
…ensions Adapts the pipeline to the compiler's e84b988: `Entry::CMidRule`'s `kern_left`/`kern_right` and `Entry::AddLineSpace`'s `space` are `FontDimen { pt, em, ex }` rather than points, so booktabs' `\cmidrule(l{.5em}r{2ex})` and `\addlinespace[1ex]` are evaluated in the font in force at the rule (`FontDimen::resolve(m.em, m.ex)`) exactly as `\@setrulekerning` does, instead of at a fixed 10pt body size. Tabular oracle: 79/79 (was 78/79; fixture 60-cmidrule-kerns was the one failure and is the em trim this fixes). Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary) Commit-Executor: claude-opus-5 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…gion A longtable is no longer a box inside a paragraph. `Block::LongTable` contributes every row, rule row and head or foot box straight to the page's vertical list, as `\LT@array` does (longtable.sty 167-191), so the page builder can break between rows. - `longtable.rs`: `\LT@end@hd@ft` splits the entries into first head, head, foot, last foot and body; `\LT@get@widths` measures every chunk (`\kill` rows included) once and each chunk is then set against that one column geometry; `\tabskip\LTleft`/`\LTright` place the table (`\fill` on both sides by default, so centred; `[l]`/`[c]`/`[r]` and `\setlength` override it). - `table.rs` splits `layout` into `widths` + `layout_with(.., Options)` so chunks share a measurement, and grows longtable's `\hline`: `\LT@hline` is two `\multispan` leader rows `\LT@sep` apart, not one `\hrule` — coincident for `\hline`, `\doublerulesep` apart for `\hline\hline` (whose second `\hline` `\@gtempa` gobbles). - `pagebuild.rs`: `VBlock` gains `lineskip` (longtable sets it to 0 with `\baselineskip`, so rows abut and every gap between them is a legal breakpoint), `contributed` (lines built but held back) and `line_penalty`. A `Region` reduces `\pagegoal` by `\ht\LT@foot` and zeroes `\maxdepth` inside the table, ends a page broken there with `\LT@foot` and opens the next with `\LT@head` (`\LT@output`). - `\LTpre`/`\LTpost` are `\bigskipamount` unless `\setlength` changed them; `\caption` inside a longtable is reported, not yet set. Gates on this machine (TeX Live 2025 for new oracle runs; the committed refs are MacTeX and are reproduced here byte for byte): - Tabular oracle 79/79, unchanged from the previous commit. - HW1/HW2 rendering-v2 display lists byte-identical to the main build (bffd168), 0 errors, 0 overfull. - `cargo test --release` on crates/render-pipeline: all green (70 lib tests including 5 new longtable ones). Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary) Commit-Executor: claude-opus-5 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Two facts measured against pdflatex, not derived from the package source:
- `\prevdepth` after a longtable. `\LT@array` builds each chunk in a
`\vbox` and `\endlongtable`/`\LT@ntabularcr` `\unvbox` it into the
page's vertical list (longtable.sty 252, 322, 334); `\unvbox` never
sets `\prevdepth`, so only the boxes the package appends itself —
`\box\LT@firsthead` (239) and `\box\LT@lastfoot` (506) — do. A table
with no head and no foot leaves `\prevdepth` as the material before it
had it. `VBlock::depth_after` says which. Without this the paragraph
after a headless longtable sat 4.35pt (the `\@arstrutbox` depth) too
high.
- `\LT@start`'s `\maxdepth\z@` (230) does not reach the page. TeX froze
`page_max_depth` when the page's first box landed (§987) — before
`\LT@start` runs for a table that starts mid-page — and `\@makecol`
ends every page with `\global\maxdepth\@maxdepth`, so continuation
pages freeze the class value again. Instrumenting `\LT@output` on a
three-page longtable shows `maxdepth=0pt` only on the first call and
`6.0pt` after; honouring the zero lost one row per continuation page.
The page goal is still reduced by `\ht\LT@foot`, which is what decides
the break.
Corpus: 12 longtable fixtures (80-91) — plain, the four terminators,
two- and three-page breaks with a repeating head and foot, `[l]`/`[r]`,
`\setlength\LTleft`, `\LTpre`/`\LTpost`, `\kill`, `\\*`, booktabs rules
and a wrapping `p{}` column with vertical rules. Their references were
generated on this machine with **TeX Live 2025** (recorded in each
`reference_engine` field), not MacTeX; every committed MacTeX reference
(fixtures 1-79) was checked to be reproduced byte for byte by the local
pdflatex first, and none was rewritten. `oracle.py` now accepts a
fixture with more than one page, which a longtable needs.
Gates on this machine:
- Tabular oracle 91/91 (was 79/79 over 79 fixtures; the 12 new ones all
pass and none of the old ones changed).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- `tools/real-world-corpus/run.py --no-oracle --no-pixels`: same status
and page count on all 9 fixtures; one diagnostic fewer
(`packages booktabs are recognised but not implemented`, which the
#173 compiler now implements).
- `cargo test --release` on crates/render-pipeline: 30 test binaries,
all green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
`\LT@makecaption` (longtable.sty 475-485) is `\LT@mcol\LT@cols c{\hbox
to\z@{\hss \parbox[t]\LTcapwidth{...}\hss}}`: a row of the alignment like
any other, so it takes the `\@arstrut`, holding a zero-width box centred
on the table, so however wide the caption is it never widens a column.
Inside the parbox the whole caption goes on one centred line when it fits
(`\hbox to\hsize{\hfil\box\@tempboxa\hfil}`) and is set as a paragraph
otherwise, closed by `\endgraf\vskip\baselineskip`. `\parbox[t]` is a
`\vtop`, so `CaptionBox::height` is the first line's height and `depth`
is everything below it, the closing `\baselineskip` included.
`\caption` prefixes `\fnum@table` = `\tablename~\thetable` and a colon;
the tie is a non-breaking space and the space after the colon carries
TeX's space factor (`\sfcode`\:` = 2000), so it takes the face's
`\fontdimen7`. Without that the centred line was 1.3pt narrow and every
word of it sat 0.65bp off. `\caption*` drops the prefix. `\LTcapwidth`
is read from `\setlength`.
The caption of `\endhead` repeats at the top of every continuation page
with the rest of the head; `chunk_geometry` now renumbers a caption's
entry index back to the whole table's, without which the head's caption
was built but never painted.
Corpus: 6 more fixtures (92-97) — a short caption, one wrapping in the
4in parbox, `\caption*`, a first-head and an `\endhead` caption over a
page break, two longtables each stepping the `table` counter, and a
narrowed `\LTcapwidth`. References generated here with TeX Live 2025
(recorded in `reference_engine`); no committed MacTeX reference touched.
Gates on this machine:
- Tabular oracle 97/97 (18/18 longtable, fixtures 1-79 unchanged).
- amsmath corpus 59/59, identical to the main build (bffd168).
- HW1/HW2 rendering-v2 display lists byte-identical to the main build,
0 errors, 0 overfull.
- Real-world corpus (`--no-oracle --no-pixels`): same status and page
count on all 9 fixtures; one diagnostic fewer, the booktabs package
note the #173 compiler resolves.
- `cargo test --release` on crates/render-pipeline: 30 binaries green.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
longtable.sty 135-137 redefines `\newpage` as `\noalign{\break}`, an
eject penalty between rows; the compiler reports it as
`Entry::PageBreak`, which the pipeline now turns into a zero-extent glue
unit carrying `\penalty-\@M` before the next row. The region's foot and
head go in at that break like any other, so the page ends with
`\LT@foot` and the next opens with `\LT@head`.
Fixture 98 (TeX Live 2025 reference, generated here): a two-page
longtable forced by `\newpage` after the third row. Tabular oracle
98/98; HW1/HW2 byte-identical to the main build; `cargo test --release`
on crates/render-pipeline 171 passed, 0 failed.
Also verified on this machine, for the record: PR #173's compiler
(`e84b9885`) builds and its whole suite passes here — 399 tests, 0
failed — with the repository's protocol/, tests/tex-corpus, docs/ and
apps/mac/Fonts alongside it.
Implementation-Agent: claude-opus-5 (table-packages lane, nixos linux-primary)
Commit-Executor: claude-opus-5
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
… main Rebase repair for the table-packages branch (PR #176), whose base predates 190 commits of `main`. Three places where `main` moved underneath it: - `pagebuild::VBlock` gained `lineskip`/`contributed`/`line_penalty`/ `depth_after` on this branch, but `main` grew two new initialisers of its own in the meantime (`\colorbox`'s inner block and the empty positioned block). Both are ordinary boxes appended in vertical mode, so they take the neutral values `plain_vblock` uses: no forced `\lineskip`, every line contributed, no explicit `\penalty` nodes and `DepthAfter::LastLine`. - `display::Paint` gained `device` (the `display-list-v2-device-color` proposal: the operands pdfTeX actually writes). The colortbl rule paint has no device colour to give it, because `crate::tablecolor` has already flattened the colour to sRGB, so it is `None` with a comment naming the real fix -- resolving colortbl colours through the compiler's `crate::color` instead of the pipeline's stand-in. - `typeset::multicol::block_start` is new on `main` and did not know about `Block::LongTable`; a longtable is contributed straight to the vertical list, so its origin is the environment's own span. Tabular oracle corpus (`crates/compiler/tests/tabular_corpus/oracle.py`, pinned pdflatex refs, never regenerated) on this tree: 98/98, 0 font diagnostics. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…f it `tests/tabular_oracle.rs` carried a hand-written `PASSING` list naming 53 of the then 59 fixtures. Nothing extended it when this branch added 39 more, so `cargo test` went on measuring the same 53 while every longtable, multirow and colortbl fixture rode along unchecked -- and CI runs `cargo test`, never the corpus's own `oracle.py`, so "unchecked here" meant "unchecked anywhere". The names now come from the fixtures directory, so a fixture is measured as soon as it has a pinned reference. Two things had to become true for that to hold: - **Page counts.** The test asserted one page and read `pages[0]`. A longtable legitimately runs over several, so it now compares the page count against the reference's and walks every page. - **Rule merging on both sides.** It merged only the candidate's rules and compared them against the reference's raw ones. That happened to work while every reference rule was already minimal; a colortbl reference is not (pdfTeX paints a fill per row), so `71-rowcolor`, `76-doublerulesepcolor`, `78-xcolor-table` and `79-multirow-cellcolor` reported "4 rules vs reference 12" against a candidate that is in fact correct. Both sides are merged now, and -- like `oracle.py`'s `merge_rules` -- only rules of the same colour are joined, since a colortbl fill and the black rule abutting it are two different paints. Rule colour is compared too, to `oracle.py`'s 0.001. The two harnesses now report the same number on the same tree: 98/98 here and 98/98 from `python3 oracle.py check`, with no font diagnostics. The remaining difference is deliberate: `oracle.py` also aligns words into runs and checks math extension columns, which needs the reference's own word grouping. The six fixtures the old list excluded (`11-p-wrap`, `33-array-inline`, `39-booktabs-article`, `41-array-m`, `42-array-b`, `52-p-long-hline`) pass on current main; the list had simply gone stale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
force-pushed
the
rebase/176-table-packages-pipeline
branch
from
September 14, 2026 02:22
331a3b3 to
b5351c5
Compare
`crates/render-pipeline` builds against `vendor/compiler`, not `../compiler`, so the longtable/multirow/booktabs/colortbl types #250 added to `crates/compiler/src/tabular.rs` are invisible to the pipeline until the mirror is re-exported. This is the re-pin #250, #251 and #253 each say is "deliberately not in any of these PRs (vendor is the integration lane's)"; both pipeline halves were measured against exactly this re-pin, locally. It rides with #251 rather than landing as its own PR (as #274's re-pin did) because it is not standalone-safe in either direction, verified on this tree against main 5baa9e6: - re-pin without #251: `cargo build --release` in crates/render-pipeline fails, `error[E0027]: pattern does not mention fields kern_left, kern_right` -- #250 grew `Entry::CMidRule` and `table.rs::from_compiler` matches `ct::Entry` exhaustively with no wildcard arm; - #251 without the re-pin: the same build fails on the types it is written against (`ct::Longtable`, `ct::Multirow`, `ct::ColorFill`, `ct::Entry::SpecialRule`/`Section`/`PageBreak`/...), which is what #251's own `rust render-pipeline` and `rust flashtex-cli` CI jobs show. Either half alone leaves main red, so they land in one merge. `git archive 5baa9e6 crates/compiler`, byte-identical to the real crate apart from `PIN` (verified by re-archiving the previous pin 2495ebf and diffing against the committed mirror: only `PIN` differed). Implementation-Agent: integration lane (linux-primary, NixOS) Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git under the observed-Cursor-limit user override) 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
siunitx loads array.sty (siunitx.sty 9321), so it joins ARRAY_PACKAGES.
With siunitx loaded, S[<options>] and s[<options>] are read as one column
specification item instead of one illegal character per letter. Both are
centred columns; plain numeric S entries are typeset through \num with the
column's options (table-* layout keys dropped) and plain s entries through
\unit. Braced, blank and command-bearing entries stay text, as siunitx sets
{...} entries. Decimal-marker alignment is not implemented and is reported
once per specification.
Clears every column-specification error in fixtures/real-world
siunitx-tables and lab-report. Syncs the Mac supported-latex.json copy,
which was stale since #251.
Refs #324
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
siunitx loads array.sty (siunitx.sty 9321), so it joins ARRAY_PACKAGES.
With siunitx loaded, S[<options>] and s[<options>] are read as one column
specification item instead of one illegal character per letter. Both are
centred columns; plain numeric S entries are typeset through \num with the
column's options (table-* layout keys dropped) and plain s entries through
\unit. Braced, blank and command-bearing entries stay text, as siunitx sets
{...} entries. Decimal-marker alignment is not implemented and is reported
once per specification.
Clears every column-specification error in fixtures/real-world
siunitx-tables and lab-report. Syncs the Mac supported-latex.json copy,
which was stale since #251.
Refs #324
Implementation-Agent: daniel-vpclaude (Claude Code, Claude Pro)
Commit-Executor: daniel-vpclaude (direct git)
Claude-Session: https://claude.ai/code/session_012iWhnaQddU1UTMh6ZssGBJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of #176 (
agent/kabir-claude/table-packages) onto currentmain, plus a repair to the gate that was supposed to be guarding it. Supersedes #176 — its branch is untouched. Compiler half: #250 (rebase of #173).Where
mainhad moved underneath itpagebuild::VBlockgainslineskip/contributed/line_penalty/depth_afteron this branch, butmaingrew two new initialisers of its own meanwhile (\colorbox's inner block, and the empty positioned block). Both are ordinary boxes appended in vertical mode, so they takeplain_vblock's neutral values.display::Paintgaineddevice(thedisplay-list-v2-device-colorproposal). The colortbl rule paint has no device colour to give it:crate::tablecolorhas already flattened the colour to sRGB, so it isNonewith a comment naming the real fix. See "Follow-up" below — this is the interesting one.typeset::multicol::block_startis new onmainand had noBlock::LongTablearm.One cherry-pick conflict, in
tabular_corpus/oracle.py:mainadded the zero-font-diagnostics assertion, this branch relaxedlen(ref) == len(cand) == 1to>= 1for multi-page longtables. Both kept.The gate was not measuring this feature
tests/tabular_oracle.rshad a hand-writtenPASSINGlist naming 53 of the then 59 fixtures. Nothing extended it when this branch added 39 more, socargo testkept measuring the same 53 — and CI runscargo test, never the corpus'soracle.py, so every longtable, multirow and colortbl fixture would have landed unguarded. The98/98in #176's description came fromoracle.pyrun by hand.The last commit here fixes that: fixture names come from the directory, page counts are compared instead of asserting one page, and rules are merged on both sides (only within a colour, as
oracle.pydoes) with rule colour compared to 0.001. Merging only the candidate happened to work while every reference rule was already minimal; a colortbl reference is not, so71-rowcolor,76-doublerulesepcolor,78-xcolor-tableand79-multirow-cellcolorreported "4 rules vs reference 12" against a candidate that is in fact correct.The two harnesses now report the same number on the same tree.
Gates, measured on this tree
Control is
main@5e6c65bewith its own committed vendor pin; this branch was measured withvendor/compilerlocally re-pinned to #250 (not committed — vendor is the integration lane's).oracle.py check)cargo test --test tabular_oracle)crates/render-pipelinecargo test --releaseThe one corpus difference is
article-twocolumnlosingpackages booktabs are recognised but not implemented, which is the point of the change.Note the control is 59/59, not the "59/79" in #176's description —
mainalready passes all 59 of its fixtures, and the six the stalePASSINGlist excluded (11-p-wrap,33-array-inline,39-booktabs-article,41-array-m,42-array-b,52-p-long-hline) pass too.Follow-up, not done here
src/tablecolor.rssays in its own module comment that it is "a minimal stand-in for the colour model of PR #150/#158 … Replace with the #150 model once it is merged." #150 is merged —mainhascrate::color,DeviceColorandparser/colors.rs. So this file is now a ~400-line duplicate of a model the compiler already has, and because it flattens to sRGB it is also why the colortblPaint.deviceabove isNone, i.e. colortbl fills are not written in their own colour model the way pdfTeX writes them. Doing it properly means resolvingColorSpecthroughcrate::colorin the compiler and deletingtablecolor.rs; that changes the compiler's public table types, so it belongs in its own PR on top of #250 rather than inside a rebase.Rebased and re-measured against
main5e6c65be.mainmoved 53 commits during this work, including changes toparser.rs,typeset.rsandmathtex.rs; every number in this PR is from the final tree, not the earlier base.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu