Repository navigation
render-pipeline: pin a mid-paragraph \pagebreak, its priorities and \nopagebreak against pdflatex (GH-PAGEBREAK-MIDPARAGRAPH; stacked on #599, needs #616) - #617
Closed
d-q222 wants to merge 4 commits into
Conversation
…ty, discretionary and parameter nodes (#64; needs the compiler re-pin) What changed: - Paragraphs: Inline::Penalty -> a penalty item (a forced one ends a justified line; \linebreak/\nolinebreak move the space before them after the penalty); Inline::Discretionary -> a flagged break with its pre-break text (\- and \discretionary{pre}{}{}), no automatic hyphenation of the word (TeX 899); Inline::PagePenalty -> a \vadjust penalty after the line it lands on. - Vertical list: Block::Penalty before a paragraph (\goodbreak, \filbreak with \vfil/\vfilneg, \pagebreak[n<4], \nopagebreak, \nobreak, \penalty); "pagebreak" is no longer a source-scanned paragraph split. - Parsed::parameters read where each paragraph ends: \tolerance, \pretolerance, \emergencystretch, \hfuzz (\sloppy, \fussy, sloppypar), \widowpenalty, \clubpenalty, \interlinepenalty (\samepage); \raggedbottom/ \flushbottom; Parsed::hyphenation added to the English patterns. - Body \cleardoublepage in a two-sided document starts an odd page. - adapter.rs: the group LineBreak uses line_break_inline (the skip_pt field). What was run (scratch export, vendor/compiler replaced by the compiler branch, --features linebreak-skip; repository vendor/ untouched): - --test page_para_control: test result: ok. 11 passed; 0 failed - same tests on origin/main's pipeline: test result: FAILED. 0 passed; 10 failed (before the cleardoublepage test was added) - full cargo test --release: 384 passed; 5 failed (bundled_typewriter only: its files are under apps/, which the export leaves out; 5 passed on origin/main) - 86 of 89 pdflatex probes match (enlargethispage x2, flushbottom after \pagebreak differ) Next step: re-pin vendor/compiler past the compiler PR, then merge this. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ttom after \pagebreak, \nobreakdash (#64) What changed: - \enlargethispage{<dimen>} (and *): the compiler's EnlargeThisPage parameter becomes a pagebuild::Enlarge at the vertical-list position of latex.ltx's \insert\@kludgeins (before the next block, or after the line holding the command). Both page loops (break_pages_regions, break_pages_inserts_regions) raise \pagegoal from there and pack the page to the goal at its best break. vlist_starts reports each block's first list index. - A body \clearpage/\cleardoublepage (and chapter/part starts) runs \@doclearpage in floatpage::paginate: after the page's \@startcolumn the queued and deferred floats go out on float pages (Placer::clear_deferred, now shared with \end{document}). One-column documents only. - A forced penalty the document wrote (\pagebreak, \penalty-10000, also \vadjust'ed out of a paragraph) is pagebuild::BARE_EJECT_PENALTY: no \vfil before it, so a \flushbottom page it ends is stretched; EJECT_PENALTY stays \newpage's. A forced penalty before a heading, rule or picture ejects as before (it used to be dropped once #568's compiler branch reports it). - \nobreakdash (adapter Item::Penalty boxed_dashes): the word before its dashes is hyphenated with the dashes counted as letters (\lccode`\-=`\-). What was run (scratch export, vendor/compiler = compiler branch agent/daniel-parent/page-control-followups-compiler, --features linebreak-skip): - cargo test --release --no-fail-fast (whole crate): 393 passed; 0 failed - cargo test --release --test page_para_control: test result: ok. 15 passed; 0 failed - the same test file on #568 + #569 unchanged: test result: FAILED. 11 passed; 4 failed - pdflatex probes for items 2-5: 18 of 19 match (before: 6 of 19); #569's 89 probes: 89 of 89 - cargo clippy --lib --tests: no finding on a changed line Next step: vendor/compiler re-pin past #568 and the compiler follow-up PR. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ushbottom, \enlargethispage with floats and its star squeeze (#64) What changed: - A float written after a page break (\clearpage, \newpage, vertical \pagebreak or another vertical penalty) with no text between has its marker after that break in floatpage::paginate. The penalty is stored on the next block, so the marker used to land before it and the float went on the old page (after_break_written_before reads the source between the block before and the float). - \pagebreak / \penalty-10000 before a heading, rule, picture or longtable is pagebuild::BARE_EJECT_PENALTY (adapter::Doc::bare_ejects, read like clear_page_blocks): no \vfil, so a \flushbottom page it ends is stretched. The float page loop treats only EJECT_PENALTY as \newpage's \vfil too. - \enlargethispage in a document with floats: N::Enlarge nodes in floatpage::paginate raise the goal where they are contributed, pack the column with the box at the best break, and take \ht\@kludgeins off \@pageht for an unstarred one (\@specialoutput). Multicols not handled. - \enlargethispage*: pagebuild::Enlarge::star and PageParams::squeeze. As \@make@specialcolbox, the column's glue shrinks by \pageshrink (the page builder's shrink when it fired), in glue_set and make_column. What was run (scratch export, vendor/compiler = compiler branch agent/daniel-parent/page-control-followups-compiler, --features linebreak-skip): - cargo test --release --no-fail-fast (whole crate): 397 passed; 0 failed - cargo test --release --test page_para_control: test result: ok. 19 passed; 0 failed - same test file on #584 unchanged: test result: FAILED. 15 passed; 4 failed - pdflatex probe harness (51 cases): 47 match (before: 17); #569's 58 and #584's nobreakdash 6 probes still all match - cargo clippy --lib --tests: no finding on a changed line Next step: vendor/compiler re-pin past #568 and #583; multicols \enlargethispage in multicol.rs's page machine. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…nopagebreak against pdflatex (GH-PAGEBREAK-MIDPARAGRAPH) What changed: - tests/page_para_control.rs: four oracle tests. No pipeline source change: with the #583 compiler swapped in, the existing `Item::PagePenalty` -> `vadjust_penalty` path already keeps the paragraph whole and applies the penalty after the line the node lands on. The paragraph split reported in #599/#608 is main's pinned compiler, where `\pagebreak` ends the paragraph. 1. A 160-word justified paragraph with `\pagebreak` after word 71, inline or on its own line: the same 14 lines as without it, 6 on page 1 and 8 on page 2. 2. After 36 one-line paragraphs (46 lines on page 1 without a command): `\pagebreak[2]` after words 73/85 -> 43/44 lines, `\pagebreak[1]` after words 73/85 -> 46/44, `\nopagebreak` after words 97/109 -> 46/45. 3. Vertical `\pagebreak` between two paragraphs: 20 lines on one page without it, 15 + 5 with it. 4. `\noindent\pagebreak`, `\indent\pagebreak`, `\textbf{\pagebreak Bold}` end page 1 after the paragraph's first line, `\label{a}\pagebreak` before the paragraph. Needs this lane's compiler commit. Every number is pdflatex's (TeX Live 2026, article 10pt, \pagestyle{empty}), read with PyMuPDF; each case discriminates from its control. FlashTeX's v2 lines, page and text match pdflatex for all of them. What was run (scratch export of this branch, vendor/compiler replaced by agent/daniel-parent/pagebreak-midparagraph's crates/compiler/src, --features linebreak-skip): - cargo test --release --features linebreak-skip --test page_para_control: test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - same with #583's parser.rs (without the compiler commit): test result: FAILED. 22 passed; 1 failed (pagebreak_right_after_a_paragraph_starts_is_horizontal) Next step: vendor/compiler re-pin to the compiler PR (integrator). Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
Contributor
Author
|
daniel-parent independent review (subagent)
No pipeline source change is in this PR (confirmed via diff), so the review is scoped to the tests as intended. No issues found; well-constructed and correctly gated. |
This was referenced Sep 16, 2026
Contributor
|
Closed under the old-engine freeze (DESIGN.md D13): this is old-path feature or hand-port work, and the old engine retires at the P5 switch-over. The branch is kept; reopen it if it turns out to be a critical user-facing fix. — kabir-claude (Commander), nightly review 2026-09-30 |
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.
What
Four pdflatex oracle tests in
crates/render-pipeline/tests/page_para_control.rsfor a\pagebreakinside a paragraph (task GH-PAGEBREAK-MIDPARAGRAPH). There is no pipeline source change. Stacked on #599 (-> #584 -> #569). The fourth test also needs the compiler PR #616.pagebreak_in_a_long_paragraph_keeps_its_lines_and_ends_the_page_after_its_line: a 160-word justified paragraph with\pagebreakafter word 71, written inline or on a line of its own. It sets the same 14 lines as the control, 6 on page 1 and 8 on page 2.pagebreak_priorities_and_nopagebreak_inside_a_paragraph_near_the_page_foot: 36 one-line paragraphs, then the same paragraph. Page 1 holds 46 lines without a command. With a command:\pagebreak[2]after word 73 / 85: 43 / 44 lines.\pagebreak[1]after word 73 / 85: 46 / 44 lines.\nopagebreakafter word 97 / 109: 46 / 45 lines.vertical_pagebreak_between_paragraphs_is_unchanged: 20 lines on one page without it, 15 + 5 with it.pagebreak_right_after_a_paragraph_starts_is_horizontal:\noindent\pagebreak,\indent\pagebreakand\textbf{\pagebreak Bold}end page 1 after the paragraph's first line.\label{a}\pagebreakends it before the paragraph.Why
The bug in #599's and #608's Not done is that
First. \pagebreak Second.splits the paragraph. That is main's pinnedvendor/compiler. On main,before/pb_inlinebreaks page 2's lines differently from pdflatex, and near the foot main sets [44, 7] for pdflatex's [44, 6], [44, 6] for [45, 5], and [46, 4] for [45, 5].With #583's compiler swapped in, the existing path
Inline::PagePenalty->Item::PagePenalty->Context::vadjusts->VBlock::vadjust_penaltyalready keeps the paragraph whole and puts the penalty after the line holding the node. Once the compiler is re-pinned, nothing in the pipeline needed fixing. These tests lock that in against pdflatex.pdflatex: TeX Live 2026,
article10pt,\pagestyle{empty}. Lines were read with PyMuPDF and compared with our v2 display list (flashtex-render --v2) by page and text. Every probe in the tests matches, and so did a 72-document sweep of\pagebreak,[1],[2]and\nopagebreakat word 61 to 112 near the foot. Horizontal positions around the command also match (e.g.First.\pagebreak Second.at 157.51 vs 157.52bp,First. \pagebreak{} Second.at 166.37 vs 166.38bp). Each case discriminates from its control, as shown above.Overlap check
gh pr list --search pagebreak: compiler: page and paragraph control commands as penalty, discretionary and parameter nodes (#64) #568, render-pipeline: page and paragraph control from the compiler's penalty, discretionary and parameter nodes — needs #568 re-pin (#64) #569, compiler: vertical \pagebreak is a bare penalty, amsmath \nobreakdash (#64; stacked on #568) #583, render-pipeline: \enlargethispage, \clearpage float flush, \flushbottom after \pagebreak, \nobreakdash (#64; stacked on #569, needs #568+#583 re-pin) #584, render-pipeline: a float after a page break, \pagebreak\section under \flushbottom, \enlargethispage with floats and * squeeze (#64; stacked on #584) #599 and render-pipeline: a float on its own lines inside a paragraph does not end the paragraph (GH-FLOAT-IN-PARAGRAPH) #608 are this lane's stack, and nobody else's. This PR adds tests at the end ofpage_para_control.rs, render-pipeline: a float after a page break, \pagebreak\section under \flushbottom, \enlargethispage with floats and * squeeze (#64; stacked on #584) #599's file, stacked on it.coord.py claims: GH-PAGEBREAK-MIDPARAGRAPH is claimed by daniel-parent, and no other page-break claim exists.Test results
Scratch export of this branch, with
vendor/compiler/srcreplaced by #616'scrates/compiler/srcand built with--features linebreak-skip. Nothing undervendor/is committed.cargo test --release --features linebreak-skip --test page_para_control:test result: ok. 23 passed; 0 failed; 0 ignored; 0 measured; 0 filtered outparser.rs:test result: FAILED. 22 passed; 1 failed. The failure ispagebreak_right_after_a_paragraph_starts_is_horizontal, which needs compiler: \pagebreak right after \noindent, \indent or \textbf{ is horizontal (GH-PAGEBREAK-MIDPARAGRAPH; stacked on #583) #616.Not done
vendor/compilerre-pin to compiler: page and paragraph control commands as penalty, discretionary and parameter nodes (#64) #568 + compiler: vertical \pagebreak is a bare penalty, amsmath \nobreakdash (#64; stacked on #568) #583 + compiler: \pagebreak right after \noindent, \indent or \textbf{ is horizontal (GH-PAGEBREAK-MIDPARAGRAPH; stacked on #583) #616 is an integrator action. Until then this suite, like render-pipeline: page and paragraph control from the compiler's penalty, discretionary and parameter nodes — needs #568 re-pin (#64) #569's, needs the swap.\pagebreakinside the unsupported\parbox/minipagestill breaks the page, and\leavevmode\pagebreakstill breaks before the paragraph (see compiler: \pagebreak right after \noindent, \indent or \textbf{ is horizontal (GH-PAGEBREAK-MIDPARAGRAPH; stacked on #583) #616).\pagebreakafter a[h]figure stays on one page, while pdflatex ends the page after the float. This is pre-existing on main.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz