{"abstract":"Words that exactly fill the measure are wrapped.","category":"Typography line breaking","checks":8,"contract":"Input [words, width, minimum last-line length]. Greedy fill (unit spaces; overwide word alone). Then while there are at least two lines and the last line string is shorter than the minimum, move the last word of the previous line down if that line keeps at least one word and the new last line fits. Return lines.","evaluation_group":"w2-typography-line-breaking-runt-last-line","failed_approach":"Allowing width + 1 overfills.","family":"w2-typography-line-breaking-runt-last-line-greedy-fill-boundary","id":"FA-80146","implementations":{"attempt":{"sha256":"aff963c53d8616d77c88ec4f1cc1505a494d01fe9574142dd5b8e7fcbc8bb279","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, min_last = x\n    lines = []\n    cur = ''\n    for w in words:\n        cand = w if not cur else cur + ' ' + w\n        if len(cand) <= width + 1 or not cur:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = w\n    lines.append(cur)\n    while len(lines) >= 2 and len(lines[-1]) < min_last:\n        prev = lines[-2].split(' ')\n        if len(prev) < 2:\n            break\n        moved = prev[-1] + ' ' + lines[-1]\n        if len(moved) > width:\n            break\n        lines[-2] = ' '.join(prev[:-1])\n        lines[-1] = moved\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('regression: greedy fill boundary', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink']), ('regression: greedy fill boundary', [['baseline', 'type', 'is', 'serif', 'on', 'at', 'baseline'], 7, 3], ['baseline', 'type is', 'serif', 'on at', 'baseline']), ('partial-repair probe', [['a', 'is', 'grid', 'at', 'the', 'kerning', 'kerning', 'type', 'measure', 'ink', 'on'], 18, 5], ['a is grid at the', 'kerning kerning', 'type measure', 'ink on']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['a', 'x', 'is'], 15, 7], ['a x is']), ('control layout', [['grid', 'serif', 'at', 'measure'], 15, 3], ['grid serif at', 'measure']), ('control layout', [['serif', 'the', 'is', 'is', 'of', 'grid', 'at', 'is', 'a'], 10, 7], ['serif the', 'is is of', 'grid', 'at is a'])], [('regression: greedy fill boundary', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: greedy fill boundary', [['baseline', 'is', 'grid', 'x', 'x', 'the', 'a', 'is', 'grid', 'at', 'kerning'], 18, 8], ['baseline is grid x', 'x the a is grid', 'at kerning']), ('regression: greedy fill boundary', [['ink', 'the', 'is', 'ink', 'baseline', 'is', 'grid', 'grid', 'x'], 6, 5], ['ink', 'the is', 'ink', 'baseline', 'is', 'grid', 'grid x']), ('regression: greedy fill boundary', [['baseline', 'x', 'at', 'the', 'measure', 'serif', 'ink', 'grid', 'a', 'the', 'on', 'kerning'], 13, 3], ['baseline x at', 'the measure', 'serif ink', 'grid a the on', 'kerning']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['x', 'measure', 'ink', 'measure', 'is'], 14, 4], ['x measure ink', 'measure is']), ('control layout', [['the', 'measure', 'ink', 'the', 'type', 'x', 'is', 'x'], 9, 3], ['the', 'measure', 'ink the', 'type x', 'is x'])], [('regression: greedy fill boundary', [['measure', 'of', 'baseline', 'a', 'on', 'at', 'kerning', 'measure', 'serif', 'grid', 'baseline', 'is'], 13, 8], ['measure of', 'baseline a on', 'at kerning', 'measure serif', 'grid', 'baseline is']), ('regression: greedy fill boundary', [['a', 'baseline', 'the', 'a', 'type', 'kerning', 'is', 'serif', 'a', 'grid', 'the'], 6, 3], ['a', 'baseline', 'the a', 'type', 'kerning', 'is', 'serif', 'a grid', 'the']), ('regression: greedy fill boundary', [['grid', 'measure', 'kerning', 'kerning', 'is', 'the', 'grid', 'is', 'measure', 'is', 'serif'], 14, 5], ['grid measure', 'kerning', 'kerning is the', 'grid is', 'measure is', 'serif']), ('regression: greedy fill boundary', [['baseline', 'of', 'of', 'type', 'serif', 'at', 'measure', 'serif', 'x', 'type', 'ink'], 11, 3], ['baseline of', 'of type', 'serif at', 'measure', 'serif x', 'type ink']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['is', 'of', 'of', 'is', 'type', 'kerning', 'the'], 9, 5], ['is of of', 'is type', 'kerning', 'the']), ('control layout', [['serif', 'grid', 'at', 'ink'], 19, 3], ['serif grid at ink'])], [('regression: greedy fill boundary', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('regression: greedy fill boundary', [['grid', 'ink', 'is', 'a', 'x', 'on', 'serif', 'serif', 'on', 'x', 'x', 'a'], 20, 5], ['grid ink is a x on', 'serif serif on x x a']), ('partial-repair probe', [['kerning', 'on', 'kerning'], 17, 7], ['kerning on', 'kerning']), ('partial-repair probe', [['of', 'on', 'ink', 'kerning', 'serif', 'x', 'grid', 'baseline'], 20, 8], ['of on ink kerning', 'serif x grid', 'baseline']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['kerning', 'type', 'baseline', 'on', 'type', 'a', 'is'], 16, 7], ['kerning type', 'baseline on', 'type a is']), ('control layout', [['serif', 'serif', 'grid', 'measure'], 7, 7], ['serif', 'serif', 'grid', 'measure'])], [('regression: greedy fill boundary', [['grid', 'grid', 'measure', 'on', 'serif', 'serif', 'grid', 'the', 'grid', 'is', 'type'], 12, 8], ['grid grid', 'measure on', 'serif serif', 'grid the', 'grid is type']), ('regression: greedy fill boundary', [['type', 'baseline', 'x', 'grid', 'type', 'grid'], 13, 7], ['type baseline', 'x grid', 'type grid']), ('partial-repair probe', [['grid', 'the', 'ink', 'measure', 'x', 'serif', 'kerning', 'type', 'measure', 'measure', 'on'], 19, 9], ['grid the ink', 'measure x serif', 'kerning type', 'measure measure on']), ('partial-repair probe', [['serif', 'of', 'of', 'serif', 'kerning', 'is', 'grid'], 6, 9], ['serif', 'of of', 'serif', 'kerning', 'is', 'grid']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['the', 'ink', 'kerning', 'of', 'at'], 8, 6], ['the ink', 'kerning', 'of at']), ('control layout', [['baseline', 'x', 'grid'], 7, 3], ['baseline', 'x grid'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"9196d3b1e3cb286327b2e37788c9664e18bada74fc78d96a5add8e96a99c352c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, min_last = x\n    lines = []\n    cur = ''\n    for w in words:\n        cand = w if not cur else cur + ' ' + w\n        if len(cand) < width or not cur:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = w\n    lines.append(cur)\n    while len(lines) >= 2 and len(lines[-1]) < min_last:\n        prev = lines[-2].split(' ')\n        if len(prev) < 2:\n            break\n        moved = prev[-1] + ' ' + lines[-1]\n        if len(moved) > width:\n            break\n        lines[-2] = ' '.join(prev[:-1])\n        lines[-1] = moved\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('regression: greedy fill boundary', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink']), ('regression: greedy fill boundary', [['baseline', 'type', 'is', 'serif', 'on', 'at', 'baseline'], 7, 3], ['baseline', 'type is', 'serif', 'on at', 'baseline']), ('partial-repair probe', [['a', 'is', 'grid', 'at', 'the', 'kerning', 'kerning', 'type', 'measure', 'ink', 'on'], 18, 5], ['a is grid at the', 'kerning kerning', 'type measure', 'ink on']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['a', 'x', 'is'], 15, 7], ['a x is']), ('control layout', [['grid', 'serif', 'at', 'measure'], 15, 3], ['grid serif at', 'measure']), ('control layout', [['serif', 'the', 'is', 'is', 'of', 'grid', 'at', 'is', 'a'], 10, 7], ['serif the', 'is is of', 'grid', 'at is a'])], [('regression: greedy fill boundary', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: greedy fill boundary', [['baseline', 'is', 'grid', 'x', 'x', 'the', 'a', 'is', 'grid', 'at', 'kerning'], 18, 8], ['baseline is grid x', 'x the a is grid', 'at kerning']), ('regression: greedy fill boundary', [['ink', 'the', 'is', 'ink', 'baseline', 'is', 'grid', 'grid', 'x'], 6, 5], ['ink', 'the is', 'ink', 'baseline', 'is', 'grid', 'grid x']), ('regression: greedy fill boundary', [['baseline', 'x', 'at', 'the', 'measure', 'serif', 'ink', 'grid', 'a', 'the', 'on', 'kerning'], 13, 3], ['baseline x at', 'the measure', 'serif ink', 'grid a the on', 'kerning']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['x', 'measure', 'ink', 'measure', 'is'], 14, 4], ['x measure ink', 'measure is']), ('control layout', [['the', 'measure', 'ink', 'the', 'type', 'x', 'is', 'x'], 9, 3], ['the', 'measure', 'ink the', 'type x', 'is x'])], [('regression: greedy fill boundary', [['measure', 'of', 'baseline', 'a', 'on', 'at', 'kerning', 'measure', 'serif', 'grid', 'baseline', 'is'], 13, 8], ['measure of', 'baseline a on', 'at kerning', 'measure serif', 'grid', 'baseline is']), ('regression: greedy fill boundary', [['a', 'baseline', 'the', 'a', 'type', 'kerning', 'is', 'serif', 'a', 'grid', 'the'], 6, 3], ['a', 'baseline', 'the a', 'type', 'kerning', 'is', 'serif', 'a grid', 'the']), ('regression: greedy fill boundary', [['grid', 'measure', 'kerning', 'kerning', 'is', 'the', 'grid', 'is', 'measure', 'is', 'serif'], 14, 5], ['grid measure', 'kerning', 'kerning is the', 'grid is', 'measure is', 'serif']), ('regression: greedy fill boundary', [['baseline', 'of', 'of', 'type', 'serif', 'at', 'measure', 'serif', 'x', 'type', 'ink'], 11, 3], ['baseline of', 'of type', 'serif at', 'measure', 'serif x', 'type ink']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['is', 'of', 'of', 'is', 'type', 'kerning', 'the'], 9, 5], ['is of of', 'is type', 'kerning', 'the']), ('control layout', [['serif', 'grid', 'at', 'ink'], 19, 3], ['serif grid at ink'])], [('regression: greedy fill boundary', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('regression: greedy fill boundary', [['grid', 'ink', 'is', 'a', 'x', 'on', 'serif', 'serif', 'on', 'x', 'x', 'a'], 20, 5], ['grid ink is a x on', 'serif serif on x x a']), ('partial-repair probe', [['kerning', 'on', 'kerning'], 17, 7], ['kerning on', 'kerning']), ('partial-repair probe', [['of', 'on', 'ink', 'kerning', 'serif', 'x', 'grid', 'baseline'], 20, 8], ['of on ink kerning', 'serif x grid', 'baseline']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['kerning', 'type', 'baseline', 'on', 'type', 'a', 'is'], 16, 7], ['kerning type', 'baseline on', 'type a is']), ('control layout', [['serif', 'serif', 'grid', 'measure'], 7, 7], ['serif', 'serif', 'grid', 'measure'])], [('regression: greedy fill boundary', [['grid', 'grid', 'measure', 'on', 'serif', 'serif', 'grid', 'the', 'grid', 'is', 'type'], 12, 8], ['grid grid', 'measure on', 'serif serif', 'grid the', 'grid is type']), ('regression: greedy fill boundary', [['type', 'baseline', 'x', 'grid', 'type', 'grid'], 13, 7], ['type baseline', 'x grid', 'type grid']), ('partial-repair probe', [['grid', 'the', 'ink', 'measure', 'x', 'serif', 'kerning', 'type', 'measure', 'measure', 'on'], 19, 9], ['grid the ink', 'measure x serif', 'kerning type', 'measure measure on']), ('partial-repair probe', [['serif', 'of', 'of', 'serif', 'kerning', 'is', 'grid'], 6, 9], ['serif', 'of of', 'serif', 'kerning', 'is', 'grid']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['the', 'ink', 'kerning', 'of', 'at'], 8, 6], ['the ink', 'kerning', 'of at']), ('control layout', [['baseline', 'x', 'grid'], 7, 3], ['baseline', 'x grid'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"34175ea798b548e397ec893135915337064d0de10ac82ad341a12be8454fca21","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width, min_last = x\n    lines = []\n    cur = ''\n    for w in words:\n        cand = w if not cur else cur + ' ' + w\n        if len(cand) <= width or not cur:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = w\n    lines.append(cur)\n    while len(lines) >= 2 and len(lines[-1]) < min_last:\n        prev = lines[-2].split(' ')\n        if len(prev) < 2:\n            break\n        moved = prev[-1] + ' ' + lines[-1]\n        if len(moved) > width:\n            break\n        lines[-2] = ' '.join(prev[:-1])\n        lines[-1] = moved\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('regression: greedy fill boundary', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink']), ('regression: greedy fill boundary', [['baseline', 'type', 'is', 'serif', 'on', 'at', 'baseline'], 7, 3], ['baseline', 'type is', 'serif', 'on at', 'baseline']), ('partial-repair probe', [['a', 'is', 'grid', 'at', 'the', 'kerning', 'kerning', 'type', 'measure', 'ink', 'on'], 18, 5], ['a is grid at the', 'kerning kerning', 'type measure', 'ink on']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['a', 'x', 'is'], 15, 7], ['a x is']), ('control layout', [['grid', 'serif', 'at', 'measure'], 15, 3], ['grid serif at', 'measure']), ('control layout', [['serif', 'the', 'is', 'is', 'of', 'grid', 'at', 'is', 'a'], 10, 7], ['serif the', 'is is of', 'grid', 'at is a'])], [('regression: greedy fill boundary', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: greedy fill boundary', [['baseline', 'is', 'grid', 'x', 'x', 'the', 'a', 'is', 'grid', 'at', 'kerning'], 18, 8], ['baseline is grid x', 'x the a is grid', 'at kerning']), ('regression: greedy fill boundary', [['ink', 'the', 'is', 'ink', 'baseline', 'is', 'grid', 'grid', 'x'], 6, 5], ['ink', 'the is', 'ink', 'baseline', 'is', 'grid', 'grid x']), ('regression: greedy fill boundary', [['baseline', 'x', 'at', 'the', 'measure', 'serif', 'ink', 'grid', 'a', 'the', 'on', 'kerning'], 13, 3], ['baseline x at', 'the measure', 'serif ink', 'grid a the on', 'kerning']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['x', 'measure', 'ink', 'measure', 'is'], 14, 4], ['x measure ink', 'measure is']), ('control layout', [['the', 'measure', 'ink', 'the', 'type', 'x', 'is', 'x'], 9, 3], ['the', 'measure', 'ink the', 'type x', 'is x'])], [('regression: greedy fill boundary', [['measure', 'of', 'baseline', 'a', 'on', 'at', 'kerning', 'measure', 'serif', 'grid', 'baseline', 'is'], 13, 8], ['measure of', 'baseline a on', 'at kerning', 'measure serif', 'grid', 'baseline is']), ('regression: greedy fill boundary', [['a', 'baseline', 'the', 'a', 'type', 'kerning', 'is', 'serif', 'a', 'grid', 'the'], 6, 3], ['a', 'baseline', 'the a', 'type', 'kerning', 'is', 'serif', 'a grid', 'the']), ('regression: greedy fill boundary', [['grid', 'measure', 'kerning', 'kerning', 'is', 'the', 'grid', 'is', 'measure', 'is', 'serif'], 14, 5], ['grid measure', 'kerning', 'kerning is the', 'grid is', 'measure is', 'serif']), ('regression: greedy fill boundary', [['baseline', 'of', 'of', 'type', 'serif', 'at', 'measure', 'serif', 'x', 'type', 'ink'], 11, 3], ['baseline of', 'of type', 'serif at', 'measure', 'serif x', 'type ink']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['is', 'of', 'of', 'is', 'type', 'kerning', 'the'], 9, 5], ['is of of', 'is type', 'kerning', 'the']), ('control layout', [['serif', 'grid', 'at', 'ink'], 19, 3], ['serif grid at ink'])], [('regression: greedy fill boundary', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('regression: greedy fill boundary', [['grid', 'ink', 'is', 'a', 'x', 'on', 'serif', 'serif', 'on', 'x', 'x', 'a'], 20, 5], ['grid ink is a x on', 'serif serif on x x a']), ('partial-repair probe', [['kerning', 'on', 'kerning'], 17, 7], ['kerning on', 'kerning']), ('partial-repair probe', [['of', 'on', 'ink', 'kerning', 'serif', 'x', 'grid', 'baseline'], 20, 8], ['of on ink kerning', 'serif x grid', 'baseline']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['kerning', 'type', 'baseline', 'on', 'type', 'a', 'is'], 16, 7], ['kerning type', 'baseline on', 'type a is']), ('control layout', [['serif', 'serif', 'grid', 'measure'], 7, 7], ['serif', 'serif', 'grid', 'measure'])], [('regression: greedy fill boundary', [['grid', 'grid', 'measure', 'on', 'serif', 'serif', 'grid', 'the', 'grid', 'is', 'type'], 12, 8], ['grid grid', 'measure on', 'serif serif', 'grid the', 'grid is type']), ('regression: greedy fill boundary', [['type', 'baseline', 'x', 'grid', 'type', 'grid'], 13, 7], ['type baseline', 'x grid', 'type grid']), ('partial-repair probe', [['grid', 'the', 'ink', 'measure', 'x', 'serif', 'kerning', 'type', 'measure', 'measure', 'on'], 19, 9], ['grid the ink', 'measure x serif', 'kerning type', 'measure measure on']), ('partial-repair probe', [['serif', 'of', 'of', 'serif', 'kerning', 'is', 'grid'], 6, 9], ['serif', 'of of', 'serif', 'kerning', 'is', 'grid']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('control layout', [['the', 'ink', 'kerning', 'of', 'at'], 8, 6], ['the ink', 'kerning', 'of at']), ('control layout', [['baseline', 'x', 'grid'], 7, 3], ['baseline', 'x grid'])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-typography-line-breaking-runt-last-line-greedy-fill-boundary","generated_at":"2026-09-29T14:49:50.986639+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.","repair":"Accept a candidate line equal to the width.","root_cause":"Greedy fill uses a strict comparison.","sha256":"73a04a1f9151282ab787999a56b391e510c91a7ad19a1cf0a94770d8bbbd9ff6","title":"Runt last-line prevention: greedy fill boundary · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.147,"exit_code":1,"observations":[{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["a the of measure","at type kerning","the ink"],"check":"regression: greedy fill boundary","expected":["a the of","measure at type","kerning the ink"],"passed":false},{"actual":["baseline","type is","serif on","at","baseline"],"check":"regression: greedy fill boundary","expected":["baseline","type is","serif","on at","baseline"],"passed":false},{"actual":["a is grid at the","kerning kerning","type measure ink on"],"check":"partial-repair probe","expected":["a is grid at the","kerning kerning","type measure","ink on"],"passed":false},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["a x is"],"check":"control layout","expected":["a x is"],"passed":true},{"actual":["grid serif at","measure"],"check":"control layout","expected":["grid serif at","measure"],"passed":true},{"actual":["serif the","is is of","grid","at is a"],"check":"control layout","expected":["serif the","is is of","grid","at is a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"passed\": true}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"a the of measure\", \"at type kerning\", \"the ink\"], \"expected\": [\"a the of\", \"measure at type\", \"kerning the ink\"], \"passed\": false}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"baseline\", \"type is\", \"serif on\", \"at\", \"baseline\"], \"expected\": [\"baseline\", \"type is\", \"serif\", \"on at\", \"baseline\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"a is grid at the\", \"kerning kerning\", \"type measure ink on\"], \"expected\": [\"a is grid at the\", \"kerning kerning\", \"type measure\", \"ink on\"], \"passed\": false}, {\"check\": \"one-word runt pulled down\", \"actual\": [\"the type\", \"grid is a\"], \"expected\": [\"the type\", \"grid is a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"a x is\"], \"expected\": [\"a x is\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"grid serif at\", \"measure\"], \"expected\": [\"grid serif at\", \"measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"expected\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.408,"exit_code":1,"observations":[{"actual":["kerning","baseline","x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":false},{"actual":["a the of","measure at","type kerning","the ink"],"check":"regression: greedy fill boundary","expected":["a the of","measure at type","kerning the ink"],"passed":false},{"actual":["baseline","type","is","serif","on at","baseline"],"check":"regression: greedy fill boundary","expected":["baseline","type is","serif","on at","baseline"],"passed":false},{"actual":["a is grid at the","kerning kerning","type measure","ink on"],"check":"partial-repair probe","expected":["a is grid at the","kerning kerning","type measure","ink on"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["a x is"],"check":"control layout","expected":["a x is"],"passed":true},{"actual":["grid serif at","measure"],"check":"control layout","expected":["grid serif at","measure"],"passed":true},{"actual":["serif the","is is of","grid","at is a"],"check":"control layout","expected":["serif the","is is of","grid","at is a"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline\", \"x\"], \"expected\": [\"kerning\", \"baseline x\"], \"passed\": false}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"a the of\", \"measure at\", \"type kerning\", \"the ink\"], \"expected\": [\"a the of\", \"measure at type\", \"kerning the ink\"], \"passed\": false}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"baseline\", \"type\", \"is\", \"serif\", \"on at\", \"baseline\"], \"expected\": [\"baseline\", \"type is\", \"serif\", \"on at\", \"baseline\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"a is grid at the\", \"kerning kerning\", \"type measure\", \"ink on\"], \"expected\": [\"a is grid at the\", \"kerning kerning\", \"type measure\", \"ink on\"], \"passed\": true}, {\"check\": \"one-word runt pulled down\", \"actual\": [\"the type\", \"grid is a\"], \"expected\": [\"the type\", \"grid is a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"a x is\"], \"expected\": [\"a x is\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"grid serif at\", \"measure\"], \"expected\": [\"grid serif at\", \"measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"expected\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.335,"exit_code":0,"observations":[{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["a the of","measure at type","kerning the ink"],"check":"regression: greedy fill boundary","expected":["a the of","measure at type","kerning the ink"],"passed":true},{"actual":["baseline","type is","serif","on at","baseline"],"check":"regression: greedy fill boundary","expected":["baseline","type is","serif","on at","baseline"],"passed":true},{"actual":["a is grid at the","kerning kerning","type measure","ink on"],"check":"partial-repair probe","expected":["a is grid at the","kerning kerning","type measure","ink on"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["a x is"],"check":"control layout","expected":["a x is"],"passed":true},{"actual":["grid serif at","measure"],"check":"control layout","expected":["grid serif at","measure"],"passed":true},{"actual":["serif the","is is of","grid","at is a"],"check":"control layout","expected":["serif the","is is of","grid","at is a"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"passed\": true}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"a the of\", \"measure at type\", \"kerning the ink\"], \"expected\": [\"a the of\", \"measure at type\", \"kerning the ink\"], \"passed\": true}, {\"check\": \"regression: greedy fill boundary\", \"actual\": [\"baseline\", \"type is\", \"serif\", \"on at\", \"baseline\"], \"expected\": [\"baseline\", \"type is\", \"serif\", \"on at\", \"baseline\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"a is grid at the\", \"kerning kerning\", \"type measure\", \"ink on\"], \"expected\": [\"a is grid at the\", \"kerning kerning\", \"type measure\", \"ink on\"], \"passed\": true}, {\"check\": \"one-word runt pulled down\", \"actual\": [\"the type\", \"grid is a\"], \"expected\": [\"the type\", \"grid is a\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"a x is\"], \"expected\": [\"a x is\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"grid serif at\", \"measure\"], \"expected\": [\"grid serif at\", \"measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"expected\": [\"serif the\", \"is is of\", \"grid\", \"at is a\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}