FAILURE MAP
← Case archive

FA-80266 / Typography line breaking / Open access

Single-letter and unit bindings: single-letter case folding · case 01

Capitalised single-letter words at sentence start dangle at line ends.

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

ROOT CAUSE

The single-letter test is case-sensitive.

VERIFIED REPAIR

Compare the lowercased word with the single-letter set.

Unsuccessful approach: Uppercasing before lookup misses every lowercase preposition.

Case contract

Input [words, width]. A single-letter preposition/conjunction (a i o u v z k s w, any case) is bound to the following word, chaining; a number (digits with optional . or , decimal) is bound to a following unit (kg km cm mm % pt px). Bound groups are unbreakable; greedy fill of groups with unit spaces; an overwide group is set alone. Return lines.

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
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.replace('.', '').replace(',', '').isdigit()
            if last in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: single-letter case folding', [['V', 'V', 'text', 'Praze', 'k', 'k', 'kg', '2.5', 'V', 'pt', 's', 'Praze'], 14], ['V V text Praze', 'k k kg 2.5', 'V pt s Praze']), ('regression: single-letter case folding', [['10', 'i', 's', 'řádek', 'o', 'V', 'Praze', 'kg', 'i', 'domě'], 16], ['10 i s řádek', 'o V Praze kg', 'i domě']), ('partial-repair probe', [['k', 'k', 'km', 'pt', 'o', 's', 'z', '10', 'řádek', 'i', 'z', 'km'], 11], ['k k km pt', 'o s z 10', 'řádek', 'i z km']), ('partial-repair probe', [['z', '2.5', 'i', 'v', 'o', 'sazba', 'text', 'kg', 'text', 'V', 'domě'], 16], ['z 2.5', 'i v o sazba text', 'kg text V domě']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['k', 'řádek', 'km', 'k'], 11], ['k řádek km', 'k']), ('control layout', [['s', 'i', 'km', 'k', 'pt', 'km', 'kg', 'o', 'kg', 'řádek', 'o'], 6], ['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o'])], [('regression: single-letter case folding', [['domě', 'V', 's', 'Praze', 'k'], 6], ['domě', 'V s Praze', 'k']), ('regression: single-letter case folding', [['o', 'V', 'V', 'o', 'o', 'o', '2.5', 'i', 'kg', 'i'], 9], ['o V V o o o 2.5', 'i kg i']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['z', 's', 'řádek', 'z', 'z', 'pt'], 13], ['z s řádek', 'z z pt']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 'V', 'o', 's', 'Praze', 'k'], 14], ['v V o s Praze', 'k']), ('control layout', [['km', '2.5', 'km', 'sazba', 'text', 's'], 11], ['km 2.5 km', 'sazba text', 's'])], [('regression: single-letter case folding', [['a', 'řádek', 'text', 'V', 'i', 'V', 'i', 'i', 'o', 'sazba', 'km', 'Praze'], 8], ['a řádek', 'text', 'V i V i i o sazba', 'km Praze']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['o', 'km', 'pt', '10', 'kg', 'Praze', 'text', 'k', 'sazba'], 7], ['o km pt', '10 kg', 'Praze', 'text', 'k sazba']), ('partial-repair probe', [['km', '2.5', 'pt', 'i', 'i', 'pt', 'sazba', 'řádek', 'o', 'domě', '1,5', 'cm'], 13], ['km 2.5 pt', 'i i pt sazba', 'řádek o domě', '1,5 cm']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['s', 'řádek', 'domě', 'cm', 'text', 'z', 'domě', 'i'], 16], ['s řádek domě cm', 'text z domě i']), ('control layout', [['2.5', 'řádek', 'pt', 'text', 'text', 'Praze', '1,5', 'text'], 15], ['2.5 řádek pt', 'text text Praze', '1,5 text'])], [('regression: single-letter case folding', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('regression: single-letter case folding', [['Praze', 'k', '10', '1,5', 'sazba', 'a', 'text', 'V', '1,5', '10', 'kg'], 8], ['Praze', 'k 10 1,5', 'sazba', 'a text', 'V 1,5', '10 kg']), ('partial-repair probe', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: single-letter case folding', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['cm', 'k', 'V', 'z', 'řádek'], 14], ['cm k V z řádek']), ('control layout', [['sazba', 'domě', 'z', 'text', 'Praze', 's'], 10], ['sazba domě', 'z text', 'Praze s'])], [('regression: single-letter case folding', [['sazba', 'Praze', 'V', '1,5', 'k'], 15], ['sazba Praze', 'V 1,5 k']), ('regression: single-letter case folding', [['cm', '10', 's', 'k', 'V', 'o'], 6], ['cm 10', 's k V o']), ('regression: single-letter case folding', [['z', 'k', '10', 'z', '2.5', '1,5', 'V', '1,5', 'i', '10', 'sazba', 'kg'], 6], ['z k 10', 'z 2.5', '1,5', 'V 1,5', 'i 10', 'sazba', 'kg']), ('regression: single-letter case folding', [['a', 'z', '2.5', 'v', 'text', 'V', 'kg', 'domě', 'v'], 16], ['a z 2.5 v text', 'V kg domě v']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['řádek', 'Praze', '1,5', 'i', 'řádek', 'domě'], 11], ['řádek Praze', '1,5 i řádek', 'domě']), ('control layout', [['pt', 'v', 'text', 'z', '2.5'], 10], ['pt v text', 'z 2.5'])]]
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
regression: single-letter case folding['V V text Praze', 'k k kg 2.5 V', 'pt s Praze']['V V text Praze', 'k k kg 2.5', 'V pt s Praze']Failed
regression: single-letter case folding['10 i s řádek o V', 'Praze kg i domě']['10 i s řádek', 'o V Praze kg', 'i domě']Failed
partial-repair probe['k k km pt', 'o s z 10', 'řádek', 'i z km']['k k km pt', 'o s z 10', 'řádek', 'i z km']Passed
partial-repair probe['z 2.5', 'i v o sazba text', 'kg text V domě']['z 2.5', 'i v o sazba text', 'kg text V domě']Passed
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
control layout['k řádek km', 'k']['k řádek km', 'k']Passed
control layout['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']Passed

