FA-80196 / Typography line breaking / Open access
Ties and discretionary hyphens: invisible break rendering · case 01
Zero-width break opportunities show up as spaces.
ROOT CAUSE
The zero-width opportunity is joined with a space separator.
VERIFIED REPAIR
Join chunks across a zero-width opportunity with nothing.
Unsuccessful approach: Dropping the opportunity entirely removes a legal break.
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
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 in 'sz' 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 = [[('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('regression: invisible break rendering', ['url|path url|path hy\\-phen com\\-po\\-si\\-tion word b|c a word b|c', 11], ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc']), ('partial-repair probe', ['com\\-po\\-si\\-tion word word hy\\-phen url|path', 6], ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path']), ('partial-repair probe', ['word set a x ~set ~set b|c x', 6], ['word', 'set a', 'x set', ' set b', 'c x']), ('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', ['ink a a ~hy\\-phen x com\\-po\\-si\\-tion x', 6], ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x']), ('control layout', ['hy\\-phen ink type word', 11], ['hyphen ink', 'type word'])], [('regression: invisible break rendering', ['url|path ~com\\-po\\-si\\-tion b|c b|c url|path word Dr.~Knuth url|path ~hy\\-phen', 12], ['urlpath com-', 'position bc', 'bc urlpath', 'word', 'Dr. Knuth', 'urlpath hy-', 'phen']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~b|c ~x ink url|path a', 12], ['composition', ' bc x ink', 'urlpath a']), ('regression: invisible break rendering', ['b|c a a set a ~com\\-po\\-si\\-tion hy\\-phen ink ~url|path', 11], ['bc a a set', 'a composi-', 'tion hyphen', 'ink url', 'path']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('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', ['com\\-po\\-si\\-tion 10~pt word set com\\-po\\-si\\-tion', 6], ['compo-', 'sition', '10 pt', 'word', 'set', 'compo-', 'sition']), ('control layout', ['set com\\-po\\-si\\-tion 10~pt word', 15], ['set composition', '10 pt word'])], [('regression: invisible break rendering', ['10~pt url|path ink set com\\-po\\-si\\-tion set word com\\-po\\-si\\-tion', 7], ['10 pt', 'urlpath', 'ink set', 'composi-', 'tion', 'set', 'word', 'composi-', 'tion']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~url|path x ~set ~com\\-po\\-si\\-tion com\\-po\\-si\\-tion x ~Dr.~Knuth', 8], ['composi-', 'tion', ' urlpath', 'x set', ' composi-', 'tion com-', 'position', 'x', ' Dr. Knuth']), ('partial-repair probe', ['x ~url|path url|path ~type word', 5], ['x', ' url', 'path', 'url', 'path', ' type', 'word']), ('partial-repair probe', ['Dr.~Knuth 10~pt word Dr.~Knuth word x b|c url|path 10~pt', 8], ['Dr. Knuth', '10 pt', 'word', 'Dr. Knuth', 'word x b', 'c url', 'path', '10 pt']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['word x hy\\-phen', 6], ['word x', 'hyphen']), ('control layout', ['10~pt ~10~pt ~type ~Dr.~Knuth Dr.~Knuth', 5], ['10 pt', ' 10 pt', ' type', ' Dr. Knuth', 'Dr. Knuth'])], [('regression: invisible break rendering', ['url|path ~ink ~url|path set b|c hy\\-phen', 13], ['urlpath ink', ' urlpath set', 'bc hyphen']), ('regression: invisible break rendering', ['b|c url|path ~set ink type ~b|c b|c ~url|path ink', 9], ['bc url', 'path set', 'ink type', ' bc bc', ' urlpath', 'ink']), ('partial-repair probe', ['url|path url|path hy\\-phen ink url|path hy\\-phen set b|c', 5], ['url', 'path', 'url', 'path', 'hy-', 'phen', 'ink', 'url', 'path', 'hy-', 'phen', 'set b', 'c']), ('partial-repair probe', ['ink type 10~pt Dr.~Knuth set a url|path', 10], ['ink type', '10 pt', 'Dr. Knuth', 'set a url', 'path']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type set', 20], ['type set']), ('control layout', ['hy\\-phen type ~word hy\\-phen ~x', 14], ['hyphen type', ' word hyphen', ' x']), ('control layout', ['Dr.~Knuth a Dr.~Knuth set com\\-po\\-si\\-tion Dr.~Knuth', 12], ['Dr. Knuth a', 'Dr. Knuth', 'set composi-', 'tion', 'Dr. Knuth'])], [('regression: invisible break rendering', ['b|c b|c ~set ~com\\-po\\-si\\-tion', 12], ['bc bc set', ' composition']), ('regression: invisible break rendering', ['10~pt b|c a', 16], ['10 pt bc a']), ('regression: invisible break rendering', ['Dr.~Knuth url|path a Dr.~Knuth b|c b|c com\\-po\\-si\\-tion', 15], ['Dr. Knuth url', 'path a', 'Dr. Knuth bc bc', 'composition']), ('partial-repair probe', ['x url|path word ~a', 8], ['x url', 'path', 'word a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['Dr.~Knuth set com\\-po\\-si\\-tion', 5], ['Dr. Knuth', 'set', 'compo-', 'si-', 'tion']), ('control layout', ['word hy\\-phen x ~type Dr.~Knuth ~type', 10], ['word hy-', 'phen x', ' type', 'Dr. Knuth', ' type'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| invisible break | ['url', 'path', 'x'] | ['url', 'pathx'] | Failed |
| regression: invisible break rendering | ['url path', 'url path hy-', 'phen compo-', 'sition word', 'b c a word', 'b c'] | ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc'] | Failed |
| partial-repair probe | ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path'] | ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path'] | Passed |
| partial-repair probe | ['word', 'set a', 'x set', ' set b', 'c x'] | ['word', 'set a', 'x set', ' set b', 'c x'] | Passed |
| discretionary taken | ['the compo-', 'sition'] | ['the compo-', 'sition'] | Passed |
| tie keeps title with name | ['see', 'Dr. Knuth', 'now'] | ['see', 'Dr. Knuth', 'now'] | Passed |
| control layout | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | Passed |
| control layout | ['hyphen ink', 'type word'] | ['hyphen ink', 'type word'] | Passed |
SHA-256 / 1d5b6ec8be959266c23cba16151e0be1ae885166ea0c1b3b68a0d49b39875862
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] == ' ':
j += 1
ops.append('s')
chunks.append('')
i = j
continue
if c == '|':
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 = [[('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('regression: invisible break rendering', ['url|path url|path hy\\-phen com\\-po\\-si\\-tion word b|c a word b|c', 11], ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc']), ('partial-repair probe', ['com\\-po\\-si\\-tion word word hy\\-phen url|path', 6], ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path']), ('partial-repair probe', ['word set a x ~set ~set b|c x', 6], ['word', 'set a', 'x set', ' set b', 'c x']), ('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', ['ink a a ~hy\\-phen x com\\-po\\-si\\-tion x', 6], ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x']), ('control layout', ['hy\\-phen ink type word', 11], ['hyphen ink', 'type word'])], [('regression: invisible break rendering', ['url|path ~com\\-po\\-si\\-tion b|c b|c url|path word Dr.~Knuth url|path ~hy\\-phen', 12], ['urlpath com-', 'position bc', 'bc urlpath', 'word', 'Dr. Knuth', 'urlpath hy-', 'phen']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~b|c ~x ink url|path a', 12], ['composition', ' bc x ink', 'urlpath a']), ('regression: invisible break rendering', ['b|c a a set a ~com\\-po\\-si\\-tion hy\\-phen ink ~url|path', 11], ['bc a a set', 'a composi-', 'tion hyphen', 'ink url', 'path']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('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', ['com\\-po\\-si\\-tion 10~pt word set com\\-po\\-si\\-tion', 6], ['compo-', 'sition', '10 pt', 'word', 'set', 'compo-', 'sition']), ('control layout', ['set com\\-po\\-si\\-tion 10~pt word', 15], ['set composition', '10 pt word'])], [('regression: invisible break rendering', ['10~pt url|path ink set com\\-po\\-si\\-tion set word com\\-po\\-si\\-tion', 7], ['10 pt', 'urlpath', 'ink set', 'composi-', 'tion', 'set', 'word', 'composi-', 'tion']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~url|path x ~set ~com\\-po\\-si\\-tion com\\-po\\-si\\-tion x ~Dr.~Knuth', 8], ['composi-', 'tion', ' urlpath', 'x set', ' composi-', 'tion com-', 'position', 'x', ' Dr. Knuth']), ('partial-repair probe', ['x ~url|path url|path ~type word', 5], ['x', ' url', 'path', 'url', 'path', ' type', 'word']), ('partial-repair probe', ['Dr.~Knuth 10~pt word Dr.~Knuth word x b|c url|path 10~pt', 8], ['Dr. Knuth', '10 pt', 'word', 'Dr. Knuth', 'word x b', 'c url', 'path', '10 pt']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['word x hy\\-phen', 6], ['word x', 'hyphen']), ('control layout', ['10~pt ~10~pt ~type ~Dr.~Knuth Dr.~Knuth', 5], ['10 pt', ' 10 pt', ' type', ' Dr. Knuth', 'Dr. Knuth'])], [('regression: invisible break rendering', ['url|path ~ink ~url|path set b|c hy\\-phen', 13], ['urlpath ink', ' urlpath set', 'bc hyphen']), ('regression: invisible break rendering', ['b|c url|path ~set ink type ~b|c b|c ~url|path ink', 9], ['bc url', 'path set', 'ink type', ' bc bc', ' urlpath', 'ink']), ('partial-repair probe', ['url|path url|path hy\\-phen ink url|path hy\\-phen set b|c', 5], ['url', 'path', 'url', 'path', 'hy-', 'phen', 'ink', 'url', 'path', 'hy-', 'phen', 'set b', 'c']), ('partial-repair probe', ['ink type 10~pt Dr.~Knuth set a url|path', 10], ['ink type', '10 pt', 'Dr. Knuth', 'set a url', 'path']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type set', 20], ['type set']), ('control layout', ['hy\\-phen type ~word hy\\-phen ~x', 14], ['hyphen type', ' word hyphen', ' x']), ('control layout', ['Dr.~Knuth a Dr.~Knuth set com\\-po\\-si\\-tion Dr.~Knuth', 12], ['Dr. Knuth a', 'Dr. Knuth', 'set composi-', 'tion', 'Dr. Knuth'])], [('regression: invisible break rendering', ['b|c b|c ~set ~com\\-po\\-si\\-tion', 12], ['bc bc set', ' composition']), ('regression: invisible break rendering', ['10~pt b|c a', 16], ['10 pt bc a']), ('regression: invisible break rendering', ['Dr.~Knuth url|path a Dr.~Knuth b|c b|c com\\-po\\-si\\-tion', 15], ['Dr. Knuth url', 'path a', 'Dr. Knuth bc bc', 'composition']), ('partial-repair probe', ['x url|path word ~a', 8], ['x url', 'path', 'word a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['Dr.~Knuth set com\\-po\\-si\\-tion', 5], ['Dr. Knuth', 'set', 'compo-', 'si-', 'tion']), ('control layout', ['word hy\\-phen x ~type Dr.~Knuth ~type', 10], ['word hy-', 'phen x', ' type', 'Dr. Knuth', ' type'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| invisible break | ['urlpathx'] | ['url', 'pathx'] | Failed |
| regression: invisible break rendering | ['urlpath', 'urlpath hy-', 'phen compo-', 'sition word', 'bc a word', 'bc'] | ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc'] | Failed |
| partial-repair probe | ['compo-', 'sition', 'word', 'word', 'hyphen', 'urlpath'] | ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path'] | Failed |
| partial-repair probe | ['word', 'set a', 'x set', ' set', 'bc x'] | ['word', 'set a', 'x set', ' set b', 'c x'] | Failed |
| discretionary taken | ['the compo-', 'sition'] | ['the compo-', 'sition'] | Passed |
| tie keeps title with name | ['see', 'Dr. Knuth', 'now'] | ['see', 'Dr. Knuth', 'now'] | Passed |
| control layout | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | Passed |
| control layout | ['hyphen ink', 'type word'] | ['hyphen ink', 'type word'] | Passed |
SHA-256 / b4e738e7c86bd05e2c563ba4406b93ece613387706b3f0520ca52bd43fe8e512
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 = [[('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('regression: invisible break rendering', ['url|path url|path hy\\-phen com\\-po\\-si\\-tion word b|c a word b|c', 11], ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc']), ('partial-repair probe', ['com\\-po\\-si\\-tion word word hy\\-phen url|path', 6], ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path']), ('partial-repair probe', ['word set a x ~set ~set b|c x', 6], ['word', 'set a', 'x set', ' set b', 'c x']), ('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', ['ink a a ~hy\\-phen x com\\-po\\-si\\-tion x', 6], ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x']), ('control layout', ['hy\\-phen ink type word', 11], ['hyphen ink', 'type word'])], [('regression: invisible break rendering', ['url|path ~com\\-po\\-si\\-tion b|c b|c url|path word Dr.~Knuth url|path ~hy\\-phen', 12], ['urlpath com-', 'position bc', 'bc urlpath', 'word', 'Dr. Knuth', 'urlpath hy-', 'phen']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~b|c ~x ink url|path a', 12], ['composition', ' bc x ink', 'urlpath a']), ('regression: invisible break rendering', ['b|c a a set a ~com\\-po\\-si\\-tion hy\\-phen ink ~url|path', 11], ['bc a a set', 'a composi-', 'tion hyphen', 'ink url', 'path']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('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', ['com\\-po\\-si\\-tion 10~pt word set com\\-po\\-si\\-tion', 6], ['compo-', 'sition', '10 pt', 'word', 'set', 'compo-', 'sition']), ('control layout', ['set com\\-po\\-si\\-tion 10~pt word', 15], ['set composition', '10 pt word'])], [('regression: invisible break rendering', ['10~pt url|path ink set com\\-po\\-si\\-tion set word com\\-po\\-si\\-tion', 7], ['10 pt', 'urlpath', 'ink set', 'composi-', 'tion', 'set', 'word', 'composi-', 'tion']), ('regression: invisible break rendering', ['com\\-po\\-si\\-tion ~url|path x ~set ~com\\-po\\-si\\-tion com\\-po\\-si\\-tion x ~Dr.~Knuth', 8], ['composi-', 'tion', ' urlpath', 'x set', ' composi-', 'tion com-', 'position', 'x', ' Dr. Knuth']), ('partial-repair probe', ['x ~url|path url|path ~type word', 5], ['x', ' url', 'path', 'url', 'path', ' type', 'word']), ('partial-repair probe', ['Dr.~Knuth 10~pt word Dr.~Knuth word x b|c url|path 10~pt', 8], ['Dr. Knuth', '10 pt', 'word', 'Dr. Knuth', 'word x b', 'c url', 'path', '10 pt']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['word x hy\\-phen', 6], ['word x', 'hyphen']), ('control layout', ['10~pt ~10~pt ~type ~Dr.~Knuth Dr.~Knuth', 5], ['10 pt', ' 10 pt', ' type', ' Dr. Knuth', 'Dr. Knuth'])], [('regression: invisible break rendering', ['url|path ~ink ~url|path set b|c hy\\-phen', 13], ['urlpath ink', ' urlpath set', 'bc hyphen']), ('regression: invisible break rendering', ['b|c url|path ~set ink type ~b|c b|c ~url|path ink', 9], ['bc url', 'path set', 'ink type', ' bc bc', ' urlpath', 'ink']), ('partial-repair probe', ['url|path url|path hy\\-phen ink url|path hy\\-phen set b|c', 5], ['url', 'path', 'url', 'path', 'hy-', 'phen', 'ink', 'url', 'path', 'hy-', 'phen', 'set b', 'c']), ('partial-repair probe', ['ink type 10~pt Dr.~Knuth set a url|path', 10], ['ink type', '10 pt', 'Dr. Knuth', 'set a url', 'path']), ('discretionary taken', ['the com\\-po\\-si\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type set', 20], ['type set']), ('control layout', ['hy\\-phen type ~word hy\\-phen ~x', 14], ['hyphen type', ' word hyphen', ' x']), ('control layout', ['Dr.~Knuth a Dr.~Knuth set com\\-po\\-si\\-tion Dr.~Knuth', 12], ['Dr. Knuth a', 'Dr. Knuth', 'set composi-', 'tion', 'Dr. Knuth'])], [('regression: invisible break rendering', ['b|c b|c ~set ~com\\-po\\-si\\-tion', 12], ['bc bc set', ' composition']), ('regression: invisible break rendering', ['10~pt b|c a', 16], ['10 pt bc a']), ('regression: invisible break rendering', ['Dr.~Knuth url|path a Dr.~Knuth b|c b|c com\\-po\\-si\\-tion', 15], ['Dr. Knuth url', 'path a', 'Dr. Knuth bc bc', 'composition']), ('partial-repair probe', ['x url|path word ~a', 8], ['x url', 'path', 'word a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['Dr.~Knuth set com\\-po\\-si\\-tion', 5], ['Dr. Knuth', 'set', 'compo-', 'si-', 'tion']), ('control layout', ['word hy\\-phen x ~type Dr.~Knuth ~type', 10], ['word hy-', 'phen x', ' type', 'Dr. Knuth', ' type'])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| invisible break | ['url', 'pathx'] | ['url', 'pathx'] | Passed |
| regression: invisible break rendering | ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc'] | ['urlpath url', 'path hyphen', 'composition', 'word bc a', 'word bc'] | Passed |
| partial-repair probe | ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path'] | ['compo-', 'sition', 'word', 'word', 'hyphen', 'url', 'path'] | Passed |
| partial-repair probe | ['word', 'set a', 'x set', ' set b', 'c x'] | ['word', 'set a', 'x set', ' set b', 'c x'] | Passed |
| discretionary taken | ['the compo-', 'sition'] | ['the compo-', 'sition'] | Passed |
| tie keeps title with name | ['see', 'Dr. Knuth', 'now'] | ['see', 'Dr. Knuth', 'now'] | Passed |
| control layout | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | ['ink a', 'a hy-', 'phen x', 'compo-', 'sition', 'x'] | Passed |
| control layout | ['hyphen ink', 'type word'] | ['hyphen ink', 'type word'] | Passed |
SHA-256 / 6188cb0583ec77fc61eaf899b94cab60a0f07a846d52c6619ec7e40e8a6a124c
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.605050+00:00.
Case digest / a1dc9398d1561261f8f58c9fc65d7ac0f5acdd060e361d223123446115b14f91