Repository navigation
render-pipeline: the kern reverse lookup accepts amsmath's thin space too - #231
Merged
Merged
Conversation
… too
Pipeline half of the package-gating lane. Compiler half is a separate PR, also
based on `main`.
`kern_command_text` asks `text_builtins::text_kern` which spelling produced an
`Inline::Kern` amount, to recover the control sequence inside a user macro's
replacement. That lookup assumed one amount per spelling. It is not: amsmath
renews `\thinspace`/`\negthinspace` to `.1667em` against the kernel's
`.16667em` — 20sp apart at 10pt and 24sp at 12pt, measured with TeX Live 2025
pdflatex (`\hbox{a\,b}` 12.22230pt against 12.22261pt, `\hbox{a\!b}` 8.88887
against 8.88857). The compiler now picks one from the document's packages, and
`text_kern` takes the flag as a required parameter so no caller can silently
fall back to the kernel.
This is a reverse lookup of a spelling for an amount already chosen, with no
document in scope, so it accepts either definition; the two amounts are
disjoint, so no spelling is claimed twice.
Behind the new `compiler-package-gating` feature, **off by default**, exactly
like `amsmath-inline` and `math-glyph-spans`: the two-argument `text_kern`
exists only in a compiler newer than the committed `vendor/compiler` pin, and
without the feature this calls the one-argument form as before. Turning it on
after the re-pin is a one-line default-feature edit.
Gates: `crates/render-pipeline` `cargo test --release` with
`FLASHTEX_FONT_DIRS`/`FLASHTEX_TFM_DIRS` pointed at the bundled Latin Modern
and its three rooted metric trees — **191 passed, 0 failed**, identical to a
control run of this branch's base in the same worktree. The feature path was
built and measured through an uncommitted full vendor swap of the compiler
branch: amsmath corpus 59/59, amssymb corpus 38/39 (`32-braces-narrow`, 1.012
bp, fails at the base too), with output files byte-identical to the same swap
of the base and zero font diagnostics.
Implementation-Agent: engine-engineer (Claude Opus 5), linux-primary worktree
Commit-Executor: engine-engineer direct Git (Cursor usage-limit fallback)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
…th-package-gating-pipeline
This was referenced Sep 14, 2026
GoKubar
marked this pull request as ready for review
September 14, 2026 01:18
This was referenced Sep 14, 2026
Closed
GoKubar
pushed a commit
that referenced
this pull request
Sep 15, 2026
…ositions, new compiler lanes (#246) The board still said "main ad71b64" with FT-050..055 as the queue. It now carries the FT-060..067 outcomes, the two standing performance programs (FT-070 Kabir, FT-071 Mac), the dispositions agreed on issue #2 for the 53 open PRs (Kabir's 2026-09-14T00:10Z triage), the merge order #233 -> #241 -> #230 -> #231 -> #232, and the three unclaimed compiler lanes #242/#243/#244 that close the last real-world corpus errors. Historical rows are kept below. Implementation-Agent: Claude Code (mac-claude-a) Commit-Executor: git via Claude Code Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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 package-gating lane. Compiler half is #230 (based on
main, no stacking between the two).The problem
kern_command_text(adapter.rs) askstext_builtins::text_kernwhich spelling produced anInline::Kernamount, so it can recover the control sequence from inside a user macro's replacement. That reverse lookup assumed one amount per spelling.It is not one. amsmath renews
\thinspace/\negthinspaceto.1667emagainst the kernel's.16667em, and\tmspacescales the factor rather than rounding it, so the two really differ. Measured with TeX Live 2025 pdflatex:\hbox{a\,b}\hbox{a\!b}24sp at 12pt.
\:/\;and their negatives are byte-identical under both, and the math-mode\mskipforms do not move at all.#230 makes the compiler pick one from the document's packages, and gives
text_kernthe flag as a required parameter — deliberately, because a defaulted one is exactly the silent-kernel-fallback bug that lane exists to close.What changed
The reverse lookup accepts either definition. It is looking up a spelling for an amount that has already been chosen, and it has no document in scope; the two amounts are disjoint, so no spelling is claimed twice.
Behind the new
compiler-package-gatingfeature, off by default, the same arrangementamsmath-inline,math-glyph-spansandmath-class-overridealready use: the two-argumenttext_kernexists only in a compiler newer than the committedvendor/compilerpin, and without the feature this calls the one-argument form exactly as before. Turning it on after the re-pin is a one-line default-feature edit.Gates
crates/render-pipelinecargo test --release, withFLASHTEX_FONT_DIRS/FLASHTEX_TFM_DIRSpointed at the bundled Latin Modern and its three rooted metric trees: 191 passed, 0 failed, identical to a control run of this branch's base in the same worktree — same suite counts, same (empty) failure set.The feature path cannot be built against the committed vendor pin, so it was built and measured through an uncommitted full vendor swap of #230's
crates/compiler/srcovervendor/compiler/src, against a control that swaps in #230's base the same way:32-braces-narrow, 1.012 bp, fails at the base too)Zero font diagnostics on every render gate, asserted per fixture. The swap is neutral on its own: the control's numbers are identical to the committed pin's.
Merge order
Safe on its own — the feature is off, so there is no behaviour change. It becomes usable after #230 lands and
vendor/compileris re-pinned past it.Known gap this does not close
#230 forces the LaTeX kernel's
\angle(6.37344pt) and\hbar(5.76172pt) advances for documents that load no amsfonts, but it can only do so throughMathAtom::width_em, which this crate reads only as the\varnothingsentinel flag (symbol_atoms). Forcing them in the display list needs two more sentinels on theVARNOTHING_SENTINELpattern acrossmathfont.rs,mathtex.rsandtypeset.rs. Left out of this PR deliberately: it is a self-contained piece of work and does not belong in a one-function reverse-lookup fix.Draft; not for merge.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu