Skip to content

render-pipeline: \@makecol packs the whole float+footnote column to \@colht (rebase of #192 onto current main) - #284

Closed
GoKubar wants to merge 1 commit into
rebase/154-footnotes-2from
rebase/192-float-notes-column
Closed

GoKubar wants to merge 1 commit into
rebase/154-footnotes-2from
rebase/192-float-notes-column

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Rebase of #192 onto current main, on top of #282. Supersedes #192 — its branch is untouched.

\@makecol packs the whole float + footnote column to \@colht, with a new pdflatex oracle for pages that carry both. Chain: #259 → #281 (compiler) → #282 (pipeline) → this.

All of #192 cherry-picked cleanly onto the rebased #282; the integration work was in #281 and #282.

Gates, measured on this tree

Control is main @ 5e6c65be with its committed vendor pin; this branch was measured with vendor/compiler locally re-pinned to #281 (not committed — vendor is the integration lane's).

gate control #282 this branch
float-notes oracle — (new here) — 10/10 exact, 0 diagnostics, every page count equal
footnotes oracle, gated and matching pdflatex 19 of 24 35 of 39 35 of 39
amsmath corpus 59/59 59/59 59/59
tabular corpus (oracle.py check) 59/59 59/59 59/59
font diagnostics over both corpora 0 0 0
crates/render-pipeline cargo test --release 213 passed, 0 failed 213, 0 failed 214 passed, 0 failed
real-world corpus, all 10 fixtures — identical to control identical to control
real-world corpus, HW1 / HW2 render 3 pages, 0 errors, 0 overfull — 3 / 3 pages, 0 errors, 0 overfull

The +1 test is this PR's float_notes_oracle. Every one of its ten fixtures matches pdflatex on page count, word origins (worst 0.005 bp) and painted rects, with zero diagnostics — including the two-column and \clearpage cases:

01-top-float-note        2/2 pages  508/508 words  worst 0.005bp  rects 2/2
02-bottom-float-note     2/2        581/581                       2/2
03-note-defers-float     3/3        790/790                       2/2
04-deferred-float-notes  3/3        860/860                       5/5
05-split-note-float      3/3      1437/1437                       3/3
06-float-page-note       3/3        714/714                       2/2
07-here-float-note       2/2        529/529                       2/2
08-twocolumn-float-note  2/2      1217/1217                       3/3
09-clearpage-note-float  3/3        322/322                       3/3
10-top-bottom-notes      2/2        736/736                       3/3

This is the PR that found the two bugs in #154 (the missing shrink allowance and the column packed to the wrong height), so it is also the check that they stayed fixed across the rebase.

No committed oracle data was regenerated.


Rebased and re-measured against main 5e6c65be. main moved 53 commits during this work, including changes to parser.rs, typeset.rs and mathtex.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

…ColhT

Extends draft #154 (`agent/kabir-claude/footnotes-2` @ 8217e98), which this
branch is based on and does not replace. #154 already carries the insertion
state through the float paginator; these are the two places its model and
pdflatex disagree, both found by ten new fixtures and both measured against
local pdflatex (TeX Live 2025).

1. **§1005's shrink allowance.** The box-overflow shortcut fired at
   `total > \pagegoal`, but TeX only calls a page hopeless once the excess
   passes what the glue can shrink. A body of `\parskip 0pt plus 1pt` has no
   shrink, so this never showed without insertions; `\skip\footins`'s
   `minus 2pt` (and an `h` float's `\intextsep`) supplies some, and the
   column lost the line TeX keeps. `06-float-page-note` was a body line short
   on page 1 with the `\footnoterule` 11.36 bp high.

2. **One `\vbox to\@colht`, not a body packed to `\@colroom`.** `\@makecol`
   attaches the notes to `\box\@cclv` first (the default
   `build/column/outputbox` plug is `footnotes-floats-legacy`) and only then
   `\@combinefloats` wraps the floats around that, so the column is

       top floats, \floatsep between them, \textfloatsep,
       the body, the \vfil \@outputbox@removebskip lifted off its end,
       \skip\footins, \footnoterule, the notes,
       \textfloatsep, the bottom floats, \vskip-\dp, \@textbottom

   `\@cflt` and `\@cflb` build plain `\vbox`es and only
   `\@make@normalcolbox` packs `\vbox to\@colht`, so a single glue set ratio
   covers the body's glue, `\skip\footins` (`plus 4pt minus 2pt`) and both
   `\textfloatsep`s (`plus 2pt minus 4pt`) together. Setting the body and
   notes to `\@colroom` on their own and then placing the bottom floats by a
   rule (flush at `\@colht` with a `\vfil` or `\flushbottom`, natural
   otherwise) gives `\skip\footins` no share of the slack: on
   `02-bottom-float-note` the rule, the notes and the bottom float sat
   1.276 bp high, and on `08-twocolumn-float-note` the second column's body
   sat 1.137 bp high from its fourth line down.

   `pagebuild::make_column` now takes the column's float material
   (`ColumnFloats`) and returns where it put each float box
   (`FloatPlacement`), which replaces the `keep_depth` flag and the
   `text_off` shifting in `floatpage`. `break_pages_inserts` passes an empty
   `ColumnFloats` and is unchanged.

`\@cflt`/`\@cflb`/`\@makecol`/`\@specialoutput` were read from latex.ltx as
shipped by TeX Live 2025, and the column order was confirmed against a
`\tracingoutput=1` dump of a page carrying a top float, a note and a bottom
float.

## Fixtures

Ten under `fixtures/float-notes/`, with `tools/float-notes-oracle/generate.py`
and the `float_notes_oracle` test: top float + note, bottom float + note
(notes above the float), a note that defers a float through `\@pageht`, three
competing `[t]` floats with notes, a note split under a top float, a `[p]`
float page with a note pending, an `h` float with notes, two-column,
`\clearpage` with a note and deferred floats, and a page with a top float, a
bottom float and three notes.

**reference_engine: pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025/nixos.org)**
— generated on this Linux host, recorded in each expected file's header.
Unlike the MacTeX 2026 data under `fixtures/footnotes/` and
`fixtures/floats/`, none of which is regenerated here.

Implementation-Agent: engine-engineer (kabir-claude float-notes lane)
Commit-Executor: engine-engineer (direct git, Cursor usage limit fallback)

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar
GoKubar force-pushed the rebase/192-float-notes-column branch from 1057da1 to 76f5ff6 Compare September 14, 2026 02:49
GoKubar added a commit that referenced this pull request Sep 15, 2026
…n_launch (#632)

The CI job `rust bridge (ubuntu-latest)` intermittently failed
compiler_process_success_and_timeout_leave_editor_unchanged with
"validation_launch: Could not launch the configured FlashTeX compiler"
on unrelated PRs (#264, #284, #491).

Root cause, reproduced locally: the classic fork/exec ETXTBSY race.
The bridge integration tests run in parallel threads, and each writes a
fresh fake-compiler script (fs::write + chmod) before validate() spawns
it. If another thread forks a child while the writer's fd is still open,
that child inherits the write fd until its own exec; exec'ing the script
in the meantime fails with os error 26 (Text file busy) even though the
writer already closed the file. A standalone stress harness reproduced
605 ETXTBSY failures in 24000 write+spawn cycles across 8 threads, and
the same fake()+validate() pattern against the unfixed crate reproduced
the exact CI error 8 times in 3200 cycles.

Fix in CompilerValidator::validate:
- retry the spawn (up to 20 x 10ms) when the error kind is
  ExecutableFileBusy - the condition is transient by definition and
  clears as soon as the interfering child execs;
- on real launch failure, include the executable path and the
  underlying io::Error in the validation_launch message instead of
  discarding it, so a future failure is diagnosable from the CI log.

The test itself is unchanged, so nothing it asserts is weakened.
Verified: full bridge suite green (170 passed, 0 failed, 2 ignored);
proposal_validation run 20x in a loop, 20/20 green; stress harness
0 failures in 3200 concurrent validate() cycles with the fix vs 8
without it.

Implementation-Agent: fable-bridge-flake
Commit-Executor: fable-bridge-flake (direct; Cursor usage limit)
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing: this landed on main as commit 84d104c ("render-pipeline: @makecol packs the whole float+footnote column to @ColhT" — same title and body as this PR's tip). Verified by content: all ten float-notes fixtures, the oracle test (crates/render-pipeline/tests/float_notes_oracle.rs) and the generator are byte-identical between this branch's tip (76f5ff6) and main; pagebuild.rs/floatpage.rs differ only by later work main added on top.

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the rebase/192-float-notes-column 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