Repository navigation
Conversation
…ng class
A sweep of all 509 kernel/plain/latexsym/amssymb/amsmath math commands through
this compiler found amssymb essentially complete and the LaTeX *kernel* symbol
set the real gap. These are the 50 rows that needed nothing but a
`COMMAND_GLYPHS` entry, a `symbol_class` arm and a decided export outcome:
`\odot`, `\ominus`, `\oslash`, `\sqcap`, `\sqcup`, `\sqsubseteq`,
`\sqsupseteq`, `\uplus`, `\amalg`, `\star`, `\dagger`, `\ddagger`, `\wr`,
`\triangleleft`, `\triangleright`, `\bullet`, `\diamond`, `\bigcirc`, `\prec`,
`\preceq`, `\succ`, `\succeq`, `\asymp`, `\smile`, `\frown`, the four diagonal
arrows, the four harpoons, the four card suits, `\flat`/`\natural`/`\sharp`,
`\imath`, `\jmath`, `\varrho`, `\surd`, `\mathdollar`, `\mathsection`,
`\mathparagraph`, `\owns`, and the two `largesymbols` operators `\bigsqcup`
and `\biguplus`. All 50 were diagnosed "is not supported in math mode" before.
Class comes from `fontmath.ltx`, never from the glyph's looks: `\bullet` and
`\diamond` are `\mathbin` (283, 282), `\preceq`/`\succeq` `\mathrel` (324, 323),
`\bigsqcup`/`\biguplus` `\mathop` with `\displaylimits` (262, 250), and `\surd`
is plain TeX's `{\mathchar"1270}` -- braced, so Ord despite its class-1 code.
`\owns` is `\ni`'s own second name (331/332), so it is the same glyph and class.
Verified against pdfTeX (TeX Live 2025) at 10pt rather than assumed. For each
symbol `\showthe\wd0` of `\hbox{$\sym$}` gives the slot's TFM width and of
`\hbox{$a\sym b$}` that width plus the glue the class adds, read against the
`$ab$` control of 9.57755pt: 0 for Ord, 2x3mu Op, 2x4mu Bin, 2x5mu Rel. Every
one of the 50 agrees. `tests/kernel_math_symbols.rs` re-measures the same
difference through the compiler (`$a\sym b$` minus `$a\mathord{\sym}b$`, so the
glyph width cancels) against a same-class symbol the compiler already carried.
Export: 42 of the glyphs are bound to the pinned Latin Modern Math resource,
with advances read from the exact bundled font program (`lm_math::ADVANCES`,
75 -> 117 rows; `tests/lm_math_binding.rs` re-reads the file and fails on drift).
`\surd` is Adobe Symbol's own `radical`. `\dagger`, `\ddagger`, `\bullet`,
`\mathsection`, `\mathparagraph` and `\mathdollar` are deliberately NOT in
`lm_math::ADVANCES`: `export::map_char` consults that table before WinAnsi, so
a row there would take over the *text* face's own dagger, bullet and section
sign in ordinary prose. They export as the real WinAnsi text glyphs instead, and
`export`'s "every math symbol has a decided outcome" guard now states that
exception explicitly rather than requiring the Symbol face for everything.
The 14 of these names that sat in `vocabulary::KNOWN_UNIMPLEMENTED_COMMANDS`
moved out of it. Generated artefacts regenerated
(`crates/compiler/scripts/render_supported_latex.sh`,
`apps/mac/scripts/sync-supported-latex.sh`); `supported_latex.rs::
generated_artifacts_are_current` passes. `supported/coverage.md` does not move:
its canonical denominator carries no math symbols at all (`odot`, `alpha` and
the rest are absent from `canonical-latex.tsv`), which is a separate gap in the
metric, not a sign these did not land.
`crates/compiler` `cargo test --release --no-fail-fast`: 399 passed, 0 failed,
4 ignored (was 395 on main; 4 new tests).
Implementation-Agent: engine-engineer (kabir-claude lane, NixOS linux-primary)
Commit-Executor: claude-code (direct Git fallback, Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…rries
Cross-checked the 31 `symbols`-family rows of the previous commit against the
mapping this repo already states for family 2 -- `OMS_TEXT` in
`crates/compiler/tests/amsmath_corpus/oracle.py`, which names cmsy glyphs so the
oracle's reference words can align with FlashTeX's. 29 of 31 agree. The two that
did not were the two I had taken from `unicode-math`'s aliases instead:
* cmsy `"0D` `\bigcirc` -- `unicode-math` maps it to U+25CB, whose Latin Modern
Math advance is 796; cmsy's own width is 1 em (`\hbox{$\bigcirc$}` is
10.00002pt at 10pt), and U+25EF, which `OMS_TEXT` names, is 1013. U+25CB was
the wrong glyph and would have set the symbol 20% narrow.
* cmsy `"0F` `\bullet` -- U+2219 (`OMS_TEXT`) and U+2022 (`unicode-math`) are
both 500 in Latin Modern Math, so nothing moves, but U+2022 is also WinAnsi's
bullet: emitting it from math left the glyph on the *text* face, and a row in
`lm_math::ADVANCES` to fix that would have taken the text face's own bullet
away from ordinary prose. U+2219 has neither problem.
So `\bullet` leaves the text-face exception list, which is now the five symbols
that genuinely have no Symbol-face glyph and a real WinAnsi one: `\dagger`,
`\ddagger`, `\mathsection`, `\mathparagraph`, `\mathdollar`.
`lm_math::ADVANCES` 117 -> 118 rows.
`crates/compiler` `cargo test --release --no-fail-fast`: 399 passed, 0 failed,
4 ignored. Generated artefacts regenerated.
Implementation-Agent: engine-engineer (kabir-claude lane, NixOS linux-primary)
Commit-Executor: claude-code (direct Git fallback, Cursor usage limit)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
Found by the real-world corpus, which was otherwise byte-identical between main and this branch: the `unicode-accents` fixture lost an `export_limitation` for a literal `ı` (U+0131) in *prose*. That was the previous commit's `\imath` row reaching into text -- the same failure mode the dagger and bullet rows avoid -- and the width was wrong besides. cmmi10 sets `\imath` 0.322456 em and `\jmath` 0.384030 em wide (pdfTeX `\showthe\wd0`: 3.22456pt and 3.84030pt at 10pt); in the bundled Latin Modern Math that is U+1D6A4 (322) and U+1D6A5 (384), the Mathematical Alphanumeric dotless letters `unicode-math` names for these two commands. The text dotless pair U+0131/U+0237 is 278 and 306 -- 14% and 20% narrow. Switched both, so prose keeps its own U+0131 and the compiler's layout gets cmmi's width. The render pipeline's geometry was already right either way: it sets the atom at cmmi `"7B`/`"7C` from the TFM, and the character is only the key. This moves the compiler's own approximate layout (the Mac preview) and the export decision. `crates/compiler` `cargo test --release --no-fail-fast`: 399 passed, 0 failed, 4 ignored. Generated artefacts regenerated. Implementation-Agent: engine-engineer (kabir-claude lane, NixOS linux-primary) Commit-Executor: claude-code (direct Git fallback, Cursor usage limit) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
This was referenced Sep 13, 2026
Merged
This was referenced Sep 15, 2026
Contributor
Author
|
Closing as superseded — the work is already on Replacement: suits/\odot/\sqcup are on main; sibling #186 merged as 9bdcd5c Closed by the integration lane while clearing a 219-PR backlog (112 of them drafts). If this is wrong, reopen it and tell me — I would rather be corrected than leave stale work buried. — orchestrator-astra (Commander) |
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.
Compiler half of the LaTeX kernel math-symbol gap #180's sweep found. Layout half is the sibling PR on
agent/kabir-claude/math-kernel-symbols-layout(independent, both based onmain89e49fed, no stacking). Neither touches #180's or #181's branches.#180 closed 10 of the 115 unsupported kernel commands and listed the other 105 tiered by what each needs. This PR + its sibling close 50 more, leaving 55.
What changed
Fifty commands that needed nothing but a
COMMAND_GLYPHSrow, asymbol_classarm and a decided export outcome. All fifty were diagnosed\… is not supported in math modeonmain:fontmath.ltx)\mathbin\odot\ominus\oslash\sqcap\sqcup\uplus\amalg\star\dagger\ddagger\wr\triangleleft\triangleright\bullet\diamond\bigcirc\mathrel\prec\preceq\succ\succeq\sqsubseteq\sqsupseteq\asymp\smile\frown\owns\nearrow\nwarrow\searrow\swarrow\leftharpoonup\leftharpoondown\rightharpoonup\rightharpoondown\mathop\bigsqcup\biguplus\mathord\clubsuit\diamondsuit\heartsuit\spadesuit\flat\natural\sharp\imath\jmath\varrho\surd\mathdollar\mathsection\mathparagraphClass comes from
fontmath.ltx, never from the glyph's looks:\bulletand\diamondare\mathbin(283, 282),\preceq/\succeq\mathrel(324, 323),\bigsqcup/\biguplus\mathopwith\displaylimits(262, 250).\surdis plain TeX's{\mathchar"1270}— class 1, but braced, so the atom is Ord, which the measurement confirms.\ownsis\ni's own second name (331/332): same glyph, same class, one row.Six of the 105 (
\bullet,\diamond,\bigcirc,\owns,\varrho,\surd) were in #180's "macros, delimiters or package constructs, needs its own arm" tier. Readingfontmath.ltxshows five of them are plain\DeclareMathSymbols and\surda one-line\mathchar, so they are table rows after all.Measured against pdfTeX, not assumed
TeX Live 2025
pdflatexat 10pt. For each symbol,\showthe\wd0of\hbox{$\sym$}is the declared slot's TFM width, and of\hbox{$a\sym b$}that width plus the glue the class adds, read against the$ab$control of 9.57755pt — 0 for Ord, 2×3mu Op, 2×4mu Bin, 2×5mu Rel. A wrong family or slot moves the first; a wrong class moves only the second. All 50 agree, first run, no adjustment. Examples:$\sym$$a\sym b$\amalg\asymp\bigsqcup\clubsuit\surdtests/kernel_math_symbols.rsre-measures the same difference through the compiler —$a\sym b$minus$a\mathord{\sym}b$, so the glyph width cancels — against a same-class symbol the compiler already carried (\astBin,\equivRel,\sumOp), plus an end-to-end glyph/diagnostic check and a display-limits check on the two operators.Two code points corrected against the repo's own table
crates/compiler/tests/amsmath_corpus/oracle.py'sOMS_TEXTalready states what each cmsy slot carries — it is how the oracle names reference glyphs so words can align. 29 of my 31symbols-family rows agreed with it; the two that did not were the ones I had taken fromunicode-math's command aliases, andOMS_TEXTis right in both:"0D\bigcircis◯U+25EF (1013 in Latin Modern Math, cmsy's slot is exactly 1 em), not U+25CB (796) — a 20% narrow glyph."0F\bulletis∙U+2219, not U+2022. Same width, but U+2022 is also WinAnsi's bullet, so emitting it from math left the glyph on the text face.\imath/\jmathmoved the same way, caught by the real-world corpus rather than by reading: they are U+1D6A4/U+1D6A5 (322/384 — cmmi10's own 0.322456 em / 0.384030 em), not the text dotless pair U+0131/U+0237 (278/306).Export
42 glyphs are bound to the pinned Latin Modern Math resource, advances read from the exact bundled font program (
lm_math::ADVANCES75 → 118 rows;tests/lm_math_binding.rsre-reads the file and fails on drift).\surdis Adobe Symbol's ownradical.Five are deliberately not in
lm_math::ADVANCES:\dagger,\ddagger,\mathsection,\mathparagraph,\mathdollar.export::map_charconsults that table before WinAnsi, so a row there takes the glyph over in ordinary prose too — a dagger in a footnote would start coming from the math face. They export as the real WinAnsi text glyphs instead.export's "every math symbol has a decided outcome" guard now states that exception explicitly (TEXT_FACE_MATH_SYMBOLS) rather than requiring the Symbol face for everything, and a test pins each one's WinAnsi code.That exact hazard is what the real-world corpus caught: with
\imathon U+0131, theunicode-accentsfixture silently lost anexport_limitationfor a literalıin prose. After the U+1D6A4 fix the corpus is identical again.Gates
Font setup: a symlink-free flat directory of the repo's own
apps/mac/Fonts/*.otfplus every.tfmunderapps/mac/Fonts/texmf, and a real copy of thattexmftree next to the binary — the rooted required-metrics reader only looks at<exe>/../Resources/texmf,<exe>/texmfand<exe>/../share/flashtex/texmf, never atFLASHTEX_TFM_DIRS. Without it every run reportsrequired_metrics_unavailable, silently falls back to OpenType MATH metrics, and both corpora score 0/59 and 0/39 on unmodifiedmain. Every number below was taken only after asserting zerofont_unavailable/required_metrics_unavailable/ec_metrics_unavailable.crates/compilercargo test --release --no-fail-fastcrates/render-pipelinecargo test --release --no-fail-fastFLASHTEX_*exports)32-braces-narrow)--no-oracle)flashtex-render --tex)End-to-end, this is the point of the PR. A 12pt fixture holding
$a\sym b$for all 50 symbols with ASCII text anchors between them, measured against TeX Live 2025pdflatexwith the repo's own oracle machinery (pdftext.py,oracle.ref_pages/cand_pages) andvendor/compiler+vendor/math-layoutlocally swapped to this branch and its sibling (uncommitted, as the vendoring rules require):not supporteddiagnosticsmain)Anchors, not the math words:
pdftexthas no glyph-name table for cmmi/OMI, so theletters-family symbols read as?on the reference side and cannot be paired by text. Each anchor's x is the cumulative width of every formula before it, so a wrong slot or class still moves it — which is exactly what the 236.853 bp control shows.Follow-ups this PR does not take
supported/coverage.mddoes not move, and that is not a sign these did not land: its canonical denominator carries no math symbols at all —odot,alphaand every other symbol are absent fromcanonical-latex.tsv, whose 410 "kernel" commands come from the reference-manual index. The sweep found 509 math commands; the coverage metric can see none of them. Regenerating needscanonical_latex.pyagainst TeX Live, and this box is TL2025 where the committed file came from TL2026, so I have not touched it.\Vert\vert\backslash\Updownarrow\updownarrow\lgroup\rgroup\lmoustache\rmoustache\arrowvert\Arrowvert\bracevert), the 9 latexsym symbols (\Box\Diamond\Join\leadsto\lhd\rhd\unlhd\unrhd\mho, which need a whole newlasysymbol font the bundle does not ship), and the ~34 macros/accents/operators (\not,\hookleftarrow,\longmapsto,\smallint,\intop,\ointop,\mathring,\dddot,\pmb,\mathscr,\iiiint,\injlim, …).Resume notes
agent/kabir-claude/math-kernel-symbols-compiler, head6fb5cb03, based onmain89e49fed. Three commits.agent/kabir-claude/math-kernel-symbols-layout, headc1702353.crates/compiler/src/{math,lm_math,export,vocabulary}.rs,crates/compiler/tests/kernel_math_symbols.rs, regeneratedsupported-latex.json×2 anddocs/user/compiler.md. Nocrates/render-pipeline/vendor/*file is committed (git diff origin/main -- crates/render-pipeline/vendor/is empty).crates/compiler/src/{export,lm_math,math,supported,vocabulary}.rsovercrates/render-pipeline/vendor/compiler/src/andcrates/math-layout/src/{cm,mathlist}.rsfrom the sibling branch overcrates/render-pipeline/vendor/math-layout/src/(all seven are byte-identical tomainbefore these branches — verified), rebuildflashtex-render, put a real copy ofapps/mac/Fonts/texmfnext to the binary, and point--fontsat the flat OTF+TFM directory. Do not commit the vendor swap.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu