Repository navigation
Conversation
…class re-read The compiler carries `\colon`'s `\mathpunct` class as the crate-private `MathAtom::class_override`, so the pipeline re-reads the control word at the atom's span (`typeset::class_override_of`, pin `d416472a`) exactly as it does for `\bot`/`\bigtriangleup`. Without an arm there, the compiler's `:` atom falls back to math-layout's `default_class`, which has `:` as `\mathrel` (`fontmath.ltx` 385) — the class the *character* has, not the one `\colon` declares (`fontmath.ltx` 400). `f\colon A` then got the relation's 5mu on both sides instead of 3mu after the colon only. Measured end to end against TeX Live 2025 pdflatex on a 12pt fixture holding `$f\colon A\to B$`, `$g\colon X\to Y$`, `$a:b$`, `$c:d$`, the eight `largesymbols` operators and `\neg`/`\lnot`, with `vendor/compiler` locally swapped to agent/kabir-claude/math-symbols-compiler (uncommitted, as the vendoring rules require): * with this arm: every word within **0.006 bp** of pdflatex; * without it: every word after each `\colon` is **4.647 bp** out, 9.303 bp by the second formula on the line — the 7mu (10mu relation − 3mu punctuation) the class decides, 4.667pt at 12pt. `crates/render-pipeline/tests/math_symbols.rs` gains the unit test over `class_override_of` itself (no compiler dependency, runs now) and the end-to-end spacing assertion, `#[ignore]`d with the exact reason: the pinned `vendor/compiler` has no `\colon` arm at all and still emits the literal text `\colon`, so there is no `:` atom for the class to land on. Verified that the ignored test passes with the vendor swapped in. Gates (NixOS, TeX Live 2025, pinned vendor as committed; fonts from a symlink-free flat copy of the repo's own `apps/mac/Fonts` + its bundled `texmf` TFMs, after confirming every gate run reports **zero** `font_unavailable` / `required_metrics_unavailable` diagnostics — an earlier round of these numbers was measured on the OpenType-MATH fallback and is superseded): - `crates/render-pipeline` `cargo test --release --no-fail-fast` (no FLASHTEX_* exports; the tests do their own font discovery and several assert a no-NewCM control that an exported FLASHTEX_FONT_DIRS breaks): **171 passed, 0 failed, 2 ignored**, against 170/0/1 on main. - amsmath corpus (`crates/compiler/tests/amsmath_corpus/oracle.py check`): **59/59** within 0.5 bp, per-fixture identical to main. - amssymb corpus: **38/39**, per-fixture identical to main; `32-braces-narrow` (brace extents, worst 1.012 bp) fails on main too. - real-world corpus (`tools/real-world-corpus/run.sh --no-oracle`, 10 fixtures x 2 producers): no behavioural change — status, page counts, error/warning counts and the exact diagnostic message sets identical. hw1 3 pages, hw2 3 pages (render), 0 errors and 0 overfull. The 3 `ec_metrics_unavailable` and 3 `font_outline_substituted` are pre-existing and identical on both sides: the bundled `Fonts` dir ships no `lmmono*.otf` and no `ectt*` T1 typewriter metrics. - `crates/paragraph-layout` `cargo test --test hyphenation_oracle`: 5 passed, including `thirty_paragraphs_break_like_pdflatex` (the HW1/HW2 line-break oracle). Implementation-Agent: kabir-claude (engine-engineer, linux-primary) Commit-Executor: kabir-claude direct git (Cursor usage limit fallback) Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu Co-authored-by: GoKubar <[email protected]>
This was referenced Sep 13, 2026
Merged
This was referenced Sep 15, 2026
Contributor
Author
|
Closing as superseded — the work is already on Replacement: \colon arms are on main in crates/compiler/src/math.rs and typeset.rs 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.
Pipeline half of the math-symbol lane. Compiler half is #180 (
agent/kabir-claude/math-symbols-compiler). Both are based onmainindependently — no stacking; either can merge first, and neither changes the other's behaviour untilvendor/compileris re-pinned.What changed
One arm, in
typeset::class_override_of:The compiler carries
\colon's\mathpunctclass as the crate-privateMathAtom::class_override, so the pipeline re-reads the control word at the atom's span (pind416472a), exactly as it already does for\bot/\bigtriangleup/\mathpunct. Without an arm there the compiler's:atom falls back to math-layout'sdefault_class, which classifies:as\mathrel— the class the character has (fontmath.ltx385), not the one\colondeclares (fontmath.ltx400).f\colon Athen gets the relation's 5mu on both sides instead of 3mu after the colon only.Measured
TeX Live 2025
pdflatexagainstflashtex-render, on a 12pt fixture holding$f\colon A\to B$,$g\colon X\to Y$,$a:b$,$c:d$, the eightlargesymbolsoperators and\neg/\lnot, withvendor/compilerlocally swapped to #180's branch (uncommitted, as the vendoring rules require):\colon; 9.303 bp by the second formula on the line4.647 bp is the 7mu the class decides (10mu relation − 3mu punctuation = 4.667pt at 12pt).
Tests
crates/render-pipeline/tests/math_symbols.rsgains:colon_is_punctuation_where_a_bare_colon_is_a_relation— a unit test overclass_override_ofitself. No compiler dependency, runs now, passes.colon_gets_thin_space_after_only_end_to_end— the spacing assertion,#[ignore]d with the exact reason: the pinnedvendor/compilerhas no\colonarm at all and still emits the literal text\colon, so there is no:atom for the class to land on. Verified that it passes with the vendor swapped to compiler: \colon as math punctuation, \mathbb as a real msbm alphabet, the largesymbols operators and \neg #180; un-ignoring it is the acceptance check for the re-pin.Gates
Run with the pinned vendor, i.e. exactly what this branch commits. Fonts come from a symlink-free flat copy of the repo's own
apps/mac/Fontsplus its bundledtexmfTFMs, and every gate run was asserted to report zerofont_unavailable/required_metrics_unavailablediagnostics before its numbers were used — on NixOS, symlinkedtexmf-distpath components make the rooted TFM reader fall back to OpenType MATH metrics silently, and two builds sharing that fallback agree perfectly on wrong geometry.crates/render-pipelinecargo test --release --no-fail-fastamsmath_corpus/oracle.py check)amssymb_corpus/oracle.py check)crates/paragraph-layoutcargo test --test hyphenation_oraclethirty_paragraphs_break_like_pdflatexRun
crates/render-pipeline'scargo testwith noFLASHTEX_*exports: several tests (mathbb_paints_from_new_computer_modern_when_bundled,mathcal_…,varnothing_…,cm_less_symbols_…) render a deliberate without-NewCM control and fail if an exportedFLASHTEX_FONT_DIRSleaks a font directory into it. WithFLASHTEX_FONT_DIRS+FLASHTEX_TFM_DIRS+FLASHTEX_LM_DIRexported,mainitself reports 8 failures; with the CI triple, 17. The oracle harnesses set their own environment per subprocess and are unaffected.Pre-existing and identical on both sides:
32-braces-narrow(amssymb, brace extents, worst 1.012 bp), and the real-world corpus's 3ec_metrics_unavailable+ 3font_outline_substituted(the bundledFontsdir ships nolmmono*.otfand noectt*T1 typewriter metrics).Correction to a measurement from the inline-math-expansion lane
crates/render-pipeline/tests/microtype_math.rsonagent/kabir-claude/math-inline-expansion@df1bbae6#[ignore]soperators_functions_and_spacing_commandswith the reason "the compiler drops\mathbb{Z}and sets\colonas the literal characters". The\colonhalf is right and is what this PR + #180 fix. The\mathbb{Z}half is not: on currentmainwith the pinned vendor,$\mathbb{Z} a$ … $\mathbb{W} f$renders within 0.013 bp of pdflatex. That claim was most likely measured on the metrics fallback described above, where every face degrades at once.Re-measuring that fixture with #180 + this PR: paragraph 2 — the one holding
$h\colon A\to B$and$A=B=\mathbb{Z}$— now starts at pdflatex's own line origin (198.403 vs 198.404 bp) and ends within 0.003 bp, and every remaining outlier is in paragraph 1:\sin/\cos/\lim/\log, the operator-name spacing that lane already attributes to #177. Once both land, that#[ignore]reason should be narrowed to #177 alone. I have not touched that branch or its fixtures — inline-math microtype is a fenced lane.Follow-up this PR does not take
\bigsqcup(cmex10"46, U+2A06) and\biguplus("55, U+2A04) are the only twolargesymbolsoperators #180 leaves out, because each also needs acm::symbol_slot+default_classrow incrates/math-layout— whichcrates/render-pipelinevendors. Whoever takes them should land the math-layout rows, the compilerCOMMAND_GLYPHSrows and thelm_math::ADVANCESentries (both 833 in the bundledlatinmodern-math.otf) together. #180's description lists the other 105 unsupported kernel/plain math commands the sweep found, tiered by what each needs.Resume notes
agent/kabir-claude/math-symbols-pipeline, headab4dd82a, based onmain89e49fed.00242508.crates/compiler/src/{export,lm_math,math,supported,vocabulary}.rsfrom compiler: \colon as math punctuation, \mathbb as a real msbm alphabet, the largesymbols operators and \neg #180's branch overcrates/render-pipeline/vendor/compiler/src/(uncommitted; those five files are byte-identical tomainbefore that branch), rebuildflashtex-render, then runcargo test --release --test math_symbols -- --ignored. Do not commit the vendor swap.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu