Repository navigation
math-layout: box the cmsy square relations from their real TFM slots ("74-"77) - #211
Conversation
…("74-"77)
`cm::symbol_slot` had no entry for U+2291-U+2294, so `\sqsubseteq`,
`\sqsupseteq`, `\sqcup` and `\sqcap` could not be boxed from the cmsy TFM
at all; the pipeline fell through to the OpenType fallback and set them at
Latin Modern Math's advances instead of the metrics pdfLaTeX uses.
These are base LaTeX2e kernel symbols, not amssymb. `fontmath.ltx`:
279: \DeclareMathSymbol{\sqcup}{\mathbin}{symbols}{"74}
278: \DeclareMathSymbol{\sqcap}{\mathbin}{symbols}{"75}
301: \DeclareMathSymbol{\sqsubseteq}{\mathrel}{symbols}{"76}
302: \DeclareMathSymbol{\sqsupseteq}{\mathrel}{symbols}{"77}
Verified against pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025): `\show`
gives \mathchar"2274, "2275, "3276 and "3277 both with and without
amssymb loaded, pinning family 2 (cmsy) and the four slots. amsfonts does
not redefine them -- it adds only the strict `\sqsubset`/`\sqsupset`,
which are msam and never reach this table.
The new test asserts the slots and then reads the widths back out of the
bundled TFM: 6.66669pt for "74/"75 and 7.77780pt for "76/"77 at the 10pt
text size. Those are the same numbers pdflatex reports for `\hbox{$\sqcup$}`
(6.66669pt) and `\hbox{$\sqsubseteq$}` (7.7778pt), so the mapping is
confirmed from both ends rather than only asserted.
Atom classes (Bin for "74/"75, Rel for "76/"77) live on the compiler side
and ship in a separate PR against `COMMAND_GLYPHS`/`symbol_class`; this
change is metrics only. End-to-end output needs both plus a
render-pipeline vendor re-pin.
Implementation-Agent: engine-engineer (Claude Opus 5), linux-primary
Commit-Executor: engine-engineer (Claude Opus 5), direct git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
End-to-end gate resultsVerified locally with all three PRs of this set applied together (#210 compiler kernel relations, #211 math-layout slots, #212 generator) plus a local, uncommitted render-pipeline vendor re-pin — the four vendored files ( Environment: bundled fonts only (
Failing sets are identical to the control, not just the counts:
Note Corpus references are MacTeX 2026 and were not regenerated ( Font diagnostics on the gates: HW1, HW2 and the amsmath/amssymb corpora report zero. The corpus-wide run shows 3 pre-existing Before/after on the actual commandsA probe document ( With these PRs: zero So eight commands move from hard-unsupported to rendering; Coverage gap worth a follow-upNo fixture in the real-world, amsmath or amssymb corpora uses any of these ten commands (checked by word-boundary grep). That is why the gates are unmoved — but it also means the 39-fixture amssymb corpus never exercised the symbols the generator was dropping, and there is no position-level oracle fixture for them yet. Adding one is the natural next step, and would give these symbols the same 0.5 bp treatment the rest of the corpus gets. |
cm::symbol_slothad no entry for U+2291–U+2294, so\sqsubseteq,\sqsupseteq,\sqcupand\sqcapcould not be boxed from the cmsy TFM at all. The pipeline fell through to the OpenType fallback and set them at Latin Modern Math's advances instead of the metrics pdfLaTeX uses.These are base LaTeX2e kernel symbols, not amssymb.
fontmath.ltx:Oracle evidence
pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025):
\showgives\mathchar"2274,"2275,"3276and"3277both with and withoutamssymbloaded, pinning family 2 (cmsy) and the four slots. amsfonts does not redefine them — it adds only the strict\sqsubset/\sqsupset, which are msam and never reach this table.The new test asserts the slots and then reads the widths back out of the bundled TFM:
\hbox{$\sym$}"74\sqcup"75\sqcap"76\sqsubseteq"77\sqsupseteqSo the mapping is confirmed from both ends rather than only asserted: the slot numbers come from
fontmath.ltx, and the metrics they produce independently match what pdflatex measures.Scope
Metrics only. Atom classes (Bin for
"74/"75, Rel for"76/"77) live on the compiler side and ship in a separate PR againstCOMMAND_GLYPHS/symbol_class. All PRs in this set are based onmainand none are stacked. End-to-end output needs both plus a render-pipeline vendor re-pin (done locally, left uncommitted per instruction).Gates
cargo testoncrates/math-layout: 57 passed, 0 failed vs a control checkout of the same base at 56 passed, 0 failed. The +1 is this PR's new test; no failures on either side.No fixture in the real-world, amsmath or amssymb corpora uses any of these four commands, so those gates are untouched by construction (verified by grep with word boundaries).
Draft — not for merge while
mainis in the release sequence.