SHA-256 / b3862a8bef07c89975a8eab622f622e1beda26384edd9440fa59634b20127079

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
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.replace('.', '').replace(',', '').isdigit()
            if last.upper() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: single-letter case folding', [['V', 'V', 'text', 'Praze', 'k', 'k', 'kg', '2.5', 'V', 'pt', 's', 'Praze'], 14], ['V V text Praze', 'k k kg 2.5', 'V pt s Praze']), ('regression: single-letter case folding', [['10', 'i', 's', 'řádek', 'o', 'V', 'Praze', 'kg', 'i', 'domě'], 16], ['10 i s řádek', 'o V Praze kg', 'i domě']), ('partial-repair probe', [['k', 'k', 'km', 'pt', 'o', 's', 'z', '10', 'řádek', 'i', 'z', 'km'], 11], ['k k km pt', 'o s z 10', 'řádek', 'i z km']), ('partial-repair probe', [['z', '2.5', 'i', 'v', 'o', 'sazba', 'text', 'kg', 'text', 'V', 'domě'], 16], ['z 2.5', 'i v o sazba text', 'kg text V domě']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['k', 'řádek', 'km', 'k'], 11], ['k řádek km', 'k']), ('control layout', [['s', 'i', 'km', 'k', 'pt', 'km', 'kg', 'o', 'kg', 'řádek', 'o'], 6], ['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o'])], [('regression: single-letter case folding', [['domě', 'V', 's', 'Praze', 'k'], 6], ['domě', 'V s Praze', 'k']), ('regression: single-letter case folding', [['o', 'V', 'V', 'o', 'o', 'o', '2.5', 'i', 'kg', 'i'], 9], ['o V V o o o 2.5', 'i kg i']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['z', 's', 'řádek', 'z', 'z', 'pt'], 13], ['z s řádek', 'z z pt']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 'V', 'o', 's', 'Praze', 'k'], 14], ['v V o s Praze', 'k']), ('control layout', [['km', '2.5', 'km', 'sazba', 'text', 's'], 11], ['km 2.5 km', 'sazba text', 's'])], [('regression: single-letter case folding', [['a', 'řádek', 'text', 'V', 'i', 'V', 'i', 'i', 'o', 'sazba', 'km', 'Praze'], 8], ['a řádek', 'text', 'V i V i i o sazba', 'km Praze']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['o', 'km', 'pt', '10', 'kg', 'Praze', 'text', 'k', 'sazba'], 7], ['o km pt', '10 kg', 'Praze', 'text', 'k sazba']), ('partial-repair probe', [['km', '2.5', 'pt', 'i', 'i', 'pt', 'sazba', 'řádek', 'o', 'domě', '1,5', 'cm'], 13], ['km 2.5 pt', 'i i pt sazba', 'řádek o domě', '1,5 cm']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['s', 'řádek', 'domě', 'cm', 'text', 'z', 'domě', 'i'], 16], ['s řádek domě cm', 'text z domě i']), ('control layout', [['2.5', 'řádek', 'pt', 'text', 'text', 'Praze', '1,5', 'text'], 15], ['2.5 řádek pt', 'text text Praze', '1,5 text'])], [('regression: single-letter case folding', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('regression: single-letter case folding', [['Praze', 'k', '10', '1,5', 'sazba', 'a', 'text', 'V', '1,5', '10', 'kg'], 8], ['Praze', 'k 10 1,5', 'sazba', 'a text', 'V 1,5', '10 kg']), ('partial-repair probe', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: single-letter case folding', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['cm', 'k', 'V', 'z', 'řádek'], 14], ['cm k V z řádek']), ('control layout', [['sazba', 'domě', 'z', 'text', 'Praze', 's'], 10], ['sazba domě', 'z text', 'Praze s'])], [('regression: single-letter case folding', [['sazba', 'Praze', 'V', '1,5', 'k'], 15], ['sazba Praze', 'V 1,5 k']), ('regression: single-letter case folding', [['cm', '10', 's', 'k', 'V', 'o'], 6], ['cm 10', 's k V o']), ('regression: single-letter case folding', [['z', 'k', '10', 'z', '2.5', '1,5', 'V', '1,5', 'i', '10', 'sazba', 'kg'], 6], ['z k 10', 'z 2.5', '1,5', 'V 1,5', 'i 10', 'sazba', 'kg']), ('regression: single-letter case folding', [['a', 'z', '2.5', 'v', 'text', 'V', 'kg', 'domě', 'v'], 16], ['a z 2.5 v text', 'V kg domě v']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['řádek', 'Praze', '1,5', 'i', 'řádek', 'domě'], 11], ['řádek Praze', '1,5 i řádek', 'domě']), ('control layout', [['pt', 'v', 'text', 'z', '2.5'], 10], ['pt v text', 'z 2.5'])]]
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
regression: single-letter case folding['V V text Praze', 'k k kg 2.5 V', 'pt s Praze']['V V text Praze', 'k k kg 2.5', 'V pt s Praze']Failed
regression: single-letter case folding['10 i s řádek o V', 'Praze kg i domě']['10 i s řádek', 'o V Praze kg', 'i domě']Failed
partial-repair probe['k k km pt o', 's z 10', 'řádek i z', 'km']['k k km pt', 'o s z 10', 'řádek', 'i z km']Failed
partial-repair probe['z 2.5 i v o', 'sazba text kg', 'text V domě']['z 2.5', 'i v o sazba text', 'kg text V domě']Failed
chained singles['text v a k', 'domě']['text', 'v a k domě']Failed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
control layout['k řádek km', 'k']['k řádek km', 'k']Passed
control layout['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']Passed

