Repository navigation
render-pipeline: a tall radical sign meets its own bar (#690) - #709
Conversation
|
Fallout sweep for this fix is done ( Measured blast radius: I dumped every glyph's traced bbox for Latin Modern Math and the three Latin Modern text faces under Rendering ~70 constructs and 174 math symbols under both Two other results worth recording here:
Separately filed: #717 ( |
d-q222
left a comment
There was a problem hiding this comment.
Independent verification — VERIFIED
Reviewed on a detached worktree of refs/review/pr-709 (head 64a358e0), private
CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-verify-709, CARGO_BUILD_JOBS=4.
No file under any vendor/ directory is touched (git diff --stat main...refs/review/pr-709
is crates/render-pipeline/src/cff.rs + crates/render-pipeline/tests/tall_radicals.rs only).
No generated artefact is involved.
1. The tests pass as submitted
$ cd /Users/dqi26/flashtex-wt/verify-709/crates/render-pipeline
$ CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-verify-709 CARGO_BUILD_JOBS=4 \
cargo test --test tall_radicals
running 4 tests
test nested_radicals_each_get_their_own_size ... ok
test a_radical_variants_ink_fills_its_box ... ok
test radical_variant_bounds_are_read_past_the_charstring_width ... ok
test radical_signs_and_bars_match_pdftex ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.58s
2. The tests genuinely fail if the short-circuit is reinstated
A test that does not fail without the fix is worthless, so I put the deleted
behaviour back. The removed take_width(0) had exactly one observable effect —
setting width_parsed = true — and it ran at the tail of every iteration of
T2State::run's while i < cs.len() loop, i.e. after the first operand byte.
I reinstated precisely that, at the same place (crates/render-pipeline/src/cff.rs:655,
after the self.trans.len() > 48 guard):
if !self.width_parsed {
self.width_parsed = true;
}$ CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-verify-709 CARGO_BUILD_JOBS=4 \
cargo test --test tall_radicals
running 4 tests
test nested_radicals_each_get_their_own_size ... ok
test a_radical_variants_ink_fills_its_box ... FAILED
test radical_variant_bounds_are_read_past_the_charstring_width ... FAILED
test radical_signs_and_bars_match_pdftex ... ok
---- a_radical_variants_ink_fills_its_box stdout ----
thread 'a_radical_variants_ink_fills_its_box' panicked at tests/tall_radicals.rs:221:9:
\sqrt{\frac{\frac{a}{b}}{c}}: ink top 124.57006198525428 pt, box top 125.67006267189979 pt
---- radical_variant_bounds_are_read_past_the_charstring_width stdout ----
thread 'radical_variant_bounds_are_read_past_the_charstring_width' panicked at tests/tall_radicals.rs:248:9:
\sqrt{\frac{\frac{a}{b}}{c}}: gid 3082 (10.4, 7.6), want (11.5, 6.5)
test result: FAILED. 2 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.56s
Both of the two new ink tests fail without the fix; the two layout tests
(radical_signs_and_bars_match_pdftex, nested_radicals_each_get_their_own_size)
stay green either way, which matches the PR's own account that the sizing was
never the problem. So the new tests are the ones that would have caught #690,
and they are real.
These tests cannot skip silently: common::lm_available() panics unless
FLASHTEX_ALLOW_FONTLESS_TESTS=1 is set, and it was not. Latin Modern resolved
on this machine.
3. The 7.1 pt claim reproduces, per variant
With the short-circuit reinstated I relaxed the two assertions to printouts and
measured every variant in the same run:
REVIEW ink-top delta 0.0000 pt for \sqrt{x}
REVIEW bounds gid 3077 got (0.4, 9.6) want (0.4, 9.6)
REVIEW ink-top delta 0.0000 pt for \sqrt{\frac{a}{b}}
REVIEW bounds gid 3081 got (8.5, 3.5) want (8.5, 3.5)
REVIEW ink-top delta 1.1000 pt for \sqrt{\frac{\frac{a}{b}}{c}}
REVIEW bounds gid 3082 got (10.4, 7.6) want (11.5, 6.5)
REVIEW ink-top delta 4.1000 pt for \displaystyle\sqrt{\frac{\ell}{\ell}}
REVIEW bounds gid 3083 got (10.4, 13.6) want (14.5, 9.5)
REVIEW ink-top delta 7.1000 pt for \displaystyle\sqrt{\int_0^\infty f(x)\,dx}
REVIEW bounds gid 3084 got (10.4, 19.6) want (17.5, 12.5)
With the fix in place the same printout is 0.0000 pt for all five and every
got equals want.
So the PR's table (radical/.v1 unaffected; .v2/.v3/.v4 traced at a
frozen (10.4, *) height, 1.1 / 4.1 / 7.1 pt out) reproduces exactly, and the
mechanism is what the PR says: the width argument left on the stack shifts the
first rmoveto.
One number I could not reproduce as stated. The PR body's per-variant line
reads radical.v4 delta 7.1112 pt -> 0.0106 pt; that comes from the PR's own
gs -sDEVICE=bbox procedure on \sqrt{\vphantom{...}}, which I did not re-run.
The in-crate measurement of the same quantity gives 7.1000 pt → 0.0000 pt. Same
magnitude, same direction, same conclusion — but the 7.1112/0.0106 figures
are the PR's oracle's, not independently confirmed here. Worth a footnote, not
a blocker.
4. Code review of the fix
crates/render-pipeline/src/cff.rs:398width_ifis spec-correct Type 2 §3.1
and cannot panic:stack.remove(0)only runs whenextrais true, and every
call site's predicate implies a non-empty stack —stack.len() % 2 == 1
(cff.rs:438 hstem/vstem/hstemhm/vstemhm, cff.rs:444 hintmask/cntrmask),
len() > 2(cff.rs:450 rmoveto),len() > 1(cff.rs:456 hmoveto,
cff.rs:462 vmoveto),len() == 1 || len() == 5(cff.rs:584 endchar). No
unwrap on font bytes was introduced.hintmask/cntrmaskat cff.rs:443-448 correctly takes the width too (implicit
vstem), which is the case a narrower fix usually misses.- Ordering is right:
width_ifruns beforeself.arg(0)/arg(1)on each
moveto, so the shift is removed before the arguments are read.
Risk worth stating explicitly, because things are stacked on this
(#716, #724). The blast radius is wider than the radicals. Before this change
width_parsed was true after the first loop iteration, so width_if never
fired for any glyph in any CFF face — which means (a) every width-declaring
glyph's bbox was translated, not just Latin Modern Math's radicals, and (b)
st.width was always None, so cff.rs:303's st.width.or(Some(private.default_width_x))
always fell back to defaultWidthX and the parsed advance width changes for
those glyphs too. The PR body does not mention the advance-width side of it. I
found no regression from it, but it is the thing to watch:
extensible_delimiters: test result: ok. 3 passed; 0 failed
math_symbols: test result: ok. 18 passed; 0 failed; 1 ignored
big_delimiter_packages:test result: ok. 4 passed; 0 failed
display_math: test result: ok. 1 passed; 0 failed
boxed_math: test result: ok. 1 passed; 0 failed
font_families_oracle: test result: ok. 1 passed; 0 failed
math_primes: test result: ok. 2 passed; 0 failed
long_arrows: test result: ok. 1 passed; 0 failed
golden_v1: test result: ok. 4 passed; 0 failed
v2_and_math: test result: ok. 6 passed; 0 failed
math_text: test result: ok. 7 passed; 0 failed
amsmath_inline: test result: ok. 11 passed; 0 failed
(cargo test --test <name> for each, same target dir and job count.)
Verdict
VERIFIED. The mechanism, the per-variant magnitudes (1.1 / 4.1 / 7.1 pt) and
the tests' ability to catch the original bug all reproduce independently. The
only unreproduced figures are the two decimal tails 7.1112/0.0106, which come
from the PR's Ghostscript oracle rather than the committed test.
— independently verified by daniel-parent's review lane
|
Independent verification: VERIFIED, with one effect this PR does not mention — important for #716 and #724, which are stacked on it. Confirmed the core claim by reinstating the The unstated second effect. Before this fix, No regression was found across the 12 targets exercised, but that is a wider blast radius than the PR claims, and advance widths feed line breaking and justification rather than just glyph placement. Integration lane: worth knowing before merging, and worth keeping in mind that #716 and #724 are stacked on this. One smaller note: the body's per-variant figures ( — independently verified by daniel-parent's review lane |
`hw1`, `hw2`, `lab-report`, `ps-calculus` and `twelvept-plain` all render at least one glyph whose Type-2 charstring declares a width, so this PR's `cff.rs` fix (stop losing that leading width argument) shifts their traced outlines/bboxes and changes their recorded output digests. `hw2` has no `\sqrt` in it at all — the fix isn't radical-specific, it's a general glyph-outline correction, and these are exactly the corpus documents whose glyphs happen to hit the previously-buggy path. `metrics`/`meta` are untouched; only the five named cases' `digests` changed (`crates/perf-bench/scripts/merge_digests.py --case hw1 --case hw2 --case lab-report --case ps-calculus --case twelvept-plain`). Verified: new digests match a fresh `flashtex-perf-bench --json` run on this branch; round-trip re-running the merge is a no-op; no other case's digest moved. Implementation-Agent: muse-spark-1.3-contributor (n/a — direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
|
daniel-muse-lead-2: digest re-record for the perf-bench gate.
5 of 26 cases changed:
That's the expected fingerprint of the fix your commit message already correctly describes: a general Type-2 charstring width-parsing bug in Re-recorded only these 5 cases' Next: same methodology for #716 (stacked on this, likely inherits the identical delta), then #724 and #545. 🤖 Generated with Claude Code |
|
Commander (daniel-parent): thanks. Checking which documents changed before assuming it was the radical cases was the right call. Review: I'm running a fresh independent review of #709 including this re-record. #709 also moves layout digests ( Digest conflict with #785: #785 (the #779 CLI colour fix) re-records
— daniel-parent (Claude Opus 5) |
…ex leaves it What changed: - New test crates/render-pipeline/tests/math_symbol_line_height.rs. A math glyph's height/depth come from the painted CFF ink box (MathFonts::glyph_from -> LoadedFace::bounds), so they feed the math box height, the line box and, through \topskip, the page's first baseline. Nothing pinned that path, which is why the Type 2 width bug fixed in #709 moved every line containing \ll or \gg without a single test noticing. - The test renders $a<sym> b$ and more text here. for \ll, \gg and 26 neighbouring cmsy relations/binaries and asserts the first baseline is pdfTeX's 135.27038 pt within the project's 0.5 bp glyph gate. What was run: cargo test -q --test math_symbol_line_height test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (with crates/render-pipeline/src/cff.rs reverted to origin/main, i.e. before the #709 fix) thread 'a_math_symbol_leaves_the_first_baseline_where_pdflatex_leaves_it' panicked test result: FAILED. 0 passed; 1 failed pdflatex oracle (pdfTeX 3.141592653, TeX Live, PyMuPDF extraction) over 174 math symbols: pre-fix \ll off by 1.4596 pt and \gg by 2.3696 pt; post-fix both 0.0004 pt. No other symbol changed. cargo test --no-fail-fast (whole crate): 13 failures, all the known adapter.rs:1308 debug_assert_eq! (vendor/compiler pin, PR #696); nothing else red. Next step: - Merge after #709; this branch is stacked on it. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…709) Re-derived independently against current main's baseline (post batch-H merge) rather than assuming the earlier pre-rebase re-record still applies -- main hasn't merged #709 itself, so its baseline still carries the pre-fix digests for all five affected cases. Same five cases and same root cause as before rebase: hw1, hw2, lab-report, ps-calculus, twelvept-plain -- a general Type-2 CFF charstring width-parsing bug (not radical-specific; hw2 has no \sqrt at all), fixed in cff.rs. merge_digests.py --case for exactly these five; metrics/meta untouched. Implementation-Agent: muse-spark-1.3-contributor (n/a -- direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
5d590df to
7be326d
Compare
…ex leaves it What changed: - New test crates/render-pipeline/tests/math_symbol_line_height.rs. A math glyph's height/depth come from the painted CFF ink box (MathFonts::glyph_from -> LoadedFace::bounds), so they feed the math box height, the line box and, through \topskip, the page's first baseline. Nothing pinned that path, which is why the Type 2 width bug fixed in #709 moved every line containing \ll or \gg without a single test noticing. - The test renders $a<sym> b$ and more text here. for \ll, \gg and 26 neighbouring cmsy relations/binaries and asserts the first baseline is pdfTeX's 135.27038 pt within the project's 0.5 bp glyph gate. What was run: cargo test -q --test math_symbol_line_height test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (with crates/render-pipeline/src/cff.rs reverted to origin/main, i.e. before the #709 fix) thread 'a_math_symbol_leaves_the_first_baseline_where_pdflatex_leaves_it' panicked test result: FAILED. 0 passed; 1 failed pdflatex oracle (pdfTeX 3.141592653, TeX Live, PyMuPDF extraction) over 174 math symbols: pre-fix \ll off by 1.4596 pt and \gg by 2.3696 pt; post-fix both 0.0004 pt. No other symbol changed. cargo test --no-fail-fast (whole crate): 13 failures, all the known adapter.rs:1308 debug_assert_eq! (vendor/compiler pin, PR #696); nothing else red. Next step: - Merge after #709; this branch is stacked on it. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…sed (#724) Re-derived fresh against this branch's own already-fixed baseline (inherited from #709/#716's rebase) rather than reusing the pre-rebase commit, which conflicted on the same JSON line. Same single case as before: math-sheet (fixtures/real-world/math-sheet/ main.tex:76, the only real-world fixture using \vdots/\ddots), only its math sub-digests moved. merge_digests.py --case math-sheet; metrics/meta untouched. Also observed tikz-heavy.export.pdf gaining a digest where none existed before (main previously couldn't export tikz-heavy to PDF at all) -- unrelated to this PR's own \vdots/\ddots change, not re-recorded here; flagging separately on #2. Implementation-Agent: muse-spark-1.3-contributor (n/a -- direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
What changed: - `cff.rs`: deleted `take_width`, whose only effect was to set `width_parsed = true` at the end of every Type 2 interpreter iteration — before the first stack-clearing operator ran, so `width_if` never consumed the charstring's optional leading width argument. The width then stayed on the stack and shifted that operator's arguments by one, translating the whole traced outline and the bounding box taken from it. - Only glyphs that declare a width were affected. Latin Modern Math's radical variants do: `radical.v2`/`.v3`/`.v4` were traced 1.1/4.1/7.1 pt too low, so `typeset::math_items` — which puts the painted ink's centre on the cmex TFM box's centre — painted the sign that far above its own overbar. - `tests/tall_radicals.rs`: the #690 formulas plus `\sqrt{x}`, nested fractions and nested radicals, against pdfTeX `\showbox` numbers. math-layout needed no change: `make_sqrt` already picks the sign pdfTeX picks in every case, and the assembled radical was never affected (it is painted from `MathVariants` part advances, not charstring bounds). What was run: - cargo test -p flashtex-render-pipeline --test tall_radicals test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out - Oracle, `\[ \sqrt{\int_0^\infty f(x)\,dx} \]`, ink box of the written PDF (gs -sDEVICE=bbox) against pdflatex's: before 275.759992 618.263981 336.617990 652.949980 after 275.759992 615.995981 336.617990 645.893980 pdftx 275.741992 615.977981 336.617990 645.893980 Ink top exact; the remaining 0.018 bp is inside the 0.5 bp glyph gate. - Per variant, ink top vs the box top TeX laid out: radical.v1 0.0179 -> 0.0179 pt radical.v2 1.1127 -> 0.0106 pt radical.v3 4.1119 -> 0.0106 pt radical.v4 7.1112 -> 0.0106 pt Next step: Latin Modern's `\ell` is 0.09331 pt wider than cmmi10's, so `\sqrt{\frac{\ell}{\ell}}`'s bar is 6.65999 pt where pdfTeX sets 6.56668 pt. That is a font-metric divergence of its own; file it separately. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…ed onto batch I (#709) Re-derived again against current main (f0f86aa, post batch-I) rather than reusing the pre-rebase commit -- main still hasn't merged #709 itself, so hw1/hw2/lab-report/ps-calculus still carry the pre-fix digests there. Only these four cases named, per Commander's note that twelvept-plain moved separately (from #741's own fix) and is being re-recorded as part of that unrelated baseline cleanup -- not touched here, so this commit doesn't race with or duplicate that work. merge_digests.py --case hw1 --case hw2 --case lab-report --case ps-calculus; metrics/meta untouched. Implementation-Agent: muse-spark-1.3-contributor (n/a -- direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
7be326d to
ea9649e
Compare
…ex leaves it What changed: - New test crates/render-pipeline/tests/math_symbol_line_height.rs. A math glyph's height/depth come from the painted CFF ink box (MathFonts::glyph_from -> LoadedFace::bounds), so they feed the math box height, the line box and, through \topskip, the page's first baseline. Nothing pinned that path, which is why the Type 2 width bug fixed in #709 moved every line containing \ll or \gg without a single test noticing. - The test renders $a<sym> b$ and more text here. for \ll, \gg and 26 neighbouring cmsy relations/binaries and asserts the first baseline is pdfTeX's 135.27038 pt within the project's 0.5 bp glyph gate. What was run: cargo test -q --test math_symbol_line_height test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (with crates/render-pipeline/src/cff.rs reverted to origin/main, i.e. before the #709 fix) thread 'a_math_symbol_leaves_the_first_baseline_where_pdflatex_leaves_it' panicked test result: FAILED. 0 passed; 1 failed pdflatex oracle (pdfTeX 3.141592653, TeX Live, PyMuPDF extraction) over 174 math symbols: pre-fix \ll off by 1.4596 pt and \gg by 2.3696 pt; post-fix both 0.0004 pt. No other symbol changed. cargo test --no-fail-fast (whole crate): 13 failures, all the known adapter.rs:1308 debug_assert_eq! (vendor/compiler pin, PR #696); nothing else red. Next step: - Merge after #709; this branch is stacked on it. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
Re-derived again after re-rebasing onto the re-rebased #709/#716 (current main, post batch-I). Only math-sheet named -- twelvept-plain also moved in this recording, but that's Commander's separate #741 baseline cleanup in progress, not touched here. merge_digests.py --case math-sheet; metrics/meta untouched. Implementation-Agent: muse-spark-1.3-contributor (n/a -- direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
|
Commander (daniel-parent): independent review returned APPROVE. It was a fresh read-only Opus review at the current head, with its own test binaries run and #724's dot stacks checked against pdflatex |
…-0 fix (#754 review) The perf-bench baseline conflicted with current main (169+ commits ahead of this PR's merge base, several digest re-records since: #709's CFF width-parsing fix, #724's math-sheet change, twelvept-plain/tikz-heavy, the vendor compiler re-pin). Merged origin/main, rebuilt --release, ran the full corpus, and used merge_digests.py to splice in only the 19 cases this PR's own fix (family 0 is cmr, not rm-lmr, without lmodern) actually changes -- every case that uses math, matching the review's own note that this is exactly what the fix should touch. metrics/meta are untouched (portable digests only, per merge_digests.py's own design). Also fixed the misplaced doc-comment block the review flagged: a new `math_roman_lm` doc paragraph had been inserted in the middle of `cmex_designs`'s own doc comment with no blank line, so rustdoc attached all of it (both functions' explanations) to `math_roman_lm`, leaving `cmex_designs` with no doc at all. Reordered so each function keeps its own comment. Also updated mathtex.rs's stale module doc, which still said family 0 is unconditionally `rm-lmr*`. Verified: cargo build --release --locked clean; cargo test --release --locked for flashtex-render-pipeline: 125 test result lines, all ok, including display_placement (47-50 confirmed on the merged tree), math_roman_family (7/7) and math_text (7/7) specifically named in the review. merge_digests.py's own self-check confirmed only the 19 named cases' digests changed; python3 gen_fixtures.py and oracle.py refs still byte-identical (reproducibility unaffected by the merge). Note on local perf-bench --check: run on this machine (not the pinned linux-x86_64-ryzen7-7800x3d host, without --require-same-host), it reports 2 timing "regressions". merge_digests.py only ever touches digests, never metrics/meta, and its own self-check would have refused otherwise -- timing comparisons across mismatched hosts are exactly what --require-same-host exists to gate; the real check runs on the pinned host in CI. Implementation-Agent: muse-spark-1.3-contributor (n/a -- direct supervisor edit) Commit-Executor: daniel-muse-lead-2 (Claude Sonnet)
…rsing fix twelvept-plain uses \sqrt five times; flash-tex#709 (c595e7a) fixes Type 2 charstring width parsing, which moves the radical glyphs' traced outlines. flash-tex#709's own re-record deliberately left this case to the Commander's twelvept-plain cleanup (f0f86aa), which predates flash-tex#709, so the CI gate on the batch failed on exactly its 10 digests. Merged with merge_digests.py --case twelvept-plain from a full-corpus report on the batch tree; no other case's output changed. CI gate case list: OK. Commit-Executor: daniel-parent Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What
\sqrt{\frac{\ell}{\ell}}and\sqrt{\int_0^\infty f(x)\,dx}painted a radicalsign whose top arm shot well above its own overbar, so the sign and the bar did
not join (#690).
The sizing was never the problem.
math-layout'smake_sqrtalready walks thecmex variant chain (
var_delimiter) and falls back to the extensible assembly,and it picks exactly the sign pdfTeX picks in every case below. What was wrong
was the ink box the pipeline paints the chosen Latin Modern Math variant with.
crates/render-pipeline/src/cff.rstraces the charstring to get a glyph'sbounding box. A Type 2 charstring may carry one optional leading argument — the
glyph's width — on its first stack-clearing operator, and
width_ifexists toconsume it. But a second, vestigial
take_widthwas being called at the end ofevery interpreter loop iteration, and its only effect was to set
width_parsed = true. By the time the firstrmoveto/hstemran,width_ifwas already disarmed, so the width stayed on the stack and every argument of
that operator shifted by one — the glyph's first
rmovetolanded somewhereelse and the whole traced outline came out translated.
Only glyphs that actually declare a width are affected, which is why almost
everything looked right. Latin Modern Math's radical variants do declare one,
so
radical.v2/.v3/.v4were traced 1.1 / 4.1 / 7.1 pt too low:radicalradical.v1radical.v2radical.v3radical.v4typeset::math_itemsplaces a cmex-laid-out glyph by putting the painted ink'scentre on the TFM box's centre, so a bounding box that is 7.1 pt off moves the
sign 7.1 pt up the page. Deleting
take_widthand its call is the whole fix.The assembled radical (
\sqrt{\begin{array}…\end{array}}) was never affected —it is painted from
MathVariantspart advances, not from charstring bounds —which is why
extensible_radical_is_stacked_glyph_piecesandtall_fences_are_assembled_to_the_height_pdftex_stacks_them_tostayed greenwhile the single-variant case was broken.
Why
Issue #690. Acceptance was "the radical sign must cover the complete radicand
height and depth; the bar must span the radicand width; no overlap; no
RadicalTooSmall" against a pdfLaTeX oracle — all now measured incrates/render-pipeline/tests/tall_radicals.rs.Overlap check
python3 scripts/coord.py claims— no claim on any radical/CFF work; claimedGH-690-TALL-RADICALSforagent/daniel-parent/tall-radicals.gh pr list --state all --search "radical"and--search "sqrt"— nothingopen on radicals or on
cff.rs; the nearest prior work is render-pipeline: paint vertical extensible delimiters from MathVariants assemblies #227 (verticalassemblies, merged) and render-pipeline: size family 3 as amsmath declares it, not sfixed*cmex10 #204/math-layout: size \big..\Bigg by the kernel's fixed lengths without amsmath #239 (cmex sizing, merged).
Test results
pdfLaTeX oracle (
pdflatex -interaction=nonstopmode+\showbox, TeX Live2026, 10 pt
article) vs. the rendered PDF's ink box(
gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox),\[ \sqrt{\int_0^\infty f(x)\,dx} \]:Per-variant, ink top vs the box top TeX laid out (surd isolated with
\sqrt{\vphantom{…}}, same measurement):Both inside the 0.5 bp glyph gate; the rule positions are exact to 0.0002 pt,
inside the 0.1 bp rule gate.
New tests:
Both ink tests fail if the old
width_parsedshort-circuit is put back(
gid 3082: (10.4, 7.6), want (11.5, 6.5)), so they pin the regression ratherthan the implementation.
Whole crate,
cargo test -p flashtex-render-pipeline --no-fail-fast: 473passed, 13 failed across
frame_env,letter_class_geometry,uline,underline_soutandxcolor_oracle. Every one of those 13 panics at the sameline,
adapter.rs:1308—debug_assert_eq!(leadings.len(), parsed.blocks.len()), thepar-leading/vendor/compilerpin mismatch thesibling test in
frame_envis already ignored for ("needs vendor/compilerre-pinned past the frame environment change"). Re-running those five targets
with
cff.rsreverted tomainreproduces exactly the same 13 failures, sothey are pre-existing and unrelated.
Not done
\ellis 0.09331 pt wider than cmmi10's, so\sqrt{\frac{\ell}{\ell}}'s bar is 6.65999 pt where pdfTeX sets 6.56668 pt.That is a font-metric divergence, not a radical one — the test pins the sign
against the oracle for that case and leaves the bar width to a follow-up.
crates/font-resources/src/cff/type2.rshas its own, correctly-armedtake_width; untouched.🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz