{"abstract":"Short last lines with several short words are left as runts.","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":"Ignoring spaces undercounts multi-word lines.","family":"w2-typography-line-breaking-runt-last-line-runt-measure-unit","id":"FA-80141","implementations":{"attempt":{"sha256":"c1e58cd8f769bc5d075f33ab3dc64f98bc0caf54e8f448f7930d1c9a52993b38","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].replace(' ', '')) < 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 = [[('regression: runt measure unit', [['grid', 'the', 'grid', 'baseline', 'serif'], 20, 8], ['grid the grid', 'baseline serif']), ('regression: runt measure unit', [['type', 'the', 'baseline', 'a', 'grid', 'x', 'ink', 'of'], 20, 9], ['type the baseline a', 'grid x ink of']), ('regression: runt measure unit', [['kerning', 'grid', 'of', 'is', 'serif', 'the', 'serif', 'ink', 'serif', 'type', 'a', 'the'], 17, 9], ['kerning grid of', 'is serif the', 'serif ink serif', 'type a the']), ('regression: runt measure unit', [['baseline', 'type', 'is', 'of', 'serif', 'x', 'grid', 'on', 'x'], 14, 8], ['baseline type', 'is of serif x', 'grid on x']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('control layout', [['kerning', 'grid', 'a', 'kerning', 'serif', 'is', 'the', 'kerning', 'baseline', 'serif'], 7, 4], ['kerning', 'grid a', 'kerning', 'serif', 'is the', 'kerning', 'baseline', 'serif'])], [('regression: runt measure unit', [['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']), ('regression: runt measure unit', [['x', 'x', 'measure', 'baseline', 'of', 'on', 'on', 'serif', 'serif', 'type', 'type'], 15, 9], ['x x measure', 'baseline of on', 'on serif serif', 'type type']), ('regression: runt measure unit', [['serif', 'baseline', 'x', 'ink', 'at', 'on', 'on', 'a', 'at'], 16, 4], ['serif baseline x', 'ink at on on', 'a at']), ('regression: runt measure unit', [['kerning', 'at', 'at', 'is', 'is'], 15, 8], ['kerning at', 'at is is']), ('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', [['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x', 'is'], 5, 9], ['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x is']), ('control layout', [['x', 'a', 'baseline', 'is', 'measure'], 10, 8], ['x a', 'baseline', 'is measure'])], [('regression: runt measure unit', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: runt measure unit', [['measure', 'x', 'x', 'the', 'a', 'the', 'at', 'baseline', 'ink', 'is', 'grid', 'measure'], 20, 9], ['measure x x the a', 'the at baseline ink', 'is grid measure']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('regression: runt measure unit', [['the', 'a', 'ink', 'on', 'at'], 11, 5], ['the a ink', 'on at']), ('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', [['on', 'is', 'type', 'grid', 'ink', 'at', 'the', 'is', 'type'], 6, 6], ['on is', 'type', 'grid', 'ink at', 'the is', 'type']), ('control layout', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink'])], [('regression: runt measure unit', [['at', 'measure', 'kerning', 'of', 'is', 'type'], 17, 3], ['at measure', 'kerning of is', 'type']), ('regression: runt measure unit', [['at', 'of', 'measure', 'x', 'of', 'on', 'grid', 'of', 'x', 'is', 'serif'], 10, 8], ['at of', 'measure x', 'of on grid', 'of x', 'is serif']), ('regression: runt measure unit', [['the', 'is', 'grid', 'at', 'at', 'a', 'is'], 18, 7], ['the is grid at', 'at a is']), ('regression: runt measure unit', [['a', 'kerning', 'serif', 'is', 'a'], 16, 4], ['a kerning serif', 'is a']), ('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', [['baseline', 'serif', 'is', 'baseline', 'x', 'x', 'at', 'is', 'serif', 'at', 'at'], 6, 9], ['baseline', 'serif', 'is', 'baseline', 'x x at', 'is', 'serif', 'at at']), ('control layout', [['of', 'the', 'kerning'], 6, 4], ['of the', 'kerning'])], [('regression: runt measure unit', [['grid', 'kerning', 'ink', 'baseline', 'at', 'type', 'grid', 'of', 'baseline', 'type', 'ink'], 18, 7], ['grid kerning ink', 'baseline at type', 'grid of baseline', 'type ink']), ('regression: runt measure unit', [['ink', 'the', 'kerning', 'x', 'kerning'], 18, 7], ['ink the kerning x', 'kerning']), ('regression: runt measure unit', [['a', 'serif', 'grid', 'ink', 'measure', 'the', 'type', 'type', 'at', 'a', 'of'], 13, 7], ['a serif grid', 'ink measure', 'the type type', 'at a of']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['the', 'on', 'is', 'at', 'baseline', 'the', 'a', 'at', 'ink', 'type'], 9, 5], ['the on is', 'at', 'baseline', 'the a at', 'ink type']), ('control layout', [['on', 'serif', 'on'], 7, 6], ['on', 'serif', 'on'])]]\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":"6dd284329a6acd99c4ae3cc2e229c325c68d8dca2440f10269f296e41a992376","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].split(' ')) < 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 = [[('regression: runt measure unit', [['grid', 'the', 'grid', 'baseline', 'serif'], 20, 8], ['grid the grid', 'baseline serif']), ('regression: runt measure unit', [['type', 'the', 'baseline', 'a', 'grid', 'x', 'ink', 'of'], 20, 9], ['type the baseline a', 'grid x ink of']), ('regression: runt measure unit', [['kerning', 'grid', 'of', 'is', 'serif', 'the', 'serif', 'ink', 'serif', 'type', 'a', 'the'], 17, 9], ['kerning grid of', 'is serif the', 'serif ink serif', 'type a the']), ('regression: runt measure unit', [['baseline', 'type', 'is', 'of', 'serif', 'x', 'grid', 'on', 'x'], 14, 8], ['baseline type', 'is of serif x', 'grid on x']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('control layout', [['kerning', 'grid', 'a', 'kerning', 'serif', 'is', 'the', 'kerning', 'baseline', 'serif'], 7, 4], ['kerning', 'grid a', 'kerning', 'serif', 'is the', 'kerning', 'baseline', 'serif'])], [('regression: runt measure unit', [['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']), ('regression: runt measure unit', [['x', 'x', 'measure', 'baseline', 'of', 'on', 'on', 'serif', 'serif', 'type', 'type'], 15, 9], ['x x measure', 'baseline of on', 'on serif serif', 'type type']), ('regression: runt measure unit', [['serif', 'baseline', 'x', 'ink', 'at', 'on', 'on', 'a', 'at'], 16, 4], ['serif baseline x', 'ink at on on', 'a at']), ('regression: runt measure unit', [['kerning', 'at', 'at', 'is', 'is'], 15, 8], ['kerning at', 'at is is']), ('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', [['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x', 'is'], 5, 9], ['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x is']), ('control layout', [['x', 'a', 'baseline', 'is', 'measure'], 10, 8], ['x a', 'baseline', 'is measure'])], [('regression: runt measure unit', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: runt measure unit', [['measure', 'x', 'x', 'the', 'a', 'the', 'at', 'baseline', 'ink', 'is', 'grid', 'measure'], 20, 9], ['measure x x the a', 'the at baseline ink', 'is grid measure']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('regression: runt measure unit', [['the', 'a', 'ink', 'on', 'at'], 11, 5], ['the a ink', 'on at']), ('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', [['on', 'is', 'type', 'grid', 'ink', 'at', 'the', 'is', 'type'], 6, 6], ['on is', 'type', 'grid', 'ink at', 'the is', 'type']), ('control layout', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink'])], [('regression: runt measure unit', [['at', 'measure', 'kerning', 'of', 'is', 'type'], 17, 3], ['at measure', 'kerning of is', 'type']), ('regression: runt measure unit', [['at', 'of', 'measure', 'x', 'of', 'on', 'grid', 'of', 'x', 'is', 'serif'], 10, 8], ['at of', 'measure x', 'of on grid', 'of x', 'is serif']), ('regression: runt measure unit', [['the', 'is', 'grid', 'at', 'at', 'a', 'is'], 18, 7], ['the is grid at', 'at a is']), ('regression: runt measure unit', [['a', 'kerning', 'serif', 'is', 'a'], 16, 4], ['a kerning serif', 'is a']), ('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', [['baseline', 'serif', 'is', 'baseline', 'x', 'x', 'at', 'is', 'serif', 'at', 'at'], 6, 9], ['baseline', 'serif', 'is', 'baseline', 'x x at', 'is', 'serif', 'at at']), ('control layout', [['of', 'the', 'kerning'], 6, 4], ['of the', 'kerning'])], [('regression: runt measure unit', [['grid', 'kerning', 'ink', 'baseline', 'at', 'type', 'grid', 'of', 'baseline', 'type', 'ink'], 18, 7], ['grid kerning ink', 'baseline at type', 'grid of baseline', 'type ink']), ('regression: runt measure unit', [['ink', 'the', 'kerning', 'x', 'kerning'], 18, 7], ['ink the kerning x', 'kerning']), ('regression: runt measure unit', [['a', 'serif', 'grid', 'ink', 'measure', 'the', 'type', 'type', 'at', 'a', 'of'], 13, 7], ['a serif grid', 'ink measure', 'the type type', 'at a of']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['the', 'on', 'is', 'at', 'baseline', 'the', 'a', 'at', 'ink', 'type'], 9, 5], ['the on is', 'at', 'baseline', 'the a at', 'ink type']), ('control layout', [['on', 'serif', 'on'], 7, 6], ['on', 'serif', 'on'])]]\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":"4bdfa2e83c4ff9d5e9072ca847623f27045bb86f2ad1b1366530e871d61f4c35","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 = [[('regression: runt measure unit', [['grid', 'the', 'grid', 'baseline', 'serif'], 20, 8], ['grid the grid', 'baseline serif']), ('regression: runt measure unit', [['type', 'the', 'baseline', 'a', 'grid', 'x', 'ink', 'of'], 20, 9], ['type the baseline a', 'grid x ink of']), ('regression: runt measure unit', [['kerning', 'grid', 'of', 'is', 'serif', 'the', 'serif', 'ink', 'serif', 'type', 'a', 'the'], 17, 9], ['kerning grid of', 'is serif the', 'serif ink serif', 'type a the']), ('regression: runt measure unit', [['baseline', 'type', 'is', 'of', 'serif', 'x', 'grid', 'on', 'x'], 14, 8], ['baseline type', 'is of serif x', 'grid on x']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['ink', 'on', 'kerning', 'ink', 'is', 'measure'], 14, 7], ['ink on kerning', 'ink is measure']), ('control layout', [['kerning', 'grid', 'a', 'kerning', 'serif', 'is', 'the', 'kerning', 'baseline', 'serif'], 7, 4], ['kerning', 'grid a', 'kerning', 'serif', 'is the', 'kerning', 'baseline', 'serif'])], [('regression: runt measure unit', [['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']), ('regression: runt measure unit', [['x', 'x', 'measure', 'baseline', 'of', 'on', 'on', 'serif', 'serif', 'type', 'type'], 15, 9], ['x x measure', 'baseline of on', 'on serif serif', 'type type']), ('regression: runt measure unit', [['serif', 'baseline', 'x', 'ink', 'at', 'on', 'on', 'a', 'at'], 16, 4], ['serif baseline x', 'ink at on on', 'a at']), ('regression: runt measure unit', [['kerning', 'at', 'at', 'is', 'is'], 15, 8], ['kerning at', 'at is is']), ('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', [['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x', 'is'], 5, 9], ['serif', 'of', 'ink', 'grid', 'the', 'kerning', 'is', 'type', 'x is']), ('control layout', [['x', 'a', 'baseline', 'is', 'measure'], 10, 8], ['x a', 'baseline', 'is measure'])], [('regression: runt measure unit', [['is', 'the', 'serif', 'grid', 'serif', 'of', 'serif'], 13, 3], ['is the serif', 'grid serif of', 'serif']), ('regression: runt measure unit', [['measure', 'x', 'x', 'the', 'a', 'the', 'at', 'baseline', 'ink', 'is', 'grid', 'measure'], 20, 9], ['measure x x the a', 'the at baseline ink', 'is grid measure']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('regression: runt measure unit', [['the', 'a', 'ink', 'on', 'at'], 11, 5], ['the a ink', 'on at']), ('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', [['on', 'is', 'type', 'grid', 'ink', 'at', 'the', 'is', 'type'], 6, 6], ['on is', 'type', 'grid', 'ink at', 'the is', 'type']), ('control layout', [['a', 'the', 'of', 'measure', 'at', 'type', 'kerning', 'the', 'ink'], 15, 7], ['a the of', 'measure at type', 'kerning the ink'])], [('regression: runt measure unit', [['at', 'measure', 'kerning', 'of', 'is', 'type'], 17, 3], ['at measure', 'kerning of is', 'type']), ('regression: runt measure unit', [['at', 'of', 'measure', 'x', 'of', 'on', 'grid', 'of', 'x', 'is', 'serif'], 10, 8], ['at of', 'measure x', 'of on grid', 'of x', 'is serif']), ('regression: runt measure unit', [['the', 'is', 'grid', 'at', 'at', 'a', 'is'], 18, 7], ['the is grid at', 'at a is']), ('regression: runt measure unit', [['a', 'kerning', 'serif', 'is', 'a'], 16, 4], ['a kerning serif', 'is a']), ('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', [['baseline', 'serif', 'is', 'baseline', 'x', 'x', 'at', 'is', 'serif', 'at', 'at'], 6, 9], ['baseline', 'serif', 'is', 'baseline', 'x x at', 'is', 'serif', 'at at']), ('control layout', [['of', 'the', 'kerning'], 6, 4], ['of the', 'kerning'])], [('regression: runt measure unit', [['grid', 'kerning', 'ink', 'baseline', 'at', 'type', 'grid', 'of', 'baseline', 'type', 'ink'], 18, 7], ['grid kerning ink', 'baseline at type', 'grid of baseline', 'type ink']), ('regression: runt measure unit', [['ink', 'the', 'kerning', 'x', 'kerning'], 18, 7], ['ink the kerning x', 'kerning']), ('regression: runt measure unit', [['a', 'serif', 'grid', 'ink', 'measure', 'the', 'type', 'type', 'at', 'a', 'of'], 13, 7], ['a serif grid', 'ink measure', 'the type type', 'at a of']), ('regression: runt measure unit', [['at', 'measure', 'grid', 'serif', 'on', 'is', 'measure', 'at', 'at', 'at', 'the'], 15, 9], ['at measure grid', 'serif on is', 'measure at', 'at at the']), ('runt limited by width', [['kerning', 'baseline', 'x'], 10, 4], ['kerning', 'baseline x']), ('one-word runt pulled down', [['the', 'type', 'grid', 'is', 'a'], 12, 5], ['the type', 'grid is a']), ('control layout', [['the', 'on', 'is', 'at', 'baseline', 'the', 'a', 'at', 'ink', 'type'], 9, 5], ['the on is', 'at', 'baseline', 'the a at', 'ink type']), ('control layout', [['on', 'serif', 'on'], 7, 6], ['on', 'serif', 'on'])]]\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-runt-measure-unit","generated_at":"2026-09-29T14:49:50.979619+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":"Measure the last line in characters including spaces.","root_cause":"The runt test counts words instead of characters.","sha256":"075490bec347a375276d7911d785fc9923dcca59b0211c8f496ee6d59eb0fe4d","title":"Runt last-line prevention: runt measure unit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.988,"exit_code":1,"observations":[{"actual":["grid the grid","baseline serif"],"check":"regression: runt measure unit","expected":["grid the grid","baseline serif"],"passed":true},{"actual":["type the baseline a","grid x ink of"],"check":"regression: runt measure unit","expected":["type the baseline a","grid x ink of"],"passed":true},{"actual":["kerning grid of","is serif the","serif ink","serif type a the"],"check":"regression: runt measure unit","expected":["kerning grid of","is serif the","serif ink serif","type a the"],"passed":false},{"actual":["baseline type","is of serif","x grid on x"],"check":"regression: runt measure unit","expected":["baseline type","is of serif x","grid on x"],"passed":false},{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["ink on kerning","ink is measure"],"check":"control layout","expected":["ink on kerning","ink is measure"],"passed":true},{"actual":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"check":"control layout","expected":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: runt measure unit\", \"actual\": [\"grid the grid\", \"baseline serif\"], \"expected\": [\"grid the grid\", \"baseline serif\"], \"passed\": true}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"type the baseline a\", \"grid x ink of\"], \"expected\": [\"type the baseline a\", \"grid x ink of\"], \"passed\": true}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"kerning grid of\", \"is serif the\", \"serif ink\", \"serif type a the\"], \"expected\": [\"kerning grid of\", \"is serif the\", \"serif ink serif\", \"type a the\"], \"passed\": false}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"baseline type\", \"is of serif\", \"x grid on x\"], \"expected\": [\"baseline type\", \"is of serif x\", \"grid on x\"], \"passed\": false}, {\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"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\": [\"ink on kerning\", \"ink is measure\"], \"expected\": [\"ink on kerning\", \"ink is measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"expected\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.978,"exit_code":1,"observations":[{"actual":["grid the","grid baseline serif"],"check":"regression: runt measure unit","expected":["grid the grid","baseline serif"],"passed":false},{"actual":["type the baseline","a grid x ink of"],"check":"regression: runt measure unit","expected":["type the baseline a","grid x ink of"],"passed":false},{"actual":["kerning grid of","is serif the","serif ink","serif type a the"],"check":"regression: runt measure unit","expected":["kerning grid of","is serif the","serif ink serif","type a the"],"passed":false},{"actual":["baseline type","is of serif","x grid on x"],"check":"regression: runt measure unit","expected":["baseline type","is of serif x","grid on x"],"passed":false},{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["ink on kerning","ink is measure"],"check":"control layout","expected":["ink on kerning","ink is measure"],"passed":true},{"actual":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"check":"control layout","expected":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: runt measure unit\", \"actual\": [\"grid the\", \"grid baseline serif\"], \"expected\": [\"grid the grid\", \"baseline serif\"], \"passed\": false}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"type the baseline\", \"a grid x ink of\"], \"expected\": [\"type the baseline a\", \"grid x ink of\"], \"passed\": false}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"kerning grid of\", \"is serif the\", \"serif ink\", \"serif type a the\"], \"expected\": [\"kerning grid of\", \"is serif the\", \"serif ink serif\", \"type a the\"], \"passed\": false}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"baseline type\", \"is of serif\", \"x grid on x\"], \"expected\": [\"baseline type\", \"is of serif x\", \"grid on x\"], \"passed\": false}, {\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"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\": [\"ink on kerning\", \"ink is measure\"], \"expected\": [\"ink on kerning\", \"ink is measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"expected\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.864,"exit_code":0,"observations":[{"actual":["grid the grid","baseline serif"],"check":"regression: runt measure unit","expected":["grid the grid","baseline serif"],"passed":true},{"actual":["type the baseline a","grid x ink of"],"check":"regression: runt measure unit","expected":["type the baseline a","grid x ink of"],"passed":true},{"actual":["kerning grid of","is serif the","serif ink serif","type a the"],"check":"regression: runt measure unit","expected":["kerning grid of","is serif the","serif ink serif","type a the"],"passed":true},{"actual":["baseline type","is of serif x","grid on x"],"check":"regression: runt measure unit","expected":["baseline type","is of serif x","grid on x"],"passed":true},{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["ink on kerning","ink is measure"],"check":"control layout","expected":["ink on kerning","ink is measure"],"passed":true},{"actual":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"check":"control layout","expected":["kerning","grid a","kerning","serif","is the","kerning","baseline","serif"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: runt measure unit\", \"actual\": [\"grid the grid\", \"baseline serif\"], \"expected\": [\"grid the grid\", \"baseline serif\"], \"passed\": true}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"type the baseline a\", \"grid x ink of\"], \"expected\": [\"type the baseline a\", \"grid x ink of\"], \"passed\": true}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"kerning grid of\", \"is serif the\", \"serif ink serif\", \"type a the\"], \"expected\": [\"kerning grid of\", \"is serif the\", \"serif ink serif\", \"type a the\"], \"passed\": true}, {\"check\": \"regression: runt measure unit\", \"actual\": [\"baseline type\", \"is of serif x\", \"grid on x\"], \"expected\": [\"baseline type\", \"is of serif x\", \"grid on x\"], \"passed\": true}, {\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"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\": [\"ink on kerning\", \"ink is measure\"], \"expected\": [\"ink on kerning\", \"ink is measure\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"expected\": [\"kerning\", \"grid a\", \"kerning\", \"serif\", \"is the\", \"kerning\", \"baseline\", \"serif\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}