Repository navigation
render-pipeline: re-pin the vendored compiler and tex-expansion to 4511166e - #829
Conversation
`vendor/compiler` was pinned at `f0f86aaf`, 26 `crates/compiler` commits behind `main`, so merged compiler work was inert in the renderer. Re-pinned to `main` (`4511166e`) with `git archive`, `PIN` updated, byte-identity verified both ways: the old tree's 641 path/mode/blob entries match `f0f86aaf:crates/compiler` apart from `PIN` (no local patch was dropped), and `diff -r --exclude=PIN` against a fresh re-extraction is empty over 644 files. `vendor/tex-expansion` moves with it, from `f0f86aaf` to the same SHA, 7 `crates/tex-expansion` commits. That half is **not** needed to compile -- the new compiler type-checks against the old expansion engine -- but `cee66115` memoizes `Lexer::rest_of_line_blank`, whose rescan of a long run of spaces is a fuzz-found hang, and #700/#727 add `\newtheorem` to the engine outright (the old copy has no `newtheorem` at all), so a colliding name is rejected with LaTeX's own error, group-scoped, without disabling the working declaration. A hang reachable from the renderer is worth more than a minimal diff. Verified the same two ways over 448 files. No other vendored crate is touched. Visible now: #509 relsize, #571 starred `\setlist*`, #721 preamble lengths and `marginpar`, #791/#798 `\intertext` display math, `\pod`, `\allowbreak`, and #700/#727 whole rather than half. Measured through the render path: `\newtheorem{section}{Section}` in an `article` preamble now reports `LaTeX Error: Command \section already defined.` and the document's own `\section` still sets. No `parser::Block`/`parser::Inline` variant moved, so no exhaustive match in the pipeline changed and both swaps built clean. One pipeline change, in `adapter::adapt`: #749's review commit made the compiler warn on the `[` of `\twocolumn[<material>]` that its own IR has no `\@topnewpage` model, while leaving the tokens for a renderer that does. This pipeline is that renderer, so the warning described output it does not produce and `tests/twocolumn_banner.rs` dropped to 4/13 on the diagnostic assertion alone, every measured baseline still within 0.5 bp of pdflatex. The bracket now goes onto `Doc::superseded` both when the material is boxed (the warning is false here) and when it is not (the typed `twocolumn_top_material` limitation says it more precisely, and one diagnostic per `\twocolumn[` beats two). `cargo test --release --no-fail-fast` on `crates/render-pipeline`: 631 passed, 0 failed, 2 ignored, after each half of the swap. Both `#[ignore]`s stay -- one is the pipeline's own `scan \input'd preambles` `todo!()`, re-checked with `--ignored` under this pin, the other is ignored for being slow. No perf-bench digest moved after either half (`--check --require-same-host` exits 0 with no `digest_mismatches`), so the baseline is untouched. `VENDORING.md`: both rows rewritten, and the intro's stale `pdf` SHA corrected to `a9ec24a9` to match that directory's `PIN`. Implementation-Agent: Claude Opus 5 (daniel-parent subagent) Commit-Executor: daniel-parent (Claude Opus 5) Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
… case supersedes too) Implementation-Agent: daniel-parent (Claude Opus 5) Commit-Executor: daniel-parent (Claude Opus 5) Co-authored-by: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
|
Commander (daniel-parent): independent Opus review of The one code note, a stale comment saying the unboxed case keeps the warning, is fixed in PR #829 — re-pin vendored
|
| case | compiler warning | pipeline limitation | total |
|---|---|---|---|
boxed (split_top_material → Some) |
superseded | none | 0 (correct: output matches LaTeX) |
not boxed (boxed != Some(open)) |
superseded at open |
twocolumn_top_material at (end, end) |
1 |
one-column geometry (two_column false) |
superseded | twocolumn_top_material |
1 |
no bracket per \@ifnextchar |
never emitted | none | 0 |
The last row is the one that could have gone wrong, and does not. The two
sides agree on what counts as a bracket: columns::optional_bracket
(columns.rs:195) allows spaces, tabs, \r and at most one \n, returning
None on a blank line; the compiler's peek_bracket_span uses skip_spaces
(parser.rs:10393), which skips only Space and Comment tokens and therefore
stops at the \par a blank line produces. Neither warns. Test
a_blank_line_before_the_bracket_is_plain_text_not_a_warning
(tests/twocolumn_banner.rs:326) pins this.
The one divergence I found is safe: \twocolumn %c\n[X]. The compiler skips
the Comment token and warns; optional_bracket hits % and returns None,
so the pipeline neither boxes nor supersedes. The material really is set as
ordinary text there, so the surviving compiler warning is accurate, and the
count is still one.
Is Doc::superseded the right mechanism? Yes. It is the same Vec<Span>
that abstractenv::apply (abstractenv.rs:321/336/366), listings::apply
(listings.rs:886/888) and the size_envs pass (adapter.rs:2274) already push
into, consumed by one retain at lib.rs:302-308. toc::superseded_commands
is a different path (the is_superseded closure at lib.rs:265, applied
before that retain) — the PR body lumps the two together, but the doc comment
on Doc::superseded (adapter.rs:824-827) already describes them that way, so
this is house style rather than an error.
Document-id and byte correctness. Both pushes use DocumentId(entry)
(the first via the local document binding, adapter.rs:2347) and
source = texts[entry] (adapter.rs, top of adapt_cached), so the byte
offsets and the document id refer to the same text. Both open values come
from the same columns::optional_bracket computation — branch A through
ColumnMode::top_material (columns.rs:465), branch B directly
(adapter.rs:2372) — so they cannot disagree on which byte is the [.
3. Claimed behaviour changes — both spot-checks PASS
Lexer hang fix — present in the new copy, absent from f0f86aaf.
vendor/tex-expansion/src/lexer.rs replaces
fn rest_of_line_blank(&self) -> bool {
self.src.as_bytes()[self.pos..].iter().take_while(|&&b| b != b'\n' && b != b'\r').all(|&b| b == b' ')
}with a memoized &mut self version carrying blank_probe: Option<(usize, usize, bool)>.
The pre-image is byte-identical to f0f86aaf:crates/tex-expansion, so the fix
is genuinely absent there.
I checked the memoization for correctness, since it is an engine change that
now reaches users, and it is sound in all three stored shapes:
(pos, i, false)whereiis the first non-space: every byte inpos..i
is a space, so any probe frompos..=icorrectly answersfalse
(includingpos == i, where the byte itself is non-space).(pos, i, true)whereiis the\n/\r: any probe frompos..=i
answerstrue; atpos == ithe originaltake_whileis empty and
all()is vacuouslytrue, so the two agree.(pos, len, true)at end of buffer: same reasoning.
Staleness is impossible: src is an immutable Rc<str>, and pos only
moves forward (every assignment in the file is += or = self.src.len()),
so a probe on the next line has pos > floor and rescans. Lexer::resume
sets blank_probe: None. Scanned ranges across rescans are disjoint, so the
claimed O(line length) bound holds.
\newtheorem is genuinely new — in the expansion engine. This is the
claim I first read as false, and it is not; the detail matters enough to
record:
f0f86aaf:crates/tex-expansioncontains nonewtheoremat all
(git grep -i newtheoremexits 1).4511166e:crates/tex-expansion/src/expand.rsadds
("newtheorem", Primitive::NewTheorem)(line 341),do_newtheorem
(line 3141) and the collision error
LaTeX Error: Command \<name> already defined.(lines 2509, 3202), plus
six new tests intests/expand_tests.rs:741-801.
So \newtheorem{section}{Section} reporting Command \section already defined.
is a real new behaviour reaching the render path, and "stops being half-landed"
is exactly right: the compiler half had landed, the expansion half had not.
Note for future verifiers: the compiler half was not half-landed and did
not move. f0f86aaf:crates/compiler already had full \newtheorem support
(parser.rs, supported.rs, theorems.rs, vocabulary.rs,
tests/amsthm.rs), and across the two pins P::new_theorem and theorems.rs
are byte-identical; tests/amsthm.rs gains 99 lines of tests and no
production change. Grepping the compiler alone makes the PR's wording look
false. It is about the expansion engine, where VENDORING.md's
tex-expansion row states it precisely.
4. Regressions — PASS
See "Tests run" below. 631/0/2, twocolumn_banner 13/13, perf gate exit 0
with zero digest movement.
One structural check worth recording: no test file anywhere in
crates/render-pipeline/tests/ was modified by this PR (git diff --name-only
over that directory is empty), and twocolumn_banner.rs contains exactly 13
#[test] functions. So the 4/13 → 13/13 improvement cannot have come from
relaxed assertions; it is produced by the re-pin and the adapter change alone.
5. Docs — PASS
Only the compiler and tex-expansion rows changed; no row was added or
removed, and every other row is byte-identical.
compiler:4511166e(wasf0f86aaf) — SHA matchesPINand the tree.
"26crates/compilercommits" matchesgit rev-list --count f0f86aaf..4511166e -- crates/compiler= 26.
641/644 entry counts match my own measurements.tex-expansion:4511166e(wasf0f86aaf) — "7crates/tex-expansioncommits"
matchesgit rev-list --count= 7. 448/448 matches.- Previous pins are preserved verbatim: each new row contains its entire
predecessor row body under "Previouslyf0f86aafonmain, whose row still
read as follows", verified by exact substring containment of theHEAD~1
row text. The historical chain back to8a8a22b4andc95977d6is intact. - The intro's stale
pdfbffd168a→a9ec24a9correction is right: the
pdfrow itself already reada9ec24a9before this PR and is unchanged.
Non-blocking notes
-
adapter.rs:2356-2357— the comment contradicts the code it points at.
"The unboxed case below keeps it and addstwocolumn_top_material." The
unboxed case does not keep the compiler's warning:adapter.rs:2388
supersedes it there too, which is the whole point of the second hunk (and
its own comment says so — "this typed limitation replaces it"). Suggest
"The unboxed case below replaces it withtwocolumn_top_material." A
future reader trusting this comment would believe two diagnostics survive
the unboxed path. -
PR body: "all fourteen cases" understates the gate. The harness
compared 26 cases and 215 digests. The gate is stronger than advertised,
but the number should be corrected so a later reviewer diffing case counts
does not think coverage shrank. -
PR body: "the intro list collapses the pair to one entry." The intro
already listedcompiler/tex-expansionas a single entry before this
PR; only the SHA inside it changed. Harmless, but it is not a change. -
Doc::supersededmatches on start byte and path only (lib.rs:302-308:
r.start_byte == s.start && paths.get(s.document.0) == Some(&*r.path)),
with no message or end-byte check, and it drops a diagnostic if any of its
source ranges matches. So any unrelated compiler diagnostic whose span
starts on the same[byte in the entry file would also be suppressed.
I could not construct a realistic case —peek_bracket_spanreturns the
span of the[-initial word token, and diagnostics on ordinary word text
are rare — and this imprecision is pre-existing and identical for
abstract,listingsandsize_envs, so it is not introduced here.
Recorded only because it is the mechanism's weakest point and this PR adds
two more users of it. A message-aware match would be strictly tighter. -
Reviewer trap, recorded for the next pass: grepping
newtheoremagainst
f0f86aaf:crates/compilermakes the PR's\newtheorembullet look false.
The claim is aboutcrates/tex-expansion. See section 3.
Tests run
All on this worktree, release profile, shared target dir
~/flashtex-wt/review-target, one cargo invocation at a time.
-
cd crates/render-pipeline && nice -n 15 env CARGO_BUILD_JOBS=3 CARGO_TARGET_DIR=$HOME/flashtex-wt/review-target cargo test --release --locked --no-fail-fast
→ exit 0. 631 passed, 0 failed, 2 ignored across 29 binaries, matching
the PR exactly. The two ignored are unrelated to any pin:
adapter::tests::preamble_scan_does_not_see_input_files(pipeline-side
todo!()at adapter.rs:7602) and
incremental_output_is_byte_identical_over_30_edits_of_a_107_page_document
(marked slow).
twocolumn_banner: 13 passed, 0 failed, 0 ignored. -
cd crates/perf-bench && cargo build --release --locked, then
flashtex-perf-bench --baseline baselines/linux-x86_64-ryzen7-7800x3d.json --check --require-same-host
→ exit 0,OK: 549 metrics compared, no regression.I did not take that at face value, because
report.rs:581makes a missing
digest a warning rather than a failure, so an all-missing run would pass
vacuously. Cross-checking the emitted JSON against the committed baseline
directly:215 baseline digests over 26 cases — 215 matched, 0 missing, 0 mismatched,
unmeasured: []. Digest comparison atreport.rs:577-582is unconditional
on host, andgate_failed(report.rs:620-626) fails on any digest
mismatch regardless ofrequire_same_host, so this is a real gate. No
digest moved; no baseline was re-recorded, correctly.Timing deltas are not evidence here and the harness says so itself: the host
fingerprint differs (linux/x86_64 Ryzen 7 7800X3D → macos/aarch64 Apple M5
Pro) and peak 1-minute load was 1.4 for the baseline versus 5.1 for this
run.--require-same-hostis what makes that non-fatal. Themem.*
"metric missing from this run" warnings are memory metrics unavailable on
this platform, not digests.
Verdict rationale
The substance of this PR — the part that is trust-critical — is exactly what
it claims: both vendored trees are unmodified git archive output at
4511166e, verified at the tree level (path, mode, blob SHA), in both
directions, with the pre-image proven clean so no local patch could have been
dropped. The adapter change is 14 additive lines, correct in both branches,
using the established mechanism, and it cannot mask an unboxed case. Tests and
the digest gate are green on measurements I reproduced rather than accepted.
The four non-blocking notes are one stale code comment and three wording
imprecisions in the PR description; none changes behaviour and none should
hold the merge.
VERDICT: APPROVE
The pipeline builds against frozen copies of its sibling crates. Both were at
f0f86aaf, so merged work was inert in rendering. Four separate PR reviews today (#511, #514, #816, #820) flagged this as the reason a fix "doesn't reach users".What moved
vendor/compiler:f0f86aaf→4511166e(26 commits)vendor/tex-expansion:f0f86aaf→4511166e(7 commits); the pair shares one pin againByte-identity was verified in both directions for each: the old tree's entries match
git ls-tree -r f0f86aafapart fromPIN, anddiff -r --exclude=PINagainst a fresh extraction of4511166eis empty (644 and 448 files).Now visible in rendering
\larger/\smaller/\relsize), compiler: \setlist* (enumitem starred form) is unsupported (#563) #571 starred\setlist*, compiler: tests for 6 untested preamble-length registers + \marginpar, fix stale inventory entry #721 and9745b219(six preamble lengths,marginpar), math: pre-existing gaps found reviewing #783 (\intertext math dropped, $..$ in \text in inline math, \pod/\pmod display spacing) #791/math: $..$ inside \intertext should be display math (\pmod/\pod/\mod spacing 5.56pt narrow) #798 ($..$in\intertext, nested$in\text,\pod,\allowbreak), tex-expansion: reject \newtheorem names that collide with defined commands (#700) #727/diagnostics: \newtheorem{def} reports generic missing-control-sequence instead of reserved \def collision #700's compiler half.cee66115): the lexer memoizes its trailing-space probe, so repeatedrest_of_line_blankrescans of a long blank run no longer hang the engine.\newtheoremstops being half-landed: the old copy had nonewtheoremat all. Measured through the render path,\newtheorem{section}{Section}now reportsLaTeX Error: Command \section already defined.and the document still sets.Pipeline change: one call site, a diagnostic
adapter.rsinadapt(+14). #749'sP::column_commandwarns that the compiler IR has no\@topnewpagemodel, so\twocolumn[<material>]"is typeset as ordinary text, brackets included". This pipeline is the renderer that has that box (split_top_material→Doc::top_material), so every banner document carried a warning describing output it does not produce. The[now goes ontoDoc::superseded, the mechanismabstractandtoc::superseded_commandsalready use, in both branches. One diagnostic per\twocolumn[, not two.No content is lowered lossily, nothing is stubbed, and no new
unsupported_*limitation was added. No enum variant changed, so no exhaustive match moved.Gates
cargo test --release --no-fail-fastoncrates/render-pipeline: 631 passed, 0 failed, 2 ignored.twocolumn_bannerwent 4/13 → 13/13; it was failing on the diagnostic assertion alone, with every measured baseline still within 0.5bp of pdflatex.--baseline … --check --require-same-hostexits 0 with emptydigest_mismatchesacross all fourteen cases. No digest moved, so no baseline was re-recorded.#[ignore]s are unrelated to any pin (a pipeline-sidetodo!(), and a slow 107-page test).Docs
VENDORING.md: both rows rewritten with the new SHA, what each makes visible, and the previous pin kept in the historical chain; the intro list collapses the pair to one entry; the stalepdfentry is corrected to match its own row.🤖 Generated with Claude Code