Repository navigation
Show where an edit changes the PDF away from its own lines - #6
Merged
Merged
Conversation
The review located each edit with SyncTeX and compared only the words printed there, so side effects went unseen: the uses of a redefined macro, equations and references renumbered after an inserted equation, a new bibliography entry. The engine now also compares the two PDFs word by word in reading order and lists each change outside the edits' own crops under the edit that causes it, with no buttons of its own. A round with one edit needs nothing more. With several, an edit that prints nothing itself, such as a macro definition, is compiled alone onto the accepted text, and the changes that remain unexplained are traced by compiling halves of the other edits, at most sixteen extra builds. The first three places of an edit render with the round; the rest render when the reviewer asks. Papilot's comparison of uncommitted changes passes the same variant builds and serves the remaining places, and the review proxy allows the new route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cu1ch3n
force-pushed
the
review-effects
branch
from
October 30, 2026 02:24
37d808d to
b97f674
Compare
A review found that the whole-document comparison reported changes that were not there: - Each build guessed its page header separately, so a line at the top of a page was left out of one document but kept in the other. Page furniture is now a line at a page's top or bottom edge that, without the page's own number, is empty or recurs at that height on another page. - Words were aligned across the whole document, so a number in an inserted paragraph could pair with a section number pages later. The comparison now aligns printed lines first and words only within the lines that differ, as the engine compares a section's rows. - Text that moved was dropped where it left but kept where it arrived. Removals and additions of a run now pair up. - A build kept from an earlier day differed from today's by \today. Every build of a day now prints the same date through SOURCE_DATE_EPOCH, which joins the cache key. Also: builds of edits that print nothing count against the limit of sixteen variants; layout and position edits no longer count as edits that print nothing; the pass after variant builds reuses the first pass's cards; a comparison that takes longer than five seconds is given up; a place's section comes from its first changed word, and a change across a column break gets one crop per column. The places route checks its parameters first, answers 404 for an unknown round and keeps the hint when the builds are gone, and an edit needed together with another is named by its change number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The PDF review located each edit with SyncTeX and diffed only the words printed there. A change that is a side effect of an edit was never shown: the uses of a redefined macro, equations and references renumbered after an inserted equation, a new bibliography entry. Changing
\newcommand{\method}{…}showed only a source diff of the definition.This PR shows those places under the edit that causes them.
How it works
Each edit's own crop is unchanged: source diff, SyncTeX lookup, word diff at those spots. On top of that:
render/effects.ts). Both PDFs are compared in reading order, so pagination does not matter:--color-movedthreshold of at least 20 alphanumeric characters.attribute()incore/publish.ts). A change outside every edit's crop needs a cause:withUnits(),Repo.treeWith()), compiled by the existingBuilder. No commits are created.placesOf(),renderPlace()): changes with the same causes that lie within the engine's existingJOIN_GAPshare one crop. A crop grows to every printed line it cuts through, so acasesdisplay or a tall delimiter is never cut in half. Marks come from the whole-document diff, so a word hyphenated differently is not marked as changed.GET /api/tasks/:name/rounds/:n/effects/:unitrenders the remaining places into the round's folder and caches them. Papilot allows the route through its review proxy and serves the same thing for its comparison of uncommitted changes (/review/:projectId/api/changes/rounds/:n/effects/:unit).The renderer worker now writes each request to its own file, since several requests can render into one round's folder.
Build dates. Every build of a day prints the same date:
SOURCE_DATE_EPOCHis set to noon UTC of the local date (withFORCE_SOURCE_DATE) unless the user sets it, and it is part of the build cache key. Without this, a build cached on an earlier day differed from today's by\today, and that difference was attributed to some edit.\todayshows the local date;\timeprints 12:00.Cost
\Probredefined, equation inserted, sentence editedLimitations
Review follow-up
An independent review of the first commit found these problems; the second commit fixes them:
\todaydiffered between builds made on different days (fixed by the build dates above).Tests
vendor/latex-review/tests/ts/effects.test.ts: moved runs, page furniture (including section numbers that open pages), attribution by halving with edits needed together, the shared build limit, build dates.vendor/latex-review/tests/ts/end-to-end.test.ts:more().tests/core.test.tscovers the new proxy route.npm run typecheck,npm test,npm run build, the engine'snpm run buildand its full Vitest suite (119 tests) pass, as does the viewer's browser test (PAPILOT_REVIEW_BROWSER=1).🤖 Generated with Claude Code