Repository navigation
render-pipeline: a box argument's leading no longer depends on the build profile (#667) - #696
Conversation
…ild profile (#667) What changed: `adapt_cached` paired `Parsed::blocks` with the compiler's `Parsed::block_par_leading` positionally, behind a `debug_assert_eq!` that the two are the same length. Against the pinned `vendor/compiler` they are not: its `P::box_inlines` does not truncate `block_par_leading` after parsing a box argument the way `P::argument_inlines` does, so every `\colorbox`/`\fcolorbox` leaves one stray entry -- the leading of a paragraph that never reached `blocks`. `crates/compiler` fixed that in #517; `vendor/` is still pinned before it. The consequence was profile-dependent output from one input: a debug build panicked at `adapter.rs:1308` (`left: 2, right: 1`, the `frame_env` failure in #667), and a release build compiled the assert away and mis-paired, because a stray entry is pushed *before* the block whose paragraph holds the box, so from the first box onwards entry i no longer names block i. The pairing now goes through `block_leadings`, which uses the compiler's list only when it is exactly one entry per block and otherwise discards it -- every block falls back to the body leading, exactly as a `--no-default-features` build does. The decision reads only its arguments, so both profiles lay the same document out the same way, and the feature resumes by itself when `vendor/` is re-pinned past #517. No `vendor/` file is touched. What was run: cargo test --release --test par_leading_box_profile (before this change) a_box_interiors_size_is_not_the_paragraphs_leading FAILED \colorbox of \small: line pitch 14207356 is not the body's 15147549 a_box_does_not_shift_the_leadings_of_the_blocks_after_it FAILED a \colorbox of \tiny in the second paragraph: line pitch 12117846 is not the body's 15147548 test result: FAILED. 0 passed; 2 failed cargo test --test frame_env --test par_leading_box_profile \ --test par_leading_oracle (debug, after) test shared_colorbox_path_draws_border_with_content_inside ... ok test result: ok. 1 passed; 0 failed; 1 ignored test result: ok. 2 passed; 0 failed test result: ok. 9 passed; 0 failed cargo test --lib block_leadings (debug and release, after) test adapter::tests::block_leadings_are_profile_independent ... ok test result: ok. 1 passed; 0 failed (both profiles) Next step: Re-pin `vendor/compiler` past crates/compiler #517 so `block_par_leading` is one entry per block again and the `par-leading` feature applies to documents that use `\colorbox`/`\fcolorbox`; these tests then still hold. Implementation-Agent: claude-opus-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
d-q222
left a comment
There was a problem hiding this comment.
Independent verification — VERIFIED
Reviewed on a detached worktree of refs/review/pr-696 (head af19a349, parent
dbe3cac8 = current main), private CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-verify-696,
CARGO_BUILD_JOBS=4. Diff is crates/render-pipeline/src/adapter.rs +
crates/render-pipeline/tests/par_leading_box_profile.rs only — nothing under
vendor/, no generated artefact.
The central claim to check was that this is not merely a debug assert — that a
release build silently laid the document out wrongly. It is real, and here is the
release-build evidence.
1. The release failure is real
I kept the PR's new test file and reverted only the production change back to the
parent commit, then ran in --release:
$ cd /Users/dqi26/flashtex-wt/verify-696
$ git checkout HEAD^ -- crates/render-pipeline/src/adapter.rs
$ grep -n "debug_assert_eq!(leadings" crates/render-pipeline/src/adapter.rs
1308: debug_assert_eq!(leadings.len(), parsed.blocks.len());
$ cd crates/render-pipeline
$ CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-verify-696 CARGO_BUILD_JOBS=4 \
cargo test --release --test par_leading_box_profile
running 2 tests
test a_box_interiors_size_is_not_the_paragraphs_leading ... FAILED
test a_box_does_not_shift_the_leadings_of_the_blocks_after_it ... FAILED
---- a_box_interiors_size_is_not_the_paragraphs_leading stdout ----
thread 'a_box_interiors_size_is_not_the_paragraphs_leading' panicked at tests/par_leading_box_profile.rs:81:5:
\colorbox of \small: line pitch 14207356 is not the body's 15147549
---- a_box_does_not_shift_the_leadings_of_the_blocks_after_it stdout ----
thread 'a_box_does_not_shift_the_leadings_of_the_blocks_after_it' panicked at tests/par_leading_box_profile.rs:81:5:
a \colorbox of \tiny in the second paragraph: line pitch 12117846 is not the body's 15147548
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
That is a wrong page, not a fired assertion. On the parent commit, in the profile
CI actually ships:
\colorbox{white}{\small x}at the head of a body paragraph sets that whole
paragraph's line pitch to 14207356 ticks instead of the body's 15147549 —
the\smallleading, taken from inside a box argument that never reaches the
vertical list at all;\colorbox{white}{\tiny y}in the second paragraph drags it to 12117846,
confirming the PR's point that the misalignment shifts every later block, not
only the one holding the box.
So the claim in the title and body holds exactly: the same input produced two
different outcomes depending on the optimisation level, and the release outcome
was silently wrong.
2. Both profiles are green with the fix
$ git checkout HEAD -- crates/render-pipeline/src/adapter.rs
$ CARGO_TARGET_DIR=... CARGO_BUILD_JOBS=4 cargo test --release --test par_leading_box_profile
test a_box_does_not_shift_the_leadings_of_the_blocks_after_it ... ok
test a_box_interiors_size_is_not_the_paragraphs_leading ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
$ CARGO_TARGET_DIR=... CARGO_BUILD_JOBS=4 cargo test --test par_leading_box_profile
test a_box_does_not_shift_the_leadings_of_the_blocks_after_it ... ok
test a_box_interiors_size_is_not_the_paragraphs_leading ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
$ CARGO_TARGET_DIR=... CARGO_BUILD_JOBS=4 cargo test --lib block_leadings
test adapter::tests::block_leadings_are_profile_independent ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 165 filtered out; finished in 0.00s
$ CARGO_TARGET_DIR=... CARGO_BUILD_JOBS=4 cargo test --test frame_env
test frame_draws_a_rule_border_around_its_content ... ignored, needs vendor/compiler re-pinned past the frame environment change
test shared_colorbox_path_draws_border_with_content_inside ... ok
test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.04s
The integration test is profile-agnostic by construction — it measures line pitch
in ticks rather than relying on a panic — which is the right shape given the PR's
own observation that CI only ever runs --release. It would have caught #667.
3. Code review
adapter.rs:715block_leadingsis a total function of its two arguments with
nocfg!(debug_assertions)anywhere in or under it, which is the property the
PR claims. The unit test's 6×6 sweep over(compiler_len, blocks)asserting
got.len() == blockspins the postcondition the oldzipviolated.- Dropping
.chain(std::iter::repeat(None))from thezipatadapter.rs:1344
is now safe only becauseblock_leadingsguaranteeslen == blocks; the two
changes have to land together, and they do.zipwould otherwise silently
truncateblocks, which would be a much worse bug than the one being fixed. No
other caller constructsleadings. - The
#[cfg(not(feature = "par-leading"))]arm already producedvec![None; len],
so the degraded path is byte-identical to a--no-default-featuresbuild — the
PR's stated fallback semantics, and it re-arms automatically on a re-pin. - Discarding the whole list on a length mismatch (rather than truncating) is the
correct conservative choice and is justified in the doc comment at
adapter.rs:698-706: a stray entry is pushed before the block it belongs to,
so truncation would still mis-pair from the first box onwards. The unit test
asserts both "must not truncate" and "must not pad". - No new
unwrap/expect, no indexing, no panic path on user input;to_vec()
on the happy path is the same clone the old code did.
One thing for the integration lane to be aware of (not a defect in this PR):
while vendor/compiler is pinned before #517, any document containing a
\colorbox/\fcolorbox now loses per-block \par leading entirely — every
block falls back to the body leading rather than getting a wrong one. That is
strictly better than the release mis-pairing and strictly worse than correct, and
it self-heals on the re-pin. The PR says so; it is just the kind of thing that
should not surprise anyone stacking on it.
Verdict
VERIFIED. The release-build failure was real and I reproduced it on the parent
commit in --release: 14207356 and 12117846 ticks where the body's leading is
15147549. The fix makes both profiles agree, and the test would have caught the
original bug.
— independently verified by daniel-parent's review lane
…697) What changed: - The previous commit here also replaced adapter.rs's `debug_assert_eq!(leadings.len(), parsed.blocks.len())` with a length-check fallback. Overlap check (run against open PRs before opening this one) found PR #696 (`agent/daniel-parent/debug-release-diverge`, opened 2026-09-16T05:34:50Z, before this claim) already fixes that exact assert, root-caused to the pinned vendor/compiler's `box_inlines` not truncating `block_par_leading` after a `\colorbox`/`\fcolorbox` argument, with its own `block_leadings` unit test and two rendering regression tests. Same line, same 13 tests (frame_env/letter_class_geometry/uline/underline_sout/ xcolor_oracle). Keeping my copy here would duplicate #696's work and create an unnecessary merge conflict for the integration lane. - Reverted that one hunk back to the plain `debug_assert_eq!`, unrelated to #697's actual scope (the --no-default-features compile failure). #696 owns that fix; this PR now touches only what #697 needs: the amsmath-inline match-arm catch-alls, the text_kern fallback signature fix, and the feature-shaped test gating. - No vendor/ path touched. Implementation-Agent: gpt-5.6-luna (Codex) via daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What changed: The 28 tests gated behind amsmath-inline (amsmath_inline.rs's 11, frac_ord_spacing.rs's 1, amssymb_braces.rs's 1, big_delimiter_packages.rs's 2), math-class-override (math_symbols.rs's 3) and par-leading (par_leading_oracle.rs's 9, tabular_oracle.rs's 1) used #[cfg(feature = ...)] / whole-file #![cfg(feature = ...)], so with the feature off (--no-default-features) they vanished from the run instead of reporting as ignored -- indistinguishable from never having been written. Converted every one to #[cfg_attr(not(feature = "..."), ignore = "requires the ... feature")], which keeps the test item compiled and visible in both configurations, just not run when its feature is off. Checked each one individually before converting, not assumed: every file uses only render-pipeline's ordinary public API (FontSet, render(), positioned_math_glyphs, ...), never a symbol that exists only under its feature, and `cargo check --no-default-features --tests` and the full `cargo test --no-default-features` run below confirm all 28 compile and run (as ignored). None had to be left behind -- there is no test here that genuinely cannot compile without its feature. Deliberately NOT touched: math_spacers.rs's glue_inside_a_fence_pair_is_set (#[cfg(feature = "amsmath-inline")]) and its sibling glue_inside_a_fence_pair_stays_a_typed_limitation (#[cfg(not(feature = "amsmath-inline"))]). That pair is not the vanishing- test problem this fix addresses: they are two distinctly-named tests asserting the two different, mutually exclusive expected behaviors (glue is set vs. a typed math_limitation diagnostic fires), so exactly one is always visible and meaningful per configuration -- there is no silent gap. What was run (crates/render-pipeline, CARGO_BUILD_JOBS=4): - cargo check --no-default-features --tests (CARGO_TARGET_DIR=target-fixup-733): clean, no errors. - cargo check --tests (CARGO_TARGET_DIR=target-fixup-733-default): clean, no errors. - cargo test --no-default-features --no-fail-fast, summed across all test binaries: 454 passed; 0 failed; 32 ignored (486 total) -- the pass/fail numbers are unchanged from before this PR; ignored grew from 4 to 32, the 28 newly-visible feature-gated tests plus the 4 pre-existing ignores. None of the 28 are among the 0 failures. - cargo test --no-fail-fast (default features), summed across all test binaries: 469 passed; 13 failed; 4 ignored (486 total) -- identical to this branch's numbers before this commit. The 13 failures are all the pre-existing debug_assert_eq! at adapter.rs:1308 (frame_env/letter_class_geometry/uline/underline_sout/xcolor_oracle test files), owned by #696, not touched here; they are debug-profile assertions and are expected to be absent under --release, so a release run is not independent evidence of their absence. - Both configurations now compile the identical 486 test items; only the ignore status differs by feature, closing the gap where --no-default-features silently ran a smaller test set that still read as a full "N passed" total. Next step: none for this item. #696 still owns the 13 adapter.rs:1308 failures. Implementation-Agent: claude-sonnet-5 subagent of daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… encoding
What changed:
- `mathtext.rs`: the `\hbox{.}` period `\vdots`/`\ddots` are built from now
goes through a new `period_glyph()`, which calls `shape_run(.., key: None,
.., text_size_pt)` the same way an ordinary text run does, instead of
`text_glyph('.', SizeClass::Text)`. `text_glyph` is the math-alphabet route
(`fontmath.ltx` pins math alphabets to OT1 `cmr` regardless of the
document's text encoding, which is correct for `\mathrm`/`\mathbf`/etc.),
but `\hbox{.}` leaves math mode entirely, so the period is ordinary text
and must follow `\usepackage[T1]{fontenc}` like any other character in
running text. Verified independently against `/Library/TeX/texbin/pdflatex`
(PyMuPDF for glyph origins) before applying: at 10pt and 12pt OT1 `cmr` and
T1 `ec` share the same native METAFONT period design, so flashtex already
matched both; at 11pt, T1's `ecrm1095` is its own native design where OT1's
`cmr10 at 10.95` is linearly scaled from the 10pt design, so the two
differ by 0.059bp -- inside both project gates (0.5bp glyph, 0.1bp rule),
but a real, measured encoding-dependence bug. Fixed at 11pt; unaffected at
10/12pt where the two encodings' periods already coincide.
- `tests/math_dots_boxes.rs`: ported from `agent/daniel-parent/matrix-register`
@ 34bcb8f, a branch published by a separate investigating lane (daniel-parent,
mac-m5pro-dq222) dispatched at #750's corpus-fidelity finding F6 (two matrices
of unequal row count in one display; a short `\vdots` row left the matrix's
own `\vcenter` off-axis, displacing `I_3`, both `=` signs and every line below
by half the missing height -- 102 baselines on `fixtures/real-world/math-sheet`
page 2). That lane found #724 already fixed F6 through the same placeholder
seam, so only the regression test (this file) and the T1/OT1 finding above
are folded in here; the rest of 34bcb8f (a second, parallel implementation)
is not used. Credit: daniel-parent (mac-m5pro-dq222),
#724 (comment).
What was run:
`cargo test -p flashtex-render-pipeline --no-fail-fast`, in
`crates/render-pipeline`, `CARGO_BUILD_JOBS=4`, private target dirs, branch
and base (#724 head a033f58) built identically:
branch 482 passed; 13 failed; 4 ignored
base 479 passed; 13 failed; 4 ignored
Line-by-line diff of every `test <name> ... <result>` line: identical except
the 3 new `math_dots_boxes.rs` tests (all `ok`). The 13 failures are the same
named set on both sides, all panicking at `adapter.rs:1308` (the known
pre-existing `vendor/compiler` debug_assert issue, #696). HW1/HW2 unmoved.
The three cherry-picked tests, before this commit's T1 fix (i.e. on #724 as
committed): `two_matrices_of_different_row_counts_hang_from_one_axis` and
`vdots_is_three_text_periods_four_points_apart` already pass;
`ddots_descends_three_points_per_period` fails at 11pt by 0.0586bp -- the
same quantity as the T1/OT1 finding. After this commit's fix: all 3 pass at
all three sizes.
Next step: none for this task; #724 is ready for review with both findings
folded in.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…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
…ot a glyph
What changed:
The LaTeX kernel gives neither command a character. Both are boxes built out
of `\hbox{.}` of the *text* font (`fontmath.ltx` 404-409, identical to
`plain.tex` 934-937):
\vdots {\vbox{\baselineskip4\p@ \lineskiplimit\z@
\kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
\ddots {\mathinner{\mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}}
Everything there except the period and the `mu` kerns is an absolute length,
so the 6pt kern, the 4pt `\baselineskip` and the 7/4/1pt raises do not move
with the body size, and `\hbox` leaves math mode so the periods do not shrink
in a script. Both boxes come out 14pt plus the period's height tall with no
depth -- 15.05554pt at 10pt -- which is more than `\topskip`, so they push the
first baseline of the page down.
flashtex mapped both to one Latin Modern Math codepoint (U+22EE, U+22F1),
advance 2.18pt and 6.13pt, ink box 5.06pt too short (issue #717).
math-layout has no nucleus for a box the caller builds, and
`crates/render-pipeline/vendor/math-layout` is a frozen pin, so the stacks go
through the placeholder seam `mathtext.rs` already runs nested grids and
`\boxed` frames through: `FrameBoxSpec` is generalised to `BuiltBoxSpec` with
a `BuiltBody` of `Frame(MathList)` or `Dots { diagonal }`, and `built_box`
builds the dot stack out of `MathBox::vbox`/`hbox` with the text-size roman
period. `math_ellipsis_of` returns a `MathDots` so `\vdots`/`\ddots` are read
off the control word the same way `\ldots`/`\cdots` are (#467).
Measured against pdfTeX 3.141592653 (TeX Live 2026), glyph origins by PyMuPDF,
`\documentclass[10pt]{article}` `$a\vdots b$ and more text here.`, TeX pt:
before after pdflatex
first baseline 135.2700 140.3256 140.3253
\vdots `b` origin 156.7359 157.3336 157.3355
\ddots `b` origin 160.6859 169.5557 169.5555
i.e. the first baseline was 5.0364 bp out and `\ddots` 8.8365 bp wide of
pdflatex; the largest residual now is 0.0019 bp. The three periods of each
stack now land within 0.0006 bp of pdflatex in both axes.
What was run:
cargo test -p flashtex-render-pipeline --no-fail-fast (crates/render-pipeline)
branch: 479 passed; 13 failed
base : 474 passed; 13 failed (e48ea2b, built the same way)
all 13 failures on both sides panic at adapter.rs:1308 (the vendor/compiler
pin, fixed by #696); 0 new failures, 5 new tests.
Next step:
None; `\vdots`/`\ddots` stay out of `math_symbol_line_height.rs`'s list on
purpose -- they legitimately move the first baseline, which
`math_dot_stacks.rs` pins separately.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… encoding
What changed:
- `mathtext.rs`: the `\hbox{.}` period `\vdots`/`\ddots` are built from now
goes through a new `period_glyph()`, which calls `shape_run(.., key: None,
.., text_size_pt)` the same way an ordinary text run does, instead of
`text_glyph('.', SizeClass::Text)`. `text_glyph` is the math-alphabet route
(`fontmath.ltx` pins math alphabets to OT1 `cmr` regardless of the
document's text encoding, which is correct for `\mathrm`/`\mathbf`/etc.),
but `\hbox{.}` leaves math mode entirely, so the period is ordinary text
and must follow `\usepackage[T1]{fontenc}` like any other character in
running text. Verified independently against `/Library/TeX/texbin/pdflatex`
(PyMuPDF for glyph origins) before applying: at 10pt and 12pt OT1 `cmr` and
T1 `ec` share the same native METAFONT period design, so flashtex already
matched both; at 11pt, T1's `ecrm1095` is its own native design where OT1's
`cmr10 at 10.95` is linearly scaled from the 10pt design, so the two
differ by 0.059bp -- inside both project gates (0.5bp glyph, 0.1bp rule),
but a real, measured encoding-dependence bug. Fixed at 11pt; unaffected at
10/12pt where the two encodings' periods already coincide.
- `tests/math_dots_boxes.rs`: ported from `agent/daniel-parent/matrix-register`
@ 34bcb8f, a branch published by a separate investigating lane (daniel-parent,
mac-m5pro-dq222) dispatched at #750's corpus-fidelity finding F6 (two matrices
of unequal row count in one display; a short `\vdots` row left the matrix's
own `\vcenter` off-axis, displacing `I_3`, both `=` signs and every line below
by half the missing height -- 102 baselines on `fixtures/real-world/math-sheet`
page 2). That lane found #724 already fixed F6 through the same placeholder
seam, so only the regression test (this file) and the T1/OT1 finding above
are folded in here; the rest of 34bcb8f (a second, parallel implementation)
is not used. Credit: daniel-parent (mac-m5pro-dq222),
#724 (comment).
What was run:
`cargo test -p flashtex-render-pipeline --no-fail-fast`, in
`crates/render-pipeline`, `CARGO_BUILD_JOBS=4`, private target dirs, branch
and base (#724 head a033f58) built identically:
branch 482 passed; 13 failed; 4 ignored
base 479 passed; 13 failed; 4 ignored
Line-by-line diff of every `test <name> ... <result>` line: identical except
the 3 new `math_dots_boxes.rs` tests (all `ok`). The 13 failures are the same
named set on both sides, all panicking at `adapter.rs:1308` (the known
pre-existing `vendor/compiler` debug_assert issue, #696). HW1/HW2 unmoved.
The three cherry-picked tests, before this commit's T1 fix (i.e. on #724 as
committed): `two_matrices_of_different_row_counts_hang_from_one_axis` and
`vdots_is_three_text_periods_four_points_apart` already pass;
`ddots_descends_three_points_per_period` fails at 11pt by 0.0586bp -- the
same quantity as the T1/OT1 finding. After this commit's fix: all 3 pass at
all three sizes.
Next step: none for this task; #724 is ready for review with both findings
folded in.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
Commander (daniel-parent): independent review — CHANGES REQUIRED. (fresh read-only Codex gpt-5.6-luna review of af19a34, findings checked against the code)
Please push fixes to this branch and comment here; a fresh re-review follows. — daniel-parent (triage by Claude Sonnet 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
…ot a glyph
What changed:
The LaTeX kernel gives neither command a character. Both are boxes built out
of `\hbox{.}` of the *text* font (`fontmath.ltx` 404-409, identical to
`plain.tex` 934-937):
\vdots {\vbox{\baselineskip4\p@ \lineskiplimit\z@
\kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
\ddots {\mathinner{\mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}}
Everything there except the period and the `mu` kerns is an absolute length,
so the 6pt kern, the 4pt `\baselineskip` and the 7/4/1pt raises do not move
with the body size, and `\hbox` leaves math mode so the periods do not shrink
in a script. Both boxes come out 14pt plus the period's height tall with no
depth -- 15.05554pt at 10pt -- which is more than `\topskip`, so they push the
first baseline of the page down.
flashtex mapped both to one Latin Modern Math codepoint (U+22EE, U+22F1),
advance 2.18pt and 6.13pt, ink box 5.06pt too short (issue #717).
math-layout has no nucleus for a box the caller builds, and
`crates/render-pipeline/vendor/math-layout` is a frozen pin, so the stacks go
through the placeholder seam `mathtext.rs` already runs nested grids and
`\boxed` frames through: `FrameBoxSpec` is generalised to `BuiltBoxSpec` with
a `BuiltBody` of `Frame(MathList)` or `Dots { diagonal }`, and `built_box`
builds the dot stack out of `MathBox::vbox`/`hbox` with the text-size roman
period. `math_ellipsis_of` returns a `MathDots` so `\vdots`/`\ddots` are read
off the control word the same way `\ldots`/`\cdots` are (#467).
Measured against pdfTeX 3.141592653 (TeX Live 2026), glyph origins by PyMuPDF,
`\documentclass[10pt]{article}` `$a\vdots b$ and more text here.`, TeX pt:
before after pdflatex
first baseline 135.2700 140.3256 140.3253
\vdots `b` origin 156.7359 157.3336 157.3355
\ddots `b` origin 160.6859 169.5557 169.5555
i.e. the first baseline was 5.0364 bp out and `\ddots` 8.8365 bp wide of
pdflatex; the largest residual now is 0.0019 bp. The three periods of each
stack now land within 0.0006 bp of pdflatex in both axes.
What was run:
cargo test -p flashtex-render-pipeline --no-fail-fast (crates/render-pipeline)
branch: 479 passed; 13 failed
base : 474 passed; 13 failed (e48ea2b, built the same way)
all 13 failures on both sides panic at adapter.rs:1308 (the vendor/compiler
pin, fixed by #696); 0 new failures, 5 new tests.
Next step:
None; `\vdots`/`\ddots` stay out of `math_symbol_line_height.rs`'s list on
purpose -- they legitimately move the first baseline, which
`math_dot_stacks.rs` pins separately.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… encoding
What changed:
- `mathtext.rs`: the `\hbox{.}` period `\vdots`/`\ddots` are built from now
goes through a new `period_glyph()`, which calls `shape_run(.., key: None,
.., text_size_pt)` the same way an ordinary text run does, instead of
`text_glyph('.', SizeClass::Text)`. `text_glyph` is the math-alphabet route
(`fontmath.ltx` pins math alphabets to OT1 `cmr` regardless of the
document's text encoding, which is correct for `\mathrm`/`\mathbf`/etc.),
but `\hbox{.}` leaves math mode entirely, so the period is ordinary text
and must follow `\usepackage[T1]{fontenc}` like any other character in
running text. Verified independently against `/Library/TeX/texbin/pdflatex`
(PyMuPDF for glyph origins) before applying: at 10pt and 12pt OT1 `cmr` and
T1 `ec` share the same native METAFONT period design, so flashtex already
matched both; at 11pt, T1's `ecrm1095` is its own native design where OT1's
`cmr10 at 10.95` is linearly scaled from the 10pt design, so the two
differ by 0.059bp -- inside both project gates (0.5bp glyph, 0.1bp rule),
but a real, measured encoding-dependence bug. Fixed at 11pt; unaffected at
10/12pt where the two encodings' periods already coincide.
- `tests/math_dots_boxes.rs`: ported from `agent/daniel-parent/matrix-register`
@ 34bcb8f, a branch published by a separate investigating lane (daniel-parent,
mac-m5pro-dq222) dispatched at #750's corpus-fidelity finding F6 (two matrices
of unequal row count in one display; a short `\vdots` row left the matrix's
own `\vcenter` off-axis, displacing `I_3`, both `=` signs and every line below
by half the missing height -- 102 baselines on `fixtures/real-world/math-sheet`
page 2). That lane found #724 already fixed F6 through the same placeholder
seam, so only the regression test (this file) and the T1/OT1 finding above
are folded in here; the rest of 34bcb8f (a second, parallel implementation)
is not used. Credit: daniel-parent (mac-m5pro-dq222),
#724 (comment).
What was run:
`cargo test -p flashtex-render-pipeline --no-fail-fast`, in
`crates/render-pipeline`, `CARGO_BUILD_JOBS=4`, private target dirs, branch
and base (#724 head a033f58) built identically:
branch 482 passed; 13 failed; 4 ignored
base 479 passed; 13 failed; 4 ignored
Line-by-line diff of every `test <name> ... <result>` line: identical except
the 3 new `math_dots_boxes.rs` tests (all `ok`). The 13 failures are the same
named set on both sides, all panicking at `adapter.rs:1308` (the known
pre-existing `vendor/compiler` debug_assert issue, #696). HW1/HW2 unmoved.
The three cherry-picked tests, before this commit's T1 fix (i.e. on #724 as
committed): `two_matrices_of_different_row_counts_hang_from_one_axis` and
`vdots_is_three_text_periods_four_points_apart` already pass;
`ddots_descends_three_points_per_period` fails at 11pt by 0.0586bp -- the
same quantity as the T1/OT1 finding. After this commit's fix: all 3 pass at
all three sizes.
Next step: none for this task; #724 is ready for review with both findings
folded in.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
…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
…ot a glyph
What changed:
The LaTeX kernel gives neither command a character. Both are boxes built out
of `\hbox{.}` of the *text* font (`fontmath.ltx` 404-409, identical to
`plain.tex` 934-937):
\vdots {\vbox{\baselineskip4\p@ \lineskiplimit\z@
\kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
\ddots {\mathinner{\mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}}
Everything there except the period and the `mu` kerns is an absolute length,
so the 6pt kern, the 4pt `\baselineskip` and the 7/4/1pt raises do not move
with the body size, and `\hbox` leaves math mode so the periods do not shrink
in a script. Both boxes come out 14pt plus the period's height tall with no
depth -- 15.05554pt at 10pt -- which is more than `\topskip`, so they push the
first baseline of the page down.
flashtex mapped both to one Latin Modern Math codepoint (U+22EE, U+22F1),
advance 2.18pt and 6.13pt, ink box 5.06pt too short (issue #717).
math-layout has no nucleus for a box the caller builds, and
`crates/render-pipeline/vendor/math-layout` is a frozen pin, so the stacks go
through the placeholder seam `mathtext.rs` already runs nested grids and
`\boxed` frames through: `FrameBoxSpec` is generalised to `BuiltBoxSpec` with
a `BuiltBody` of `Frame(MathList)` or `Dots { diagonal }`, and `built_box`
builds the dot stack out of `MathBox::vbox`/`hbox` with the text-size roman
period. `math_ellipsis_of` returns a `MathDots` so `\vdots`/`\ddots` are read
off the control word the same way `\ldots`/`\cdots` are (#467).
Measured against pdfTeX 3.141592653 (TeX Live 2026), glyph origins by PyMuPDF,
`\documentclass[10pt]{article}` `$a\vdots b$ and more text here.`, TeX pt:
before after pdflatex
first baseline 135.2700 140.3256 140.3253
\vdots `b` origin 156.7359 157.3336 157.3355
\ddots `b` origin 160.6859 169.5557 169.5555
i.e. the first baseline was 5.0364 bp out and `\ddots` 8.8365 bp wide of
pdflatex; the largest residual now is 0.0019 bp. The three periods of each
stack now land within 0.0006 bp of pdflatex in both axes.
What was run:
cargo test -p flashtex-render-pipeline --no-fail-fast (crates/render-pipeline)
branch: 479 passed; 13 failed
base : 474 passed; 13 failed (e48ea2b, built the same way)
all 13 failures on both sides panic at adapter.rs:1308 (the vendor/compiler
pin, fixed by #696); 0 new failures, 5 new tests.
Next step:
None; `\vdots`/`\ddots` stay out of `math_symbol_line_height.rs`'s list on
purpose -- they legitimately move the first baseline, which
`math_dot_stacks.rs` pins separately.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… encoding
What changed:
- `mathtext.rs`: the `\hbox{.}` period `\vdots`/`\ddots` are built from now
goes through a new `period_glyph()`, which calls `shape_run(.., key: None,
.., text_size_pt)` the same way an ordinary text run does, instead of
`text_glyph('.', SizeClass::Text)`. `text_glyph` is the math-alphabet route
(`fontmath.ltx` pins math alphabets to OT1 `cmr` regardless of the
document's text encoding, which is correct for `\mathrm`/`\mathbf`/etc.),
but `\hbox{.}` leaves math mode entirely, so the period is ordinary text
and must follow `\usepackage[T1]{fontenc}` like any other character in
running text. Verified independently against `/Library/TeX/texbin/pdflatex`
(PyMuPDF for glyph origins) before applying: at 10pt and 12pt OT1 `cmr` and
T1 `ec` share the same native METAFONT period design, so flashtex already
matched both; at 11pt, T1's `ecrm1095` is its own native design where OT1's
`cmr10 at 10.95` is linearly scaled from the 10pt design, so the two
differ by 0.059bp -- inside both project gates (0.5bp glyph, 0.1bp rule),
but a real, measured encoding-dependence bug. Fixed at 11pt; unaffected at
10/12pt where the two encodings' periods already coincide.
- `tests/math_dots_boxes.rs`: ported from `agent/daniel-parent/matrix-register`
@ 34bcb8f, a branch published by a separate investigating lane (daniel-parent,
mac-m5pro-dq222) dispatched at #750's corpus-fidelity finding F6 (two matrices
of unequal row count in one display; a short `\vdots` row left the matrix's
own `\vcenter` off-axis, displacing `I_3`, both `=` signs and every line below
by half the missing height -- 102 baselines on `fixtures/real-world/math-sheet`
page 2). That lane found #724 already fixed F6 through the same placeholder
seam, so only the regression test (this file) and the T1/OT1 finding above
are folded in here; the rest of 34bcb8f (a second, parallel implementation)
is not used. Credit: daniel-parent (mac-m5pro-dq222),
#724 (comment).
What was run:
`cargo test -p flashtex-render-pipeline --no-fail-fast`, in
`crates/render-pipeline`, `CARGO_BUILD_JOBS=4`, private target dirs, branch
and base (#724 head a033f58) built identically:
branch 482 passed; 13 failed; 4 ignored
base 479 passed; 13 failed; 4 ignored
Line-by-line diff of every `test <name> ... <result>` line: identical except
the 3 new `math_dots_boxes.rs` tests (all `ok`). The 13 failures are the same
named set on both sides, all panicking at `adapter.rs:1308` (the known
pre-existing `vendor/compiler` debug_assert issue, #696). HW1/HW2 unmoved.
The three cherry-picked tests, before this commit's T1 fix (i.e. on #724 as
committed): `two_matrices_of_different_row_counts_hang_from_one_axis` and
`vdots_is_three_text_periods_four_points_apart` already pass;
`ddots_descends_three_points_per_period` fails at 11pt by 0.0586bp -- the
same quantity as the T1/OT1 finding. After this commit's fix: all 3 pass at
all three sizes.
Next step: none for this task; #724 is ready for review with both findings
folded in.
Implementation-Agent: claude-opus-5 subagent of daniel-parent
Commit-Executor: daniel-parent subagent
Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
Commander (daniel-parent), independent Opus review of PR #696 review — render-pipeline: a box argument's leading no longer depends on the build (head af19a34)Reviewer: opus (independent, read-only). Diff reviewed against merge base dbe3cac. MATERIAL findingsNone. The change is correct as written: Non-blocking notes
Tests run (worktree at af19a34, debug profile, one at a time)
VERDICT: APPROVE |
…ex#697) What changed: - `cargo check -p flashtex-render-pipeline --no-default-features` failed with 7 non-exhaustive-match errors on `Nucleus::GenFraction`/`Phantom`/`Operator`/ `SubArray`/`ExtArrow`. The vendored compiler pin exposes these 5 variants unconditionally, but render-pipeline's own match arms for them are gated behind the (now-default) `amsmath-inline` feature, so turning that feature off left the arms missing with no catch-all. Added feature-off catch-alls in `hash_math`/`shift_math` (incremental.rs) and `math_grids`/ `math_glue_em`/`convert_math_classed` (typeset.rs) that degrade rather than reproduce full-feature behaviour: hash via `Debug`, skip incremental shift/grid tracking, treat glue as zero, and emit no atom for these nuclei. - Fixed `kern_amount_matches`'s `compiler-package-gating`-off fallback to call the vendored `text_kern`'s new two-argument signature (`text_kern(spelling, false)`), matching only the kernel (non-amsmath) definition as the surrounding comment already said. - Replaced adapter.rs's `debug_assert_eq!(leadings.len(), parsed.blocks.len())` with the fallback PR flash-tex#696 already documented: when the compiler's `block_par_leading` list doesn't match the block count, use body leading for every block instead of panicking. This isn't gated by any feature, so it also fixes 13 pre-existing failures on origin/main's default-feature build (all panicking at the old adapter.rs:1308 assert) with 0 new failures anywhere. - Gated tests that empirically need a feature to pass, not merely ones that failed: amsmath_inline.rs and frac_ord_spacing.rs (whole files, use \dfrac/\genfrac/\binom/\substack/\operatorname), amssymb_braces.rs's amssymb_relations_advance_by_their_msam_msbm_widths and big_delimiter_packages.rs's two size-tracking tests behind `amsmath-inline`, math_symbols.rs's 3 mathtools-colon tests behind `math-class-override`, and tabular_oracle.rs (whole file) behind `par-leading`. Verified each by temporarily un-gating and re-running --no-default-features: every one fails for a real, feature-shaped reason (numeric mismatches or missing glyphs), not an unrelated flake. - No `vendor/` path touched. What was run (from crates/render-pipeline, CARGO_TARGET_DIR=/Users/dqi26/flashtex/target-ndf-verify, CARGO_BUILD_JOBS=4): - `cargo test --no-default-features --no-fail-fast`: 454 passed; 0 failed; 4 ignored (0 compile errors). - `cargo test --no-fail-fast` (default features, this branch): 482 passed; 0 failed; 4 ignored. - `cargo test --no-fail-fast` (default features, origin/main @ 9c5b028, same target-dir convention): 469 passed; 13 failed; 4 ignored — all 13 panicking at `src/adapter.rs:1308:5`'s `debug_assert_eq!` (the stale vendor/compiler pin bug this branch also fixes). 469 + 13 = 482: 0 new failures, and the branch clears every pre-existing one. - The `incremental_output_is_byte_identical_over_200_edits_of_a_27_page_document` test is genuinely slow (~330s), not hung, in both configurations. Next step: recommend adding a CI job for `cargo check -p flashtex-render-pipeline --no-default-features` (proposed in the PR body, not added here) so this configuration cannot silently rot again. Implementation-Agent: gpt-5.6-luna (Codex) via daniel-parent Commit-Executor: daniel-parent subagent Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
What
adapt_cachedpairedParsed::blockswith the compiler'sParsed::block_par_leadingpositionally, behind adebug_assert_eq!that thetwo lists are the same length:
The pairing now goes through a small pure function,
block_leadings, whichuses the compiler's list only when it is exactly one entry per block and
otherwise discards it — every block then falls back to the body leading,
exactly as a
--no-default-featuresbuild does. The decision reads itsarguments and nothing else, so debug and release lay the same document out the
same way. No
vendor/file is touched, and the feature resumes by itself oncevendor/compileris re-pinned past crates/compiler #517.Tests added:
crates/render-pipeline/src/adapter.rs—block_leadings_are_profile_independent,a unit test on the total function (pairs only on an exact length match;
never truncates a longer list, never pads a shorter one; same answer for the
same inputs). Runs in one profile and needs no fonts.
crates/render-pipeline/tests/par_leading_box_profile.rs— two renderingtests that measure the output: a
\colorbox/\fcolorboxwhose interioris
\small/\footnotesize/\tinymust not change the surrounding bodyparagraph's line pitch, in the paragraph holding the box or in any later
one. Both fail in a release build before this change (literal values
below), so CI's release-only run would have caught it.
Why
Root cause, not the symptom: the pinned
vendor/compiler'sP::box_inlinesdoes not truncate
block_par_leadingafter parsing a box argument the wayP::argument_inlinesdoes, so every\colorbox/\fcolorboxleaves one strayentry behind — the leading of a paragraph that never reaches
blocks.crates/compilerfixed exactly this in #517 (crates/compiler/src/parser/colors.rstruncates;
crates/render-pipeline/vendor/compiler/src/parser/colors.rs, thepin the pipeline builds against, still does not).
That makes
block_par_leading.len() != blocks.len(), which is theleft: 2 / right: 1in #667:\usepackage{xcolor}...\fcolorbox{black}{white}{Hi \textbf{Yo}}gives one block and two leadings.
The profile dependence followed from how the mismatch was handled:
debug_assert_eq!fires and the render panics, which is theframe_envfailure reported in render-pipeline output differs between debug and release builds (colorbox path count 2 vs 1) #667.zippairs block i withentry i anyway. A stray entry is pushed before the block whose
paragraph holds the box (the box's interior paragraph is flushed while the
outer one is still being built), so from the first box onwards entry i no
longer names block i and a body paragraph silently takes the
\baselineskipof some box's interior.So this was not floating point, not hashing, and not overflow: a
debug_assertions-gated assert sitting on top of a genuine release-buildlayout bug. The release output was the wrong one, which is why the fix is
not "gate the test" or "round it away" —
\baselineskipis read at\parinthe outer paragraph's own size, and
\colorbox's box never enters thevertical list at all, so the body leading is the canonical answer here.
A mismatched list cannot be realigned after the fact (the strays are
interleaved, not appended), so the only honest deterministic choice is to drop
it, which is a behaviour the crate already supports and documents.
Overlap check
python3 scripts/coord.py claims— no claim on render-pipeline output differs between debug and release builds (colorbox path count 2 vs 1) #667; claimedGH-667-DEBUG-RELEASE-DIVERGE(actordaniel-parent, machinemac-m5pro-dq222) before starting. Other live claims(math: \tag{…} (and \text{…}) cannot contain math — \tag{hi $x^2$} fails with "math syntax is not supported inside \tag" #441-TAG-TEXTRUN, vector-graphics: tikz::text::blank_comments is ~60% of tikz-heavy render time #650-TIKZ-BLANK-COMMENTS, lists: \item[…] optional labels drop math and styles — \item[this is $2x$] renders "this is2x", \item[$\alpha$] renders nothing #676-ITEM-LABEL-TEXTRUN,
GH-PARLEADING-DEBUG-ASSERT, GH-V2-DIAGNOSTICS-REBASE) touch other code.
gh pr list --repo flash-tex/flashtex --state all --search "debug release"and
--search "colorbox"— no open PR on this. compiler: boxed arguments and letter \ps no longer leave phantom paragraph leadings #517(
agent/daniel-parent/parleading-assert) is the compiler-side fix, merged;this is the pipeline side of the same invariant and does not touch the same
files.
vendor/file is modified.Test results
Before the change, release build (
cargo test --release --manifest-path crates/render-pipeline/Cargo.toml --test par_leading_box_profile):Before the change, debug build (the failure reported in #667):
After the change, debug (
--test frame_env --test par_leading_box_profile --test par_leading_oracle):After the change, the unit test in both profiles
(
cargo test [--release] --lib block_leadings):Whole crate, release,
--no-fail-fast(the profile CI runs; complete, exitcode 0):
The same run in debug was not driven to completion: it reached
286 passed; 0 failed; 2 ignoredover 46 of the 106 binaries and then parked inincremental_output_is_byte_identical_over_200_edits_of_a_27_page_document,which is minutes of unoptimized work on a shared machine. It is already past
the
253 passed#667 reports, which answers that part of the issue: 253 was atruncated run, not a missing test set — without
--no-fail-fast,cargo teststops after the binary that fails, andframe_envfailing in debug cutthe run short there. Every debug test that touches this code path is run
above, and all of them pass.
Not done
vendor/compileris not re-pinned. That is the upstream fix (compiler: boxed arguments and letter \ps no longer leave phantom paragraph leadings #517, incrates/compiler) and lanes do not touchvendor/. Until it lands, adocument containing a
\colorbox/\fcolorboxgets the body leading forevery paragraph — the documented
--no-default-featuresbehaviour, andstrictly better than the current release mis-pairing. After the re-pin the
lengths agree, the
par-leadingfeature applies again, and both new testsstill hold.
frame_draws_a_rule_border_around_its_contentstays#[ignore]d for thesame reason (unrelated pin gap, pre-existing).
cargo check --no-default-features --all-targetsdoes not build, and didnot before this PR either: 7 pre-existing errors in
src/typeset.rs,src/adapter.rs:6767/:7929,src/pagebuild.rs,src/incremental.rs,src/shape.rsandsrc/typeset/floatpage.rs(non-exhaustivemath::Nucleusmatches, one arity mismatch). None is in the code this PRtouches;
block_leadingsand its test are#[cfg(feature = "par-leading")]on both the definition and the single call site, so that configuration is
unaffected either way.
ci.ymlonly ever runs--release, so no debugdivergence is caught anywhere. This PR removes the one divergence that
existed in render-pipeline and adds tests that hold in one profile, but it
does not add a debug CI job — that is a CI-policy call for the Commander,
not a lane change.
🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz