Repository navigation
render-pipeline: seed label pages from the previous request's convergence (perf A) - #652
Merged
Merged
Conversation
…ence A document with `\pageref` or a contents list pays a page-number relayout on every warm keystroke: each request starts its label page tables empty, so pass 1 can never converge and the whole adapt+typeset pipeline runs twice even when no page number moved. On the 398-page #535 article with \tableofcontents and one \pageref per section that is ~700 ms per typed character, twice the plain document's cost. The converged `labels.pages`/`labels.toc_pages` of a request are now stored in the `RenderCache` (keyed by project) and seed the next request's first pass -- the role LaTeX's `.aux` file plays between runs. A keystroke that moves no page number converges on pass 1 and saves the relayout; convergence is verified against the seed exactly as it is verified against a pass's own output, so an edit that does move a page relays out with fresh tables as before, bounded by the same MAX_LABEL_PASSES. Nothing is stored when a request hits the pass limit without converging, and another project's tables never seed a request. Verification: - New tests (tests/label_page_seed.rs): unchanged text converges on the seeded pass with byte-identical v2 output; a typed character that moves no page stays one pass and byte-identical to a fresh-cache compile of the edited text; a page-moving edit relays out (passes >= 2) and stays byte-identical to a fresh compile; another project id does not seed. - 67/67 documents byte-identical `--v2` and `--pdf` against main 18bbacf (all 65 fixtures/ entry documents plus the 398-page article both ways; cold path -- the CLI renders each document once). - perf-bench (#206), interleaved base -> change -> base on the same box with --pin: zero digest changes anywhere, including every `warm.<scenario>.<caps>` digest -- the warm outputs the seeding path produces are byte-identical to base. hyperref-toc warm improves 28-40% (far outside its 3-5% noise bands). The flagged timing regressions appear equally in the base-vs-base control leg (up to +50% on cold phases this change does not execute, at load 5-8 on the shared box), so they are machine noise per the FT-070 gate's own load warning. - xref_measure (450 sections / 398 pages), interleaved A/B/A/B: the toc+pageref no-label warm edit drops from 2 passes / ~700 ms handle (~630 ms render) to 1 pass / ~435 ms handle (~363 ms render). renumber and move-label keep 2 passes and match base within noise; the plain document rows are untouched. - `cargo test --release --no-run` clean first; suite 456 passed / 0 failed (release); `cargo build --release --locked` clean. Semantics note: like LaTeX's `.aux`, the iteration now starts from the previous compile's fixed point, so a hypothetical document with several self-consistent page assignments could settle on the seeded one where a cold compile settles on another. Every gate above (fixtures, warm digests, the four new byte-identity tests) checks warm-equals-fresh on real documents; the convergence check remains the correctness guard. Implementation-Agent: Claude (Fable 5, render-perf lane, linux-primary) Commit-Executor: Claude (Fable 5) (direct agent Git execution, per the AGENTS.md Cursor-limit fallback in force on this machine) Co-authored-by: GoKubar <[email protected]> Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
added a commit
that referenced
this pull request
Sep 16, 2026
…unbreaks main) (#693) `tests/label_page_seed.rs:36` constructs `Wire { images, device_color }`, but `Wire` grew a third field: error[E0063]: missing field `diagnostics` in initializer of `Wire` A combination break, not either change being wrong. #652 (label-page seeding) added this test against a two-field `Wire`; #358 added `Wire.diagnostics` and landed separately inside integration PR #658. Each was green on its own branch and neither CI run saw the other. This is the same failure mode as #664 and #638: a Rust test target that fails to compile emits no `test result:` line, so summing those lines reads the crate as green while 482 tests never run. Caught by running `cargo test --no-run` as a separate first step before trusting any pass count -- worth keeping in the release checklist, since this was found while verifying main for the 0.1.6 tag. Verified in `--release` (per #667, debug is not a valid oracle for this crate): render-pipeline 482 passed, 0 failed, with `--no-run` clean first. Implementation-Agent: Claude Opus 5 (orchestrator-astra, linux-primary) Commit-Executor: Claude Opus 5 via Claude Code Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2, step A of the warm-repaint work (follows #651 = step C; independent branches, no overlap).
Problem
Every request starts
labels.pages/labels.toc_pagesempty, so a document with\pagerefor a contents list can never converge on pass 1: the whole adapt+typeset pipeline runs twice per keystroke even when no page number moved. On the 398-page #535 article with toc+\pagerefthat is ~700 ms per typed character — double the plain document.Change
The converged page tables are stored in
RenderCache(keyed by project) and seed the next request's first pass — the role LaTeX's.auxplays between runs. No page moved → pass 1 converges, relayout saved. A real move fails the (unchanged) convergence check and relays out with fresh tables, bounded by the sameMAX_LABEL_PASSES. Nothing is stored on a non-converged (pass-limit) request; another project's tables never seed.Verification
tests/label_page_seed.rs): unchanged text → 1 pass, byte-identical v2; typed char that moves nothing → 1 pass, byte-identical to a fresh-cache compile of the edited text; page-moving edit → ≥2 passes, byte-identical to a fresh compile; per-project isolation.--v2+--pdfvs main18bbacf0(65 fixtures entries + the 398-page article both ways).--pin: zero digest changes, including everywarm.<scenario>.<caps>digest — warm outputs through the harness are byte-identical.hyperref-tocwarm improves 28–40% (noise bands 3–5%). Flagged timing "regressions" reproduce identically in the base-vs-base control leg (up to +50% on cold phases this change does not execute, at load 5–8), i.e. shared-box noise per the gate's own load warning — happy to rerun on a quiet box before merge.cargo test --release --no-runclean first; suite 456 passed / 0 failed (release);cargo build --release --lockedclean.Semantics note (for the record)
Like LaTeX's
.aux, the iteration now starts from the previous compile's fixed point. A contrived document with several self-consistent page assignments could settle on the seeded one where a cold compile settles on another; the gates above pin warm-equals-fresh on real documents, and the convergence check remains the correctness guard.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu