Repository navigation
render-pipeline: multicol multicols/multicols* as multicol.sty (oracle 23/25 exact) - #160
Merged
Merged
Conversation
…(oracle 23/25 exact) typeset/multicol.rs runs TeX's page builder, \vsplit and \vbox to with multicol's output routines: \enough@room, the partial page, \set@mult@vsize, \multi@column@out, \speci@ls (\columnbreak), \balance@columns and \page@sofar with \columnseprule; multicols* and \raggedcolumns. The environment markup is blanked before parsing (like floats::mask), so no compiler change or vendor re-pin is needed. Documents without multicols keep pagebuild: HW1, HW2 and the real-world corpus are byte-identical. Implementation-Agent: Claude Opus 5 (subagent kabir-claude multicol, 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
This was referenced Sep 13, 2026
compiler: parse multicol multicols/multicols*, \columnbreak, \raggedcolumns (companion of #160)
#164
Merged
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
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
GoKubar
added a commit
that referenced
this pull request
Sep 13, 2026
…#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
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.
multicol:
multicols/multicols*in the render pipelineNew module
crates/render-pipeline/src/typeset/multicol.rs(non-vendored) sets multicol.sty 2025/10/21 v2.0b exactly, transcribed with line citations: TeX's page builder (§§980–1028,fire_upreturning material after the best break),\vsplit(vert_break,prune_page_top),\vbox toglue setting and badness, and multicol's output routines:\mult@@cols/\enough@room{\premulticols}(\addpenalty,\newpagewhen\pagegoal-\pagetotalis short), preface at full width,\addvspace\multicolsep, the\prevdepthgrid kern,\prepare@multicols(partial page saved by\eject,\@colroom,\set@mult@vsize,\hsize= (\linewidth+\columnsep)/n −\columnsepin sp,\tolerance 9999,\pretolerance -1,\emergencystretch4pt·n)\multi@column@out(full pages,\raggedcolumns\vfilmaxdepth, leftover back to the contributions),\speci@ls(\columnbreak[n]via\colbreak@box, end penalty −10006)\balance@columns(start height from (ht+dp)/n on the\baselineskipgrid, 1pt steps,columnbadness/finalcolumnbadness, natural-height retry,\multicolundershoot,\maxbalancingoverflow,unbalance,minrows)\page@sofar/\LR@column@boxes(columns in\hssgaps,\columnseprulecentred, depth ≥ dp ofp),\endmulticolswith\enough@room\postmulticols,multicols*\setlengthof\columnsep,\columnseprule,\multicolsep,\premulticols,\postmulticols;\setcounterofunbalance,columnbadness,finalcolumnbadness,minrows,collectmoreThe environment is found in the source and blanked before the compiler parses (same byte length,
\begin/\end→\par), exactly likefloats::mask, so this PR does not need the compiler PR or a vendor re-pin. Only documents containingmulticolstake the new path.Hooks in
typeset.rsare three lines (outer_docat the top ofbuild_with_floats,paginatein the pagination expression,shiftbeforepage_chrome), plus theContextfield and two lines inlib.rs.Diagnostics (code
multicol):May not work with the twocolumn option,Using 'n' columns doesn't seem a good idea…,Too many columns,Floats and marginpars not allowed inside 'multicols' environment!,\columnbreak outside multicols, nested multicols. Not implemented, with a diagnostic and main's layout kept: multicols in a two-column document, documents with floats or footnotes (\mult@footnotetext/\init@mult@footinsare not modelled), nested (boxed) multicols,\columnseprulecolor, RL columns.Oracle (pdflatex MacTeX 2026 is the oracle only; cargo never runs TeX)
tools/multicol-oracle/generate.pywrites 25 fixtures andfixtures/multicol/expected/*.txt(words and rules from pdflatex's content streams, reusing the page-frame reader).tests/multicol_oracle.rsgates words at 0.5bp, rules at 0.1bp, page count and multicol warnings.23/25 fixtures exact (12335/12672 words overall), gated: 2/3/4 columns, uneven content,
multicols*,\columnbreak(vertical and inline), preface, multi-page (2 and 3 columns),\columnseprule,\raggedcolumns, display inside, heading before/inside, two environments on one page,\premulticolsforcing a new page,\columnsep,\multicolsep, 12pt, short content, multicols after a page of text.Not gated:
11-itemize-inside(43/182: the list's\topsep/\partopsepreach the page builder without stretch, so the balanced column spreads glue 0.8bp differently; list-structure lane),14-twocolumn-document(not implemented, warning emitted).Gates
cargo test --releaseincrates/render-pipeline: all green (incl. 3 new unit tests and the oracle test).fixtures/real-worlddocuments: v2 display list and diagnostics byte-identical to origin/mainc40d2a6c(none uses multicol).Companion: compiler-only PR (multicols parsing,
\columnbreak/\raggedcolumnsarms, package inventory) — independent of this one.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu