Skip to content

render-pipeline: lay LaTeX box commands out with tex-boxes (oracle 36/37; needs compiler box-commands re-pin) - #138

Closed
GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/box-commands-pipeline
Closed

GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/box-commands-pipeline

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What

Lays out the compiler's box nodes (Inline::Box / SetLength / LengthGlue) with crates/tex-boxes (KC-107), which render-pipeline
now depends on by path like class-geometry.

  • Content is measured with the existing layout: an \hbox line (natural width, or to width for [s]/infinite glue with
    \bm@<pos>'s \hss in the same line), or \parbox/minipage paragraphs broken at the box width under \@parboxrestore
    (no indent, \normalbaselineskip, \sloppy).
  • Each measured line enters BoxEngine as an opaque box tagged with a whatsit; the latex.ltx macro runs on it
    (latex::fbox/framebox with \fboxsep/\fboxrule from \setlength, makebox alignment, raisebox height/depth overrides,
    parbox/minipage [t|c|b] via \vtop/\vcenter with the size's axis height, phantom, smash, lap, strut), and
    ship_out gives every line position and frame rule to the sp. The record reuses the table record for painting.
  • \settowidth & co. measure the content's hbox; lengths feed later box dimensions and \hspace{\len}.
  • Lines inside boxes re-set finite glue as hpack does (set_finite_glue_as_hpack): paragraph-layout includes
    \emergencystretch in the stretch it sets a loose line with, so \sloppy lines came out short of the measure.
  • Boxes, length assignments and length glue are never block-cached (absolute record indices, document state).

Depends

Needs the compiler PR (branch agent/kabir-claude/box-commands) and a vendor/compiler re-pin to its merge: against the currently
pinned vendor this branch does not build (Inline::Box etc. are missing). No vendor files are edited here.

Evidence (scratch copy: this branch + merged compiler swapped into vendor/compiler, main 85ec30c)

  • Oracle tools/box-oracle/oracle.py (pdflatex TeX Live 2026, oracle only) over fixtures/boxes (37 fixtures: every command with
    options, nesting, fbox around math, parbox/minipage alignment in a line, side-by-side minipages, saved box used twice,
    \settowidth driving \hspace, 10/11/12pt): 36/37 within 0.5 bp (words) and 0.1 bp (rules). Known difference:
    23-minipage-footnote (minipage footnotes not implemented). tests/box_oracle.rs replays the pinned references
    (cargo never runs TeX).
  • cargo test --release: 146 passed, 0 failed, 1 ignored.
  • HW1 / HW2: PDF and v2 display list byte-identical to main's build.
  • Real-world corpus (tools/real-world-corpus/run.sh --no-oracle, render producer): all 9 fixtures unchanged (status, pages,
    diagnostics).

🤖 Generated with Claude Code

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]>
GoKubar added a commit that referenced this pull request Sep 13, 2026
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
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing as abandoned (per backlog triage). This is the render-pipeline half of #137, pinned against #137's compiler vendor snapshot ("needs compiler box-commands re-pin"). With #137 closed as abandoned and two vendor re-pin generations landed since, this cannot be revived as-is. The tex-boxes layout work (oracle 36/37) stays on branch agent/kabir-claude/box-commands-pipeline for a future rebuild.

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the agent/kabir-claude/box-commands-pipeline 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