{"abstract":"A paragraph that exactly fills the page is split needlessly.","category":"Typography line breaking","checks":8,"contract":"Input [paragraph line counts, page height, min orphan lines, min widow lines]. Lines flow onto pages. When a paragraph must break on a page that already holds lines, at least min widow lines must carry to the next page (move lines forward) and, if the paragraph starts on this page, at least min orphan lines must stay (else move it all). A paragraph that exactly fits stays. Constraints are waived on an empty page. Return lines per page.","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-widow-orphan","failed_approach":"Allowing rem <= room + 1 overfills the page.","family":"w2-typography-line-breaking-widow-orphan-exact-fit-acceptance","id":"FA-79996","implementations":{"attempt":{"sha256":"70f9a54a9115218701bb3e122872835aa192b44d9e5f6ed168d20ddff57ab0d7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    paras, H, orphan, widow = x\n    pages = []\n    used = 0\n    for p in paras:\n        rem = p\n        started = True\n        while rem > 0:\n            room = H - used\n            if rem <= room + 1:\n                used += rem\n                rem = 0\n                continue\n            a = room\n            if used > 0:\n                if rem - a < widow:\n                    a = max(rem - widow, 0)\n                if started and a < orphan:\n                    a = 0\n            used += a\n            rem -= a\n            if a > 0:\n                started = False\n            pages.append(used)\n            used = 0\n    if used > 0:\n        pages.append(used)\n    return pages\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('regression: exact fit acceptance', [[7, 6, 7, 1], 4, 3, 1], [4, 3, 4, 2, 4, 4]), ('regression: exact fit acceptance', [[6, 3, 5, 3, 1, 6, 5, 7], 10, 2, 3], [9, 9, 8, 10]), ('regression: exact fit acceptance', [[2, 2, 5, 5, 7, 6, 4, 2], 8, 2, 3], [6, 8, 7, 6, 6]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('control layout', [[6, 3, 4, 2], 11, 1, 2], [11, 4]), ('control layout', [[9, 6, 2, 9, 7], 12, 3, 2], [12, 12, 9])], [('regression: exact fit acceptance', [[2, 8, 2, 7], 12, 1, 1], [12, 7]), ('regression: exact fit acceptance', [[3, 5, 5, 1, 7, 7, 3, 1], 4, 3, 3], [3, 4, 1, 4, 2, 4, 3, 4, 3, 4]), ('partial-repair probe', [[6, 7, 1, 1], 12, 3, 2], [11, 4]), ('regression: exact fit acceptance', [[2, 2, 5, 5, 7, 6, 4, 2], 8, 2, 3], [6, 8, 7, 6, 6]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('orphan pushed forward', [[5, 3], 6, 2, 2], [5, 3]), ('control layout', [[5, 1, 2, 7, 6], 9, 1, 2], [9, 9, 3]), ('control layout', [[9, 7, 4], 11, 2, 1], [11, 9])], [('regression: exact fit acceptance', [[6, 9, 1, 5, 1, 8], 11, 2, 1], [11, 11, 8]), ('regression: exact fit acceptance', [[6, 6, 2, 6, 9, 7, 2, 8], 7, 1, 1], [7, 7, 7, 7, 7, 7, 4]), ('partial-repair probe', [[8, 8, 2, 6, 7, 7, 9], 7, 3, 3], [7, 6, 5, 6, 7, 7, 7, 2]), ('partial-repair probe', [[1, 9, 7, 4, 6, 9], 5, 2, 1], [5, 5, 5, 5, 5, 5, 5, 1]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('control layout', [[5, 9, 5, 1], 12, 1, 1], [12, 8]), ('control layout', [[5, 2, 2, 6, 3, 3, 3, 3], 10, 2, 3], [9, 9, 9])], [('regression: exact fit acceptance', [[8, 1, 5, 2, 5, 5], 8, 1, 3], [8, 8, 7, 3]), ('regression: exact fit acceptance', [[4, 5, 5, 3, 2, 6], 9, 2, 2], [9, 8, 8]), ('partial-repair probe', [[3, 7, 3, 2], 6, 1, 2], [6, 5, 4]), ('regression: exact fit acceptance', [[7, 4, 1, 1, 2, 6], 6, 3, 2], [6, 6, 6, 3]), ('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('control layout', [[2, 5, 2], 11, 3, 1], [9]), ('control layout', [[3, 5, 4, 4, 2, 7], 10, 1, 1], [10, 10, 5])], [('regression: exact fit acceptance', [[1, 7, 1, 3, 3, 9, 6, 9], 6, 1, 3], [5, 4, 6, 6, 6, 6, 6]), ('regression: exact fit acceptance', [[9, 3, 5, 4], 6, 3, 3], [6, 6, 5, 4]), ('regression: exact fit acceptance', [[6, 4, 9, 9, 4], 5, 2, 3], [5, 5, 5, 4, 5, 4, 4]), ('partial-repair probe', [[6, 8, 9, 3, 2, 5, 9, 6], 4, 1, 3], [4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 2]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('control layout', [[7, 4, 6, 6], 4, 3, 1], [4, 3, 4, 4, 2, 4, 2]), ('control layout', [[8, 7, 8], 8, 1, 3], [8, 8, 7])]]\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":"085f83febfb35a3d269dbdc446a9b3ae83698b625c267099223b721da4dc16c6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    paras, H, orphan, widow = x\n    pages = []\n    used = 0\n    for p in paras:\n        rem = p\n        started = True\n        while rem > 0:\n            room = H - used\n            if rem < room:\n                used += rem\n                rem = 0\n                continue\n            a = room\n            if used > 0:\n                if rem - a < widow:\n                    a = max(rem - widow, 0)\n                if started and a < orphan:\n                    a = 0\n            used += a\n            rem -= a\n            if a > 0:\n                started = False\n            pages.append(used)\n            used = 0\n    if used > 0:\n        pages.append(used)\n    return pages\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('regression: exact fit acceptance', [[7, 6, 7, 1], 4, 3, 1], [4, 3, 4, 2, 4, 4]), ('regression: exact fit acceptance', [[6, 3, 5, 3, 1, 6, 5, 7], 10, 2, 3], [9, 9, 8, 10]), ('regression: exact fit acceptance', [[2, 2, 5, 5, 7, 6, 4, 2], 8, 2, 3], [6, 8, 7, 6, 6]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('control layout', [[6, 3, 4, 2], 11, 1, 2], [11, 4]), ('control layout', [[9, 6, 2, 9, 7], 12, 3, 2], [12, 12, 9])], [('regression: exact fit acceptance', [[2, 8, 2, 7], 12, 1, 1], [12, 7]), ('regression: exact fit acceptance', [[3, 5, 5, 1, 7, 7, 3, 1], 4, 3, 3], [3, 4, 1, 4, 2, 4, 3, 4, 3, 4]), ('partial-repair probe', [[6, 7, 1, 1], 12, 3, 2], [11, 4]), ('regression: exact fit acceptance', [[2, 2, 5, 5, 7, 6, 4, 2], 8, 2, 3], [6, 8, 7, 6, 6]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('orphan pushed forward', [[5, 3], 6, 2, 2], [5, 3]), ('control layout', [[5, 1, 2, 7, 6], 9, 1, 2], [9, 9, 3]), ('control layout', [[9, 7, 4], 11, 2, 1], [11, 9])], [('regression: exact fit acceptance', [[6, 9, 1, 5, 1, 8], 11, 2, 1], [11, 11, 8]), ('regression: exact fit acceptance', [[6, 6, 2, 6, 9, 7, 2, 8], 7, 1, 1], [7, 7, 7, 7, 7, 7, 4]), ('partial-repair probe', [[8, 8, 2, 6, 7, 7, 9], 7, 3, 3], [7, 6, 5, 6, 7, 7, 7, 2]), ('partial-repair probe', [[1, 9, 7, 4, 6, 9], 5, 2, 1], [5, 5, 5, 5, 5, 5, 5, 1]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('control layout', [[5, 9, 5, 1], 12, 1, 1], [12, 8]), ('control layout', [[5, 2, 2, 6, 3, 3, 3, 3], 10, 2, 3], [9, 9, 9])], [('regression: exact fit acceptance', [[8, 1, 5, 2, 5, 5], 8, 1, 3], [8, 8, 7, 3]), ('regression: exact fit acceptance', [[4, 5, 5, 3, 2, 6], 9, 2, 2], [9, 8, 8]), ('partial-repair probe', [[3, 7, 3, 2], 6, 1, 2], [6, 5, 4]), ('regression: exact fit acceptance', [[7, 4, 1, 1, 2, 6], 6, 3, 2], [6, 6, 6, 3]), ('paragraph exactly fills page', [[2, 4, 3], 6, 2, 2], [6, 3]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('control layout', [[2, 5, 2], 11, 3, 1], [9]), ('control layout', [[3, 5, 4, 4, 2, 7], 10, 1, 1], [10, 10, 5])], [('regression: exact fit acceptance', [[1, 7, 1, 3, 3, 9, 6, 9], 6, 1, 3], [5, 4, 6, 6, 6, 6, 6]), ('regression: exact fit acceptance', [[9, 3, 5, 4], 6, 3, 3], [6, 6, 5, 4]), ('regression: exact fit acceptance', [[6, 4, 9, 9, 4], 5, 2, 3], [5, 5, 5, 4, 5, 4, 4]), ('partial-repair probe', [[6, 8, 9, 3, 2, 5, 9, 6], 4, 1, 3], [4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 2]), ('long paragraph continuation', [[2, 14], 6, 2, 2], [6, 6, 4]), ('single widow pulled back', [[3, 4], 6, 2, 2], [5, 2]), ('control layout', [[7, 4, 6, 6], 4, 3, 1], [4, 3, 4, 4, 2, 4, 2]), ('control layout', [[8, 7, 8], 8, 1, 3], [8, 8, 7])]]\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-widow-orphan-exact-fit-acceptance","generated_at":"2026-09-29T14:49:49.688651+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":"The fit test uses rem < room so an exact fit takes the breaking path.","sha256":"16bbd779f307a3804e1b7f04aaec7922decd30046d731a1163767dcfc63edb9b","title":"Widow and orphan page breaking: exact fit acceptance · 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":44.022,"exit_code":1,"observations":[{"actual":[6,3],"check":"paragraph exactly fills page","expected":[6,3],"passed":true},{"actual":[4,3,4,2,4,4],"check":"regression: exact fit acceptance","expected":[4,3,4,2,4,4],"passed":true},{"actual":[9,9,11,7],"check":"regression: exact fit acceptance","expected":[9,9,8,10],"passed":false},{"actual":[9,8,7,9],"check":"regression: exact fit acceptance","expected":[6,8,7,6,6],"passed":false},{"actual":[6,6,4],"check":"long paragraph continuation","expected":[6,6,4],"passed":true},{"actual":[7],"check":"single widow pulled back","expected":[5,2],"passed":false},{"actual":[11,4],"check":"control layout","expected":[11,4],"passed":true},{"actual":[12,12,9],"check":"control layout","expected":[12,12,9],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"paragraph exactly fills page\", \"actual\": [6, 3], \"expected\": [6, 3], \"passed\": true}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [4, 3, 4, 2, 4, 4], \"expected\": [4, 3, 4, 2, 4, 4], \"passed\": true}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [9, 9, 11, 7], \"expected\": [9, 9, 8, 10], \"passed\": false}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [9, 8, 7, 9], \"expected\": [6, 8, 7, 6, 6], \"passed\": false}, {\"check\": \"long paragraph continuation\", \"actual\": [6, 6, 4], \"expected\": [6, 6, 4], \"passed\": true}, {\"check\": \"single widow pulled back\", \"actual\": [7], \"expected\": [5, 2], \"passed\": false}, {\"check\": \"control layout\", \"actual\": [11, 4], \"expected\": [11, 4], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [12, 12, 9], \"expected\": [12, 12, 9], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.756,"exit_code":1,"observations":[{"actual":[4,5],"check":"paragraph exactly fills page","expected":[6,3],"passed":false},{"actual":[4,3,4,2,4,3,1],"check":"regression: exact fit acceptance","expected":[4,3,4,2,4,4],"passed":false},{"actual":[9,9,8,7,3],"check":"regression: exact fit acceptance","expected":[9,9,8,10],"passed":false},{"actual":[6,5,7,6,7,2],"check":"regression: exact fit acceptance","expected":[6,8,7,6,6],"passed":false},{"actual":[6,6,4],"check":"long paragraph continuation","expected":[6,6,4],"passed":true},{"actual":[5,2],"check":"single widow pulled back","expected":[5,2],"passed":true},{"actual":[11,4],"check":"control layout","expected":[11,4],"passed":true},{"actual":[12,12,9],"check":"control layout","expected":[12,12,9],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"paragraph exactly fills page\", \"actual\": [4, 5], \"expected\": [6, 3], \"passed\": false}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [4, 3, 4, 2, 4, 3, 1], \"expected\": [4, 3, 4, 2, 4, 4], \"passed\": false}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [9, 9, 8, 7, 3], \"expected\": [9, 9, 8, 10], \"passed\": false}, {\"check\": \"regression: exact fit acceptance\", \"actual\": [6, 5, 7, 6, 7, 2], \"expected\": [6, 8, 7, 6, 6], \"passed\": false}, {\"check\": \"long paragraph continuation\", \"actual\": [6, 6, 4], \"expected\": [6, 6, 4], \"passed\": true}, {\"check\": \"single widow pulled back\", \"actual\": [5, 2], \"expected\": [5, 2], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [11, 4], \"expected\": [11, 4], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [12, 12, 9], \"expected\": [12, 12, 9], \"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."}}