Repository navigation
tex-boxes (KC-107) - #93
Merged
Merged
Conversation
New crate crates/tex-boxes: scaled arithmetic and units (tex.web 99-109, 453-458), node model, badness/hpack/vpackage with exact over/underfull report text (108, 644-678), show_box/short_display (173-198), shipout positions with cur_g/cur_glue rounding and leaders (619-637), a primitive box engine (nest, save stack, box contexts, vtop, lastbox, unpackage, vcenter, single-line paragraph hook), and the latex.ltx box layer (makebox/framebox/fbox/raisebox/parbox/minipage/rule/hspace/vspace/ phantom/smash/laps/savebox/settodim/lrbox). Oracle generator, 151 fixtures and generated expected.txt; DSL-driven oracle test not yet run. Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-107, 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
- generate.py: expand nested <<N*...>> repeats innermost-first, keep a
space after \wd0 so DIM fields don't fuse, drop the \voidb@x error,
emit no DIAG lines for an empty transcript. pdflatex log now has no
TeX errors; axisheight regenerated (163840sp).
- DSL: nested repeats, simple {..} groups inside box bodies.
- engine: LaTeX 2021-06+ standard \everypar (indent box saved, empty
\par, \noindent restart with \parskip 0 / -\parskip under minipage)
which produces pdfTeX's doubled \parskip glue; term_offset for
write_out's print_nl.
- scaled: .3\baselineskip = 235932sp (round_decimals 19661).
Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-107 r2, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
… r2) write_out's print_nl breaks the line when the terminal is mid-line. In the oracle run that holds exactly when the previous fixture shipped a page (position pass); \showbox's error() ends with print_ln. Oracle now passes all 151 fixtures (dims, badness, showbox, diagnostics) and 92/92 positions. Glue ratio: storing glue_set as f32 breaks g_long_stretch, g_long_odd and g_long_vertical positions; f64 matches, so pdfTeX 1.40.29 uses double. Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-107 r2, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]>
… r2) Documents oracle coverage (151 fixtures exact; 92 positions), the glue ratio (double) and LaTeX para-hook findings, adoption for render-pipeline / compiler, and plug-in points for KC-101 tex-expansion (main-control mapping, register ownership), KC-102 microtype (LineBreaker, margin kerns; expansion hook is a stub) and KC-106 page-builder (PageBuilder, module de-duplication). Implementation-Agent: Claude Opus 5 (subagent kabir-claude KC-107 r2, mac-m5pro-kabir) Commit-Executor: Claude Code direct Git Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Sep 13, 2026
GoKubar
marked this pull request as ready for review
September 13, 2026 07:31
Member
|
Merged to main via integration/2026-09-13c (Commander orchestrator-jaysen-claude); hermetic library, tests green. |
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.
Supersedes #92. This PR resumes KC-107 (TeX boxes, rules, kerns, glue setting, and the LaTeX box commands). It only changes
crates/tex-boxes/**.Oracle: pdfTeX 1.40.29, TeX Live 2026
Missing }errors had two causes, both now fixed:<<N*…>>repeats were not expanded;\wd0\spacelet\spaceterminate the register number, so the DIM fields ran together.axisheighthas been regenerated and is 163840sp.cargo testpasses all 151/151 fixtures on each of:\badness;\showboxtext;Findings
glue_setas f32 breaksg_long_stretch,g_long_oddandg_long_vertical. With f64 all positions match.\everyparrestarts each paragraph with\noindent, with\parskipset to 0 (or-\parskipunder minipage). That puts a second\glue(\parskip)in the vertical list. This is modeled inBoxEngine::latex_para_hooksand fixed all 12 parbox/minipage\showboxdiffs..3\baselineskipgives 235932sp, via round_decimals 19661. The old unit test expected the wrong value.print_nl). This is modeled withterm_offset.CONTRACT.md
CharMetricsimplementation over TFM data, nodes as the layout IR, andship_outpositions in sp.BoxEngine, plus a recommendation on register and save-stack ownership.LineBreakerhook and margin kerns. The expansion hook is still a stub and its wiring is listed as work.PageBuilderhook, and a plan to remove the scaled/node/pack code duplicated in page-builder.Believed, not oracle-checked
\vadjustmigration;\vcenterin real math;🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu