Repository navigation
math: the four kernel cmsy square relations (\sqcup, \sqcap, \sqsubseteq, \sqsupseteq) - #210
Conversation
…teq, \sqsupseteq)
These are base LaTeX2e kernel symbols, not amssymb, and the compiler had
none of them. `fontmath.ltx` declares them from the `symbols` (cmsy)
family:
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, confirming family 2 (cmsy) and the slots above, and that
amsfonts does not touch them -- it adds only the strict `\sqsubset` and
`\sqsupset`, which come from msam and are a separate gap.
Classes measured at 10pt against the 9.57755pt `$ab$` control:
$a\sqcup b$ 20.68857pt = 9.57755 + 6.66669 + 8mu -> Bin
$a\sqcap b$ 20.68857pt -> Bin
$a\sqsubseteq b$ 22.91077pt = 9.57755 + 7.7778 + 10mu -> Rel
$a\sqsupseteq b$ 22.91077pt -> Rel
(1mu = 10/18pt here, so 8mu = 4.44444pt and 10mu = 5.55556pt; the
measured residuals are 4.44433pt and 5.55542pt.) `$\subseteq$` measures
identically to `$\sqsubseteq$`, a useful cross-check that both are cmsy
relations of the same design width.
The base-14 Symbol face has no square cup/cap or square subset, so the
glyphs are bound to the pinned Latin Modern Math resource like the other
symbols in `lm_math`, which is what keeps `export`'s
`every_math_symbol_has_a_decided_export_outcome` guard satisfied. Their
advances (667 and 778 per 1000 em) are read from the pinned font program
and agree with the pdfLaTeX measurements above.
This is the compiler's own (non-TFM) layout only. The matching
math-layout change that boxes them from the cmsy TFM at "74-"77 is a
separate PR against `cm::symbol_slot`; end-to-end output needs both plus
a render-pipeline vendor re-pin.
docs/user/compiler.md and supported/supported-latex.json are regenerated
with scripts/render_supported_latex.sh (537 -> 541 math command entries);
supported/coverage.md is unchanged because the canonical denominator does
not list these names.
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. |
Adds
\sqcup,\sqcap,\sqsubseteqand\sqsupseteq, which the compiler had no rows for at all.These are base LaTeX2e kernel symbols, not amssymb — a point worth stating because the neighbouring amssymb work suggested otherwise.
fontmath.ltx:Oracle evidence
pdfTeX 3.141592653-2.6-1.40.27 (TeX Live 2025).
\showgives\mathchar"2274,"2275,"3276,"3277both with and withoutamssymbloaded — family 2 (cmsy), slots"74–"77, and amsfonts does not touch them (it adds only the strict\sqsubset/\sqsupset, from msam — a separate gap, fixed in #PR3).Atom classes measured at 10pt against the
$ab$control (9.57755pt):$a\sqcup b$$a\sqcap b$$a\sqsubseteq b$$a\sqsupseteq b$1mu = 10/18pt, so 8mu = 4.44444pt and 10mu = 5.55556pt; measured residuals are 4.44433pt and 5.55542pt.
$\subseteq$measures identically to$\sqsubseteq$— a cross-check that both are cmsy relations of the same design width.Export
The base-14 Symbol face has no square cup/cap or square subset, so the four glyphs are bound to the pinned Latin Modern Math resource like the other symbols in
lm_math. That is what keepsexport'severy_math_symbol_has_a_decided_export_outcomeguard satisfied. Their advances (667 and 778 per 1000 em) are read from the pinned font program and agree with the pdfLaTeX measurements above.Scope
Compiler-side only (the non-TFM layout). Two companions, all three based on
main, none stacked:cm::symbol_slotgets cmsy"74–"77so the TFM path boxes them as pdfLaTeX does.SKIPpremise.End-to-end output needs all three plus a render-pipeline vendor re-pin (done locally, left uncommitted per instruction).
Gates
cargo testoncrates/compiler: 439 passed, 1 failed vs a control checkout of the same base at 438 passed, 1 failed. The +1 is this PR's new test; the single failure is the pre-existingcanonical_names_outside_the_inventory_are_diagnosed(assertion failed: !BUILT_INS.contains(&name),parser.rs:5227), which fails identically onmain.tests/robustness.rs'sdeeply_nested_input_does_not_blow_the_stackoverflows its stack on this NixOS host onmaintoo — environment, not this change.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).
docs/user/compiler.mdandsupported/supported-latex.jsonregenerated withscripts/render_supported_latex.sh(537 → 541 math command entries).supported/coverage.mdis unchanged: the canonical denominator does not list these names.Draft — not for merge while
mainis in the release sequence.