FAILURE MAP
← Case archive

FA-79966 / Typography line breaking / Open access

Consecutive hyphen limit: latest boundary preference · case 01

Words are split at their first syllable, wasting line space.

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

ROOT CAUSE

Candidate boundaries are scanned from the start of the word instead of from the end.

THE FAILURE

Candidate boundaries are scanned from the start of the word instead of from the end.

Unsuccessful approach: Skipping the last boundary still leaves space unused.

Case contract

Input [words as syllable lists, width, limit]. Greedy fill with 1-unit spaces and characters. A word that does not fit may be split at the latest syllable boundary whose head plus "-" fits, only if fewer than limit immediately preceding lines ended in a hyphen and the word is not the paragraph's last word. A line ended without hyphen resets the streak; a word too long for an empty line is set alone. Return the 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, limit = x
    queue = [list(w) for w in words]
    lines = []
    cur = ''
    streak = 0
    k = 0
    while k < len(queue):
        syl = queue[k]
        token = ''.join(syl)
        need = len(token) if cur == '' else len(cur) + 1 + len(token)
        if need <= width:
            cur = token if cur == '' else cur + ' ' + token
            k += 1
            continue
        split = None
        if streak < limit and k < len(queue) - 1:
            for cut in range(1, len(syl)):
                head = ''.join(syl[:cut]) + '-'
                room = len(head) if cur == '' else len(cur) + len(head) + 1
                if room <= width:
                    split = cut
                    break
        if split is not None:
            head = ''.join(syl[:split]) + '-'
            lines.append(head if cur == '' else cur + ' ' + head)
            queue[k] = syl[split:]
            cur = ''
            streak += 1
        elif cur == '':
            lines.append(token)
            k += 1
            streak = 0
        else:
            lines.append(cur)
            cur, streak = '', 0
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['a'], ['type'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['of']], 14, 3], ['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['to'], ['break', 'ing'], ['break', 'ing'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['to breaking', 'breaking', 'type leading', 'breaking', 'justified']), ('control layout', [[['pa', 'ra', 'graph'], ['kern', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['mar', 'gin'], ['set', 'ting']], 9, 2], ['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']), ('control layout', [[['col', 'umn'], ['set', 'ting'], ['break', 'ing'], ['type'], ['text'], ['of'], ['pa', 'ra', 'graph']], 10, 1], ['column', 'setting', 'breaking', 'type text', 'of', 'paragraph'])], [('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['kern', 'ing'], ['a'], ['col', 'umn'], ['line'], ['of'], ['of'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 14, 1], ['international', 'to kerning a', 'column line of', 'of of interna-', 'tional kerning']), ('regression: latest boundary preference', [[['a'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['to'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['line'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['hy', 'phen', 'a', 'tion']], 14, 3], ['a internation-', 'al of to mar-', 'gin justified', 'paragraph', 'leading line', 'international', 'a hyphenation']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion'], ['type'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['lead', 'ing']], 7, 1], ['justi-', 'fied', 'compo-', 'sition', 'type', 'margin', 'inter-', 'national', 'leading', 'leading', 'hyphen-', 'ation', 'compo-', 'sition', 'para-', 'graph', 'setting', 'leading']), ('partial-repair probe', [[['of'], ['lead', 'ing'], ['set', 'ting'], ['kern', 'ing'], ['col', 'umn'], ['line'], ['type'], ['col', 'umn']], 13, 3], ['of leading', 'setting kern-', 'ing column', 'line type', 'column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['type']], 9, 2], ['column', 'justified', 'margin', 'justified', 'type']), ('control layout', [[['kern', 'ing'], ['line'], ['kern', 'ing'], ['a'], ['to']], 14, 1], ['kerning line', 'kerning a to'])], [('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['type'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['mar', 'gin'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 1], ['interna-', 'tional', 'hyphena-', 'tion', 'kerning', 'interna-', 'tional', 'type type', 'leading', 'breaking', 'margin', 'breaking', 'interna-', 'tional', 'setting']), ('regression: latest boundary preference', [[['a'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['type'], ['to']], 13, 3], ['a composition', 'leading mar-', 'gin hyphena-', 'tion margin', 'type to']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['type'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 8, 3], ['type', 'leading', 'of jus-', 'tified', 'margin']), ('control layout', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph']], 13, 2], ['composition', 'international', 'margin hy-', 'phenation', 'paragraph'])], [('regression: latest boundary preference', [[['to'], ['of'], ['type'], ['line'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['line'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['col', 'umn']], 8, 1], ['to of', 'type', 'line', 'justi-', 'fied', 'para-', 'graph', 'line pa-', 'ragraph', 'justi-', 'fied', 'column']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['type'], ['type'], ['kern', 'ing'], ['lead', 'ing']], 6, 3], ['justi-', 'fied', 'type', 'type', 'kern-', 'ing', 'leading']), ('regression: latest boundary preference', [[['hy', 'phen', 'a', 'tion'], ['a'], ['line'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['lead', 'ing'], ['type']], 11, 2], ['hyphenation', 'a line mar-', 'gin inter-', 'national', 'text compo-', 'sition', 'leading', 'leading', 'type']), ('regression: latest boundary preference', [[['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['col', 'umn']], 7, 3], ['break-', 'ing hy-', 'phena-', 'tion', 'justi-', 'fied', 'para-', 'graph', 'column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['a'], ['col', 'umn'], ['line']], 12, 2], ['column com-', 'position a', 'column line']), ('control layout', [[['line'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['of'], ['line']], 9, 3], ['line jus-', 'tified', 'margin', 'justified', 'breaking', 'of line'])], [('regression: latest boundary preference', [[['kern', 'ing'], ['pa', 'ra', 'graph'], ['a'], ['pa', 'ra', 'graph'], ['of'], ['pa', 'ra', 'graph'], ['text']], 6, 1], ['kern-', 'ing', 'para-', 'graph', 'a pa-', 'ragraph', 'of pa-', 'ragraph', 'text']), ('regression: latest boundary preference', [[['set', 'ting'], ['line'], ['pa', 'ra', 'graph'], ['of'], ['text'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph']], 10, 1], ['setting', 'line para-', 'graph of', 'text para-', 'graph', 'hyphena-', 'tion', 'leading', 'composi-', 'tion', 'paragraph']), ('regression: latest boundary preference', [[['set', 'ting'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['of'], ['type'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['to'], ['kern', 'ing']], 9, 3], ['setting', 'hyphena-', 'tion jus-', 'tified of', 'type col-', 'umn line', 'margin to', 'kerning']), ('partial-repair probe', [[['text'], ['kern', 'ing'], ['line'], ['set', 'ting'], ['break', 'ing'], ['to'], ['mar', 'gin'], ['line'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['type']], 13, 1], ['text kerning', 'line setting', 'breaking to', 'margin line', 'column lead-', 'ing', 'composition', 'type']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['set', 'ting'], ['set', 'ting'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['to'], ['col', 'umn'], ['break', 'ing'], ['jus', 'ti', 'fied'], ['type'], ['set', 'ting']], 11, 3], ['setting', 'setting a', 'justified', 'paragraph', 'to column', 'breaking', 'justified', 'type', 'setting']), ('control layout', [[['to'], ['to'], ['com', 'po', 'si', 'tion'], ['line'], ['type'], ['com', 'po', 'si', 'tion'], ['col', 'umn'], ['break', 'ing']], 11, 2], ['to to com-', 'position', 'line type', 'composition', 'column', 'breaking'])]]
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
ladder of three hyphenated lines['in-', 'ter-', 'national', 'com-', 'po-', 'sition', 'hy-', 'phen-', 'ation', 'text']['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']Failed
regression: latest boundary preference['international', 'paragraph a', 'type a com-', 'position kern-', 'ing of']['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']Failed
regression: latest boundary preference['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hy-', 'phenation a', 'setting']['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']Failed
regression: latest boundary preference['margin', 'jus-', 'tified', 'lead-', 'ing', 'column', 'of in-', 'ter-', 'na-', 'tional', 'hy-', 'phen-', 'ation', 'pa-', 'ra-', 'graph', 'lead-', 'ing', 'set-', 'ting a']['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']Failed
last word never hyphenated['a', 'composition']['a', 'composition']Passed
control layout['to breaking', 'breaking', 'type leading', 'breaking', 'justified']['to breaking', 'breaking', 'type leading', 'breaking', 'justified']Passed
control layout['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']Passed
control layout['column', 'setting', 'breaking', 'type text', 'of', 'paragraph']['column', 'setting', 'breaking', 'type text', 'of', 'paragraph']Passed

SHA-256 / 49ee686999915636a315d0af084c99c47a9c71ea6bae9c64d60a2680cf7bc8ec

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    words, width, limit = x
    queue = [list(w) for w in words]
    lines = []
    cur = ''
    streak = 0
    k = 0
    while k < len(queue):
        syl = queue[k]
        token = ''.join(syl)
        need = len(token) if cur == '' else len(cur) + 1 + len(token)
        if need <= width:
            cur = token if cur == '' else cur + ' ' + token
            k += 1
            continue
        split = None
        if streak < limit and k < len(queue) - 1:
            for cut in range(len(syl) - 2, 0, -1):
                head = ''.join(syl[:cut]) + '-'
                room = len(head) if cur == '' else len(cur) + len(head) + 1
                if room <= width:
                    split = cut
                    break
        if split is not None:
            head = ''.join(syl[:split]) + '-'
            lines.append(head if cur == '' else cur + ' ' + head)
            queue[k] = syl[split:]
            cur = ''
            streak += 1
        elif cur == '':
            lines.append(token)
            k += 1
            streak = 0
        else:
            lines.append(cur)
            cur, streak = '', 0
    if cur:
        lines.append(cur)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['pa', 'ra', 'graph'], ['a'], ['type'], ['a'], ['com', 'po', 'si', 'tion'], ['kern', 'ing'], ['of']], 14, 3], ['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['to'], ['break', 'ing'], ['break', 'ing'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['jus', 'ti', 'fied']], 12, 1], ['to breaking', 'breaking', 'type leading', 'breaking', 'justified']), ('control layout', [[['pa', 'ra', 'graph'], ['kern', 'ing'], ['kern', 'ing'], ['set', 'ting'], ['mar', 'gin'], ['set', 'ting']], 9, 2], ['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']), ('control layout', [[['col', 'umn'], ['set', 'ting'], ['break', 'ing'], ['type'], ['text'], ['of'], ['pa', 'ra', 'graph']], 10, 1], ['column', 'setting', 'breaking', 'type text', 'of', 'paragraph'])], [('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['to'], ['kern', 'ing'], ['a'], ['col', 'umn'], ['line'], ['of'], ['of'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['kern', 'ing']], 14, 1], ['international', 'to kerning a', 'column line of', 'of of interna-', 'tional kerning']), ('regression: latest boundary preference', [[['a'], ['in', 'ter', 'na', 'tion', 'al'], ['of'], ['to'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['line'], ['in', 'ter', 'na', 'tion', 'al'], ['a'], ['hy', 'phen', 'a', 'tion']], 14, 3], ['a internation-', 'al of to mar-', 'gin justified', 'paragraph', 'leading line', 'international', 'a hyphenation']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['com', 'po', 'si', 'tion'], ['type'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['lead', 'ing'], ['lead', 'ing'], ['hy', 'phen', 'a', 'tion'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph'], ['set', 'ting'], ['lead', 'ing']], 7, 1], ['justi-', 'fied', 'compo-', 'sition', 'type', 'margin', 'inter-', 'national', 'leading', 'leading', 'hyphen-', 'ation', 'compo-', 'sition', 'para-', 'graph', 'setting', 'leading']), ('partial-repair probe', [[['of'], ['lead', 'ing'], ['set', 'ting'], ['kern', 'ing'], ['col', 'umn'], ['line'], ['type'], ['col', 'umn']], 13, 3], ['of leading', 'setting kern-', 'ing column', 'line type', 'column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['type']], 9, 2], ['column', 'justified', 'margin', 'justified', 'type']), ('control layout', [[['kern', 'ing'], ['line'], ['kern', 'ing'], ['a'], ['to']], 14, 1], ['kerning line', 'kerning a to'])], [('regression: latest boundary preference', [[['mar', 'gin'], ['jus', 'ti', 'fied'], ['lead', 'ing'], ['col', 'umn'], ['of'], ['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph'], ['lead', 'ing'], ['set', 'ting'], ['a']], 6, 3], ['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']), ('regression: latest boundary preference', [[['set', 'ting'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['type'], ['type'], ['text'], ['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['a'], ['set', 'ting']], 11, 2], ['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']), ('regression: latest boundary preference', [[['in', 'ter', 'na', 'tion', 'al'], ['hy', 'phen', 'a', 'tion'], ['kern', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['type'], ['type'], ['lead', 'ing'], ['break', 'ing'], ['mar', 'gin'], ['break', 'ing'], ['in', 'ter', 'na', 'tion', 'al'], ['set', 'ting']], 9, 1], ['interna-', 'tional', 'hyphena-', 'tion', 'kerning', 'interna-', 'tional', 'type type', 'leading', 'breaking', 'margin', 'breaking', 'interna-', 'tional', 'setting']), ('regression: latest boundary preference', [[['a'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['mar', 'gin'], ['type'], ['to']], 13, 3], ['a composition', 'leading mar-', 'gin hyphena-', 'tion margin', 'type to']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('control layout', [[['type'], ['lead', 'ing'], ['of'], ['jus', 'ti', 'fied'], ['mar', 'gin']], 8, 3], ['type', 'leading', 'of jus-', 'tified', 'margin']), ('control layout', [[['com', 'po', 'si', 'tion'], ['in', 'ter', 'na', 'tion', 'al'], ['mar', 'gin'], ['hy', 'phen', 'a', 'tion'], ['pa', 'ra', 'graph']], 13, 2], ['composition', 'international', 'margin hy-', 'phenation', 'paragraph'])], [('regression: latest boundary preference', [[['to'], ['of'], ['type'], ['line'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['line'], ['pa', 'ra', 'graph'], ['jus', 'ti', 'fied'], ['col', 'umn']], 8, 1], ['to of', 'type', 'line', 'justi-', 'fied', 'para-', 'graph', 'line pa-', 'ragraph', 'justi-', 'fied', 'column']), ('regression: latest boundary preference', [[['jus', 'ti', 'fied'], ['type'], ['type'], ['kern', 'ing'], ['lead', 'ing']], 6, 3], ['justi-', 'fied', 'type', 'type', 'kern-', 'ing', 'leading']), ('regression: latest boundary preference', [[['hy', 'phen', 'a', 'tion'], ['a'], ['line'], ['mar', 'gin'], ['in', 'ter', 'na', 'tion', 'al'], ['text'], ['com', 'po', 'si', 'tion'], ['lead', 'ing'], ['lead', 'ing'], ['type']], 11, 2], ['hyphenation', 'a line mar-', 'gin inter-', 'national', 'text compo-', 'sition', 'leading', 'leading', 'type']), ('regression: latest boundary preference', [[['break', 'ing'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['col', 'umn']], 7, 3], ['break-', 'ing hy-', 'phena-', 'tion', 'justi-', 'fied', 'para-', 'graph', 'column']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['col', 'umn'], ['com', 'po', 'si', 'tion'], ['a'], ['col', 'umn'], ['line']], 12, 2], ['column com-', 'position a', 'column line']), ('control layout', [[['line'], ['jus', 'ti', 'fied'], ['mar', 'gin'], ['jus', 'ti', 'fied'], ['break', 'ing'], ['of'], ['line']], 9, 3], ['line jus-', 'tified', 'margin', 'justified', 'breaking', 'of line'])], [('regression: latest boundary preference', [[['kern', 'ing'], ['pa', 'ra', 'graph'], ['a'], ['pa', 'ra', 'graph'], ['of'], ['pa', 'ra', 'graph'], ['text']], 6, 1], ['kern-', 'ing', 'para-', 'graph', 'a pa-', 'ragraph', 'of pa-', 'ragraph', 'text']), ('regression: latest boundary preference', [[['set', 'ting'], ['line'], ['pa', 'ra', 'graph'], ['of'], ['text'], ['pa', 'ra', 'graph'], ['hy', 'phen', 'a', 'tion'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['pa', 'ra', 'graph']], 10, 1], ['setting', 'line para-', 'graph of', 'text para-', 'graph', 'hyphena-', 'tion', 'leading', 'composi-', 'tion', 'paragraph']), ('regression: latest boundary preference', [[['set', 'ting'], ['hy', 'phen', 'a', 'tion'], ['jus', 'ti', 'fied'], ['of'], ['type'], ['col', 'umn'], ['line'], ['mar', 'gin'], ['to'], ['kern', 'ing']], 9, 3], ['setting', 'hyphena-', 'tion jus-', 'tified of', 'type col-', 'umn line', 'margin to', 'kerning']), ('partial-repair probe', [[['text'], ['kern', 'ing'], ['line'], ['set', 'ting'], ['break', 'ing'], ['to'], ['mar', 'gin'], ['line'], ['col', 'umn'], ['lead', 'ing'], ['com', 'po', 'si', 'tion'], ['type']], 13, 1], ['text kerning', 'line setting', 'breaking to', 'margin line', 'column lead-', 'ing', 'composition', 'type']), ('last word never hyphenated', [[['a'], ['com', 'po', 'si', 'tion']], 8, 2], ['a', 'composition']), ('ladder of three hyphenated lines', [[['in', 'ter', 'na', 'tion', 'al'], ['com', 'po', 'si', 'tion'], ['hy', 'phen', 'a', 'tion'], ['text']], 7, 2], ['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']), ('control layout', [[['set', 'ting'], ['set', 'ting'], ['a'], ['jus', 'ti', 'fied'], ['pa', 'ra', 'graph'], ['to'], ['col', 'umn'], ['break', 'ing'], ['jus', 'ti', 'fied'], ['type'], ['set', 'ting']], 11, 3], ['setting', 'setting a', 'justified', 'paragraph', 'to column', 'breaking', 'justified', 'type', 'setting']), ('control layout', [[['to'], ['to'], ['com', 'po', 'si', 'tion'], ['line'], ['type'], ['com', 'po', 'si', 'tion'], ['col', 'umn'], ['break', 'ing']], 11, 2], ['to to com-', 'position', 'line type', 'composition', 'column', 'breaking'])]]
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
ladder of three hyphenated lines['inter-', 'na-', 'tional', 'compo-', 'sition', 'hyphen-', 'ation', 'text']['inter-', 'nation-', 'al', 'compo-', 'sition', 'hyphen-', 'ation', 'text']Failed
regression: latest boundary preference['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']['international', 'paragraph a', 'type a compo-', 'sition kerning', 'of']Passed
regression: latest boundary preference['setting', 'justified', 'breaking', 'type type', 'text', 'breaking', 'hyphenation', 'a setting']['setting', 'justified', 'breaking', 'type type', 'text break-', 'ing hyphen-', 'ation a', 'setting']Failed
regression: latest boundary preference['margin', 'jus-', 'tified', 'leading', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phen-', 'ation', 'pa-', 'ragraph', 'leading', 'setting', 'a']['margin', 'justi-', 'fied', 'lead-', 'ing', 'column', 'of in-', 'terna-', 'tional', 'hy-', 'phena-', 'tion', 'para-', 'graph', 'lead-', 'ing', 'set-', 'ting a']Failed
last word never hyphenated['a', 'composition']['a', 'composition']Passed
control layout['to breaking', 'breaking', 'type leading', 'breaking', 'justified']['to breaking', 'breaking', 'type leading', 'breaking', 'justified']Passed
control layout['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']['paragraph', 'kerning', 'kerning', 'setting', 'margin', 'setting']Passed
control layout['column', 'setting', 'breaking', 'type text', 'of', 'paragraph']['column', 'setting', 'breaking', 'type text', 'of', 'paragraph']Passed

SHA-256 / 66e4888ab2123f508b6ec1803b4e67fa872947174e448b872672f22a4a2e8a16

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / be102a1340dbb73adb8531f5c197d925c9b6863f3c9a35dee575973b2e0d9827