Skip to content

Audit of the delegated layers: six divergences from the reference that are not interpreter gaps #754

Open

Description

@tannevaled

An audit of what this engine delegates — go-typeset/linebreak, go-typeset/hyphenation, go-opentype/opentype — looking for divergence from the reference that is not a gap in our TeX interpreter.

⚠ Everything below is read, not measured. Each finding names the file and line it was read from, and the measurement that would settle it. Nothing here should be quoted as a number until one of those measurements has been run.

Versions audited: linebreak v1.3.0, hyphenation v1.0.0, opentype v0.20.0 (fonts v0.14.0 indirect).


A. The breaker takes one measure per paragraph, so \hangindent and \parshape cannot reach it

func KnuthPlassWith(items []Item, lineWidth float64, p Params) ([]Line, bool)

lineWidth is a scalar. TeX's line_break consults \parshape/\hangindent for each line (tex.web §847-850), so the first line of a bibliography entry is full width and the rest are indented.

This engine declares both — \hangindent at classkernel.go:131 — and the kernel substrate uses it for exactly that:

amssubstrate.go:524:  \hangindent \wd\@tempboxa\noindent\box\@tempboxa

So every \bibitem, every \@hangfrom heading and every \parshape paragraph is broken on a uniform measure. Lines that should be short are set long, which is the right shape to produce fewer lines than the reference.

Candidate for #381 ("our lines hold 69 characters where the reference holds 66, with the font and the measure controlled"), #685, #589, and the \list/\parshape work held in #646.

Measurement that would settle it: one bibliography-heavy paper, our line count per entry against tectonic's, with \hangindent known non-zero.

B. \emergencystretch is declared and never reaches the breaker

texparams.go:60 declares the dimen. linebreak.Params has no field for it. What the third pass does instead (paragraph.go:251-258):

q := p
q.Tolerance = maxBadRatio

That is not TeX's emergency pass. TeX keeps \tolerance and adds \emergencystretch to the stretch available on every line (tex.web §16772-16774); the paragraph is re-broken with looser glue, and lines that remain infeasible stay infeasible. Raising the tolerance to its maximum instead accepts arbitrarily bad lines — a different set of breakpoints, and ours can keep a line TeX would have refused.

Measurement: a paragraph whose only solution needs \emergencystretch, set both ways.

C. \looseness is declared and not implemented

texparams.go:30 lists it at 0. TeX's post-pass (tex.web §873-875) re-breaks the paragraph to come out \looseness lines longer or shorter. A document that sets it gets no effect here, silently. Rare in arXiv papers, but silent, which is the part worth fixing.

D. The final pass is deliberately unarmed, and the reason is a library gap

paragraph.go:236-244 records it in full:

FinalPass IS NOT ARMED HERE YET … pass 2 does not fail here for a reason the library does not yet reproduce: TeX refuses to record a forced break whose line is past the threshold (tex.web §16769 → §16824-16831), while the library records every forced break unconditionally.

That is a defect in go-typeset/linebreak, named here, carried in #666. It is the one finding in this audit already written down; the rest were not.


E. Hyphenation is English-only, and the fallback is silence

hyphenation.go:57:  any other \language gets nothing, since no patterns are embedded
hyphenation.go:63:  if e.namedInt("language") != 0 { … }

hyph_en_us_patterns.txt is embedded; nothing else is. A paper in French, German or Spanish — and arXiv carries many — is set unhyphenated where tectonic hyphenates it. Unhyphenated text makes longer, looser lines and more of them.

This is a strong candidate for page-count divergence on a subset of the corpus that is invisible to a mean: it affects whole papers, not glyphs.

Measurement: partition the corpus by \documentclass language option / babel argument and compare Σ within each part. If the non-English part carries most of the deviation, this is it.

\lefthyphenmin/\righthyphenmin are honoured (hyphenation.go:71), so that half is aligned.


F. ⭐ The engine never runs the shaping pipeline, and asks for kerning pairwise

This is the finding I would chase first.

font.go:106:  gids := o.fc.Shape(string(comps), "liga")
font.go:286:  return ptToSP(o.fc.KernUnits(prev, cur) * o.fc.Scale())

Glyphs are resolved by a liga-only Shape, and kerning is then asked for two runes at a time. The library offers ShapePositioned, which runs GSUB then GPOS over a whole run with kern, mark and mkmk always on (shape.go:42-52). tectonic/XeTeX runs HarfBuzz over the run.

Three consequences, all widths:

  1. Contextual kerning never applies. GPOS chained-context lookups need the run; a pair lookup cannot see them.
  2. Kerning next to a ligature is taken between the wrong pair — KernUnits(prev, cur) is given runes, so after fi becomes one glyph the kern against its neighbour is computed from the component, not the ligature.
  3. Only liga is requested. clig, rlig, calt and locl are part of the default set a shaper activates for Latin; without them our glyph run differs from the reference's before any kerning happens.

Candidate for #716 ("the fidelity metric cannot see a kerning defect: 1.12pt per AV"), and for any "our lines are narrower/wider" finding.

Measurement: one paragraph, our total advance against ShapePositioned's over the same string, and both against XeTeX. go-tex/fontcmp already asks two engines the identical question.

Not a divergence: the kerning source is right. KernUnits prefers GPOS pair positioning and falls back to the legacy kern table (face.go:155-170), which is what a modern shaper does.


What I did not establish

  • No measurement. Every item above is read from source. I have not run one paper through two engines to attribute a single page to any of them.
  • No ranking. I believe F and E are the largest because they affect every glyph and whole papers respectively, but "believe" is the word: The fidelity metric cannot see a kerning defect: 1.12pt per AV was invisible to every number we steer by #716 measured 1.12pt per AV pair and nothing has measured E at all.
  • go-typeset/bidi was not audited — the engine does not import it.
  • Vertical material (\baselineskip, \lineskip, page breaking) is ours, not delegated, so it is out of this audit's scope by construction. A page-count gap can come from there and this audit would not see it.

Each heading above is meant to become its own issue once measured; this one is the map.

🤖 Generated with Claude Code

Prior art: priorart "divergence from tectonic caused by font metrics hyphenation or line breaking rather than the interpreter" at 2026-11-11 15:17 CET reported prior art; checked: 957 entries. #700 is the prior exhaustive read, but of the REFERENCE SOURCES (latex.ltx etc), not of our delegated libraries. #612 and #731 covered the space advance, now merged. #716 measured a kerning defect the metric cannot see; this names its mechanism (pairwise KernUnits instead of ShapePositioned). #381/#685/#589 are symptoms whose cause A may be. No entry audits linebreak/hyphenation/opentype as dependencies.

