Skip to content

gotex-linediff -align: which page the extra page appears on (#622) - #628

Merged
tannevaled merged 1 commit into
mainfrom
linediff-align
Oct 20, 2026
Merged

tannevaled merged 1 commit into
mainfrom
linediff-align

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

gotex-linediff -align: which page the extra page appears on

For #622. "One page too long" is the same number whether the extra page appeared on
page 2 or on page 30, and those are opposite defects. Measured
yesterday
, the
corpus bias has no length dependence at all (R² = 0.004), which says the cost is
paid once per document — and nothing here could name the page where it is paid.

-align walks every page of both PDFs through the same go-pdfkit path the rest of
this command already uses — the channel #622 asked for, which is not the word-box
band — takes a key from each reference page and finds the page of ours that carries
it, searching forward only.

   réf   nous  décal. lig.réf⚠ lig.ns⚠  clé
     2      2      +0      51      37  analytic protocol max von hippel panagiotis
     3      2      -1      55      37  work focus drawn recent work studying
     4      4      +0      50      28  figure message sequence chart illustrating ambiguous
    …
    19     18      -1      37      42  worst case never happens measured environments
décrochage à la page 3 de la référence sur 19 — c'est LÀ que la page de trop apparaît

Three defects found while building it, each of which made it report success

⛔ The key and the haystack must share one vocabulary. The key was built from
filtered words and sought in unfiltered text, so case study analytic protocol analysis max could never match a case study in analytic protocol analysis in acl2 max — the short words the key dropped were still between them. Every page of a
real paper came back "not found".
There is now one word list, and the haystack is
built from it by the same rule; the struct no longer carries a second, pre-joined
string, because that is how the two drifted apart.

⛔ A running head is not content, and no fixed number of skipped words gets past
one. The reference prints "Real Analysis Using …" atop every odd page of
2311.08855 while this engine prints no head at all, so nine of eighteen keys were
built out of the head. Any word on more than half the reference's pages is now
treated as furniture and kept out of every key — and out of the haystack, which
is the same vocabulary rule one level up.

⛔ "Found nothing" must not print what "found agreement" prints. The first
version left its slip counter at 0 when no key matched anywhere and declared the two
documents in phase. It now says so, and warns separately when fewer than half the
keys were found, because an alignment over a minority of pages does not describe the
document.

The control, and why it passed for the wrong reason

A document aligned against itself must come out at offset 0 on every page. It
passed from the start — because the fixture's words were all three letters or more,
so the key's vocabulary and the haystack's could not disagree. The fixture now
carries short words between the distinctive ones, the way prose does, and it is what
caught the first defect above.

⚠ One column pair that is NOT comparable between engines

lig.réf and lig.ns: on 2311.08855 the reference reads 51 to 86 lines a page
against 28 to 42 here, in ratios from 1.07 to 2.60. No typography does that — it
is how each writer emits its text runs, one baseline sometimes arriving as several.
Within one document the column is a real signal; across two it is not, and the report
says so on every run rather than leaving a reader to find out.

Scope

New file plus one flag; nothing existing changes behaviour. Full engine suite green.

🤖 Generated with Claude Code

"One page too long" is the same number whether the extra page appeared on page 2
or on page 30, and those are opposite defects. #622 spent a long time on per-line
and per-page quantities on the strength of a mean that cannot tell them apart;
measured, the corpus bias has no length dependence at all (R² = 0.004), which says
the cost is paid once and sends the search to where a document BEGINS. Nothing
here could name that page.

-align walks every page of both PDFs through the same go-pdfkit path the rest of
this command uses — the channel #622 asked for, which is not the word-box band —
takes a key from each reference page and finds the page of ours that carries it,
searching forward only.

Three defects found while building it, each of which made it report success:

⛔ THE KEY AND THE HAYSTACK MUST SHARE ONE VOCABULARY. The key was built from
filtered words and sought in unfiltered text, so "case study analytic protocol
analysis max" could never match "a case study in analytic protocol analysis in
acl2 max" — the short words the key dropped were still between them. Every page of
a real paper came back "not found". There is now one word list and the haystack is
built from it by the same rule; the struct no longer carries a second, pre-joined
string, because that is how the two drifted apart.

⛔ A RUNNING HEAD IS NOT CONTENT, and no fixed number of skipped words gets past
one. The reference prints "Real Analysis Using …" atop every odd page of
2311.08855 while this engine prints no head at all, so nine of eighteen keys were
built out of the head. Any word on more than half the reference's pages is now
treated as furniture and kept out of every key — and out of the haystack, which is
the same vocabulary rule one level up.

⛔ AND "FOUND NOTHING" MUST NOT PRINT WHAT "FOUND AGREEMENT" PRINTS. The first
version left its slip counter at 0 when no key matched anywhere and declared the
documents in phase. It now says so, and warns separately when fewer than half the
keys were found, because an alignment over a minority of pages does not describe
the document.

The control is a document aligned against ITSELF: offset 0 on every page. It
passed from the start — for the wrong reason, because the fixture's words were all
three letters or more, so the key's vocabulary and the haystack's could not
disagree. The fixture now carries short words between the distinctive ones, the
way prose does.

⚠ The two line columns are NOT comparable between engines and the report says so:
on 2311.08855 the reference reads 51 to 86 lines a page against 28 to 42 here, in
ratios from 1.07 to 2.60. No typography does that; it is how each writer emits its
text runs. Within one document the column is a real signal, across two it is not.

Co-Authored-By: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant