Skip to content

vendor: re-pin math-layout to main, and select the kernel \big rule without amsmath (#239's missing pipeline half) - #252

Merged
GoKubar merged 2 commits into
mainfrom
integ/vendor-repin-mathlayout
Sep 14, 2026
Merged

GoKubar merged 2 commits into
mainfrom
integ/vendor-repin-mathlayout

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Two commits: the re-pin, then the pipeline half #239 explicitly left undone.

1. vendor/math-layout re-pin — ea4ee5c8 → 9a82257b

It was five math-layout commits behind main and had never been re-pinned after #186, so three merged PRs were inert in the pipeline. Carries #239 (BigSizing), #229 (extension_glyph takes a SizeClass), #186 (47 kernel symbols), plus the cmsy square relations, dotless letters and \bullet/\bigcirc commits.

#229's signature change lands on this crate's two implementors, both pure delegators (mathtex.rs, mathtext.rs). They now forward size, as every neighbouring method in the same impls already does. Taking the _size escape would have silently pinned family 3 to Text and discarded the point of #229.

Unblocks: #239's pipeline half (commit 2), and #227 builds against this mirror.

2. The pipeline half — what #239 called "the one thing here that is not done"

math-layout models both rules; choosing between them is a fact about the package list, which only the pipeline reads, and the math-layout lane was correctly barred from touching vendor/.

Context::amsmath_loaded is computed once in the constructor (a per-formula \usepackage re-scan is what made a whole-document render quadratic — the FT-070 finding) and carried on TextSink::amsmath. The SizedDelimiter arm then picks big_delimiter or big_delimiter_kernel, mapping the compiler's scale through math-layout's own BigSizing::kernel_for_factor rather than copying 8.5/11.5/14.5/17.5 into this crate.

amsmath is deliberately not the existing ams_symbol_fonts predicate, which is amssymb || amsfonts. Neither of those loads amsmath; reusing it would apply amsmath's rule to a document that only wanted its symbols.

The fix, measured

\Big[ in an article, as painted, no amsmath:

body size before after
10pt cmex10 cmex10
11pt cmex10, baseline 142.092 cmex10, baseline 141.240
12pt one variant further up the cmex chain cmex10

At 12pt the old code reached a visibly taller bracket than pdflatex sets. The 11pt baseline moves because Rule 19's δ is max(pt − axis, axis) for the kernel's \vbox, not half the target as for amsmath's \vcenter.

A note on the third test

An amssymb-only document currently renders identically to an amsmath one — not because the rule is wrong, but because amsfonts redeclares OMX/cmex/m/n with several designs (ExtensionSizing::Designs, #204) and at these sizes both targets resolve to the same variant. Two mechanisms keyed off two different packages. The test therefore asserts at the predicate rather than resting on that coincidence, and says so.

Gates

Control is a checkout of the same base. Zero font-failure diagnostics (font_unavailable, required_metrics_unavailable, ec_metrics_unavailable, font_outline_substituted, tfm_missing, math_font_unavailable) — not zero diagnostics of any kind, since every corpus fixture legitimately reports math_resource_profile.

gate control this branch
render-pipeline --release --locked --no-fail-fast 202 passed, 0 failed 205 passed, 0 failed
render-pipeline failing SET empty empty (identical)
amsmath corpus 59/59 within 0.5 bp 59/59
HW1 / HW2 3 pages, 0 errors, 0 overfull same
real-world corpus (10 fixtures) status/pages/full diagnostic sets identical to control

Each commit builds on its own.

Found while doing this

crates/math-layout/src/cm.rs on main has a duplicate '\u{2292}' match arm (lines 429 and 528, both (Symbol, 0x77)) — #186 and the cmsy-square-relations commit each added \sqsupseteq. Same value, so no behaviour change, but it is a live unreachable_patterns warning. Not fixed here; it belongs to that crate's owner.

Implementation-Agent: Claude Opus 5 (integration lane, linux-primary / NixOS)

GoKubar and others added 2 commits September 13, 2026 21:01
`crates/render-pipeline/vendor/math-layout` was pinned at `ea4ee5c8`,
**five math-layout commits behind main** — it was never re-pinned after
#186 landed, so three merged PRs were inert in the pipeline.

`git archive origin/main:crates/math-layout`, byte-identical to the real
crate apart from `PIN`, per vendor/VENDORING.md.

What the bump carries:

- **#239** `BigSizing::{Kernel, Amsmath}` — the kernel's fixed `\big`..`\Bigg`
  lengths alongside amsmath's `\bBigg@`. `Atom::big_delimiter` keeps the
  amsmath rule, so this re-pin alone changes no output; selecting the kernel
  rule is the pipeline's job and is the next commit.
- **#229** `MathFontMetrics::extension_glyph` takes a `SizeClass`.
- **#186** 47 kernel math symbols with their cmsy/cmmi/cmr/cmex slots.
- `2d652944` cmsy square relations boxed from their real TFM slots.
- `c1702353` dotless letters share `\imath`/`\jmath`'s slots.
- `b81a5414` `\bullet`/`\bigcirc` key off their cmsy slot's code point.

#229's signature change lands on this crate's two implementors of the trait,
which are pure delegators: `mathtex.rs` forwards to `CmMathMetrics` and
`mathtext.rs` to its inner metrics. Both now forward `size`, as every
neighbouring method in the same impls already does (`delimiter_extensible`,
`radical_extensible`, `accent_sizes`). Taking the `_size` escape instead
would have silently pinned family 3 to Text and quietly discarded the point
of #229.

Unblocks: #239's pipeline half (next commit). #227 (vertical assemblies)
also builds against this mirror.

Gates, NixOS linux-primary, bundled apps/mac/Fonts, FLASHTEX_TFM_DIRS =
public/lm:jknappen/ec:public/amsfonts/symbols. Zero **font-failure**
diagnostics (`font_unavailable`, `required_metrics_unavailable`,
`ec_metrics_unavailable`, `font_outline_substituted`, `tfm_missing`,
`math_font_unavailable`) — not zero diagnostics of any kind, since every
corpus fixture legitimately reports `math_resource_profile`:

| gate | control (main 9a82257) | after re-pin |
|---|---|---|
| render-pipeline --release --locked --no-fail-fast | 202 passed, 0 failed | 202 passed, 0 failed |
| render-pipeline failing SET | empty | empty (identical) |
| amsmath corpus | 59/59 within 0.5 bp | 59/59 |
| HW1 / HW2 | 3 pages, 0 errors, 0 overfull | same |
| real-world corpus (10 fixtures) | status/pages/diagnostic sets | identical to control |

Implementation-Agent: Claude Opus 5 (integration lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
… absent

The pipeline half #239 named as "the one thing here that is *not* done".
math-layout models both sizing rules (`BigSizing::Kernel` / `::Amsmath`);
choosing between them is a fact about the package list, which only this
crate reads, and the math-layout lane was correctly barred from touching
`vendor/`.

- `Context::amsmath_loaded`, computed once in the constructor and carried
  on `TextSink::amsmath`, beside the existing `amsfonts`. Once, not per
  formula: a per-formula `\usepackage` re-scan is what made a whole-document
  render quadratic in (source size x formula count) — the FT-070 finding.
- The `N::SizedDelimiter` arm picks `Atom::big_delimiter` (amsmath) or
  `Atom::big_delimiter_kernel` (the kernel's absolute `\vbox` lengths),
  mapping the compiler's 1.2/1.8/2.4/3.0 scale through math-layout's own
  `BigSizing::kernel_for_factor` rather than copying 8.5/11.5/14.5/17.5
  into this crate.

**`amsmath` is deliberately a separate predicate from `ams_symbol_fonts`.**
That one is `amssymb || amsfonts` — the msam/msbm symbol fonts — and neither
package loads `amsmath`. Reusing it here would apply amsmath's rule to a
document that only wanted its symbols.

The fix, `\Big[` in an article, as painted:

| body size | before (no amsmath) | after | pdflatex |
|---|---|---|---|
| 10pt | cmex10 | cmex10 | fixed |
| 11pt | cmex10, baseline 142.092 | cmex10, baseline 141.240 | `\vbox`, not `\vcenter` |
| 12pt | **one variant further up the chain** | cmex10 | fixed |

At 12pt the old code reached a visibly taller bracket than pdflatex sets;
the 11pt baseline moves because Rule 19's delta is `max(pt - axis, axis)`
for the kernel's `\vbox`, not half the target as for amsmath's `\vcenter`.

New `tests/big_delimiter_packages.rs` (3): no movement with body size
without amsmath, tracking with it, and that `amssymb`/`amsfonts` alone do
not read as amsmath. The third asserts at the predicate, not through the
painted glyph, because an `amssymb` document currently renders identically
to an `amsmath` one for an unrelated reason — `amsfonts` redeclares
`OMX/cmex/m/n` with several designs (`ExtensionSizing::Designs`, #204), and
at these sizes both targets resolve to the same variant. Two mechanisms,
two packages; the test says so rather than resting on the coincidence.

Gates (control = main 9a82257 + the re-pin commit), zero **font-failure**
diagnostics — `math_resource_profile` is expected on every corpus fixture
and is not one:

| gate | control | this commit |
|---|---|---|
| render-pipeline --release --locked --no-fail-fast | 202 passed, 0 failed | 205 passed, 0 failed |
| render-pipeline failing SET | empty | empty (identical) |
| amsmath corpus | 59/59 within 0.5 bp | 59/59 |
| HW1 / HW2 | 3 pages, 0 errors, 0 overfull | same |
| real-world corpus (10 fixtures) | status/pages/diagnostic sets | identical to control |

Implementation-Agent: Claude Opus 5 (integration lane, linux-primary / NixOS)
Commit-Executor: Claude Opus 5 via Claude Code (direct-agent Git execution
under the observed-Cursor-limit user override)
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar
GoKubar merged commit 0d93456 into main Sep 14, 2026
20 checks passed
GoKubar pushed a commit that referenced this pull request Sep 14, 2026
…without amsmath — #337 already fixed by #252 (#341)

Test-only pin; #337 confirmed already fixed by #252 on main. Verified on linux-primary NixOS: --test big_delimiter_packages 4 passed / 0 failed, exit 0. No source file changed. HW1/HW2 unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
@GoKubar
GoKubar deleted the integ/vendor-repin-mathlayout branch September 16, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant