{"abstract":"A line compressed by exactly its total shrink is reported overfull.","category":"Typography line breaking","checks":8,"contract":"Input [natural, stretch, shrink, width, tolerance] (ints). shortfall=width-natural. Positive shortfall with zero stretch is underfull 10000 very_loose; shrinking past total shrink is overfull 1000000 tight. r=shortfall/stretch (or /shrink when negative); badness=min(10000, floor(100*|r|^3+1/2)); fitness tight r<-1/2, decent r<=1/2, loose r<=1, else very_loose; status ok iff badness<=tolerance. Return [status, badness, fitness].","contract_signature":"x","evaluation_group":"w2-typography-line-breaking-glue-badness","failed_approach":"Comparing the compression with the stretch total instead of the shrink total still misclassifies lines.","family":"w2-typography-line-breaking-glue-badness-shrink-exhaustion-limit","id":"FA-79841","implementations":{"attempt":{"sha256":"b7b4ae5594cc2ff37c86a39989ad7c5f0d9625f7ec1d20a72cd13a1f12ab0219","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    natural, stretch, shrink, width, tolerance = x\n    shortfall = width - natural\n    if shortfall > 0:\n        if stretch == 0:\n            return ['underfull', 10000, 'very_loose']\n        r = Fraction(shortfall, stretch)\n    elif shortfall < 0:\n        if -shortfall > stretch:\n            return ['overfull', 1000000, 'tight']\n        r = Fraction(shortfall, shrink)\n    else:\n        r = Fraction(0)\n    badness = min(10000, math.floor(100 * abs(r) ** 3 + Fraction(1, 2)))\n    if r < Fraction(-1, 2):\n        fitness = 'tight'\n    elif r <= Fraction(1, 2):\n        fitness = 'decent'\n    elif r <= 1:\n        fitness = 'loose'\n    else:\n        fitness = 'very_loose'\n    status = 'ok' if badness <= tolerance else 'underfull'\n    return [status, badness, fitness]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('full shrink is still acceptable', [100, 10, 5, 95, 200], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [92, 6, 12, 80, 100], ['ok', 100, 'tight']), ('partial-repair probe', [82, 3, 10, 77, 100], ['ok', 13, 'decent']), ('partial-repair probe', [108, 0, 6, 105, 1000], ['ok', 13, 'decent']), ('very loose over tolerance', [100, 4, 0, 110, 200], ['underfull', 1563, 'very_loose']), ('half stretch ratio rounds 12.5 up', [100, 10, 5, 105, 200], ['ok', 13, 'decent']), ('control layout', [107, 16, 10, 115, 150], ['ok', 13, 'decent']), ('control layout', [66, 4, 5, 60, 200], ['overfull', 1000000, 'tight'])], [('regression: shrink exhaustion limit', [108, 1, 10, 98, 1000], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [106, 16, 11, 95, 200], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [85, 3, 7, 78, 150], ['ok', 100, 'tight']), ('partial-repair probe', [74, 16, 4, 67, 500], ['overfull', 1000000, 'tight']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('very loose over tolerance', [100, 4, 0, 110, 200], ['underfull', 1563, 'very_loose']), ('control layout', [116, 0, 11, 126, 100], ['underfull', 10000, 'very_loose']), ('control layout', [104, 0, 1, 124, 100], ['underfull', 10000, 'very_loose'])], [('regression: shrink exhaustion limit', [92, 6, 12, 80, 100], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [92, 10, 6, 86, 500], ['ok', 100, 'tight']), ('partial-repair probe', [76, 1, 11, 74, 1000], ['ok', 1, 'decent']), ('partial-repair probe', [118, 20, 4, 106, 1000], ['overfull', 1000000, 'tight']), ('one unit past total shrink', [100, 10, 5, 94, 200], ['overfull', 1000000, 'tight']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('control layout', [64, 20, 12, 59, 100], ['ok', 7, 'decent']), ('control layout', [74, 6, 6, 67, 100], ['overfull', 1000000, 'tight'])], [('regression: shrink exhaustion limit', [90, 12, 2, 88, 150], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [62, 4, 4, 58, 200], ['ok', 100, 'tight']), ('partial-repair probe', [61, 8, 1, 56, 100], ['overfull', 1000000, 'tight']), ('partial-repair probe', [86, 10, 5, 77, 500], ['overfull', 1000000, 'tight']), ('negative half ratio is decent', [100, 10, 6, 97, 200], ['ok', 13, 'decent']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('control layout', [63, 6, 7, 53, 150], ['overfull', 1000000, 'tight']), ('control layout', [73, 0, 12, 81, 500], ['underfull', 10000, 'very_loose'])], [('regression: shrink exhaustion limit', [92, 10, 6, 86, 500], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [106, 16, 11, 95, 200], ['ok', 100, 'tight']), ('partial-repair probe', [104, 8, 3, 98, 500], ['overfull', 1000000, 'tight']), ('regression: shrink exhaustion limit', [108, 1, 10, 98, 1000], ['ok', 100, 'tight']), ('badness cap at 10000', [100, 2, 0, 150, 200], ['underfull', 10000, 'very_loose']), ('half stretch ratio rounds 12.5 up', [100, 10, 5, 105, 200], ['ok', 13, 'decent']), ('control layout', [80, 20, 11, 82, 150], ['ok', 0, 'decent']), ('control layout', [111, 8, 4, 130, 150], ['underfull', 1340, 'very_loose'])]]\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":"24415e070290606541357a02e26c85c1ed420d278cf3f640f6250a027a4b4c2d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    natural, stretch, shrink, width, tolerance = x\n    shortfall = width - natural\n    if shortfall > 0:\n        if stretch == 0:\n            return ['underfull', 10000, 'very_loose']\n        r = Fraction(shortfall, stretch)\n    elif shortfall < 0:\n        if -shortfall >= shrink:\n            return ['overfull', 1000000, 'tight']\n        r = Fraction(shortfall, shrink)\n    else:\n        r = Fraction(0)\n    badness = min(10000, math.floor(100 * abs(r) ** 3 + Fraction(1, 2)))\n    if r < Fraction(-1, 2):\n        fitness = 'tight'\n    elif r <= Fraction(1, 2):\n        fitness = 'decent'\n    elif r <= 1:\n        fitness = 'loose'\n    else:\n        fitness = 'very_loose'\n    status = 'ok' if badness <= tolerance else 'underfull'\n    return [status, badness, fitness]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('full shrink is still acceptable', [100, 10, 5, 95, 200], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [92, 6, 12, 80, 100], ['ok', 100, 'tight']), ('partial-repair probe', [82, 3, 10, 77, 100], ['ok', 13, 'decent']), ('partial-repair probe', [108, 0, 6, 105, 1000], ['ok', 13, 'decent']), ('very loose over tolerance', [100, 4, 0, 110, 200], ['underfull', 1563, 'very_loose']), ('half stretch ratio rounds 12.5 up', [100, 10, 5, 105, 200], ['ok', 13, 'decent']), ('control layout', [107, 16, 10, 115, 150], ['ok', 13, 'decent']), ('control layout', [66, 4, 5, 60, 200], ['overfull', 1000000, 'tight'])], [('regression: shrink exhaustion limit', [108, 1, 10, 98, 1000], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [106, 16, 11, 95, 200], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [85, 3, 7, 78, 150], ['ok', 100, 'tight']), ('partial-repair probe', [74, 16, 4, 67, 500], ['overfull', 1000000, 'tight']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('very loose over tolerance', [100, 4, 0, 110, 200], ['underfull', 1563, 'very_loose']), ('control layout', [116, 0, 11, 126, 100], ['underfull', 10000, 'very_loose']), ('control layout', [104, 0, 1, 124, 100], ['underfull', 10000, 'very_loose'])], [('regression: shrink exhaustion limit', [92, 6, 12, 80, 100], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [92, 10, 6, 86, 500], ['ok', 100, 'tight']), ('partial-repair probe', [76, 1, 11, 74, 1000], ['ok', 1, 'decent']), ('partial-repair probe', [118, 20, 4, 106, 1000], ['overfull', 1000000, 'tight']), ('one unit past total shrink', [100, 10, 5, 94, 200], ['overfull', 1000000, 'tight']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('control layout', [64, 20, 12, 59, 100], ['ok', 7, 'decent']), ('control layout', [74, 6, 6, 67, 100], ['overfull', 1000000, 'tight'])], [('regression: shrink exhaustion limit', [90, 12, 2, 88, 150], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [62, 4, 4, 58, 200], ['ok', 100, 'tight']), ('partial-repair probe', [61, 8, 1, 56, 100], ['overfull', 1000000, 'tight']), ('partial-repair probe', [86, 10, 5, 77, 500], ['overfull', 1000000, 'tight']), ('negative half ratio is decent', [100, 10, 6, 97, 200], ['ok', 13, 'decent']), ('rigid line with slack', [100, 0, 5, 110, 200], ['underfull', 10000, 'very_loose']), ('control layout', [63, 6, 7, 53, 150], ['overfull', 1000000, 'tight']), ('control layout', [73, 0, 12, 81, 500], ['underfull', 10000, 'very_loose'])], [('regression: shrink exhaustion limit', [92, 10, 6, 86, 500], ['ok', 100, 'tight']), ('regression: shrink exhaustion limit', [106, 16, 11, 95, 200], ['ok', 100, 'tight']), ('partial-repair probe', [104, 8, 3, 98, 500], ['overfull', 1000000, 'tight']), ('regression: shrink exhaustion limit', [108, 1, 10, 98, 1000], ['ok', 100, 'tight']), ('badness cap at 10000', [100, 2, 0, 150, 200], ['underfull', 10000, 'very_loose']), ('half stretch ratio rounds 12.5 up', [100, 10, 5, 105, 200], ['ok', 13, 'decent']), ('control layout', [80, 20, 11, 82, 150], ['ok', 0, 'decent']), ('control layout', [111, 8, 4, 130, 150], ['underfull', 1340, 'very_loose'])]]\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-glue-badness-shrink-exhaustion-limit","generated_at":"2026-09-29T14:49:48.250833+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 overfull test uses >= against the total shrink, so the legal limit itself is rejected.","sha256":"03265c7e735f5774c4ec60a3b29e9c640a5feb49f5db09c70e19edc31bffa119","title":"Glue-set badness rating: shrink exhaustion limit · 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":42.459,"exit_code":1,"observations":[{"actual":["ok",100,"tight"],"check":"full shrink is still acceptable","expected":["ok",100,"tight"],"passed":true},{"actual":["overfull",1000000,"tight"],"check":"regression: shrink exhaustion limit","expected":["ok",100,"tight"],"passed":false},{"actual":["overfull",1000000,"tight"],"check":"partial-repair probe","expected":["ok",13,"decent"],"passed":false},{"actual":["overfull",1000000,"tight"],"check":"partial-repair probe","expected":["ok",13,"decent"],"passed":false},{"actual":["underfull",1563,"very_loose"],"check":"very loose over tolerance","expected":["underfull",1563,"very_loose"],"passed":true},{"actual":["ok",13,"decent"],"check":"half stretch ratio rounds 12.5 up","expected":["ok",13,"decent"],"passed":true},{"actual":["ok",13,"decent"],"check":"control layout","expected":["ok",13,"decent"],"passed":true},{"actual":["overfull",1000000,"tight"],"check":"control layout","expected":["overfull",1000000,"tight"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"full shrink is still acceptable\", \"actual\": [\"ok\", 100, \"tight\"], \"expected\": [\"ok\", 100, \"tight\"], \"passed\": true}, {\"check\": \"regression: shrink exhaustion limit\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"ok\", 100, \"tight\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": false}, {\"check\": \"very loose over tolerance\", \"actual\": [\"underfull\", 1563, \"very_loose\"], \"expected\": [\"underfull\", 1563, \"very_loose\"], \"passed\": true}, {\"check\": \"half stretch ratio rounds 12.5 up\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"overfull\", 1000000, \"tight\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.217,"exit_code":1,"observations":[{"actual":["overfull",1000000,"tight"],"check":"full shrink is still acceptable","expected":["ok",100,"tight"],"passed":false},{"actual":["overfull",1000000,"tight"],"check":"regression: shrink exhaustion limit","expected":["ok",100,"tight"],"passed":false},{"actual":["ok",13,"decent"],"check":"partial-repair probe","expected":["ok",13,"decent"],"passed":true},{"actual":["ok",13,"decent"],"check":"partial-repair probe","expected":["ok",13,"decent"],"passed":true},{"actual":["underfull",1563,"very_loose"],"check":"very loose over tolerance","expected":["underfull",1563,"very_loose"],"passed":true},{"actual":["ok",13,"decent"],"check":"half stretch ratio rounds 12.5 up","expected":["ok",13,"decent"],"passed":true},{"actual":["ok",13,"decent"],"check":"control layout","expected":["ok",13,"decent"],"passed":true},{"actual":["overfull",1000000,"tight"],"check":"control layout","expected":["overfull",1000000,"tight"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"full shrink is still acceptable\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"ok\", 100, \"tight\"], \"passed\": false}, {\"check\": \"regression: shrink exhaustion limit\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"ok\", 100, \"tight\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"very loose over tolerance\", \"actual\": [\"underfull\", 1563, \"very_loose\"], \"expected\": [\"underfull\", 1563, \"very_loose\"], \"passed\": true}, {\"check\": \"half stretch ratio rounds 12.5 up\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"ok\", 13, \"decent\"], \"expected\": [\"ok\", 13, \"decent\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"overfull\", 1000000, \"tight\"], \"expected\": [\"overfull\", 1000000, \"tight\"], \"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."}}