FAILURE MAP
← Case archive

FA-80271 / Typography line breaking / Open access

Single-letter and unit bindings: binding chain · case 01

In "v a k domě" only the first preposition stays bound.

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

ROOT CAUSE

After one binding the group is closed instead of re-checking the newly added word.

VERIFIED REPAIR

Keep extending the group while its last word requires binding.

Unsuccessful approach: Refusing to bind the final word of the paragraph leaves trailing singles unbound.

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.lower() in SINGLE or (number and words[nxt] in UNITS):
                grp.append(words[nxt])
                break
            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 = [[('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['km', 'z', 'sazba', 'k', 'Praze', 's', 'V', 'k', 'text'], 15], ['km z sazba', 'k Praze', 's V k text']), ('partial-repair probe', [['10', 'i', 'a', 'pt', '10', 'domě', 'o', 'a', 'cm', 'a', 'sazba'], 9], ['10 i a pt', '10 domě', 'o a cm', 'a sazba']), ('regression: binding chain', [['text', 'kg', 'o', 'i', 'pt', 'i', 'a', 'o', 'V', 'řádek'], 9], ['text kg', 'o i pt', 'i a o V řádek']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['i', 'V', 'V', 'z', 'a', 'v'], 11], ['i V V z a v']), ('control layout', [['domě', 'k', 'a', 'a', 'pt', 'a', 'V', '10', 'pt'], 16], ['domě k a a pt', 'a V 10 pt'])], [('regression: binding chain', [['z', 'k', '2.5', 'i', 'V', 'o', 'i', 'z', 'z'], 10], ['z k 2.5', 'i V o i z z']), ('regression: binding chain', [['Praze', 'k', 'z', 'kg', 'a', 'i', 'a', 'text', 'cm', 'v'], 11], ['Praze', 'k z kg', 'a i a text', 'cm v']), ('regression: binding chain', [['2.5', '2.5', 'kg', 'z', 'a', 'pt', 'řádek', 'i', 'Praze', 'domě', 'V', 'v'], 14], ['2.5 2.5 kg', 'z a pt řádek', 'i Praze domě', 'V v']), ('regression: binding chain', [['2.5', 'k', 'cm', 's', 'V', 'cm', 's', 'pt', 's', 'Praze'], 14], ['2.5 k cm', 's V cm s pt', 's Praze']), ('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', 'pt', 'pt', 'domě', 'sazba', 'o', '1,5', 'sazba', '10', '1,5'], 7], ['v pt pt', 'domě', 'sazba', 'o 1,5', 'sazba', '10 1,5']), ('control layout', [['kg', 'cm', 'o', 'kg', 'cm', 'domě', 'domě'], 12], ['kg cm o kg', 'cm domě domě'])], [('regression: binding chain', [['pt', 'cm', 'a', '2.5', 'i', 'domě', 'text', 's', 'o', 'o'], 8], ['pt cm', 'a 2.5', 'i domě', 'text', 's o o']), ('regression: binding chain', [['s', 'o', 'V', 'i', 'domě', 's', 'domě', 'pt', 'a', '1,5', 'o'], 9], ['s o V i domě', 's domě pt', 'a 1,5 o']), ('partial-repair probe', [['kg', 'v', 'km', 'V', 'cm', '10', 'text', 'a', 'kg'], 8], ['kg v km', 'V cm 10', 'text', 'a kg']), ('partial-repair probe', [['řádek', '2.5', '10', 'i', 'i', 'km', 'i', 'k'], 8], ['řádek', '2.5 10', 'i i km', 'i k']), ('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', [['k', 'V', 'z', 'km', '1,5', '1,5', 'V', 'o', 's'], 12], ['k V z km 1,5', '1,5 V o s']), ('control layout', [['o', 'km', 'cm', '2.5'], 6], ['o km', 'cm 2.5'])], [('regression: binding chain', [['km', 'V', '10', 'km', '2.5', 'V'], 6], ['km', 'V 10 km', '2.5 V']), ('regression: binding chain', [['pt', 'k', '1,5', 'cm', 'k', 'i', 'a', 'v', 's', '10', 'cm', '10'], 13], ['pt k 1,5 cm', 'k i a v s 10 cm', '10']), ('regression: binding chain', [['Praze', 'i', 'o', 'domě'], 7], ['Praze', 'i o domě']), ('partial-repair probe', [['a', 'text', 'kg', 'o', 'sazba', 'v', 'km', 's', 'text'], 14], ['a text kg', 'o sazba v km', 's text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'Praze', 'kg', 'pt', 'km', 's', 'pt'], 8], ['V Praze', 'kg pt km', 's pt']), ('control layout', [['řádek', 'z', '10', 'i', 'o', '1,5'], 13], ['řádek z 10', 'i o 1,5'])], [('regression: binding chain', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: binding chain', [['text', 'V', 'řádek', 'v', 'sazba', 's', 's', 'a', 'o', '10'], 14], ['text V řádek', 'v sazba', 's s a o 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['o', 'pt', 'domě', 's', 'a', 'text'], 6], ['o pt', 'domě', 's a text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'km', '2.5', 'Praze', '10', 'k'], 9], ['V km 2.5', 'Praze 10', 'k']), ('control layout', [['km', 'o', 'cm', 'km', 'sazba', 'k'], 7], ['km o cm', 'km', 'sazba k'])]]
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
chained singles['text v a', 'k domě']['text', 'v a k domě']Failed
regression: binding chain['km z sazba', 'k Praze s V', 'k text']['km z sazba', 'k Praze', 's V k text']Failed
partial-repair probe['10 i a pt', '10 domě', 'o a cm', 'a sazba']['10 i a pt', '10 domě', 'o a cm', 'a sazba']Passed
regression: binding chain['text kg', 'o i pt', 'i a o V', 'řádek']['text kg', 'o i pt', 'i a o V řádek']Failed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['i V V z a v']['i V V z a v']Passed
control layout['domě k a a pt', 'a V 10 pt']['domě k a a pt', 'a V 10 pt']Passed

SHA-256 / cf7439fdb288332537d55078616cfd2a796825522e150d144ac8cd386112dc1f

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) - 1:
                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 = [[('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['km', 'z', 'sazba', 'k', 'Praze', 's', 'V', 'k', 'text'], 15], ['km z sazba', 'k Praze', 's V k text']), ('partial-repair probe', [['10', 'i', 'a', 'pt', '10', 'domě', 'o', 'a', 'cm', 'a', 'sazba'], 9], ['10 i a pt', '10 domě', 'o a cm', 'a sazba']), ('regression: binding chain', [['text', 'kg', 'o', 'i', 'pt', 'i', 'a', 'o', 'V', 'řádek'], 9], ['text kg', 'o i pt', 'i a o V řádek']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['i', 'V', 'V', 'z', 'a', 'v'], 11], ['i V V z a v']), ('control layout', [['domě', 'k', 'a', 'a', 'pt', 'a', 'V', '10', 'pt'], 16], ['domě k a a pt', 'a V 10 pt'])], [('regression: binding chain', [['z', 'k', '2.5', 'i', 'V', 'o', 'i', 'z', 'z'], 10], ['z k 2.5', 'i V o i z z']), ('regression: binding chain', [['Praze', 'k', 'z', 'kg', 'a', 'i', 'a', 'text', 'cm', 'v'], 11], ['Praze', 'k z kg', 'a i a text', 'cm v']), ('regression: binding chain', [['2.5', '2.5', 'kg', 'z', 'a', 'pt', 'řádek', 'i', 'Praze', 'domě', 'V', 'v'], 14], ['2.5 2.5 kg', 'z a pt řádek', 'i Praze domě', 'V v']), ('regression: binding chain', [['2.5', 'k', 'cm', 's', 'V', 'cm', 's', 'pt', 's', 'Praze'], 14], ['2.5 k cm', 's V cm s pt', 's Praze']), ('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', 'pt', 'pt', 'domě', 'sazba', 'o', '1,5', 'sazba', '10', '1,5'], 7], ['v pt pt', 'domě', 'sazba', 'o 1,5', 'sazba', '10 1,5']), ('control layout', [['kg', 'cm', 'o', 'kg', 'cm', 'domě', 'domě'], 12], ['kg cm o kg', 'cm domě domě'])], [('regression: binding chain', [['pt', 'cm', 'a', '2.5', 'i', 'domě', 'text', 's', 'o', 'o'], 8], ['pt cm', 'a 2.5', 'i domě', 'text', 's o o']), ('regression: binding chain', [['s', 'o', 'V', 'i', 'domě', 's', 'domě', 'pt', 'a', '1,5', 'o'], 9], ['s o V i domě', 's domě pt', 'a 1,5 o']), ('partial-repair probe', [['kg', 'v', 'km', 'V', 'cm', '10', 'text', 'a', 'kg'], 8], ['kg v km', 'V cm 10', 'text', 'a kg']), ('partial-repair probe', [['řádek', '2.5', '10', 'i', 'i', 'km', 'i', 'k'], 8], ['řádek', '2.5 10', 'i i km', 'i k']), ('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', [['k', 'V', 'z', 'km', '1,5', '1,5', 'V', 'o', 's'], 12], ['k V z km 1,5', '1,5 V o s']), ('control layout', [['o', 'km', 'cm', '2.5'], 6], ['o km', 'cm 2.5'])], [('regression: binding chain', [['km', 'V', '10', 'km', '2.5', 'V'], 6], ['km', 'V 10 km', '2.5 V']), ('regression: binding chain', [['pt', 'k', '1,5', 'cm', 'k', 'i', 'a', 'v', 's', '10', 'cm', '10'], 13], ['pt k 1,5 cm', 'k i a v s 10 cm', '10']), ('regression: binding chain', [['Praze', 'i', 'o', 'domě'], 7], ['Praze', 'i o domě']), ('partial-repair probe', [['a', 'text', 'kg', 'o', 'sazba', 'v', 'km', 's', 'text'], 14], ['a text kg', 'o sazba v km', 's text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'Praze', 'kg', 'pt', 'km', 's', 'pt'], 8], ['V Praze', 'kg pt km', 's pt']), ('control layout', [['řádek', 'z', '10', 'i', 'o', '1,5'], 13], ['řádek z 10', 'i o 1,5'])], [('regression: binding chain', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: binding chain', [['text', 'V', 'řádek', 'v', 'sazba', 's', 's', 'a', 'o', '10'], 14], ['text V řádek', 'v sazba', 's s a o 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['o', 'pt', 'domě', 's', 'a', 'text'], 6], ['o pt', 'domě', 's a text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'km', '2.5', 'Praze', '10', 'k'], 9], ['V km 2.5', 'Praze 10', 'k']), ('control layout', [['km', 'o', 'cm', 'km', 'sazba', 'k'], 7], ['km o cm', 'km', 'sazba k'])]]
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
chained singles['text v a k', 'domě']['text', 'v a k domě']Failed
regression: binding chain['km z sazba', 'k Praze s V k', 'text']['km z sazba', 'k Praze', 's V k text']Failed
partial-repair probe['10 i a pt', '10 domě', 'o a cm a', 'sazba']['10 i a pt', '10 domě', 'o a cm', 'a sazba']Failed
regression: binding chain['text kg', 'o i pt', 'i a o V', 'řádek']['text kg', 'o i pt', 'i a o V řádek']Failed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['i V V z a v']['i V V z a v']Passed
control layout['domě k a a pt', 'a V 10 pt']['domě k a a pt', 'a V 10 pt']Passed

SHA-256 / 05725c68696b19f1e4b42a0ca24adabc068a75222f9d8fc68251bc26a2a01c68

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 = [[('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['km', 'z', 'sazba', 'k', 'Praze', 's', 'V', 'k', 'text'], 15], ['km z sazba', 'k Praze', 's V k text']), ('partial-repair probe', [['10', 'i', 'a', 'pt', '10', 'domě', 'o', 'a', 'cm', 'a', 'sazba'], 9], ['10 i a pt', '10 domě', 'o a cm', 'a sazba']), ('regression: binding chain', [['text', 'kg', 'o', 'i', 'pt', 'i', 'a', 'o', 'V', 'řádek'], 9], ['text kg', 'o i pt', 'i a o V řádek']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('control layout', [['i', 'V', 'V', 'z', 'a', 'v'], 11], ['i V V z a v']), ('control layout', [['domě', 'k', 'a', 'a', 'pt', 'a', 'V', '10', 'pt'], 16], ['domě k a a pt', 'a V 10 pt'])], [('regression: binding chain', [['z', 'k', '2.5', 'i', 'V', 'o', 'i', 'z', 'z'], 10], ['z k 2.5', 'i V o i z z']), ('regression: binding chain', [['Praze', 'k', 'z', 'kg', 'a', 'i', 'a', 'text', 'cm', 'v'], 11], ['Praze', 'k z kg', 'a i a text', 'cm v']), ('regression: binding chain', [['2.5', '2.5', 'kg', 'z', 'a', 'pt', 'řádek', 'i', 'Praze', 'domě', 'V', 'v'], 14], ['2.5 2.5 kg', 'z a pt řádek', 'i Praze domě', 'V v']), ('regression: binding chain', [['2.5', 'k', 'cm', 's', 'V', 'cm', 's', 'pt', 's', 'Praze'], 14], ['2.5 k cm', 's V cm s pt', 's Praze']), ('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', 'pt', 'pt', 'domě', 'sazba', 'o', '1,5', 'sazba', '10', '1,5'], 7], ['v pt pt', 'domě', 'sazba', 'o 1,5', 'sazba', '10 1,5']), ('control layout', [['kg', 'cm', 'o', 'kg', 'cm', 'domě', 'domě'], 12], ['kg cm o kg', 'cm domě domě'])], [('regression: binding chain', [['pt', 'cm', 'a', '2.5', 'i', 'domě', 'text', 's', 'o', 'o'], 8], ['pt cm', 'a 2.5', 'i domě', 'text', 's o o']), ('regression: binding chain', [['s', 'o', 'V', 'i', 'domě', 's', 'domě', 'pt', 'a', '1,5', 'o'], 9], ['s o V i domě', 's domě pt', 'a 1,5 o']), ('partial-repair probe', [['kg', 'v', 'km', 'V', 'cm', '10', 'text', 'a', 'kg'], 8], ['kg v km', 'V cm 10', 'text', 'a kg']), ('partial-repair probe', [['řádek', '2.5', '10', 'i', 'i', 'km', 'i', 'k'], 8], ['řádek', '2.5 10', 'i i km', 'i k']), ('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', [['k', 'V', 'z', 'km', '1,5', '1,5', 'V', 'o', 's'], 12], ['k V z km 1,5', '1,5 V o s']), ('control layout', [['o', 'km', 'cm', '2.5'], 6], ['o km', 'cm 2.5'])], [('regression: binding chain', [['km', 'V', '10', 'km', '2.5', 'V'], 6], ['km', 'V 10 km', '2.5 V']), ('regression: binding chain', [['pt', 'k', '1,5', 'cm', 'k', 'i', 'a', 'v', 's', '10', 'cm', '10'], 13], ['pt k 1,5 cm', 'k i a v s 10 cm', '10']), ('regression: binding chain', [['Praze', 'i', 'o', 'domě'], 7], ['Praze', 'i o domě']), ('partial-repair probe', [['a', 'text', 'kg', 'o', 'sazba', 'v', 'km', 's', 'text'], 14], ['a text kg', 'o sazba v km', 's text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'Praze', 'kg', 'pt', 'km', 's', 'pt'], 8], ['V Praze', 'kg pt km', 's pt']), ('control layout', [['řádek', 'z', '10', 'i', 'o', '1,5'], 13], ['řádek z 10', 'i o 1,5'])], [('regression: binding chain', [['i', 'z', 'Praze', 'z', 'řádek', '10'], 8], ['i z Praze', 'z řádek', '10']), ('regression: binding chain', [['text', 'V', 'řádek', 'v', 'sazba', 's', 's', 'a', 'o', '10'], 14], ['text V řádek', 'v sazba', 's s a o 10']), ('chained singles', [['text', 'v', 'a', 'k', 'domě'], 10], ['text', 'v a k domě']), ('regression: binding chain', [['o', 'pt', 'domě', 's', 'a', 'text'], 6], ['o pt', 'domě', 's a text']), ('sentence-initial V binds', [['V', 'Praze', 'text', 'sazba'], 8], ['V Praze', 'text', 'sazba']), ('decimal comma with unit', [['sazba', '1,5', 'cm', 'text'], 9], ['sazba', '1,5 cm', 'text']), ('control layout', [['V', 'km', '2.5', 'Praze', '10', 'k'], 9], ['V km 2.5', 'Praze 10', 'k']), ('control layout', [['km', 'o', 'cm', 'km', 'sazba', 'k'], 7], ['km o cm', 'km', 'sazba k'])]]
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
chained singles['text', 'v a k domě']['text', 'v a k domě']Passed
regression: binding chain['km z sazba', 'k Praze', 's V k text']['km z sazba', 'k Praze', 's V k text']Passed
partial-repair probe['10 i a pt', '10 domě', 'o a cm', 'a sazba']['10 i a pt', '10 domě', 'o a cm', 'a sazba']Passed
regression: binding chain['text kg', 'o i pt', 'i a o V řádek']['text kg', 'o i pt', 'i a o V řádek']Passed
decimal comma with unit['sazba', '1,5 cm', 'text']['sazba', '1,5 cm', 'text']Passed
sentence-initial V binds['V Praze', 'text', 'sazba']['V Praze', 'text', 'sazba']Passed
control layout['i V V z a v']['i V V z a v']Passed
control layout['domě k a a pt', 'a V 10 pt']['domě k a a pt', 'a V 10 pt']Passed

SHA-256 / c023a8ad705c824ac573f83c0d5eb8bad811f818722e0556c3cd83918bef04f7

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

Case digest / 9f475968932c3ca0040666214c46527f3a61bebf85e48347e0c6b657cb3effd1