SHA-256 / 7a860f41eadd84b6ced80832063d0f780e778b72e991314062e8306820bcee63

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
    SINGLE = {'a', 'i', 'o', 'u', 'v', 'z', 'k', 's', 'w'}
    UNITS = {'kg', 'km', 'cm', 'mm', '%', 'pt', 'px'}
    groups = []
    k = 0
    while k < len(words):
        grp = [words[k]]
        while True:
            last = grp[-1]
            nxt = k + len(grp)
            if nxt >= len(words):
                break
            number = last.replace('.', '').replace(',', '').isdigit()
            if last.lower() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
            else:
                break
        groups.append(' '.join(grp))
        k += len(grp)
    lines, cur = [], ''
    for g in groups:
        cand = g if not cur else cur + ' ' + g
        if len(cand) <= width or not cur:
            cur = cand
        else:
            lines.append(cur)
            cur = g
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: single-letter case folding', [['V', 'V', 'text', 'Praze', 'k', 'k', 'kg', '2.5', 'V', 'pt', 's', 'Praze'], 14], ['V V text Praze', 'k k kg 2.5', 'V pt s Praze']), ('regression: single-letter case folding', [['10', 'i', 's', 'řádek', 'o', 'V', 'Praze', 'kg', 'i', 'domě'], 16], ['10 i s řádek', 'o V Praze kg', 'i domě']), ('partial-repair probe', [['k', 'k', 'km', 'pt', 'o', 's', 'z', '10', 'řádek', 'i', 'z', 'km'], 11], ['k k km pt', 'o s z 10', 'řádek', 'i z km']), ('partial-repair probe', [['z', '2.5', 'i', 'v', 'o', 'sazba', 'text', 'kg', 'text', 'V', 'domě'], 16], ['z 2.5', 'i v o sazba text', 'kg text V domě']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['k', 'řádek', 'km', 'k'], 11], ['k řádek km', 'k']), ('control layout', [['s', 'i', 'km', 'k', 'pt', 'km', 'kg', 'o', 'kg', 'řádek', 'o'], 6], ['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o'])], [('regression: single-letter case folding', [['domě', 'V', 's', 'Praze', 'k'], 6], ['domě', 'V s Praze', 'k']), ('regression: single-letter case folding', [['o', 'V', 'V', 'o', 'o', 'o', '2.5', 'i', 'kg', 'i'], 9], ['o V V o o o 2.5', 'i kg i']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['z', 's', 'řádek', 'z', 'z', 'pt'], 13], ['z s řádek', 'z z pt']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['v', 'V', 'o', 's', 'Praze', 'k'], 14], ['v V o s Praze', 'k']), ('control layout', [['km', '2.5', 'km', 'sazba', 'text', 's'], 11], ['km 2.5 km', 'sazba text', 's'])], [('regression: single-letter case folding', [['a', 'řádek', 'text', 'V', 'i', 'V', 'i', 'i', 'o', 'sazba', 'km', 'Praze'], 8], ['a řádek', 'text', 'V i V i i o sazba', 'km Praze']), ('regression: single-letter case folding', [['o', 's', 'text', 'V', '1,5', 'cm', '1,5', 'a', 'text', '1,5', 'a', '1,5'], 13], ['o s text', 'V 1,5 cm 1,5', 'a text 1,5', 'a 1,5']), ('partial-repair probe', [['o', 'km', 'pt', '10', 'kg', 'Praze', 'text', 'k', 'sazba'], 7], ['o km pt', '10 kg', 'Praze', 'text', 'k sazba']), ('partial-repair probe', [['km', '2.5', 'pt', 'i', 'i', 'pt', 'sazba', 'řádek', 'o', 'domě', '1,5', 'cm'], 13], ['km 2.5 pt', 'i i pt sazba', 'řádek o domě', '1,5 cm']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['s', 'řádek', 'domě', 'cm', 'text', 'z', 'domě', 'i'], 16], ['s řádek domě cm', 'text z domě i']), ('control layout', [['2.5', 'řádek', 'pt', 'text', 'text', 'Praze', '1,5', 'text'], 15], ['2.5 řádek pt', 'text text Praze', '1,5 text'])], [('regression: single-letter case folding', [['v', 'Praze', 'Praze', 'v', '1,5', 'cm', 'k', 'V', '10'], 12], ['v Praze', 'Praze', 'v 1,5 cm', 'k V 10']), ('regression: single-letter case folding', [['Praze', 'k', '10', '1,5', 'sazba', 'a', 'text', 'V', '1,5', '10', 'kg'], 8], ['Praze', 'k 10 1,5', 'sazba', 'a text', 'V 1,5', '10 kg']), ('partial-repair probe', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: single-letter case folding', [['1,5', 'km', 'domě', 'sazba', 'kg', 'V', 'v', 'text', 'domě', '1,5'], 11], ['1,5 km domě', 'sazba kg', 'V v text', 'domě 1,5']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('control layout', [['cm', 'k', 'V', 'z', 'řádek'], 14], ['cm k V z řádek']), ('control layout', [['sazba', 'domě', 'z', 'text', 'Praze', 's'], 10], ['sazba domě', 'z text', 'Praze s'])], [('regression: single-letter case folding', [['sazba', 'Praze', 'V', '1,5', 'k'], 15], ['sazba Praze', 'V 1,5 k']), ('regression: single-letter case folding', [['cm', '10', 's', 'k', 'V', 'o'], 6], ['cm 10', 's k V o']), ('regression: single-letter case folding', [['z', 'k', '10', 'z', '2.5', '1,5', 'V', '1,5', 'i', '10', 'sazba', 'kg'], 6], ['z k 10', 'z 2.5', '1,5', 'V 1,5', 'i 10', 'sazba', 'kg']), ('regression: single-letter case folding', [['a', 'z', '2.5', 'v', 'text', 'V', 'kg', 'domě', 'v'], 16], ['a z 2.5 v text', 'V kg domě v']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['řádek', 'Praze', '1,5', 'i', 'řádek', 'domě'], 11], ['řádek Praze', '1,5 i řádek', 'domě']), ('control layout', [['pt', 'v', 'text', 'z', '2.5'], 10], ['pt v text', 'z 2.5'])]]
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
regression: single-letter case folding['V V text Praze', 'k k kg 2.5', 'V pt s Praze']['V V text Praze', 'k k kg 2.5', 'V pt s Praze']Passed
regression: single-letter case folding['10 i s řádek', 'o V Praze kg', 'i domě']['10 i s řádek', 'o V Praze kg', 'i domě']Passed
partial-repair probe['k k km pt', 'o s z 10', 'řádek', 'i z km']['k k km pt', 'o s z 10', 'řádek', 'i z km']Passed
partial-repair probe['z 2.5', 'i v o sazba text', 'kg text V domě']['z 2.5', 'i v o sazba text', 'kg text V domě']Passed
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
control layout['k řádek km', 'k']['k řádek km', 'k']Passed
control layout['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']['s i km', 'k pt', 'km kg', 'o kg', 'řádek', 'o']Passed

SHA-256 / 39a89e5ea4b0832542c66ad2e64e7231295153da6a8120d53bd115dca355b5c4

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:52.240078+00:00.

Case digest / a3830adcf15bb369194d97d8568beb1a99371d85783a4f90ee34ca5c82fe93ed