{"abstract":"Hyphenated lines are reported one hyphen narrower.","category":"Typography line breaking","checks":8,"contract":"Input [items, width]; items are [\"b\",w], [\"g\",w] or [\"p\",w,cost,flag]. Legal breaks: glue immediately after a box; penalty with cost < 10000 (width counted only if broken there); cost <= -10000 forces a break. Discardable glue/penalties at a line start are dropped. First-fit: when the running width exceeds the measure, break at the last legal breakpoint. Return [[line width, break kind]] with kinds glue/penalty/forced/end.","evaluation_group":"w2-typography-line-breaking-box-glue-penalty","failed_approach":"Adding the width to the running total also charges unused hyphens.","family":"w2-typography-line-breaking-box-glue-penalty-penalty-width-accounting","id":"FA-80051","implementations":{"attempt":{"sha256":"ecd3dfc9b6b5e625c9b990832a434f38c5d0641892b24ed10e0e524bc28bdfbc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, width = x\n    lines = []\n    start = 0\n    n = len(items)\n    while start < n:\n        while start < n and items[start][0] != 'b':\n            start += 1\n        if start >= n:\n            break\n        total = 0\n        last = None\n        result = None\n        i = start\n        while i < n:\n            it = items[i]\n            if it[0] == 'p':\n                if it[2] <= -10000:\n                    result = (i, total + it[1], 'forced')\n                    break\n                if it[2] < 10000:\n                    last = (i, total + it[1], 'penalty')\n                    total += it[1]\n            elif it[0] == 'g':\n                if items[i - 1][0] == 'b':\n                    last = (i, total, 'glue')\n                total += it[1]\n            else:\n                total += it[1]\n            if total > width and last is not None:\n                result = last\n                break\n            i += 1\n        if result is None:\n            lines.append([total, 'end'])\n            break\n        lines.append([result[1], result[2]])\n        start = result[0] + 1\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 18], [[12, 'glue'], [18, 'penalty']]), ('regression: penalty width accounting', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 5], ['g', 2]], 11], [[12, 'penalty'], [1, 'forced'], [9, 'penalty'], [6, 'glue'], [5, 'glue'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 7], ['p', 0, -5000, False], ['g', 2], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1]], 7], [[5, 'penalty'], [7, 'glue'], [3, 'glue'], [7, 'penalty'], [3, 'forced'], [6, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['g', 1]], 11], [[7, 'forced'], [5, 'glue'], [7, 'glue'], [4, 'end']]), ('control layout', [[['b', 7], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['g', 1], ['b', 2], ['g', 1]], 15], [[15, 'glue'], [15, 'glue'], [15, 'glue']])], [('regression: penalty width accounting', [[['b', 1], ['g', 2], ['b', 4], ['g', 1], ['b', 5], ['p', 0, -5000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, 9999, False], ['g', 1], ['g', 1]], 7], [[7, 'glue'], [5, 'penalty'], [6, 'penalty'], [6, 'end']]), ('regression: penalty width accounting', [[['b', 5], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 9], [[9, 'penalty'], [5, 'forced'], [8, 'glue'], [8, 'glue']]), ('regression: penalty width accounting', [[['b', 7], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['g', 1]], 17], [[18, 'penalty'], [15, 'forced'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 1]], 7], [[4, 'glue'], [8, 'penalty'], [6, 'glue'], [7, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['b', 2], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2]], 15], [[12, 'glue'], [13, 'glue'], [6, 'forced']]), ('control layout', [[['b', 1], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 2]], 11], [[6, 'glue'], [7, 'glue'], [9, 'glue'], [6, 'forced']])], [('regression: penalty width accounting', [[['b', 2], ['g', 2], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 6], [[2, 'glue'], [6, 'glue'], [7, 'penalty'], [4, 'penalty'], [8, 'penalty'], [2, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1]], 12], [[12, 'penalty'], [12, 'glue'], [8, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'penalty'], [8, 'glue'], [8, 'glue'], [7, 'penalty'], [9, 'penalty'], [6, 'forced'], [2, 'end']]), ('partial-repair probe', [[['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['g', 2]], 18], [[2, 'forced'], [16, 'forced'], [11, 'forced'], [18, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 8], [[3, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -5000, False], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 13], [[10, 'forced'], [11, 'penalty'], [13, 'glue'], [7, 'glue'], [6, 'end']])], [('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 4], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 2], ['b', 6], ['g', 1]], 16], [[11, 'penalty'], [14, 'glue'], [16, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 4], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 0, 9999, False], ['g', 2], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 7], ['g', 2]], 10], [[6, 'glue'], [4, 'glue'], [7, 'penalty'], [8, 'penalty'], [8, 'penalty'], [7, 'glue'], [6, 'glue'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 7], [[1, 'glue'], [7, 'glue'], [6, 'penalty'], [3, 'penalty'], [8, 'penalty'], [5, 'end']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 16], [[13, 'glue'], [15, 'glue'], [12, 'forced'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 6], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 2], ['g', 1]], 7], [[6, 'forced'], [1, 'forced'], [6, 'glue'], [3, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']])], [('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['g', 2]], 9], [[10, 'penalty'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, 9999, False], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1]], 11], [[7, 'penalty'], [10, 'penalty'], [6, 'glue'], [9, 'glue'], [8, 'penalty'], [6, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['g', 1]], 16], [[14, 'forced'], [15, 'glue']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 15], [[9, 'penalty'], [7, 'forced'], [1, 'forced'], [5, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['p', 0, 900, False], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 4], ['g', 2]], 14], [[12, 'glue'], [14, 'glue'], [14, 'glue'], [6, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['g', 1], ['b', 2], ['g', 2], ['b', 6], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 3], ['g', 1]], 16], [[16, 'glue'], [11, 'end']])]]\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":"d3a48e4d8cd18a5bc77c8130fccb0d6560d0022353ea448312a414fc8fdab644","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, width = x\n    lines = []\n    start = 0\n    n = len(items)\n    while start < n:\n        while start < n and items[start][0] != 'b':\n            start += 1\n        if start >= n:\n            break\n        total = 0\n        last = None\n        result = None\n        i = start\n        while i < n:\n            it = items[i]\n            if it[0] == 'p':\n                if it[2] <= -10000:\n                    result = (i, total + it[1], 'forced')\n                    break\n                if it[2] < 10000:\n                    last = (i, total, 'penalty')\n            elif it[0] == 'g':\n                if items[i - 1][0] == 'b':\n                    last = (i, total, 'glue')\n                total += it[1]\n            else:\n                total += it[1]\n            if total > width and last is not None:\n                result = last\n                break\n            i += 1\n        if result is None:\n            lines.append([total, 'end'])\n            break\n        lines.append([result[1], result[2]])\n        start = result[0] + 1\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 18], [[12, 'glue'], [18, 'penalty']]), ('regression: penalty width accounting', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 5], ['g', 2]], 11], [[12, 'penalty'], [1, 'forced'], [9, 'penalty'], [6, 'glue'], [5, 'glue'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 7], ['p', 0, -5000, False], ['g', 2], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1]], 7], [[5, 'penalty'], [7, 'glue'], [3, 'glue'], [7, 'penalty'], [3, 'forced'], [6, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['g', 1]], 11], [[7, 'forced'], [5, 'glue'], [7, 'glue'], [4, 'end']]), ('control layout', [[['b', 7], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['g', 1], ['b', 2], ['g', 1]], 15], [[15, 'glue'], [15, 'glue'], [15, 'glue']])], [('regression: penalty width accounting', [[['b', 1], ['g', 2], ['b', 4], ['g', 1], ['b', 5], ['p', 0, -5000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, 9999, False], ['g', 1], ['g', 1]], 7], [[7, 'glue'], [5, 'penalty'], [6, 'penalty'], [6, 'end']]), ('regression: penalty width accounting', [[['b', 5], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 9], [[9, 'penalty'], [5, 'forced'], [8, 'glue'], [8, 'glue']]), ('regression: penalty width accounting', [[['b', 7], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['g', 1]], 17], [[18, 'penalty'], [15, 'forced'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 1]], 7], [[4, 'glue'], [8, 'penalty'], [6, 'glue'], [7, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['b', 2], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2]], 15], [[12, 'glue'], [13, 'glue'], [6, 'forced']]), ('control layout', [[['b', 1], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 2]], 11], [[6, 'glue'], [7, 'glue'], [9, 'glue'], [6, 'forced']])], [('regression: penalty width accounting', [[['b', 2], ['g', 2], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 6], [[2, 'glue'], [6, 'glue'], [7, 'penalty'], [4, 'penalty'], [8, 'penalty'], [2, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1]], 12], [[12, 'penalty'], [12, 'glue'], [8, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'penalty'], [8, 'glue'], [8, 'glue'], [7, 'penalty'], [9, 'penalty'], [6, 'forced'], [2, 'end']]), ('partial-repair probe', [[['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['g', 2]], 18], [[2, 'forced'], [16, 'forced'], [11, 'forced'], [18, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 8], [[3, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -5000, False], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 13], [[10, 'forced'], [11, 'penalty'], [13, 'glue'], [7, 'glue'], [6, 'end']])], [('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 4], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 2], ['b', 6], ['g', 1]], 16], [[11, 'penalty'], [14, 'glue'], [16, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 4], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 0, 9999, False], ['g', 2], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 7], ['g', 2]], 10], [[6, 'glue'], [4, 'glue'], [7, 'penalty'], [8, 'penalty'], [8, 'penalty'], [7, 'glue'], [6, 'glue'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 7], [[1, 'glue'], [7, 'glue'], [6, 'penalty'], [3, 'penalty'], [8, 'penalty'], [5, 'end']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 16], [[13, 'glue'], [15, 'glue'], [12, 'forced'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 6], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 2], ['g', 1]], 7], [[6, 'forced'], [1, 'forced'], [6, 'glue'], [3, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']])], [('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['g', 2]], 9], [[10, 'penalty'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, 9999, False], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1]], 11], [[7, 'penalty'], [10, 'penalty'], [6, 'glue'], [9, 'glue'], [8, 'penalty'], [6, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['g', 1]], 16], [[14, 'forced'], [15, 'glue']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 15], [[9, 'penalty'], [7, 'forced'], [1, 'forced'], [5, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['p', 0, 900, False], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 4], ['g', 2]], 14], [[12, 'glue'], [14, 'glue'], [14, 'glue'], [6, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['g', 1], ['b', 2], ['g', 2], ['b', 6], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 3], ['g', 1]], 16], [[16, 'glue'], [11, 'end']])]]\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":"b58085419ed25d198c034d8c98123dd3b12f77040be1481f8a8c72d1e26057b0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    items, width = x\n    lines = []\n    start = 0\n    n = len(items)\n    while start < n:\n        while start < n and items[start][0] != 'b':\n            start += 1\n        if start >= n:\n            break\n        total = 0\n        last = None\n        result = None\n        i = start\n        while i < n:\n            it = items[i]\n            if it[0] == 'p':\n                if it[2] <= -10000:\n                    result = (i, total + it[1], 'forced')\n                    break\n                if it[2] < 10000:\n                    last = (i, total + it[1], 'penalty')\n            elif it[0] == 'g':\n                if items[i - 1][0] == 'b':\n                    last = (i, total, 'glue')\n                total += it[1]\n            else:\n                total += it[1]\n            if total > width and last is not None:\n                result = last\n                break\n            i += 1\n        if result is None:\n            lines.append([total, 'end'])\n            break\n        lines.append([result[1], result[2]])\n        start = result[0] + 1\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 18], [[12, 'glue'], [18, 'penalty']]), ('regression: penalty width accounting', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 5], ['g', 2]], 11], [[12, 'penalty'], [1, 'forced'], [9, 'penalty'], [6, 'glue'], [5, 'glue'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 7], ['p', 0, -5000, False], ['g', 2], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1]], 7], [[5, 'penalty'], [7, 'glue'], [3, 'glue'], [7, 'penalty'], [3, 'forced'], [6, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['g', 1]], 11], [[7, 'forced'], [5, 'glue'], [7, 'glue'], [4, 'end']]), ('control layout', [[['b', 7], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['g', 1], ['b', 2], ['g', 1]], 15], [[15, 'glue'], [15, 'glue'], [15, 'glue']])], [('regression: penalty width accounting', [[['b', 1], ['g', 2], ['b', 4], ['g', 1], ['b', 5], ['p', 0, -5000, False], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, 9999, False], ['g', 1], ['g', 1]], 7], [[7, 'glue'], [5, 'penalty'], [6, 'penalty'], [6, 'end']]), ('regression: penalty width accounting', [[['b', 5], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 9], [[9, 'penalty'], [5, 'forced'], [8, 'glue'], [8, 'glue']]), ('regression: penalty width accounting', [[['b', 7], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['g', 1]], 17], [[18, 'penalty'], [15, 'forced'], [7, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['p', 0, 10000, False], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 1]], 7], [[4, 'glue'], [8, 'penalty'], [6, 'glue'], [7, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['b', 2], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2]], 15], [[12, 'glue'], [13, 'glue'], [6, 'forced']]), ('control layout', [[['b', 1], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 2]], 11], [[6, 'glue'], [7, 'glue'], [9, 'glue'], [6, 'forced']])], [('regression: penalty width accounting', [[['b', 2], ['g', 2], ['b', 6], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 6], [[2, 'glue'], [6, 'glue'], [7, 'penalty'], [4, 'penalty'], [8, 'penalty'], [2, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 1]], 12], [[12, 'penalty'], [12, 'glue'], [8, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['g', 2], ['b', 5], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'penalty'], [8, 'glue'], [8, 'glue'], [7, 'penalty'], [9, 'penalty'], [6, 'forced'], [2, 'end']]), ('partial-repair probe', [[['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 5], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['g', 2]], 18], [[2, 'forced'], [16, 'forced'], [11, 'forced'], [18, 'glue']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 8], [[3, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 7], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -5000, False], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 13], [[10, 'forced'], [11, 'penalty'], [13, 'glue'], [7, 'glue'], [6, 'end']])], [('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 4], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 6], ['g', 1], ['b', 7], ['g', 2], ['b', 6], ['g', 1]], 16], [[11, 'penalty'], [14, 'glue'], [16, 'end']]), ('regression: penalty width accounting', [[['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 4], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 0, 9999, False], ['g', 2], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 7], ['g', 2]], 10], [[6, 'glue'], [4, 'glue'], [7, 'penalty'], [8, 'penalty'], [8, 'penalty'], [7, 'glue'], [6, 'glue'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 7], [[1, 'glue'], [7, 'glue'], [6, 'penalty'], [3, 'penalty'], [8, 'penalty'], [5, 'end']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2]], 16], [[13, 'glue'], [15, 'glue'], [12, 'forced'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('control layout', [[['b', 6], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['g', 1], ['g', 1], ['b', 2], ['g', 1]], 7], [[6, 'forced'], [1, 'forced'], [6, 'glue'], [3, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']])], [('regression: penalty width accounting', [[['b', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 1], ['p', 0, 10000, False], ['g', 2]], 9], [[10, 'penalty'], [9, 'end']]), ('regression: penalty width accounting', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, 9999, False], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1]], 11], [[7, 'penalty'], [10, 'penalty'], [6, 'glue'], [9, 'glue'], [8, 'penalty'], [6, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 6], ['p', 1, 50, True], ['g', 2], ['b', 6], ['p', 0, -10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['g', 1]], 16], [[14, 'forced'], [15, 'glue']]), ('regression: penalty width accounting', [[['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1]], 15], [[9, 'penalty'], [7, 'forced'], [1, 'forced'], [5, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 7], ['p', 0, 900, False], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 1], ['b', 4], ['g', 2]], 14], [[12, 'glue'], [14, 'glue'], [14, 'glue'], [6, 'end']]), ('control layout', [[['b', 2], ['g', 1], ['g', 1], ['b', 2], ['g', 2], ['b', 6], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 3], ['g', 1]], 16], [[16, 'glue'], [11, 'end']])]]\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-box-glue-penalty-penalty-width-accounting","generated_at":"2026-09-29T14:49:50.297118+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":"Add the penalty width only when the break is taken there.","root_cause":"The break width at a penalty omits the penalty width.","sha256":"bf52313ba01a1c7a473546e16ddd264b9ff09aac521c3fee1bf5a9346d07c3f1","title":"Box-glue-penalty breakpoints: penalty width accounting · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.839,"exit_code":1,"observations":[{"actual":[[6,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":true},{"actual":[[13,"glue"],[19,"penalty"]],"check":"regression: penalty width accounting","expected":[[12,"glue"],[18,"penalty"]],"passed":false},{"actual":[[8,"penalty"],[8,"forced"],[9,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"check":"regression: penalty width accounting","expected":[[12,"penalty"],[1,"forced"],[9,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"passed":false},{"actual":[[5,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[7,"end"]],"check":"regression: penalty width accounting","expected":[[5,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[6,"end"]],"passed":false},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[9,"glue"],[3,"end"]],"check":"inhibited penalty","expected":[[9,"glue"],[3,"end"]],"passed":true},{"actual":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"check":"control layout","expected":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"passed":true},{"actual":[[15,"glue"],[15,"glue"],[15,"glue"]],"check":"control layout","expected":[[15,"glue"],[15,"glue"],[15,"glue"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hyphen penalty taken\", \"actual\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[13, \"glue\"], [19, \"penalty\"]], \"expected\": [[12, \"glue\"], [18, \"penalty\"]], \"passed\": false}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[8, \"penalty\"], [8, \"forced\"], [9, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"expected\": [[12, \"penalty\"], [1, \"forced\"], [9, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"passed\": false}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[5, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [7, \"end\"]], \"expected\": [[5, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [6, \"end\"]], \"passed\": false}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"inhibited penalty\", \"actual\": [[9, \"glue\"], [3, \"end\"]], \"expected\": [[9, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"expected\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"expected\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.522,"exit_code":1,"observations":[{"actual":[[5,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":false},{"actual":[[12,"glue"],[17,"penalty"]],"check":"regression: penalty width accounting","expected":[[12,"glue"],[18,"penalty"]],"passed":false},{"actual":[[11,"penalty"],[1,"forced"],[8,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"check":"regression: penalty width accounting","expected":[[12,"penalty"],[1,"forced"],[9,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"passed":false},{"actual":[[4,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[6,"end"]],"check":"regression: penalty width accounting","expected":[[5,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[6,"end"]],"passed":false},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[9,"glue"],[3,"end"]],"check":"inhibited penalty","expected":[[9,"glue"],[3,"end"]],"passed":true},{"actual":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"check":"control layout","expected":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"passed":true},{"actual":[[15,"glue"],[15,"glue"],[15,"glue"]],"check":"control layout","expected":[[15,"glue"],[15,"glue"],[15,"glue"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hyphen penalty taken\", \"actual\": [[5, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": false}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[12, \"glue\"], [17, \"penalty\"]], \"expected\": [[12, \"glue\"], [18, \"penalty\"]], \"passed\": false}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[11, \"penalty\"], [1, \"forced\"], [8, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"expected\": [[12, \"penalty\"], [1, \"forced\"], [9, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"passed\": false}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[4, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [6, \"end\"]], \"expected\": [[5, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [6, \"end\"]], \"passed\": false}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"inhibited penalty\", \"actual\": [[9, \"glue\"], [3, \"end\"]], \"expected\": [[9, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"expected\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"expected\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.901,"exit_code":0,"observations":[{"actual":[[6,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":true},{"actual":[[12,"glue"],[18,"penalty"]],"check":"regression: penalty width accounting","expected":[[12,"glue"],[18,"penalty"]],"passed":true},{"actual":[[12,"penalty"],[1,"forced"],[9,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"check":"regression: penalty width accounting","expected":[[12,"penalty"],[1,"forced"],[9,"penalty"],[6,"glue"],[5,"glue"],[7,"end"]],"passed":true},{"actual":[[5,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[6,"end"]],"check":"regression: penalty width accounting","expected":[[5,"penalty"],[7,"glue"],[3,"glue"],[7,"penalty"],[3,"forced"],[6,"end"]],"passed":true},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[9,"glue"],[3,"end"]],"check":"inhibited penalty","expected":[[9,"glue"],[3,"end"]],"passed":true},{"actual":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"check":"control layout","expected":[[7,"forced"],[5,"glue"],[7,"glue"],[4,"end"]],"passed":true},{"actual":[[15,"glue"],[15,"glue"],[15,"glue"]],"check":"control layout","expected":[[15,"glue"],[15,"glue"],[15,"glue"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"hyphen penalty taken\", \"actual\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[12, \"glue\"], [18, \"penalty\"]], \"expected\": [[12, \"glue\"], [18, \"penalty\"]], \"passed\": true}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[12, \"penalty\"], [1, \"forced\"], [9, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"expected\": [[12, \"penalty\"], [1, \"forced\"], [9, \"penalty\"], [6, \"glue\"], [5, \"glue\"], [7, \"end\"]], \"passed\": true}, {\"check\": \"regression: penalty width accounting\", \"actual\": [[5, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [6, \"end\"]], \"expected\": [[5, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [7, \"penalty\"], [3, \"forced\"], [6, \"end\"]], \"passed\": true}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"inhibited penalty\", \"actual\": [[9, \"glue\"], [3, \"end\"]], \"expected\": [[9, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"expected\": [[7, \"forced\"], [5, \"glue\"], [7, \"glue\"], [4, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"expected\": [[15, \"glue\"], [15, \"glue\"], [15, \"glue\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}