Skip to content

compiler: kernel text symbols, \TeX/\LaTeX logos, \rule and text-mode kerns (oracle-exact) - #128

Merged
jay3332 merged 4 commits into
mainfrom
agent/kabir-claude/text-logos-rule-symbols
Sep 13, 2026
Merged

jay3332 merged 4 commits into
mainfrom
agent/kabir-claude/text-logos-rule-symbols

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Compiler-only PR (no vendor/ changes). The render-pipeline mapping is the stacked PR on agent/kabir-claude/text-logos-rule-symbols-pipeline; it builds after the Commander re-pins vendor/compiler.

What

  • Kernel text symbols: \AA \aa \AE \ae \OE \oe \O \o \L \l \ss \SS \TH \th \DH \dh \DJ \dj \NG \ng \IJ \ij \i \j \S \P \dag \ddag \copyright \pounds \dots \ldots and their \text… forms, plus the ASCII symbols \textbackslash \textasciitilde \textasciicircum \textunderscore \textbar \textless \textgreater \textbraceleft \textbraceright. Availability per font encoding (OT1 default, \usepackage[T1]{fontenc} tracked) comes from flashtex_tex_text_encoding::encoding::resolve. The character comes from the *.dfu declarations, so \TH in OT1 is the exact pdfLaTeX error Command \TH unavailable in encoding OT1. and \SS in OT1 is SS.
  • \TeX, \LaTeX, \LaTeXe: a new Inline::Logo. text_builtins::layout_logo transcribes latex.ltx 9447-9460 (kerns in em, E lowered .5ex, the \sf@size A raised to the T height, \LaTeXe's text-style ε subscript) against metrics the layout supplies.
  • \rule[raise]{w}{h}: Inline::Rule in text and Nucleus::Rule in math (latex.ltx 16359-16367). Dimensions use tex-boxes' exact scan_dimen arithmetic: pt/in/cm/mm/bp/dd/cc/pc/sp, em, ex, \textwidth, \linewidth, \columnwidth.
  • Text-mode spacing (from the tabular-fidelity finding): \, \! \: \> \; and \thinspace \negthinspace \medspace \negmedspace \thickspace \negthickspace \enspace are Inline::Kern (latex.ltx 9432, 15669-15681). Before this they were literal commas and exclamation marks. \enskip is .5em glue. \quad/\qquad, \ and ~ were already emitted and are now oracle-checked.
  • All of this lives in one clearly marked shim, src/text_builtins.rs, which the full tex-text-encoding/tex-boxes adoption deletes. The supported inventory and docs/user/compiler.md are regenerated.

Oracle (MacTeX pdflatex, oracle only)

tests/oracle/text_builtins/generate.py records \showbox node trees for 141 fixtures, and expected.json plus 28 TL2026 TFMs are committed. The fixtures cover:

  • logos at 10/11/12pt, in \textbf/\textsf/\textit/\Large/\small, OT1 and T1;
  • \rule variants: raise ±, zero-width strut, em/ex, negative width, cv's \rule{\textwidth}{0.6pt}, .5\linewidth, math;
  • every kern and glue command above;
  • every symbol in OT1 and T1.

tests/text_builtins_oracle.rs (5 tests) compares glyph x/y, box sizes, rule edges and kerns to the scaled point, using the same TFMs. Symbols additionally check that the compiler's character typesets to the same nodes as the command. Cargo never runs TeX.

Gates

  • cargo test --release (crates/compiler): green, including the supported_latex drift gate.
  • Real-world corpus, measured with a scratch pipeline that has this compiler swapped into vendor (uncommitted):
    • "not supported" diagnostics for these commands: 58 → 0 across all 9 fixtures, both producers;
    • no page count changed;
    • no render diagnostic added;
    • HW1/HW2 render display lists byte-identical;
    • cv now paints its 5 section rules (0.6pt × 6.9in) instead of printing "0.6pt".
  • The compiler producer (runtime-v1) gains 2 honest export warnings: the rule stand-in glyph, and ı having no base-14 glyph.

Notes

  • Inline::Logo/Rule/Kern and Nucleus::Rule are new variants the pipeline must match, and the compiler now path-depends on tex-text-encoding and tex-boxes. The re-pin must add vendor/tex-text-encoding and vendor/tex-boxes.
  • The compiler's own v1 layout sets logos with Core 14 metrics (cap height for glyph heights), so it is an approximation. Exact positions come from TFM-backed layouts.
  • Merged origin/main 1d4604d. Conflicts were in math.rs/incremental.rs (kept ExtArrow, text_space, Space { .. }) and in generated files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

GoKubar and others added 4 commits September 13, 2026 06:20
…(WIP)

Kernel text symbols (\AA \ss \S \copyright ...) resolve per font
encoding through tex-text-encoding; \TeX/\LaTeX/\LaTeXe carry the
latex.ltx construction as Inline::Logo; \rule is Inline::Rule with
scan_dimen arithmetic from tex-boxes; \, \! \: \> \; \thinspace
\enspace ... are Inline::Kern. Supported inventory regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude text logos rule symbols, 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
\textbackslash \textasciitilde \textasciicircum \textunderscore
\textbar \textless \textgreater \textbraceleft \textbraceright resolve
per encoding through tex-text-encoding's kernel defaults; varepsilon_list
gives layouts \LaTeXe's subscript body.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude text logos rule symbols, 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
Nucleus::Rule lays out latex.ltx's \rule box in formulas. The oracle
(tests/oracle/text_builtins: generate.py, expected.json, 28 TL2026 TFMs)
records \showbox node trees from MacTeX pdflatex for 141 fixtures: logos
at 10/11/12pt, bold/sans/italic/\Large/\small, OT1 and T1; \rule
variants incl. cv's \rule{\textwidth}{0.6pt}, struts, negative widths,
math; text kerns/glue; every text symbol in OT1 and T1. Cargo tests
compare to the scaled point and never run TeX.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude text logos rule symbols, 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
…ymbols

Conflicts resolved in crates/compiler/src/{incremental,math}.rs (kept main's
Nucleus::Space { .. }, text_space and ExtArrow alongside Nucleus::Rule and
varepsilon_list); generated supported inventory and docs regenerated.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude text logos rule symbols, 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
@jay3332
jay3332 merged commit 940e845 into main Sep 13, 2026
11 of 18 checks passed
@jay3332

jay3332 commented Sep 13, 2026

Copy link
Copy Markdown
Member

Merged to main via integration/2026-09-13j (Commander).

@GoKubar
GoKubar deleted the agent/kabir-claude/text-logos-rule-symbols branch September 13, 2026 18:12
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.

2 participants