Skip to content

\hyphenation{…} was a stub that threw the document's words away - #775

Merged
tannevaled merged 1 commit into
mainfrom
hyphenation-exceptions
Nov 13, 2026
Merged

tannevaled merged 1 commit into
mainfrom
hyphenation-exceptions

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

\hyphenation{…} was a stub that threw the document's words away

⛔⛔ And the comment six lines above that stub warns about exactly its shape

amssubstrate.go, about \mark:

"DISCARDS its argument is the one shape no channel can see: the document says
what it wants, the engine says nothing, every test stays green, and the loss
shows up only as ink that is not on the page."

Two lines later sat:

% \hyphenation{…}: exception list — nothing to record here.
\def\hyphenation#1{}

"nothing to record here" was true when written and silently false afterwards.
The file documents the defect class and then contains an instance of it.

⚠ The silence fell on the words it was asked about. A document writes
\hyphenation for the words the patterns get wrong — that is the only reason
to write it — so every entry that mattered was discarded and the patterns' own
answer used instead. 170 of the 2935 corpus papers use it (5.8%).

What is implemented

hyphexception.go parses \hyphenation{photo-graphy manu-script} in the shape
doPatterns reads \patterns{…}, keyed on the word without its hyphens, with
break points counted in letters.

⛔ An exception replaces the patterns, it does not add to them (tex.web
§937). A word in the list breaks only where its entry says. Consulting both
would hand a document that spelled a word out the very breaks it wrote the
entry to prevent.

⛔ An entry with no hyphen is not nothing. \hyphenation{bibliography} says
the word may never be broken, and recording an empty list of points is what
says so. Dropping it as "nothing to record" would hand the word back to the
patterns — the stub's mistake in miniature.

Measured

tectonic 0.17.0, \hyphenation{photo-graphy manu-script} at \hsize=58pt. The
reference leaves photography whole and breaks manu-script, never
pho-tography. The patterns' own answer is pho-tog-ra-phy, so a break after
pho is the shape that proves the entry was ignored:

before   A pho-tography and a manuscript and a bibliog-raphy …
after    A photo-graphy and a manuscript and a bibliog-raphy …

bibliography, which has no entry, keeps its pattern break in both — a test
that did not check this would pass for an engine that had stopped hyphenating
altogether.

The mutation

Putting the stub back reddens both document tests and names the cause:

`photography` was broken where the PATTERNS say, not where the document says:
the exception was ignored

⚠ What is not claimed

Refs #765.

🤖 Generated with Claude Code

⛔⛔ AND THE COMMENT SIX LINES ABOVE THAT STUB, IN THE SAME FILE, WARNS ABOUT
EXACTLY ITS SHAPE. amssubstrate.go, about \mark:

	"DISCARDS its argument is the one shape no channel can see: the document
	 says what it wants, the engine says nothing, every test stays green, and
	 the loss shows up only as ink that is not on the page."

Two lines later sat

	% \hyphenation{…}: exception list — nothing to record here.
	\def\hyphenation#1{}

"nothing to record here" was true when it was written and silently false
afterwards. The file documents the defect class and then contains an instance
of it.

⚠ AND THE SILENCE FELL ON THE WORDS IT WAS ASKED ABOUT. A document writes
\hyphenation for the words the patterns get WRONG — that is the only reason to
write it — so every entry that mattered was discarded and the patterns' own
answer used instead. 170 of the 2935 corpus papers use it (5.8%), and it is one
of the gaps #765 names.

WHAT IS IMPLEMENTED

hyphexception.go: \hyphenation{photo-graphy manu-script} parsed in the shape
doPatterns reads \patterns{…}, keyed on the word without its hyphens, with the
break points counted in LETTERS.

⛔ AN EXCEPTION REPLACES THE PATTERNS, IT DOES NOT ADD TO THEM (tex.web §937).
A word in the list breaks only where its entry says, and the patterns are never
consulted for it. Consulting both would hand a document that spelled a word out
the very breaks it wrote the entry to prevent.

⛔ AN ENTRY WITH NO HYPHEN IS NOT NOTHING. \hyphenation{bibliography} says the
word may never be broken, and recording an EMPTY list of points is what says
so; dropping it as "nothing to record" would hand the word back to the
patterns — which is the stub's mistake in miniature.

MEASURED, tectonic 0.17.0, \hyphenation{photo-graphy manu-script} at
\hsize=58pt: the reference leaves `photography` whole and breaks `manu-script`,
never `pho-tography`. The patterns' own answer is `pho-tog-ra-phy`, so a break
after `pho` is the shape that proves the entry was ignored — and that is
exactly what this engine produced before.

	before   A pho-tography and a manuscript and a bibliog-raphy …
	after    A photo-graphy and a manuscript and a bibliog-raphy …

THE MUTATION: putting the stub back reddens both document tests, naming the
patterns' break.

	`photography` was broken where the PATTERNS say, not where the document
	says: the exception was ignored

⚠ WHAT IS NOT CLAIMED. The lookup case-folds with strings.ToLower where TeX
uses \lccode, which this engine does not track — #765 names that separately and
this does not close it. The difference shows for an alphabet whose case mapping
a document has redefined.

⚠ No corpus A/B: the 1-minute load average is 11 and 120 compiles would starve
the other sessions on this host. The witness here is direct and against the
reference.

Refs #765.

Co-Authored-By: Claude Opus 5 <[email protected]>
@tannevaled
tannevaled merged commit ef9a990 into main Nov 13, 2026
18 checks passed
@tannevaled
tannevaled deleted the hyphenation-exceptions branch November 13, 2026 15:21
tannevaled added a commit that referenced this pull request Nov 13, 2026
CLAUDE.md asks every user-visible change to reach the README, and two of
today's did not: the accented-word fix (#774) and the \hyphenation exception
list (#775). The roadmap's line-breaking item now carries them in the shape
section 4 already uses — the capability, then the defect with the measurement
that settled it.

⚠ It also says the thing the README was silent about and a reader most needs:
only English patterns are embedded, so a paper in another language is set
unhyphenated where a real TeX hyphenates it. That is #754's finding E, open.

Refs #754, #774, #775.

Co-authored-by: Claude Opus 5 <[email protected]>
@tannevaled

Copy link
Copy Markdown
Contributor Author

⭐ THE CORPUS A/B OWED FOR THIS AND #774 HAS RUN. No detectable effect, which is what was predicted — and the prediction is the weaker part of this, not the stronger.

Base 16878d5 (immediately before #774), head 3fe9a66 (current main), so the
delta is #774 + #775; #776 was shown byte-identical on a rendered page and #777
is documentation. Same corpus slice, same seed, interleaved, 1-minute load
4.82 at the start — the first window since yesterday afternoon in which this
was runnable at all.

base rows=60 scored=37   head rows=60 scored=37
   2607.10734   95.8% -> 95.9%  (+0.1, revtex4-2)
   2607.17687   97.5% -> 97.8%  (+0.3, revtex4)
   2607.29434   92.8% -> 92.7%  (-0.1, revtex4-2)

moved=3 status_flips=0 only_base=0 only_head=0

Three of 37 papers moved, by +0.1, +0.3 and −0.1. Nothing flipped status.

⚠ What this does NOT establish, which is most of it

It is not evidence that the changes work. The corpus is English-language
physics; \hyphenation is used by 5.8% of the full 2935 and accented words
barely appear in it. A change that corrects French, German, Czech and Polish
hyphenation has almost nothing here to act on, so "no movement" is the expected
reading of a null result, not a confirmation of anything.

And all three movements are at or below this metric's own noise floor.
Measured yesterday on #772: gotex-refdiff scores with pdftotext and no
-layout, which reads a two-column page as one stream and FUSES the end of one
column's line onto the start of another's. Which boundaries fuse depends on
where the lines break, so any line-breaking change moves them. On that PR a
−0.2 vanished entirely under column-aware extraction. ±0.3 is inside that
floor.

So the honest statement is: this measurement could not have detected the
effect these changes make, and it did not detect a regression either.
The
evidence that they are right is elsewhere and is direct — the reference breaks
présenta-tion where we now do and éléme-ntaires where we no longer do
(#774), and photo-graphy at the point the document gives rather than
pho-tography (#775), both measured against tectonic 0.17.0.

I deferred this run four times yesterday, at 1-minute loads of 11, 19, 12 and
35.87, rather than take it badly. It is posted now for completeness, not
because it settles anything.

Refs #774.

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