Activity

  1. tannevaled commented on Nov 11, 2026

    @tannevaled
    ContributorAuthor

    ⛔ Finding F is refuted for the case that matters, measured

    F was the one I said I would chase first — "the engine never runs the shaping pipeline, and asks for kerning pairwise". The mechanism is real. The consequence I attributed to it is not, on the fonts this corpus is actually set in.

    Latin Modern Roman 10pt, the engine's real path against ShapePositionedUnits(s, "liga"):

    "office"                        glyphs: engine= 4 shaped= 4   engine= 22.2100 shaped= 22.2100  delta=+0.0000pt
    "finding"                       glyphs: engine= 6 shaped= 6   engine= 30.0200 shaped= 30.0200  delta=+0.0000pt
    "difficult"                     glyphs: engine= 7 shaped= 7   engine= 33.3400 shaped= 33.3400  delta=+0.0000pt
    "flagstaff"                     glyphs: engine= 7 shaped= 7   engine= 34.2200 shaped= 34.2200  delta=+0.0000pt
    "fi fl ff ffi ffl"              glyphs: engine= 9 shaped= 9   engine= 46.9300 shaped= 46.9300  delta=+0.0000pt
    "The quick brown fox jumps …"   glyphs: engine=43 shaped=43   engine=198.4401 shaped=198.4400  delta=-0.0001pt
    

    Same glyph count, same width to four decimals, ligature-heavy cases included.

    The three ways this measurement nearly lied, in order

    Worth recording, because each is a shape that recurs.

    1. A font that could not answer. The first run used the engine's default face and found no difference — but that face is a math font. The control: 20 of 20 classic kerning pairs are non-zero in it (AV −1.00pt, VA −1.05pt), so kerning was genuinely active and the agreement was not vacuous for kerning. It forms no ligatures at all, so it could not test the ligature half. A second font was needed, and it is the one the corpus uses.

    2. A shaper asked the wrong question. ShapePositionedUnits(s) with no features reported the same glyph count as runes on Latin Modern too — because the library's default feature set is positioning (kern, mark, mkmk). liga is GSUB and must be requested. I was comparing two paths that both declined to ligate: an agreement about nothing. With liga asked for, "office" goes 6 glyphs → 4 and −0.57pt.

    3. A probe that was not the engine. That −0.57pt looked like the finding confirmed. It was not: my probe summed CharDims rune by rune, and the engine does not set text that way. appendChar folds prev+cur into the Unicode ligature codepoint when the font has the glyph (ligature.go), so "office" sets as o + ffi + c + e. Measuring the engine's actual fold is what produced the table above.

    Three times, the number in front of me was confident and about something else.

    What F should now say

    • Refuted for Latin body text in Latin Modern and in the built-in math face: the pairwise path and the whole-run shaper agree exactly.
    • Still unmeasured, and now the only live part: fonts carrying contextual GPOS lookups (chained context), which neither of these two appears to use for Latin. A pair lookup cannot see those by construction, so the mechanism remains — what is missing is a font in this corpus that exercises it.
    • The fidelity metric cannot see a kerning defect: 1.12pt per AV was invisible to every number we steer by #716's 1.12pt per AV therefore has another cause. It is not this.

    I have left the issue body as written rather than editing F out: the audit said in its own header that everything in it was read and not measured, and this is what measuring one of them produced.

    🤖 Generated with Claude Code

  2. tannevaled commented on Nov 11, 2026

    @tannevaled
    ContributorAuthor

    Finding E is real and it is one paper in 154, counted

    E says the engine embeds US-English hyphenation patterns and nothing else, so a paper in another language is set unhyphenated where the reference hyphenates it. I wrote that it was "a strong candidate for page-count divergence on a subset of the corpus that is invisible to a mean: it affects whole papers, not glyphs."

    Counted over the curated 154-paper list:

    corpus: 154 paper(s) listed, 0 unread
      names no language at all : 145   (English patterns apply, as the reference also defaults to them)
      names only English       :   8
      names a NON-English one  :   1   greek: 2401.03325
    

    Verified on the survivor: \usepackage[english,greek]{babel} % language dictionaries.

    0.6% of the corpus. E cannot account for a Σ of 294. It remains a correctness gap — a Greek paper is set wrong — and it is not a lever on the fidelity number.

    ⛔ And the first count was wrong by two thirds

    The census first reported three papers — German, Greek, Italian. Spot-checking the German one found this:

    %\usepackage[german, english]{babel}
    

    Commented out. The package is never loaded. A regex over raw source measures what a file contains; TeX cares what it executes. Stripping %-to-end-of-line (an escaped \% not counting) took the number from 3 to 1.

    One check of one paper caught it. I ran that check because this exact defect — a sweep that measures its own pattern — has turned up three times today already, in priorart's [closed], in privscan's idea of a private path, and in the first version of a scanner I wrote this morning that could not see the paths it existed to find.

    Where the audit stands after two measurements

    status
    A one measure per paragraph (\hangindent, \parshape) unmeasured, and now the strongest remaining candidate — it touches every bibliography entry
    B \emergencystretch not threaded unmeasured
    C \looseness unimplemented unmeasured, silent, rare
    D final pass unarmed known, carried in #666
    E English-only hyphenation measured: 1 paper in 154. Real, small
    F pairwise kerning / no shaping pipeline measured: refuted for Latin text; only contextual GPOS remains, untested

    The two I called out as "the ones I would chase first" are the two that have now been measured and shrunk. A is the one I did not name and did not measure.

    🤖 Generated with Claude Code

  3. tannevaled commented on Nov 11, 2026

    @tannevaled
    ContributorAuthor

    Finding A is confirmed against tectonic, with a control — and it is worse than A said

    One document, two engines, two paragraphs: the first on a uniform measure as a control, the second asking for \hangindent=4em \hangafter=1 — what every \bibitem does.

    The control is identical in both engines, word for word, five lines each. So the comparison below is about the hanging indent and nothing else.

    tectonic:

    HUNG: this paragraph asks for a hanging indent of four ems after its first line, which is what a bibliography
           entry does. Typography affects every line of every paper, and a measure that is wrong by a centimetre
           is wrong on every line it sets, which is why the number of lines is the thing to count rather than any
           single width. This sentence is padded so the paragraph runs to several lines. Typography affects every
           line of every paper, and a measure that is wrong by a centimetre is wrong on every line it sets.
    

    ours:

    HUNG: this paragraph asks for a hanging indent of four ems after its first line, which is what a bibliography
    entry does. Typography affects every line of every paper, and a measure that is wrong by a centimetre is wrong
    on every line it sets, which is why the number of lines is the thing to count rather than any single width. This
    sentence is padded so the paragraph runs to several lines. Typography affects every line of every paper, and a
    measure that is wrong by a centimetre is wrong on every line it sets.
    

    Two things, not one:

    1. No indent at all. Lines 2–5 are flush left where the reference indents them by four ems.
    2. Different breaks. Our lines carry four ems more text, so the paragraph is re-broken: "…is wrong on every line it sets, which is why…" lands on line 3 for us and line 4 for the reference.

    A understated it

    A said the scalar lineWidth means \hangindent "cannot reach the breaker". The witness says more: \hangindent is not applied anywhere — not as an indent on the drawn lines, not as a narrowed measure. classkernel.go:131 declares the dimen and nothing reads it. It is a register the document can set and the engine ignores.

    Why this is the one to chase

    Every \bibitem in thebibliography is a hanging-indented paragraph. The corpus is 154 real arXiv papers; a paper with forty references has forty of them, each set on a measure four ems too wide, each therefore liable to lose a line. Lines lost at the end of a document are pages lost, which is the channel Σ reads.

    I have not measured that consequence — how many corpus pages this accounts for — and it is the next measurement, not a claim. What is measured here is the mechanism, against the reference, with a control.

    Where the audit stands now

    status
    A \hangindent / \parshape confirmed against tectonic, and broader than stated: unimplemented, not merely unreachable
    B \emergencystretch not threaded unmeasured
    C \looseness unimplemented unmeasured, silent, rare
    D final pass unarmed known, #666
    E English-only hyphenation measured: 1 paper in 154
    F pairwise kerning measured: refuted for Latin text

    The two findings I called the largest are the two that shrank under measurement. The one I did not name is the one that holds.

    🤖 Generated with Claude Code

  4. tannevaled commented on Nov 13, 2026

    @tannevaled
    ContributorAuthor

    ⭐ BIBLIOGRAPHY PASS, 2026-11-13. F WAS MEASURED AND DOES NOT REPRODUCE ON THE
    CORPUS'S OWN FONT. E's library half is fixed. The versions this audit read have
    moved.

    This issue says every finding is "read, not measured". Here are measurements
    for two of them.

    ⛔ F: the predicted width divergence is not there, on Latin Modern at 10pt

    F says the engine resolves glyphs with a liga-only Shape and then asks for
    kerning two runes at a time, so contextual kerning never applies and kerning
    next to a ligature is taken between the wrong pair. The stated measurement was
    "our total advance against the reference's over the same string".

    Run, \setbox0=\hbox{…} in both engines, Latin Modern Roman 10pt, the corpus's
    own font and size:

    string tectonic 0.17.0 this engine
    Waffle 27.22pt 27.22002pt
    AV 13.89pt 13.89001pt
    office (ffi) 22.21pt 22.21pt
    To 11.39pt 11.39001pt
    Affliction (ffl) 40.28pt 40.28pt

    Five for five, to the rounding of the two \showthe formats. That includes
    both ligature cases and both classic kern pairs — exactly the shapes F predicts
    would go wrong.

    ⚠ What this does and does not settle. It settles that the hand-rolled path
    costs nothing on this font at this size, which is where the corpus lives. It
    does NOT refute F's mechanism: contextual GPOS lookups and the clig/calt/
    locl features are real, and a font that uses them would still diverge —
    Latin Modern evidently does not exercise them in these words. So F stops being
    "the finding I would chase first" and becomes "a hazard for fonts the corpus
    does not use", until someone measures a font that does.

    ⚠ And #716's 1.12pt per AV was LibertinusSerif, a different font, and was
    a kerning-SOURCE defect since fixed. The AV above is Latin Modern and agrees.

    ⭐ And the library has removed F's stated blocker

    opentype.ShapePositionedUnits exists in the version this engine already pins
    (v0.20.0, shape.go:101), and its doc comment is about this consumer by name:

    "a consumer that sets type at 10pt — where one pixel is one point — cannot
    accept half a point of error per glyph. So the engine that most needed this
    call measured its own advances instead (AdvanceIndexUnits × Scale, exact) and
    got NO ligatures and NO mark attachment as the price of keeping its metrics:
    the correct, shared path was lossier than the hand-rolled one it replaced."

    That price is gone — the unrounded call carries font units to the last line. So
    adopting the shared pipeline is now possible without losing metric precision.
    Given the table above it is no longer urgent for width, but it is the
    mutualised path, and it brings clig/calt/locl and mark attachment with
    it.

    E: the library half is fixed, the engine half is not

    E is "hyphenation is English-only". Half of what made it worse was a defect in
    the library itself: Points indexed its value array by BYTE and read it back by
    RUNE, so every accented word broke at an offset — go-typeset/hyphenation#8,
    released as v1.0.1 and adopted here in #774, measured against the reference
    (présenta-tion, where before we set présent-ation and éléme-ntaires).

    E's own subject — no patterns for any language but English — is untouched.

    Versions: this audit read three, and one has moved

    audited here now
    go-typeset/linebreak v1.3.0 v1.3.0
    go-typeset/hyphenation v1.0.0 v1.0.1 (the byte/rune fix)
    go-opentype/opentype v0.20.0 v0.21.1 (glyph mask; outline cache — neither touches shaping)

    ⚠ Separately: go-opentype/fonts carries tag v0.14.0 while its latest GitHub
    RELEASE is v0.9.0. Tags without releases are the shape ghrelease --backfill
    exists for; nothing here depends on it, but a reader comparing release pages
    would read the module as four minors older than it is.

    What I did not do

    No corpus A/B for any of this: the 1-minute load average was 11 and 120
    compiles would starve the other sessions on this host. Every number above is a
    box width, which is exact and cheap.

  5. tannevaled commented on Nov 15, 2026

    @tannevaled
    ContributorAuthor

    Three of this audit's findings now have the measurement they asked for, and one of them is much smaller than the audit hoped: the corpus is not multilingual. \looseness is set by NO measured paper, \emergencystretch by four, and only ONE of 154 has a non-English main language.

    This issue says up front that nothing in it should be quoted as a number until one of its measurements has been run. These are three of those runs — the population is the 154 papers of clean-list.txt, the same list the A/B samples from.

    Method, because the obvious version of it is wrong twice

    A grep -rl looseness over the paper tree answers about ~2935 papers, not the 154 that are measured, and matches the bare substring in prose and comments. And the list names each paper's main.tex, not its directory, so walking a list entry visits one file and silently skips every \inputed chapter — the first version of this census read 154 .tex files for 154 papers, one apiece, where walking the directories reads 679.

    So: a Go program over the list, walking each paper's directory, with TeX comments stripped (a % not preceded by an odd number of backslashes), and \documentclass as a positive control so that a zero cannot be a scan that read nothing.

    population: 154 paper(s) of 154 listed, 679 .tex file(s)
    control:    \documentclass found in 154 paper(s)
    

    C. \looseness — 0 of 154 papers

    \looseness: 0 paper(s)
    

    ⭐ So implementing \looseness is bit-identical on this corpus and owes no A/B — the finding is real (declared at texparams.go:30, silently ineffective) but it is a correctness fix, not a fidelity lever. Worth knowing before anyone budgets corpus time for it.

    ⚠ It is not cheap, though, and it is blocked: tex.web §873-875's post-pass re-breaks the paragraph to come out \looseness lines longer or shorter, which needs the breaker to offer the alternatives rather than one answer. That is a go-typeset/linebreak feature, and engine main is on linebreak v1.5.0 — every new library feature is behind the v1.8.0 bump in #784, which is itself held on the corpus A/B.

    B. \emergencystretch — 4 of 154 papers, two of them \maxdimen

    2205.03780/main.tex:     \emergencystretch=\maxdimen
    2209.13121/preamble.tex: \emergencystretch=\maxdimen
    2304.05592/main.tex:     \setlength{\emergencystretch}{3em}
    2311.15028/main.tex:     \emergencystretch 1em
    

    ⭐ So this one does owe an A/B, and it is the sharper of the two. The audit's point stands and now has a population: paragraph.go:251-258 raises Tolerance to maxBadRatio instead of adding stretch, and those are not the same paragraph. The two \maxdimen papers are the extreme case — a document asking for unlimited emergency stretch, against a third pass that instead accepts arbitrarily bad lines at the ORIGINAL glue.

    E. The corpus is not multilingual, so this is not the page-count lever

    The audit calls English-only hyphenation "a strong candidate for page-count divergence on a subset of the corpus that is invisible to a mean". Measured:

    babel:       12 paper(s)
    polyglossia:  0 paper(s)
    papers naming a non-English language: 2 of 154
      2401.03325/main.tex:    \usepackage[english,greek]{babel}
      2402.04711/packages.tex: \usepackage[russian, english]{babel}
    

    ⛔ And one of those two is an English paper. babel makes the last language in the option list the main one — which this engine already implements and documents, babel.go:62-74 ("the last one is the main language") — so [russian, english] selects english, with russian merely available to \selectlanguage. Only 2401.03325 ([english,greek]) has a non-English main language.

    So finding E affects 1 paper of 154, not a subset large enough to move a corpus figure. The divergence is real for that paper and for arXiv at large; it is not the explanation for #381's line-density gap, and finding A (one measure per paragraph, so \hangindent/\parshape cannot reach the breaker) remains the much better candidate for that.

    ⚠ Not claimed

    • That no paper selects a language another way. This detector requires the language name on the same line as babel, polyglossia or \documentclass. A \selectlanguage{french} in the body, or a class that sets a language internally, is not counted. For the two it did find, I read the option list rather than inferring from the package name.
    • Anything about the other ~2781 papers in the tree. The 154 are the measured list, and that is deliberately what this answers; the full tree may be more multilingual.
    • Any A/B result. None was run: the host's 1-minute load has been 8 to 133 all day against this repository's ~8 ceiling (readings today: 14.6, 22.3, 61, 133, 10.8, 23.6, 16.8, 56, 37.4, 15.3, 8.03, 15.3, 83.7, 17.8). The counts above are source censuses, which load does not affect.
    • Items A, D and F are untouched here. A and F owe layout measurements; D is go-typeset/linebreak's recorded gap, carried in \parfillskip is appended to every forced-break fragment, so a forced break leaves its line unjustified #666.

    🤖 Generated with Claude Code

  6. tannevaled commented on Nov 17, 2026

    @tannevaled
    ContributorAuthor

    ⚠ This audit is stale in the half that matters, and I nearly redid two of its
    findings before checking.
    It was taken at linebreak v1.3.0; the engine is on
    v1.10.0 today, and three of the six are closed. Posting the status so the map
    stops pointing at work that exists.

    Read from the source as it stands now, not from the audit:

    finding status
    A one measure per paragraph, \hangindent/\parshape cannot reach the breaker ⭐ closed
    B \emergencystretch declared and never reaching the breaker ⭐ closed
    C \looseness declared and not implemented open
    D the final pass deliberately unarmed (a library gap, #666) ⭐ closed
    E hyphenation English-only, fallback is silence open
    F kerning by pair query rather than ShapePositioned open, now instrumented

    The three that closed, with where to look

    A. libs.go:30,57 alias linebreak.Measure and linebreak.KnuthPlassShaped;
    paragraph.go:353, :395 and :405 all break through the shaped entry point
    with a per-line shape. Landed by #795 (\hangindent), #798 (\parshape as a
    primitive), #796 (a shape lasts one paragraph), after #757 and #760 named it. The
    library half is linebreak #19, released in v1.10.0 — whose doc records it
    was "measured by a consumer against tectonic on a \hangindent=4em paragraph".

    B. paragraph.go:391-405 reads the register and sets q.EmergencyStretch,
    and emergencystretch_test.go is the witness this audit asked for — "a paragraph
    whose only solution needs \emergencystretch, set both ways"
    . The library half
    is linebreak #18: bg.Stretch[0] += p.EmergencyStretch on the final pass, which
    is §863's background and not a looser tolerance.

    D. paragraph.go:394 sets p.FinalPass = emergency <= 0 and :403 arms it
    for the third pass; badbox_test.go:94 says "since FinalPass IS ARMED". The
    library gap this depended on is closed.

    The three that stand

    C. \looseness appears in this repository only inside
    cmd/gotex-paramcensus, as a term that tool can census — never in the breaker.
    And linebreak has no Looseness in Params: I read origin/main. So this
    is a library gap first, as B and D were, and the engine cannot fix it alone.
    tex.web §873-875 is the post-pass.

    E. hyphenation.go:23 embeds hyph_en_us_patterns.txt and :114 still says
    "any other language gets nothing, since no patterns are embedded".

    F. font.go:353 still calls KernUnits, a pair query, and font.go:337
    carries the reason it cannot speak for every font. #807 did not close it — it made
    it reportable: Diagnostics.KerningIsAFloor says "the pair values were used
    but contextual GPOS lookups could not be evaluated", i.e. we know we are
    under-reporting. That is worth having before the shaper work in #792, because it
    turns a silent approximation into a flagged one.

    Why I am posting this rather than a fix

    ⛔ An hour ago I rebuilt #724 without reading it, having been shown its branch by
    priorart. An audit that names six divergences is the single most likely place
    for that to happen again, and three of these six would each have been a day's
    work already done. A map's value is that it is current.

    Refs #795, Refs #798, Refs #796, Refs #807, Refs #666, Refs #792.

    🤖 Generated with Claude Code

  7. tannevaled commented on Nov 17, 2026

    @tannevaled
    ContributorAuthor

    Item (C), \looseness: the library half is done and released; the engine half
    does not work, and I am not landing it until it does.

    The library half

    go-typeset/linebreak v1.12.0 (#22) implements it, with the two things it
    needs — the choice itself (tex.web:17197-17237) and the state it chooses from.
    That second part is where the work was: tex.web:16107-16114 keys the DP by
    position, line and fitness, and collapsing the line dimension is an
    optimisation licensed only "when the looseness parameter is zero" (:16716,
    easy_line:=max_halfword). Keyed by fitness alone, a paragraph offered exactly
    one ending and the choice had a list of one.

    #825 takes that version into this engine. Seven witnesses are byte-identical
    across the bump and the suite is green.

    ⛔ The engine half, measured and withheld

    The wiring is one line — Looseness: e.namedInt("looseness") in
    breakSegment's Params. I wrote it, measured it, and took it out.

    The register arrives correctly: \looseness=-1 reads back -1 through
    namedInt. But across eighteen configurations the line count is identical
    for \looseness 0, +1 and −1 in every one:

    words= 6 hsize=40  base=3  +1=3  -1=3      words= 9 hsize=50  base=3  +1=3  -1=3
    words= 6 hsize=50  base=2  +1=2  -1=2      words=10 hsize=40  base=4  +1=4  -1=4
    words= 8 hsize=40  base=3  +1=3  -1=3      words=12 hsize=50  base=4  +1=4  -1=4
    words= 8 hsize=60  base=2  +1=2  -1=2      words=12 hsize=60  base=3  +1=3  -1=3
    …  (6, 8, 9, 10, 12, 15 words × \hsize 40, 50, 60pt; \tolerance 5000,
        \adjdemerits 10000, \spaceskip 4pt plus 8pt minus 2pt)
    

    Eighteen for eighteen is not "no feasible alternative here" — it is systematic.
    Something between this engine's paragraph builder and the library's choice
    removes the alternative endings before \looseness is consulted.
    The library's
    own fixture does move (3 lines → 4 at \looseness=1) on the same shape in the
    same units, so the choice works when it is reached.

    ⚠ No mechanism claimed. The candidates I would look at are the three-pass
    loop (an unmatched looseness fails a non-final pass, :17203, so pass 1 declines
    and pass 2 accepts whatever it reached — which should still be the closest
    available, not the base), the per-segment split at forced penalties, and the
    Background this engine adds for \leftskip/\rightskip. I have isolated none
    of them.

    Wiring a parameter whose effect cannot be witnessed would ship an unexercised
    path and let the next reader believe \looseness works. That is why item (C)
    stays open here with the library half done.

    Refs #825, Refs go-typeset/linebreak#22, Refs go-typeset/linebreak#12.

    🤖 Generated with Claude Code

  8. tannevaled commented on Nov 17, 2026

    @tannevaled
    ContributorAuthor

    ⛔ Correcting my own comment above, an hour later. I wrote that the
    \looseness wiring "does not work" and offered eighteen flat rows as the
    evidence. The rows were measured on the wrong glue, and the wiring works.

    looseness 0   3 lines
    looseness 1   4 lines
    

    What was wrong with the measurement

    Every one of those eighteen fixtures set \spaceskip=4pt plus 8pt minus 2pt.
    \spaceskip is a \newskip register in this engine and not the base interword
    glue
    — spacefactor.go:104-109 states it plainly: "\spaceskip as the base
    glue … declared in this engine as \newskip registers rather than real glue
    parameters, so there is nothing to read; a document that sets them is unaffected
    today"
    .

    So the breaker received spMock's own 3pt plus 1.5 minus 1 space. On a 50pt
    measure that makes a three-word line need ratio 4.7, and no second ending
    survives \adjdemerits — one feasible ending, nothing for \looseness to choose
    between, eighteen times. The parameter was reaching the breaker throughout.

    What separated it

    Two steps, neither of them re-reading the numbers:

    1. Drive the library's own fixture from inside the engine's binary. It moved
      (3 → 4), so the version, the aliases and the choice were all fine and the
      difference had to be in what the engine hands over.
    2. Dump that item stream. w=3.00 y=1.50 z=1.00 where the source said
      4 / 8 / 2.

    A fixture whose glue is \hskip — which this engine does honour — moves the
    line count as the source says it should.

    Status of item (C)

    Closed by #825, which takes go-typeset/linebreak v1.12.0 and adds the one
    line that passes the register, with three rows: the move, the control
    (\looseness=0 is the old behaviour exactly), and an unreachable \looseness=5
    that must still set the paragraph (tex.web:17203).

    ⚠ And a new item for this audit, which is what the hour actually bought:
    \spaceskip and \xspaceskip are accept-and-ignore. spacefactor.go documents
    it honestly at the call site, and nothing on this tracker says it, so the next
    person to write a fixture with \spaceskip will measure the font's space and
    believe otherwise — as I did. Filed separately.

    Refs #825, Refs go-typeset/linebreak#22.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions