FAILURE MAP
← Case archive

FA-80201 / Typography line breaking / Open access

Ties and discretionary hyphens: space run collapsing · case 01

Double spaces in the source produce double spaces or empty chunks in the output.

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

ROOT CAUSE

Each space character is a separate opportunity, creating empty chunks.

VERIFIED REPAIR

Collapse a run of spaces into one opportunity.

Unsuccessful approach: Also swallowing ties after spaces removes the unbreakable space.

Case contract

Input [source, width]. Runs of spaces are one breakable space; "~" is an unbreakable space rendered " "; "\-" is a discretionary hyphen: invisible unless the line breaks there, then rendered "-"; "|" is an invisible break opportunity. Greedy: append the next chunk if the line (without a potential hyphen) fits, else break at that opportunity. Return rendered 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):
    src, width = x
    chunks = ['']
    ops = []
    i = 0
    while i < len(src):
        c = src[i]
        if src.startswith('\\-', i):
            ops.append('d')
            chunks.append('')
            i += 2
            continue
        if c == ' ':
            j = i
            j += 1
            ops.append('s')
            chunks.append('')
            i = j
            continue
        if c == '|':
            ops.append('z')
            chunks.append('')
            i += 1
            continue
        chunks[-1] += ' ' if c == '~' else c
        i += 1
    line = chunks[0]
    lines = []
    for op, ch in zip(ops, chunks[1:]):
        sep = ' ' if op == 's' else ''
        if len(line + sep + ch) <= width:
            line = line + sep + ch
        else:
            lines.append(line + ('-' if op == 'd' else ''))
            line = ch
    lines.append(line)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double space collapses', ['type  set', 20], ['type set']), ('regression: space run collapsing', ['url|path  ~a a  hy\\-phen', 12], ['urlpath  a a', 'hyphen']), ('partial-repair probe', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt']), ('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['b|c ink hy\\-phen url|path type com\\-po\\-si\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('control layout', ['set type type', 5], ['set', 'type', 'type'])], [('regression: space run collapsing', ['type ~x ~x  ~word url|path  set  hy\\-phen', 15], ['type  x  x', ' word urlpath', 'set hyphen']), ('regression: space run collapsing', ['hy\\-phen ~type set ~com\\-po\\-si\\-tion set  type  com\\-po\\-si\\-tion word set', 15], ['hyphen  type', 'set  composi-', 'tion set type', 'composition', 'word set']), ('regression: space run collapsing', ['a  ~Dr.~Knuth ~ink x url|path b|c', 8], ['a', ' Dr. Knuth', ' ink x', 'urlpath', 'bc']), ('partial-repair probe', ['set type ~type url|path ~ink ~type', 10], ['set type', ' type url', 'path  ink', ' type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['hy\\-phen Dr.~Knuth a ink b|c', 10], ['hyphen', 'Dr. Knuth', 'a ink bc']), ('control layout', ['com\\-po\\-si\\-tion a x', 16], ['composition a x'])], [('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('regression: space run collapsing', ['word  b|c  com\\-po\\-si\\-tion ~hy\\-phen x word type', 10], ['word bc', 'composi-', 'tion  hy-', 'phen x', 'word type']), ('regression: space run collapsing', ['hy\\-phen com\\-po\\-si\\-tion ~url|path  Dr.~Knuth', 12], ['hyphen compo-', 'sition  url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['x  10~pt a ~Dr.~Knuth b|c  Dr.~Knuth ~hy\\-phen  set  com\\-po\\-si\\-tion', 16], ['x 10 pt a', ' Dr. Knuth bc', 'Dr. Knuth  hy-', 'phen set composi-', 'tion']), ('double space collapses', ['type  set', 20], ['type set']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['10~pt word b|c', 11], ['10 pt word', 'bc']), ('control layout', ['b|c type type', 6], ['bc', 'type', 'type'])], [('regression: space run collapsing', ['b|c url|path  Dr.~Knuth', 5], ['bc', 'url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['word a ~url|path com\\-po\\-si\\-tion  com\\-po\\-si\\-tion', 7], ['word a', ' url', 'path', 'composi-', 'tion', 'composi-', 'tion']), ('regression: space run collapsing', ['com\\-po\\-si\\-tion ~word ink  Dr.~Knuth type word a', 9], ['composi-', 'tion', ' word ink', 'Dr. Knuth', 'type word', 'a']), ('regression: space run collapsing', ['set  ~b|c 10~pt  b|c', 14], ['set  bc 10 pt', 'bc']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['b|c ink type', 14], ['bc ink type']), ('control layout', ['word a hy\\-phen b|c ink a hy\\-phen', 5], ['word', 'a hy-', 'phen', 'bc', 'ink a', 'hy-', 'phen'])], [('regression: space run collapsing', ['b|c a Dr.~Knuth  a  Dr.~Knuth ~word', 6], ['bc a', 'Dr. Knuth', 'a', 'Dr. Knuth', ' word']), ('regression: space run collapsing', ['b|c set  ink com\\-po\\-si\\-tion a', 9], ['bc set', 'ink compo-', 'sition a']), ('partial-repair probe', ['word ~Dr.~Knuth 10~pt set', 16], ['word  Dr. Knuth', '10 pt set']), ('regression: space run collapsing', ['type a hy\\-phen com\\-po\\-si\\-tion ~set set ink  type', 8], ['type a', 'hyphen', 'composi-', 'tion', ' set set', 'ink type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['hy\\-phen word word com\\-po\\-si\\-tion b|c b|c', 11], ['hyphen word', 'word compo-', 'sition bc b', 'c']), ('control layout', ['hy\\-phen 10~pt hy\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x'])]]
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
double space collapses['type set']['type set']Failed
regression: space run collapsing['urlpath a', 'a hyphen']['urlpath a a', 'hyphen']Failed
partial-repair probe['urlpath x', 'Dr. Knuth', ' 10 pt']['urlpath x', 'Dr. Knuth', ' 10 pt']Passed
regression: space run collapsing['hy-', 'phen', 'x hy-', 'phen ', 'x a', ' com-', 'posi-', 'tion ', 'hy-', 'phen ', 'word', ' type']['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']Failed
tie keeps title with name['see', 'Dr. Knuth', 'now']['see', 'Dr. Knuth', 'now']Passed
invisible break['url', 'pathx']['url', 'pathx']Passed
control layout['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']Passed
control layout['set', 'type', 'type']['set', 'type', 'type']Passed

SHA-256 / d5aa450f438e2907ed77acf8e4881f5dfbe373171498e155a021960447e1708f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    src, width = x
    chunks = ['']
    ops = []
    i = 0
    while i < len(src):
        c = src[i]
        if src.startswith('\\-', i):
            ops.append('d')
            chunks.append('')
            i += 2
            continue
        if c == ' ':
            j = i
            while j < len(src) and src[j] in ' ~':
                j += 1
            ops.append('s')
            chunks.append('')
            i = j
            continue
        if c == '|':
            ops.append('z')
            chunks.append('')
            i += 1
            continue
        chunks[-1] += ' ' if c == '~' else c
        i += 1
    line = chunks[0]
    lines = []
    for op, ch in zip(ops, chunks[1:]):
        sep = ' ' if op == 's' else ''
        if len(line + sep + ch) <= width:
            line = line + sep + ch
        else:
            lines.append(line + ('-' if op == 'd' else ''))
            line = ch
    lines.append(line)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double space collapses', ['type  set', 20], ['type set']), ('regression: space run collapsing', ['url|path  ~a a  hy\\-phen', 12], ['urlpath  a a', 'hyphen']), ('partial-repair probe', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt']), ('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['b|c ink hy\\-phen url|path type com\\-po\\-si\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('control layout', ['set type type', 5], ['set', 'type', 'type'])], [('regression: space run collapsing', ['type ~x ~x  ~word url|path  set  hy\\-phen', 15], ['type  x  x', ' word urlpath', 'set hyphen']), ('regression: space run collapsing', ['hy\\-phen ~type set ~com\\-po\\-si\\-tion set  type  com\\-po\\-si\\-tion word set', 15], ['hyphen  type', 'set  composi-', 'tion set type', 'composition', 'word set']), ('regression: space run collapsing', ['a  ~Dr.~Knuth ~ink x url|path b|c', 8], ['a', ' Dr. Knuth', ' ink x', 'urlpath', 'bc']), ('partial-repair probe', ['set type ~type url|path ~ink ~type', 10], ['set type', ' type url', 'path  ink', ' type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['hy\\-phen Dr.~Knuth a ink b|c', 10], ['hyphen', 'Dr. Knuth', 'a ink bc']), ('control layout', ['com\\-po\\-si\\-tion a x', 16], ['composition a x'])], [('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('regression: space run collapsing', ['word  b|c  com\\-po\\-si\\-tion ~hy\\-phen x word type', 10], ['word bc', 'composi-', 'tion  hy-', 'phen x', 'word type']), ('regression: space run collapsing', ['hy\\-phen com\\-po\\-si\\-tion ~url|path  Dr.~Knuth', 12], ['hyphen compo-', 'sition  url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['x  10~pt a ~Dr.~Knuth b|c  Dr.~Knuth ~hy\\-phen  set  com\\-po\\-si\\-tion', 16], ['x 10 pt a', ' Dr. Knuth bc', 'Dr. Knuth  hy-', 'phen set composi-', 'tion']), ('double space collapses', ['type  set', 20], ['type set']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['10~pt word b|c', 11], ['10 pt word', 'bc']), ('control layout', ['b|c type type', 6], ['bc', 'type', 'type'])], [('regression: space run collapsing', ['b|c url|path  Dr.~Knuth', 5], ['bc', 'url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['word a ~url|path com\\-po\\-si\\-tion  com\\-po\\-si\\-tion', 7], ['word a', ' url', 'path', 'composi-', 'tion', 'composi-', 'tion']), ('regression: space run collapsing', ['com\\-po\\-si\\-tion ~word ink  Dr.~Knuth type word a', 9], ['composi-', 'tion', ' word ink', 'Dr. Knuth', 'type word', 'a']), ('regression: space run collapsing', ['set  ~b|c 10~pt  b|c', 14], ['set  bc 10 pt', 'bc']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['b|c ink type', 14], ['bc ink type']), ('control layout', ['word a hy\\-phen b|c ink a hy\\-phen', 5], ['word', 'a hy-', 'phen', 'bc', 'ink a', 'hy-', 'phen'])], [('regression: space run collapsing', ['b|c a Dr.~Knuth  a  Dr.~Knuth ~word', 6], ['bc a', 'Dr. Knuth', 'a', 'Dr. Knuth', ' word']), ('regression: space run collapsing', ['b|c set  ink com\\-po\\-si\\-tion a', 9], ['bc set', 'ink compo-', 'sition a']), ('partial-repair probe', ['word ~Dr.~Knuth 10~pt set', 16], ['word  Dr. Knuth', '10 pt set']), ('regression: space run collapsing', ['type a hy\\-phen com\\-po\\-si\\-tion ~set set ink  type', 8], ['type a', 'hyphen', 'composi-', 'tion', ' set set', 'ink type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['hy\\-phen word word com\\-po\\-si\\-tion b|c b|c', 11], ['hyphen word', 'word compo-', 'sition bc b', 'c']), ('control layout', ['hy\\-phen 10~pt hy\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x'])]]
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
double space collapses['type set']['type set']Passed
regression: space run collapsing['urlpath a a', 'hyphen']['urlpath a a', 'hyphen']Failed
partial-repair probe['urlpath x', 'Dr. Knuth', '10 pt']['urlpath x', 'Dr. Knuth', ' 10 pt']Failed
regression: space run collapsing['hy-', 'phen', 'x hy-', 'phen', 'x a', 'compo-', 'si-', 'tion', 'hy-', 'phen', 'word', 'type']['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']Failed
tie keeps title with name['see', 'Dr. Knuth', 'now']['see', 'Dr. Knuth', 'now']Passed
invisible break['url', 'pathx']['url', 'pathx']Passed
control layout['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']Passed
control layout['set', 'type', 'type']['set', 'type', 'type']Passed

SHA-256 / dd6e427e3766592b00c5f4df76346278acb8acfdb1fe442ad5ff12dc865a7347

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    src, width = x
    chunks = ['']
    ops = []
    i = 0
    while i < len(src):
        c = src[i]
        if src.startswith('\\-', i):
            ops.append('d')
            chunks.append('')
            i += 2
            continue
        if c == ' ':
            j = i
            while j < len(src) and src[j] == ' ':
                j += 1
            ops.append('s')
            chunks.append('')
            i = j
            continue
        if c == '|':
            ops.append('z')
            chunks.append('')
            i += 1
            continue
        chunks[-1] += ' ' if c == '~' else c
        i += 1
    line = chunks[0]
    lines = []
    for op, ch in zip(ops, chunks[1:]):
        sep = ' ' if op == 's' else ''
        if len(line + sep + ch) <= width:
            line = line + sep + ch
        else:
            lines.append(line + ('-' if op == 'd' else ''))
            line = ch
    lines.append(line)
    return lines
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('double space collapses', ['type  set', 20], ['type set']), ('regression: space run collapsing', ['url|path  ~a a  hy\\-phen', 12], ['urlpath  a a', 'hyphen']), ('partial-repair probe', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt']), ('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['b|c ink hy\\-phen url|path type com\\-po\\-si\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('control layout', ['set type type', 5], ['set', 'type', 'type'])], [('regression: space run collapsing', ['type ~x ~x  ~word url|path  set  hy\\-phen', 15], ['type  x  x', ' word urlpath', 'set hyphen']), ('regression: space run collapsing', ['hy\\-phen ~type set ~com\\-po\\-si\\-tion set  type  com\\-po\\-si\\-tion word set', 15], ['hyphen  type', 'set  composi-', 'tion set type', 'composition', 'word set']), ('regression: space run collapsing', ['a  ~Dr.~Knuth ~ink x url|path b|c', 8], ['a', ' Dr. Knuth', ' ink x', 'urlpath', 'bc']), ('partial-repair probe', ['set type ~type url|path ~ink ~type', 10], ['set type', ' type url', 'path  ink', ' type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['hy\\-phen Dr.~Knuth a ink b|c', 10], ['hyphen', 'Dr. Knuth', 'a ink bc']), ('control layout', ['com\\-po\\-si\\-tion a x', 16], ['composition a x'])], [('regression: space run collapsing', ['hy\\-phen x hy\\-phen  x a ~com\\-po\\-si\\-tion  hy\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('regression: space run collapsing', ['word  b|c  com\\-po\\-si\\-tion ~hy\\-phen x word type', 10], ['word bc', 'composi-', 'tion  hy-', 'phen x', 'word type']), ('regression: space run collapsing', ['hy\\-phen com\\-po\\-si\\-tion ~url|path  Dr.~Knuth', 12], ['hyphen compo-', 'sition  url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['x  10~pt a ~Dr.~Knuth b|c  Dr.~Knuth ~hy\\-phen  set  com\\-po\\-si\\-tion', 16], ['x 10 pt a', ' Dr. Knuth bc', 'Dr. Knuth  hy-', 'phen set composi-', 'tion']), ('double space collapses', ['type  set', 20], ['type set']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['10~pt word b|c', 11], ['10 pt word', 'bc']), ('control layout', ['b|c type type', 6], ['bc', 'type', 'type'])], [('regression: space run collapsing', ['b|c url|path  Dr.~Knuth', 5], ['bc', 'url', 'path', 'Dr. Knuth']), ('regression: space run collapsing', ['word a ~url|path com\\-po\\-si\\-tion  com\\-po\\-si\\-tion', 7], ['word a', ' url', 'path', 'composi-', 'tion', 'composi-', 'tion']), ('regression: space run collapsing', ['com\\-po\\-si\\-tion ~word ink  Dr.~Knuth type word a', 9], ['composi-', 'tion', ' word ink', 'Dr. Knuth', 'type word', 'a']), ('regression: space run collapsing', ['set  ~b|c 10~pt  b|c', 14], ['set  bc 10 pt', 'bc']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['b|c ink type', 14], ['bc ink type']), ('control layout', ['word a hy\\-phen b|c ink a hy\\-phen', 5], ['word', 'a hy-', 'phen', 'bc', 'ink a', 'hy-', 'phen'])], [('regression: space run collapsing', ['b|c a Dr.~Knuth  a  Dr.~Knuth ~word', 6], ['bc a', 'Dr. Knuth', 'a', 'Dr. Knuth', ' word']), ('regression: space run collapsing', ['b|c set  ink com\\-po\\-si\\-tion a', 9], ['bc set', 'ink compo-', 'sition a']), ('partial-repair probe', ['word ~Dr.~Knuth 10~pt set', 16], ['word  Dr. Knuth', '10 pt set']), ('regression: space run collapsing', ['type a hy\\-phen com\\-po\\-si\\-tion ~set set ink  type', 8], ['type a', 'hyphen', 'composi-', 'tion', ' set set', 'ink type']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['hy\\-phen word word com\\-po\\-si\\-tion b|c b|c', 11], ['hyphen word', 'word compo-', 'sition bc b', 'c']), ('control layout', ['hy\\-phen 10~pt hy\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x'])]]
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
double space collapses['type set']['type set']Passed
regression: space run collapsing['urlpath a a', 'hyphen']['urlpath a a', 'hyphen']Passed
partial-repair probe['urlpath x', 'Dr. Knuth', ' 10 pt']['urlpath x', 'Dr. Knuth', ' 10 pt']Passed
regression: space run collapsing['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']Passed
tie keeps title with name['see', 'Dr. Knuth', 'now']['see', 'Dr. Knuth', 'now']Passed
invisible break['url', 'pathx']['url', 'pathx']Passed
control layout['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']Passed
control layout['set', 'type', 'type']['set', 'type', 'type']Passed

SHA-256 / 65722b8a99c3588c821c12d118899e7288de6f563609c6676d7b539977c9c4fa

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

Case digest / 1f6eb17d6f06f12c5e8acb6c728dbea4b40631a52aff1ab695a4930aee521eb3