{"abstract":"Overwide words are attached to the current line or leave empty lines.","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.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-runt-last-line","failed_approach":"Special-casing only the first word still merges later overwide words.","family":"w2-typography-line-breaking-runt-last-line-overwide-word-isolation","id":"FA-80151","implementations":{"attempt":{"sha256":"09a54d9d37a4e5ce15044c3740b0df134e68368b0790e133b7baec9f615e0354","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 lines:\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: overwide word isolation', [['on', 'ink', 'x', 'at', 'a', 'kerning', 'serif', 'measure', 'at', 'baseline'], 7, 3], ['on ink', 'x at a', 'kerning', 'serif', 'measure', 'at', 'baseline']), ('regression: overwide word isolation', [['on', 'of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure'], 5, 4], ['on of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure']), ('partial-repair probe', [['a', 'ink', 'measure', 'serif', 'baseline'], 14, 5], ['a ink measure', 'serif baseline']), ('partial-repair probe', [['baseline', 'on', 'grid', 'kerning', 'a', 'ink', 'baseline', 'measure', 'a'], 10, 3], ['baseline', 'on grid', 'kerning a', 'ink', 'baseline', 'measure 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', [['a', 'x', 'grid'], 13, 9], ['a x grid']), ('control layout', [['serif', 'a', 'the'], 17, 4], ['serif a the'])], [('regression: overwide word isolation', [['serif', 'baseline', 'grid', 'of', 'is', 'kerning'], 5, 8], ['serif', 'baseline', 'grid', 'of is', 'kerning']), ('regression: overwide word isolation', [['a', 'baseline', 'the', 'a', 'type', 'kerning', 'is', 'serif', 'a', 'grid', 'the'], 6, 3], ['a', 'baseline', 'the a', 'type', 'kerning', 'is', 'serif', 'a grid', 'the']), ('partial-repair probe', [['on', 'ink', 'type', 'a'], 12, 4], ['on ink', 'type a']), ('regression: overwide word isolation', [['baseline', 'a', 'a', 'is', 'a', 'type', 'on', 'baseline', 'serif', 'baseline', 'serif'], 7, 8], ['baseline', 'a a is', 'a type', 'on', 'baseline', 'serif', 'baseline', 'serif']), ('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', 'at'], 17, 3], ['on is at']), ('control layout', [['x', 'on', 'serif'], 18, 4], ['x on serif'])], [('regression: overwide word isolation', [['kerning', 'grid', 'a', 'kerning', 'serif', 'is', 'the', 'kerning', 'baseline', 'serif'], 7, 4], ['kerning', 'grid a', 'kerning', 'serif', 'is the', 'kerning', 'baseline', 'serif']), ('regression: overwide word isolation', [['on', 'at', 'grid', 'measure', 'type', 'measure', 'on', 'x', 'at', 'a', 'baseline'], 7, 5], ['on at', 'grid', 'measure', 'type', 'measure', 'on x at', 'a', 'baseline']), ('partial-repair probe', [['grid', 'serif', 'at', 'measure'], 15, 3], ['grid serif at', 'measure']), ('partial-repair probe', [['ink', 'the', 'kerning', 'x', 'kerning'], 18, 7], ['ink the kerning x', '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', [['is', 'measure', 'at'], 19, 4], ['is measure at']), ('control layout', [['measure', 'on', 'x', 'ink'], 16, 7], ['measure on x ink'])], [('regression: overwide word isolation', [['the', 'serif', 'baseline', 'x', 'a', 'baseline', 'measure', 'ink', 'of', 'measure', 'the'], 6, 8], ['the', 'serif', 'baseline', 'x a', 'baseline', 'measure', 'ink of', 'measure', 'the']), ('regression: overwide word isolation', [['on', 'of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure'], 5, 4], ['on of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure']), ('partial-repair probe', [['at', 'a', 'on', 'grid', 'grid', 'measure', 'the', 'x', 'at', 'at', 'type'], 20, 8], ['at a on grid grid', 'measure the x', 'at at type']), ('regression: overwide word isolation', [['serif', 'of', 'at', 'the', 'measure', 'ink', 'ink', 'a', 'x'], 5, 8], ['serif', 'of at', 'the', 'measure', 'ink', 'ink', 'a x']), ('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', 'on', 'serif'], 18, 4], ['x on serif']), ('control layout', [['is', 'the', 'serif'], 12, 9], ['is the serif'])], [('regression: overwide word isolation', [['baseline', 'serif', 'is', 'baseline', 'x', 'x', 'at', 'is', 'serif', 'at', 'at'], 6, 9], ['baseline', 'serif', 'is', 'baseline', 'x x at', 'is', 'serif', 'at at']), ('regression: overwide word isolation', [['on', 'at', 'a', 'at', 'type', 'of', 'a', 'baseline', 'ink', 'ink', 'serif', 'baseline'], 5, 7], ['on at', 'a at', 'type', 'of a', 'baseline', 'ink', 'ink', 'serif', 'baseline']), ('partial-repair probe', [['of', 'at', 'ink', 'measure', 'at', 'the', 'measure', 'ink'], 11, 6], ['of at ink', 'measure at', 'the', 'measure ink']), ('partial-repair probe', [['ink', 'kerning', 'ink'], 8, 9], ['ink', 'kerning', 'ink']), ('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', [['type', 'the', 'a'], 18, 3], ['type the a']), ('control layout', [['a', 'is', 'serif'], 11, 3], ['a is serif'])]]\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":"a636b396cd6c5b50bf453463b240c6779fd9ea6f39c12d31f9167f3c0480d240","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 len(w) > width:\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: overwide word isolation', [['on', 'ink', 'x', 'at', 'a', 'kerning', 'serif', 'measure', 'at', 'baseline'], 7, 3], ['on ink', 'x at a', 'kerning', 'serif', 'measure', 'at', 'baseline']), ('regression: overwide word isolation', [['on', 'of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure'], 5, 4], ['on of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure']), ('partial-repair probe', [['a', 'ink', 'measure', 'serif', 'baseline'], 14, 5], ['a ink measure', 'serif baseline']), ('partial-repair probe', [['baseline', 'on', 'grid', 'kerning', 'a', 'ink', 'baseline', 'measure', 'a'], 10, 3], ['baseline', 'on grid', 'kerning a', 'ink', 'baseline', 'measure 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', [['a', 'x', 'grid'], 13, 9], ['a x grid']), ('control layout', [['serif', 'a', 'the'], 17, 4], ['serif a the'])], [('regression: overwide word isolation', [['serif', 'baseline', 'grid', 'of', 'is', 'kerning'], 5, 8], ['serif', 'baseline', 'grid', 'of is', 'kerning']), ('regression: overwide word isolation', [['a', 'baseline', 'the', 'a', 'type', 'kerning', 'is', 'serif', 'a', 'grid', 'the'], 6, 3], ['a', 'baseline', 'the a', 'type', 'kerning', 'is', 'serif', 'a grid', 'the']), ('partial-repair probe', [['on', 'ink', 'type', 'a'], 12, 4], ['on ink', 'type a']), ('regression: overwide word isolation', [['baseline', 'a', 'a', 'is', 'a', 'type', 'on', 'baseline', 'serif', 'baseline', 'serif'], 7, 8], ['baseline', 'a a is', 'a type', 'on', 'baseline', 'serif', 'baseline', 'serif']), ('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', 'at'], 17, 3], ['on is at']), ('control layout', [['x', 'on', 'serif'], 18, 4], ['x on serif'])], [('regression: overwide word isolation', [['kerning', 'grid', 'a', 'kerning', 'serif', 'is', 'the', 'kerning', 'baseline', 'serif'], 7, 4], ['kerning', 'grid a', 'kerning', 'serif', 'is the', 'kerning', 'baseline', 'serif']), ('regression: overwide word isolation', [['on', 'at', 'grid', 'measure', 'type', 'measure', 'on', 'x', 'at', 'a', 'baseline'], 7, 5], ['on at', 'grid', 'measure', 'type', 'measure', 'on x at', 'a', 'baseline']), ('partial-repair probe', [['grid', 'serif', 'at', 'measure'], 15, 3], ['grid serif at', 'measure']), ('partial-repair probe', [['ink', 'the', 'kerning', 'x', 'kerning'], 18, 7], ['ink the kerning x', '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', [['is', 'measure', 'at'], 19, 4], ['is measure at']), ('control layout', [['measure', 'on', 'x', 'ink'], 16, 7], ['measure on x ink'])], [('regression: overwide word isolation', [['the', 'serif', 'baseline', 'x', 'a', 'baseline', 'measure', 'ink', 'of', 'measure', 'the'], 6, 8], ['the', 'serif', 'baseline', 'x a', 'baseline', 'measure', 'ink of', 'measure', 'the']), ('regression: overwide word isolation', [['on', 'of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure'], 5, 4], ['on of', 'kerning', 'on', 'kerning', 'grid', 'baseline', 'grid', 'a', 'measure', 'at', 'measure']), ('partial-repair probe', [['at', 'a', 'on', 'grid', 'grid', 'measure', 'the', 'x', 'at', 'at', 'type'], 20, 8], ['at a on grid grid', 'measure the x', 'at at type']), ('regression: overwide word isolation', [['serif', 'of', 'at', 'the', 'measure', 'ink', 'ink', 'a', 'x'], 5, 8], ['serif', 'of at', 'the', 'measure', 'ink', 'ink', 'a x']), ('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', 'on', 'serif'], 18, 4], ['x on serif']), ('control layout', [['is', 'the', 'serif'], 12, 9], ['is the serif'])], [('regression: overwide word isolation', [['baseline', 'serif', 'is', 'baseline', 'x', 'x', 'at', 'is', 'serif', 'at', 'at'], 6, 9], ['baseline', 'serif', 'is', 'baseline', 'x x at', 'is', 'serif', 'at at']), ('regression: overwide word isolation', [['on', 'at', 'a', 'at', 'type', 'of', 'a', 'baseline', 'ink', 'ink', 'serif', 'baseline'], 5, 7], ['on at', 'a at', 'type', 'of a', 'baseline', 'ink', 'ink', 'serif', 'baseline']), ('partial-repair probe', [['of', 'at', 'ink', 'measure', 'at', 'the', 'measure', 'ink'], 11, 6], ['of at ink', 'measure at', 'the', 'measure ink']), ('partial-repair probe', [['ink', 'kerning', 'ink'], 8, 9], ['ink', 'kerning', 'ink']), ('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', [['type', 'the', 'a'], 18, 3], ['type the a']), ('control layout', [['a', 'is', 'serif'], 11, 3], ['a is serif'])]]\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-overwide-word-isolation","generated_at":"2026-09-29T14:49:51.156284+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.","root_cause":"Overwide words are appended to a non-empty line instead of starting their own.","sha256":"17b456ea38cdc8c3d6706b5e8e010cc90fb69610e1bef73441e15b5658150d16","title":"Runt last-line prevention: overwide word isolation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.406,"exit_code":1,"observations":[{"actual":["on ink x at a kerning serif measure at baseline"],"check":"regression: overwide word isolation","expected":["on ink","x at a","kerning","serif","measure","at","baseline"],"passed":false},{"actual":["on of kerning on kerning grid baseline grid a measure at measure"],"check":"regression: overwide word isolation","expected":["on of","kerning","on","kerning","grid","baseline","grid","a","measure","at","measure"],"passed":false},{"actual":["a ink measure serif baseline"],"check":"partial-repair probe","expected":["a ink measure","serif baseline"],"passed":false},{"actual":["baseline on grid kerning a ink baseline measure a"],"check":"partial-repair probe","expected":["baseline","on grid","kerning a","ink","baseline","measure a"],"passed":false},{"actual":["the type grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":false},{"actual":["kerning baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":false},{"actual":["a x grid"],"check":"control layout","expected":["a x grid"],"passed":true},{"actual":["serif a the"],"check":"control layout","expected":["serif a the"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: overwide word isolation\", \"actual\": [\"on ink x at a kerning serif measure at baseline\"], \"expected\": [\"on ink\", \"x at a\", \"kerning\", \"serif\", \"measure\", \"at\", \"baseline\"], \"passed\": false}, {\"check\": \"regression: overwide word isolation\", \"actual\": [\"on of kerning on kerning grid baseline grid a measure at measure\"], \"expected\": [\"on of\", \"kerning\", \"on\", \"kerning\", \"grid\", \"baseline\", \"grid\", \"a\", \"measure\", \"at\", \"measure\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"a ink measure serif baseline\"], \"expected\": [\"a ink measure\", \"serif baseline\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"baseline on grid kerning a ink baseline measure a\"], \"expected\": [\"baseline\", \"on grid\", \"kerning a\", \"ink\", \"baseline\", \"measure a\"], \"passed\": false}, {\"check\": \"one-word runt pulled down\", \"actual\": [\"the type grid is a\"], \"expected\": [\"the type\", \"grid is a\"], \"passed\": false}, {\"check\": \"runt limited by width\", \"actual\": [\"kerning baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"passed\": false}, {\"check\": \"control layout\", \"actual\": [\"a x grid\"], \"expected\": [\"a x grid\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"serif a the\"], \"expected\": [\"serif a the\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.192,"exit_code":1,"observations":[{"actual":["on ink","x at a","kerning","serif","measure","at baseline"],"check":"regression: overwide word isolation","expected":["on ink","x at a","kerning","serif","measure","at","baseline"],"passed":false},{"actual":["on of kerning","on kerning","grid baseline","grid","a measure","at measure"],"check":"regression: overwide word isolation","expected":["on of","kerning","on","kerning","grid","baseline","grid","a","measure","at","measure"],"passed":false},{"actual":["a ink measure","serif baseline"],"check":"partial-repair probe","expected":["a ink measure","serif baseline"],"passed":true},{"actual":["baseline","on grid","kerning a","ink","baseline","measure a"],"check":"partial-repair probe","expected":["baseline","on grid","kerning a","ink","baseline","measure a"],"passed":true},{"actual":["the type","grid is a"],"check":"one-word runt pulled down","expected":["the type","grid is a"],"passed":true},{"actual":["kerning","baseline x"],"check":"runt limited by width","expected":["kerning","baseline x"],"passed":true},{"actual":["a x grid"],"check":"control layout","expected":["a x grid"],"passed":true},{"actual":["serif a the"],"check":"control layout","expected":["serif a the"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: overwide word isolation\", \"actual\": [\"on ink\", \"x at a\", \"kerning\", \"serif\", \"measure\", \"at baseline\"], \"expected\": [\"on ink\", \"x at a\", \"kerning\", \"serif\", \"measure\", \"at\", \"baseline\"], \"passed\": false}, {\"check\": \"regression: overwide word isolation\", \"actual\": [\"on of kerning\", \"on kerning\", \"grid baseline\", \"grid\", \"a measure\", \"at measure\"], \"expected\": [\"on of\", \"kerning\", \"on\", \"kerning\", \"grid\", \"baseline\", \"grid\", \"a\", \"measure\", \"at\", \"measure\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"a ink measure\", \"serif baseline\"], \"expected\": [\"a ink measure\", \"serif baseline\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"baseline\", \"on grid\", \"kerning a\", \"ink\", \"baseline\", \"measure a\"], \"expected\": [\"baseline\", \"on grid\", \"kerning a\", \"ink\", \"baseline\", \"measure a\"], \"passed\": true}, {\"check\": \"one-word runt pulled down\", \"actual\": [\"the type\", \"grid is a\"], \"expected\": [\"the type\", \"grid is a\"], \"passed\": true}, {\"check\": \"runt limited by width\", \"actual\": [\"kerning\", \"baseline x\"], \"expected\": [\"kerning\", \"baseline x\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"a x grid\"], \"expected\": [\"a x grid\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"serif a the\"], \"expected\": [\"serif a the\"], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}