Repository navigation
corpus: a reference is only a reference once pdflatex has settled - #383
Merged
Merged
Conversation
Two of the committed `reference.pdf` files were **two-pass builds of
documents that need three**, so the oracle we measure against was wrong
where it is easiest to be wrong: the page numbers in a table of contents.
| | committed | converged | wrong glyphs |
|---|---|---|---|
| `hyperref-toc` | `7758506be606` (pass 2) | `dfbfd4e366be` (pass 3 = pass 4) | **10** |
| `lmodern-report` | `319b433dcbc8` (pass 2) | `140f276b4a54` (pass 3 = pass 4) | **6** |
Every wrong glyph is a ToC or `\pageref` digit at the same position with a
different value — `hyperref-toc` listed a section that starts on page 2 as
page 1, on through "List of Figures" on page 3 that is on page 4. A
producer that got these *right* was scored as a mismatch.
`generate_reference` ran `for _pass in range(2)`. Neither the pass count
nor the rerun warning is the test:
- `hyperref-toc` pass 2 **does** warn ("Rerun to get"), and was written
anyway;
- `lmodern-report` pass 2 warns about nothing at all, and its pass 3 is
still a different document.
So the loop now runs until the PDF *stops changing* and pdflatex stops
asking, up to `MAX_ORACLE_PASSES` (6). A fixture that never settles is not
written at all and is reported — an unsettled reference is not a reference,
and silently keeping the last pass is how this got in.
`reference.json` gains `converged_after_passes`, and `argv` records
`(xN, to convergence)` rather than a hard-coded `(x2)`.
Swept all 22 fixtures for this: those two are the only ones. The other
seven whose bytes differ from a local rebuild are MacTeX 2026 references
being rebuilt with TeX Live 2025 — a different engine, not an unsettled
document — and each converges by the pass its sidecar claims.
Two tests cover the loop, and both fail against the old `range(2)`
(`2 != 4`, and a never-settling document silently producing a reference):
a late-settling document is run four times (three distinct, one to prove
the third was stable), and one that keeps asking for a rerun returns None
and writes nothing.
Harness tests 8 passed / 0 failed. pdflatex is an oracle only and is never
in the product path.
Implementation-Agent: Claude Opus 5 (Commander session, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
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.
Two of the committed
reference.pdffiles were two-pass builds ofdocuments that need three, so the oracle we measure against was wrong
where it is easiest to be wrong: the page numbers in a table of contents.
hyperref-toc7758506be606(pass 2)dfbfd4e366be(pass 3 = pass 4)lmodern-report319b433dcbc8(pass 2)140f276b4a54(pass 3 = pass 4)Every wrong glyph is a ToC or
\pagerefdigit at the same position with adifferent value —
hyperref-toclisted a section that starts on page 2 aspage 1, on through "List of Figures" on page 3 that is on page 4. A
producer that got these right was scored as a mismatch.
generate_referenceranfor _pass in range(2). Neither the pass countnor the rerun warning is the test:
hyperref-tocpass 2 does warn ("Rerun to get"), and was writtenanyway;
lmodern-reportpass 2 warns about nothing at all, and its pass 3 isstill a different document.
So the loop now runs until the PDF stops changing and pdflatex stops
asking, up to
MAX_ORACLE_PASSES(6). A fixture that never settles is notwritten at all and is reported — an unsettled reference is not a reference,
and silently keeping the last pass is how this got in.
reference.jsongainsconverged_after_passes, andargvrecords(xN, to convergence)rather than a hard-coded(x2).Swept all 22 fixtures for this: those two are the only ones. The other
seven whose bytes differ from a local rebuild are MacTeX 2026 references
being rebuilt with TeX Live 2025 — a different engine, not an unsettled
document — and each converges by the pass its sidecar claims.
Two tests cover the loop, and both fail against the old
range(2)(
2 != 4, and a never-settling document silently producing a reference):a late-settling document is run four times (three distinct, one to prove
the third was stable), and one that keeps asking for a rerun returns None
and writes nothing.
Harness tests 8 passed / 0 failed. pdflatex is an oracle only and is never
in the product path.