Repository navigation
A kerning we cannot read is reported, not returned as zero (#716) - #807
Merged
Merged
Conversation
kernSP asks go-opentype for the kern between two glyphs, and that is a PAIR query. GPOS lookup types 7 (Contextual) and 8 (Chained Contextual) position pairs too, and a pair query cannot evaluate them: such a rule is matched against the glyphs AROUND a position, which (prev, cur) does not carry. go-opentype's kernCovered skips those subtables and answers 0 -- the same 0 it answers for a pair the font deliberately leaves alone. Nothing here distinguished the two, and that is #716: a kerning defect of 1.12pt per "AV" invisible to every number this engine's fidelity measurement steers by. go-opentype/opentype v0.22.0 (go-opentype/opentype#76) reports the condition per face, and this surfaces it as Diagnostics.KerningIsAFloor, beside the other silent-swallow flags, where a reader of a corpus run will see it. ⚠ IT IS NOT THE FIX FOR THE KERNING ITSELF. kernSP still returns the pair answer. Driving the shaping path, which has the glyph sequence a contextual rule needs, is #792's "the shaper we already depend on but never call" and is not this change. What this change does is stop a floor from passing for a measurement. ⚠ AND IT IS NOT A CLAIM THAT ANY KERN WAS WRONG. Measured over the 81 fonts go-opentype/fonts bundles, 8 carry such lookups -- seven complex-script Noto faces and notosans.ttf, a general Latin sans -- so the condition is neither rare nor exotic. Whether it fires on a given document's text, and by how much, this flag does not say. Sizing that needs the corpus's own fonts (Latin Modern, Libertinus, STIX, TeX Gyre), which are not in that population. ## The hole my own tests would have hidden noteKerningFloor is hooked into SetFont AND selectFont. SetFont is how a HOST installs the base face once; \rmfamily, \ttfamily, a math font and every size change come through selectFont, so a flag hooked only into SetFont would be blind to every switch a DOCUMENT makes -- and the first two tests would still have passed in full, because they switch faces the way a host does. That was found by reading selectFont after writing them, not by running them. A third test goes in through selectFont, inside a group, and asserts the flag survives the group's end: selectFont restores the previous face, and the text set in the group still carries kerns we could not read. ## Witnesses Four rows, with the boundary covered on both sides: a face whose kerning is a floor must raise it, a pair-adjustment face must NOT (or the flag says nothing at all), and -- the row that explains the design -- a face that cannot be ASKED must not raise it either. ⛔ noteKerningFloor is a type assertion and not a fontFace method on purpose. fontFace is implemented by this package's mocks, which have no font behind them, and widening the interface would force every one of them to answer a question about OpenType lookups that has no meaning for a mock. The assertion failing is the right answer, not a missing case, and that row is what says so. ⚠ The witnesses test the WIRING, not a font. A test asserting "notosans.ttf kerns contextually" would be an assertion about a third-party font's internals that a version bump may flip for reasons unrelated to this engine. The evidence that real fonts do this is the census on go-opentype/opentype#71; the detection itself is covered by that library's own tests. Verified uncached: go test -count=1 ./... -- 11 packages, 0 failures, at a 1-minute load of 6.28. Refs #716, Refs #792, Refs go-opentype/opentype#71. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Nov 16, 2026
tannevaled
added a commit
that referenced
this pull request
Nov 17, 2026
…tor, because -race costs 6.65x (#811) MEASURED (#799). Quiet machine, GOMAXPROCS=1 -parallel 1 -count=1, arms INTERLEAVED and the order REVERSED so a drift during the pass shows up as a disagreement between orders instead of reading as an effect: run 1 run 2 plain 17.486 s 18.175 s -race 116.361 s 121.046 s A1 -> B1 6.65x B2 -> A2 6.66x (agree to 0.2%) windows-latest was failing at 1800.5 s against its own 1800 s bound, one push run in four. That left `main` ITSELF red a quarter of the time, so "is main green?" had no stable answer, ghrelease could not tag on its first try, and three open pull requests (#807, #809, #810) were red on this lane and on nothing else -- #810 changes only a comment. At 6.65x the lane was not 10% away from comfortable, it was most of an order of magnitude away. #156 and #653 already raised this bound twice; a third raise buys a few months and the same recurrence. Expected after this change: ~270 s. ⚠ AND THAT ESTIMATE IS PESSIMISTIC: the race detector's overhead on Windows is commonly HIGHER than on darwin, and a higher multiplier means a bigger saving. ## What is given up, named A data race reachable ONLY through Windows-specific code. A race is a property of the Go program and Go's memory model is platform-independent, so everything else is still caught on ubuntu and macos, on every push and every pull request. The conformance ratchet and the 80% coverage floor still run on windows: platform BEHAVIOUR is still covered there. Only the detector is dropped. ## Why the matrix and not a shell branch The policy is declared in the matrix -- `{ os: windows-latest, race: '' }` -- rather than branched on inside the step, so that reading the matrix tells you which lane guarantees what. A reader looking for "where does -race run" finds the answer in one place. ## ⚠ What is NOT changed, deliberately The 30m bound stays, although ~270 s is expected. The first green run on this lane is what measures the new time, and changing two things at once would leave nobody able to say which did it. Once that number exists the bound can come down to something that would catch a real deadlock quickly. Verified: wfaudit reads the workflow (1 read, 0 unreadable, no findings), and `go test -count=1 ./...` is green on 11 packages at a 1-minute load of 3.16. Closes #799. 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.
A kerning we cannot read is reported, not returned as zero
kernSP(font.go:336) asks go-opentype for the kern between two glyphs, andthat is a pair query. GPOS lookup types 7 (Contextual) and 8 (Chained
Contextual) position pairs too, and a pair query cannot evaluate them: such a rule
is matched against the glyphs around a position, which
(prev, cur)does notcarry. The library's
kernCoveredskips those subtables and answers0— thesame
0it answers for a pair the font deliberately leaves alone.Nothing here distinguished the two, and that is #716: a kerning defect of
1.12pt per "AV" invisible to every number this engine's fidelity measurement
steers by.
go-opentype/opentypev0.22.0 (go-opentype/opentype#76) reports the conditionper face, and this surfaces it as
Diagnostics.KerningIsAFloor, beside the othersilent-swallow flags, where a reader of a corpus run will see it.
What this is not
⚠ It is not the fix for the kerning itself.
kernSPstill returns the pairanswer. Driving the shaping path — which has the glyph sequence a contextual rule
needs — is #792's "the shaper we already depend on but never call" and is not
this change. What this change does is stop a floor from passing for a measurement.
⚠ It is not a claim that any kern was wrong. Censused the 81 font files
go-opentype/[email protected]bundles, with the new API:Seven are complex-script Noto faces where contextual positioning is expected; the
eighth is
notosans.ttf, a general Latin/Greek/Cyrillic sans. So the condition isneither rare nor exotic. Whether it fires on a given document's text, and by how
much, this flag does not say.
⚠ And that population is not the corpus's. The papers measured here are set in
Latin Modern, Libertinus, STIX and TeX Gyre, none of which is in that collection.
Sizing the effect on the corpus needs those font files; it is #716's own next step
and is not done.
⛔ The hole my own tests would have hidden
noteKerningFlooris hooked intoSetFontandselectFont.SetFontis how a host installs the base face once.\rmfamily,\ttfamily, amath font and every size change come through
selectFont— so a flag hooked onlyinto
SetFontwould be blind to every switch a document makes, and the firsttwo tests would still have passed in full, because they switch faces the way a
host does and not the way a document does.
That was found by reading
selectFontafter writing them, not by running them. Athird test goes in through
selectFont, inside a group, and asserts the flagsurvives the group's end:
selectFontrestores the previous face, and the textset in that group still carries kerns we could not read.
Witnesses
Four rows, boundary covered on both sides:
selectFont, inside a group⛔
noteKerningFlooris a type assertion and not afontFacemethod, onpurpose.
fontFaceis implemented by this package's mocks, which have no fontbehind them, and widening the interface would force every one of them to answer a
question about OpenType lookups that has no meaning for a mock. The assertion
failing is the right answer, not a missing case — and the third row is what says
so.
⚠ The witnesses test the wiring, not a font. A test asserting "
notosans.ttfkerns contextually" would be an assertion about a third-party font's internals
that a version bump may flip for reasons unrelated to this engine. The evidence
that real fonts do this is the census above, recorded on
go-opentype/opentype#71; the detection itself is covered by that library's own
tests.
Measured
go test -count=1 ./...— 11 packages, 0 failures, uncached, at a 1-minute loadof 6.28 (under the threshold
cmd/internal/loadguardenforces formeasurements).
go.modgoes togo-opentype/opentype v0.22.0. ⛔modtidyrefused the firstpush because
go gethad leftgo.sumcarrying both versions; tidied andre-tested before pushing.
Refs #716 — this gives its blindness a mechanism and a flag; it does not close it,
because the kern is still the pair answer.
Refs #792 — the shaping path stays its business.
Refs go-opentype/opentype#71, Refs go-opentype/opentype#76.
🤖 Generated with Claude Code