FAILURE MAP
← Case archive

FA-80166 / Typography line breaking / Open access

Kerning and ligature line measure: kern pair case sensitivity · case 01

Lowercase pairs receive the tighter uppercase kerning value.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Kern lookups uppercase the pair before searching the table.

VERIFIED REPAIR

Look up kern pairs exactly as they appear.

Unsuccessful approach: Falling back to the lowercase pair kerns mixed-case pairs that have no entry.

Case contract

Input [words, width]. Glyph widths: i,l,j,.,, 4; t,f 6; m 15; w 14; M 16; W 18; other lowercase 10; other uppercase 13; space 5. Within a word, fi/fl/ff form ligatures (11/11/12) with no kerning into or out of them; case-sensitive kern pairs apply between adjacent glyphs; "|" is a non-joiner (invisible, blocks ligatures and kerning). No kerning across spaces. Greedy fill. Return [[text, width]].

Why this case matters

Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
    LIG = {'fi': 11, 'fl': 11, 'ff': 12}
    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
    SPACE = 5
    def glyph(c):
        return W.get(c, 13 if c.isupper() else 10)
    def measure(w):
        total, prev, i = 0, None, 0
        while i < len(w):
            if w[i] == '|':
                prev = None
                i += 1
                continue
            pair = w[i:i + 2]
            if pair in LIG:
                total += LIG[pair]
                prev = None
                i += 2
                continue
            g = w[i]
            total += glyph(g)
            if prev is not None:
                total += KERN.get((prev + g).upper(), 0)
            prev = g
            i += 1
        return total
    def line_width(ws):
        return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
    lines, cur = [], []
    for w in words:
        cand = cur + [w]
        if not cur or line_width(cand) <= width:
            cur = cand
        else:
            lines.append(cur)
            cur = [w]
    if cur:
        lines.append(cur)
    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: kern pair case sensitivity', [['y.', 'Yo', 'fi', 'wolf|like'], 47], [['y. Yo', 38], ['fi', 11], ['wolflike', 62]]), ('regression: kern pair case sensitivity', [['Av', 'fly.', 'LA|VALLE', 'y.', 'office', 'raffle', 'VIA'], 77], [['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]), ('regression: kern pair case sensitivity', [['Av', 'flow'], 132], [['Av flow', 63]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('control layout', [['VIA', 'LA|VALLE', 'Wavy', 'wolf|like'], 72], [['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]), ('control layout', [['AVAIL', 'shelf|life', 'AT'], 140], [['AVAIL shelflife', 128], ['AT', 26]])], [('regression: kern pair case sensitivity', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: kern pair case sensitivity', [['office', 'wolf|like', 'flow', 'VIA', 'LT', 'Ta'], 45], [['office', 46], ['wolflike', 62], ['flow', 35], ['VIA', 39], ['LT', 23], ['Ta', 21]]), ('regression: kern pair case sensitivity', [['our', 'Av', 'fly.', 'av'], 83], [['our Av', 58], ['fly. av', 47]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['AT', 'flow'], 114], [['AT flow', 66]]), ('control layout', [['shelf|life', 'our'], 55], [['shelflife', 64], ['our', 30]])], [('regression: kern pair case sensitivity', [['fly.', 'Yo'], 43], [['fly.', 23], ['Yo', 21]]), ('regression: kern pair case sensitivity', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('regression: kern pair case sensitivity', [['flow', 'Ta', 'Ta', 'Av', 'LA|VALLE'], 115], [['flow Ta Ta Av', 115], ['LAVALLE', 88]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]])], [('regression: kern pair case sensitivity', [['Tofu', 'Av'], 95], [['Tofu Av', 65]]), ('regression: kern pair case sensitivity', [['Wavy', 'VIA', 'y.', 'wolf|like', 'fi'], 95], [['Wavy VIA', 89], ['y. wolflike fi', 95]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('regression: kern pair case sensitivity', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['staff.', 'office'], 111], [['staff. office', 93]]), ('control layout', [['AVAIL', 'raffle', 'raffle', 'LA', 'office', 'VIA', 'AT'], 79], [['AVAIL', 59], ['raffle', 46], ['raffle LA', 77], ['office', 46], ['VIA AT', 70]])], [('regression: kern pair case sensitivity', [['Vat', 'office', 'flow', 'LA', 'staff.', 'AT'], 44], [['Vat', 27], ['office', 46], ['flow', 35], ['LA', 26], ['staff.', 42], ['AT', 26]]), ('regression: kern pair case sensitivity', [['LT', 'staff.', 'LA|VALLE', 'LA|VALLE', 'Vat', 'office'], 95], [['LT staff.', 70], ['LAVALLE', 88], ['LAVALLE', 88], ['Vat office', 78]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('regression: kern pair case sensitivity', [['Av', 'LA|VALLE', 'Ta', 'VIA'], 53], [['Av', 23], ['LAVALLE', 88], ['Ta', 21], ['VIA', 39]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['staff.', 'office'], 118], [['staff. office', 93]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
cross-word pair must not kern[['LA Vat', 57]][['LA Vat', 58]]Failed
regression: kern pair case sensitivity[['y. Yo', 42], ['fi', 11], ['wolflike', 62]][['y. Yo', 38], ['fi', 11], ['wolflike', 62]]Failed
regression: kern pair case sensitivity[['Av fly.', 50], ['LAVALLE', 88], ['y. office', 65], ['raffle', 46], ['VIA', 39]][['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]Failed
regression: kern pair case sensitivity[['Av flow', 60]][['Av flow', 63]]Failed
non-joiner blocks ligature[['shelflife', 64]][['shelflife', 64]]Passed
case-sensitive pair[['Av av', 42]][['Av av', 47]]Failed
control layout[['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]][['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]Passed
control layout[['AVAIL shelflife', 128], ['AT', 26]][['AVAIL shelflife', 128], ['AT', 26]]Passed

SHA-256 / 12c6c0aac30a5b608ba9b615ee06592e5db376a57c99ffb961f0daef34e8e3e9

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
    LIG = {'fi': 11, 'fl': 11, 'ff': 12}
    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
    SPACE = 5
    def glyph(c):
        return W.get(c, 13 if c.isupper() else 10)
    def measure(w):
        total, prev, i = 0, None, 0
        while i < len(w):
            if w[i] == '|':
                prev = None
                i += 1
                continue
            pair = w[i:i + 2]
            if pair in LIG:
                total += LIG[pair]
                prev = None
                i += 2
                continue
            g = w[i]
            total += glyph(g)
            if prev is not None:
                total += KERN.get(prev + g, 0) or KERN.get((prev + g).lower(), 0)
            prev = g
            i += 1
        return total
    def line_width(ws):
        return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
    lines, cur = [], []
    for w in words:
        cand = cur + [w]
        if not cur or line_width(cand) <= width:
            cur = cand
        else:
            lines.append(cur)
            cur = [w]
    if cur:
        lines.append(cur)
    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: kern pair case sensitivity', [['y.', 'Yo', 'fi', 'wolf|like'], 47], [['y. Yo', 38], ['fi', 11], ['wolflike', 62]]), ('regression: kern pair case sensitivity', [['Av', 'fly.', 'LA|VALLE', 'y.', 'office', 'raffle', 'VIA'], 77], [['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]), ('regression: kern pair case sensitivity', [['Av', 'flow'], 132], [['Av flow', 63]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('control layout', [['VIA', 'LA|VALLE', 'Wavy', 'wolf|like'], 72], [['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]), ('control layout', [['AVAIL', 'shelf|life', 'AT'], 140], [['AVAIL shelflife', 128], ['AT', 26]])], [('regression: kern pair case sensitivity', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: kern pair case sensitivity', [['office', 'wolf|like', 'flow', 'VIA', 'LT', 'Ta'], 45], [['office', 46], ['wolflike', 62], ['flow', 35], ['VIA', 39], ['LT', 23], ['Ta', 21]]), ('regression: kern pair case sensitivity', [['our', 'Av', 'fly.', 'av'], 83], [['our Av', 58], ['fly. av', 47]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['AT', 'flow'], 114], [['AT flow', 66]]), ('control layout', [['shelf|life', 'our'], 55], [['shelflife', 64], ['our', 30]])], [('regression: kern pair case sensitivity', [['fly.', 'Yo'], 43], [['fly.', 23], ['Yo', 21]]), ('regression: kern pair case sensitivity', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('regression: kern pair case sensitivity', [['flow', 'Ta', 'Ta', 'Av', 'LA|VALLE'], 115], [['flow Ta Ta Av', 115], ['LAVALLE', 88]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]])], [('regression: kern pair case sensitivity', [['Tofu', 'Av'], 95], [['Tofu Av', 65]]), ('regression: kern pair case sensitivity', [['Wavy', 'VIA', 'y.', 'wolf|like', 'fi'], 95], [['Wavy VIA', 89], ['y. wolflike fi', 95]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('regression: kern pair case sensitivity', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['staff.', 'office'], 111], [['staff. office', 93]]), ('control layout', [['AVAIL', 'raffle', 'raffle', 'LA', 'office', 'VIA', 'AT'], 79], [['AVAIL', 59], ['raffle', 46], ['raffle LA', 77], ['office', 46], ['VIA AT', 70]])], [('regression: kern pair case sensitivity', [['Vat', 'office', 'flow', 'LA', 'staff.', 'AT'], 44], [['Vat', 27], ['office', 46], ['flow', 35], ['LA', 26], ['staff.', 42], ['AT', 26]]), ('regression: kern pair case sensitivity', [['LT', 'staff.', 'LA|VALLE', 'LA|VALLE', 'Vat', 'office'], 95], [['LT staff.', 70], ['LAVALLE', 88], ['LAVALLE', 88], ['Vat office', 78]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('regression: kern pair case sensitivity', [['Av', 'LA|VALLE', 'Ta', 'VIA'], 53], [['Av', 23], ['LAVALLE', 88], ['Ta', 21], ['VIA', 39]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['staff.', 'office'], 118], [['staff. office', 93]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
cross-word pair must not kern[['LA Vat', 58]][['LA Vat', 58]]Passed
regression: kern pair case sensitivity[['y. Yo', 38], ['fi', 11], ['wolflike', 62]][['y. Yo', 38], ['fi', 11], ['wolflike', 62]]Passed
regression: kern pair case sensitivity[['Av fly.', 50], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]][['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]Failed
regression: kern pair case sensitivity[['Av flow', 62]][['Av flow', 63]]Failed
non-joiner blocks ligature[['shelflife', 64]][['shelflife', 64]]Passed
case-sensitive pair[['Av av', 46]][['Av av', 47]]Failed
control layout[['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]][['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]Passed
control layout[['AVAIL shelflife', 128], ['AT', 26]][['AVAIL shelflife', 128], ['AT', 26]]Passed

SHA-256 / 4e7433b7c47152208e87300d1794e7a71c2a92a34c9982333e7891322e46cfa6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    words, width = x
    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}
    LIG = {'fi': 11, 'fl': 11, 'ff': 12}
    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}
    SPACE = 5
    def glyph(c):
        return W.get(c, 13 if c.isupper() else 10)
    def measure(w):
        total, prev, i = 0, None, 0
        while i < len(w):
            if w[i] == '|':
                prev = None
                i += 1
                continue
            pair = w[i:i + 2]
            if pair in LIG:
                total += LIG[pair]
                prev = None
                i += 2
                continue
            g = w[i]
            total += glyph(g)
            if prev is not None:
                total += KERN.get(prev + g, 0)
            prev = g
            i += 1
        return total
    def line_width(ws):
        return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)
    lines, cur = [], []
    for w in words:
        cand = cur + [w]
        if not cur or line_width(cand) <= width:
            cur = cand
        else:
            lines.append(cur)
            cur = [w]
    if cur:
        lines.append(cur)
    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: kern pair case sensitivity', [['y.', 'Yo', 'fi', 'wolf|like'], 47], [['y. Yo', 38], ['fi', 11], ['wolflike', 62]]), ('regression: kern pair case sensitivity', [['Av', 'fly.', 'LA|VALLE', 'y.', 'office', 'raffle', 'VIA'], 77], [['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]), ('regression: kern pair case sensitivity', [['Av', 'flow'], 132], [['Av flow', 63]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('control layout', [['VIA', 'LA|VALLE', 'Wavy', 'wolf|like'], 72], [['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]), ('control layout', [['AVAIL', 'shelf|life', 'AT'], 140], [['AVAIL shelflife', 128], ['AT', 26]])], [('regression: kern pair case sensitivity', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: kern pair case sensitivity', [['office', 'wolf|like', 'flow', 'VIA', 'LT', 'Ta'], 45], [['office', 46], ['wolflike', 62], ['flow', 35], ['VIA', 39], ['LT', 23], ['Ta', 21]]), ('regression: kern pair case sensitivity', [['our', 'Av', 'fly.', 'av'], 83], [['our Av', 58], ['fly. av', 47]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['AT', 'flow'], 114], [['AT flow', 66]]), ('control layout', [['shelf|life', 'our'], 55], [['shelflife', 64], ['our', 30]])], [('regression: kern pair case sensitivity', [['fly.', 'Yo'], 43], [['fly.', 23], ['Yo', 21]]), ('regression: kern pair case sensitivity', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('regression: kern pair case sensitivity', [['flow', 'Ta', 'Ta', 'Av', 'LA|VALLE'], 115], [['flow Ta Ta Av', 115], ['LAVALLE', 88]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['LA|VALLE', 'office', 'raffle', 'LA', 'staff.'], 129], [['LAVALLE', 88], ['office raffle LA', 128], ['staff.', 42]])], [('regression: kern pair case sensitivity', [['Tofu', 'Av'], 95], [['Tofu Av', 65]]), ('regression: kern pair case sensitivity', [['Wavy', 'VIA', 'y.', 'wolf|like', 'fi'], 95], [['Wavy VIA', 89], ['y. wolflike fi', 95]]), ('regression: kern pair case sensitivity', [['Av', 'Tofu'], 41], [['Av', 23], ['Tofu', 37]]), ('regression: kern pair case sensitivity', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('control layout', [['staff.', 'office'], 111], [['staff. office', 93]]), ('control layout', [['AVAIL', 'raffle', 'raffle', 'LA', 'office', 'VIA', 'AT'], 79], [['AVAIL', 59], ['raffle', 46], ['raffle LA', 77], ['office', 46], ['VIA AT', 70]])], [('regression: kern pair case sensitivity', [['Vat', 'office', 'flow', 'LA', 'staff.', 'AT'], 44], [['Vat', 27], ['office', 46], ['flow', 35], ['LA', 26], ['staff.', 42], ['AT', 26]]), ('regression: kern pair case sensitivity', [['LT', 'staff.', 'LA|VALLE', 'LA|VALLE', 'Vat', 'office'], 95], [['LT staff.', 70], ['LAVALLE', 88], ['LAVALLE', 88], ['Vat office', 78]]), ('regression: kern pair case sensitivity', [['LA|VALLE', 'av', 'Av', 'AT'], 122], [['LAVALLE av', 112], ['Av AT', 54]]), ('regression: kern pair case sensitivity', [['Av', 'LA|VALLE', 'Ta', 'VIA'], 53], [['Av', 23], ['LAVALLE', 88], ['Ta', 21], ['VIA', 39]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('control layout', [['office', 'VIA'], 112], [['office VIA', 90]]), ('control layout', [['staff.', 'office'], 118], [['staff. office', 93]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
cross-word pair must not kern[['LA Vat', 58]][['LA Vat', 58]]Passed
regression: kern pair case sensitivity[['y. Yo', 38], ['fi', 11], ['wolflike', 62]][['y. Yo', 38], ['fi', 11], ['wolflike', 62]]Passed
regression: kern pair case sensitivity[['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]][['Av fly.', 51], ['LAVALLE', 88], ['y. office', 63], ['raffle', 46], ['VIA', 39]]Passed
regression: kern pair case sensitivity[['Av flow', 63]][['Av flow', 63]]Passed
non-joiner blocks ligature[['shelflife', 64]][['shelflife', 64]]Passed
case-sensitive pair[['Av av', 47]][['Av av', 47]]Passed
control layout[['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]][['VIA', 39], ['LAVALLE', 88], ['Wavy', 45], ['wolflike', 62]]Passed
control layout[['AVAIL shelflife', 128], ['AT', 26]][['AVAIL shelflife', 128], ['AT', 26]]Passed

SHA-256 / 2b50db8a106812322b8f40f721fb40600252a5cf9ad1f3d9401584105efd65db

Verification & scope

A deterministic toy typesetting model with integer widths and a stipulated rule set; it does not claim conformance to any engine. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:51.509376+00:00.

Case digest / a3240a82118c1626c0c16e8bf32de6ede3dd7ed342ac72d0fd395f5dd211ca07