{"abstract":"Penalties left at the start of a line produce empty breaks.","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":"Dropping penalties but keeping glue leaves leading glue breakpoints.","family":"w2-typography-line-breaking-box-glue-penalty-discardable-items-at-line-start","id":"FA-80056","implementations":{"attempt":{"sha256":"f6f0c4f3db897ae72daedd008a4f16abbbb6eaedaf8740952365438507abf4fa","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] == 'p':\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 = [[('regression: discardable items at line start', [[['b', 7], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 6], [[7, 'glue'], [7, 'forced'], [5, 'glue'], [2, 'glue'], [7, 'glue'], [7, 'glue'], [8, 'penalty'], [6, 'glue'], [3, 'glue'], [5, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['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']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 1], ['p', 0, 10000, False], ['g', 1]], 6], [[6, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'glue'], [2, 'penalty'], [6, 'glue'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 7], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 6], ['g', 2]], 15], [[14, 'glue'], [7, 'glue'], [9, 'glue'], [8, 'end']]), ('control layout', [[['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 4], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 2]], 7], [[7, 'glue'], [7, 'glue'], [7, 'glue']])], [('regression: discardable items at line start', [[['b', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 2], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 6], [[1, 'glue'], [7, 'glue'], [3, 'glue'], [7, 'glue'], [2, 'forced'], [8, 'penalty'], [6, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 4], ['g', 1], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 1]], 18], [[9, 'forced'], [13, 'penalty'], [14, 'glue'], [4, 'end']]), ('partial-repair probe', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, 9999, False], ['g', 2], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 1]], 13], [[13, 'glue'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 7], ['p', 1, 50, True], ['g', 1], ['g', 1]], 17], [[9, 'forced'], [9, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 16], [[13, 'glue'], [14, 'glue'], [7, 'end']]), ('control layout', [[['b', 6], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 2]], 6], [[6, 'glue'], [7, 'glue'], [6, 'glue'], [3, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, 900, False], ['g', 1], ['b', 1], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1]], 9], [[10, 'penalty'], [3, 'glue'], [7, 'forced'], [6, 'penalty'], [7, 'glue'], [4, 'end']]), ('regression: discardable items at line start', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 2], ['b', 7], ['g', 1], ['b', 7], ['g', 2], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 2]], 12], [[5, 'glue'], [7, 'glue'], [7, 'glue'], [10, 'forced'], [5, 'end']]), ('partial-repair probe', [[['b', 4], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2]], 16], [[10, 'forced'], [8, 'end']]), ('partial-repair probe', [[['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 3], ['g', 2]], 6], [[7, 'glue'], [3, 'glue'], [3, 'glue'], [8, 'penalty'], [7, 'glue'], [5, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['b', 4], ['g', 2]], 15], [[15, 'end']]), ('control layout', [[['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1]], 17], [[13, 'glue'], [14, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 5], ['g', 1]], 6], [[4, 'glue'], [5, 'glue'], [12, 'penalty'], [7, 'glue'], [1, 'glue'], [8, 'penalty'], [4, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 3], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'glue'], [4, 'forced'], [6, 'glue'], [6, 'glue'], [3, 'end']]), ('partial-repair probe', [[['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['g', 1]], 17], [[13, 'glue'], [17, 'glue']]), ('partial-repair probe', [[['b', 2], ['g', 1], ['b', 4], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 7], ['g', 1]], 8], [[7, 'penalty'], [6, 'glue'], [8, 'glue'], [8, 'glue'], [8, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2]], 15], [[14, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 15], [[15, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1]], 14], [[11, 'glue'], [6, 'forced'], [14, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['p', 0, 9999, False], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1]], 6], [[1, 'forced'], [7, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 1], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 2]], 12], [[13, 'penalty'], [10, 'glue'], [12, 'end']]), ('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', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['g', 2], ['b', 2], ['g', 2], ['b', 6], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['g', 1], ['b', 4], ['g', 1]], 10], [[4, 'glue'], [7, 'glue'], [7, 'glue'], [6, 'glue'], [8, 'glue'], [5, '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":"b6e211d4d5ee771957154e8054ee121fd19d518cca229c062431ceb7b2d1c2ac","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] == 'g':\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 = [[('regression: discardable items at line start', [[['b', 7], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 6], [[7, 'glue'], [7, 'forced'], [5, 'glue'], [2, 'glue'], [7, 'glue'], [7, 'glue'], [8, 'penalty'], [6, 'glue'], [3, 'glue'], [5, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['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']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 1], ['p', 0, 10000, False], ['g', 1]], 6], [[6, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'glue'], [2, 'penalty'], [6, 'glue'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 7], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 6], ['g', 2]], 15], [[14, 'glue'], [7, 'glue'], [9, 'glue'], [8, 'end']]), ('control layout', [[['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 4], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 2]], 7], [[7, 'glue'], [7, 'glue'], [7, 'glue']])], [('regression: discardable items at line start', [[['b', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 2], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 6], [[1, 'glue'], [7, 'glue'], [3, 'glue'], [7, 'glue'], [2, 'forced'], [8, 'penalty'], [6, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 4], ['g', 1], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 1]], 18], [[9, 'forced'], [13, 'penalty'], [14, 'glue'], [4, 'end']]), ('partial-repair probe', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, 9999, False], ['g', 2], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 1]], 13], [[13, 'glue'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 7], ['p', 1, 50, True], ['g', 1], ['g', 1]], 17], [[9, 'forced'], [9, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 16], [[13, 'glue'], [14, 'glue'], [7, 'end']]), ('control layout', [[['b', 6], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 2]], 6], [[6, 'glue'], [7, 'glue'], [6, 'glue'], [3, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, 900, False], ['g', 1], ['b', 1], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1]], 9], [[10, 'penalty'], [3, 'glue'], [7, 'forced'], [6, 'penalty'], [7, 'glue'], [4, 'end']]), ('regression: discardable items at line start', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 2], ['b', 7], ['g', 1], ['b', 7], ['g', 2], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 2]], 12], [[5, 'glue'], [7, 'glue'], [7, 'glue'], [10, 'forced'], [5, 'end']]), ('partial-repair probe', [[['b', 4], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2]], 16], [[10, 'forced'], [8, 'end']]), ('partial-repair probe', [[['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 3], ['g', 2]], 6], [[7, 'glue'], [3, 'glue'], [3, 'glue'], [8, 'penalty'], [7, 'glue'], [5, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['b', 4], ['g', 2]], 15], [[15, 'end']]), ('control layout', [[['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1]], 17], [[13, 'glue'], [14, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 5], ['g', 1]], 6], [[4, 'glue'], [5, 'glue'], [12, 'penalty'], [7, 'glue'], [1, 'glue'], [8, 'penalty'], [4, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 3], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'glue'], [4, 'forced'], [6, 'glue'], [6, 'glue'], [3, 'end']]), ('partial-repair probe', [[['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['g', 1]], 17], [[13, 'glue'], [17, 'glue']]), ('partial-repair probe', [[['b', 2], ['g', 1], ['b', 4], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 7], ['g', 1]], 8], [[7, 'penalty'], [6, 'glue'], [8, 'glue'], [8, 'glue'], [8, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2]], 15], [[14, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 15], [[15, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1]], 14], [[11, 'glue'], [6, 'forced'], [14, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['p', 0, 9999, False], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1]], 6], [[1, 'forced'], [7, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 1], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 2]], 12], [[13, 'penalty'], [10, 'glue'], [12, 'end']]), ('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', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['g', 2], ['b', 2], ['g', 2], ['b', 6], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['g', 1], ['b', 4], ['g', 1]], 10], [[4, 'glue'], [7, 'glue'], [7, 'glue'], [6, 'glue'], [8, 'glue'], [5, '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":"9744d5cf959122298dde5fe54eaa60de0a14f8bc25e5040bbe4e68275e6b81e4","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 = [[('regression: discardable items at line start', [[['b', 7], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 1], ['g', 1]], 6], [[7, 'glue'], [7, 'forced'], [5, 'glue'], [2, 'glue'], [7, 'glue'], [7, 'glue'], [8, 'penalty'], [6, 'glue'], [3, 'glue'], [5, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['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']]), ('partial-repair probe', [[['b', 6], ['g', 1], ['b', 6], ['g', 2], ['b', 2], ['g', 1], ['b', 3], ['g', 1], ['b', 5], ['g', 1], ['b', 2], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['g', 2], ['b', 1], ['p', 0, 10000, False], ['g', 1]], 6], [[6, 'glue'], [6, 'glue'], [6, 'glue'], [5, 'glue'], [2, 'penalty'], [6, 'glue'], [6, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 7], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['g', 1], ['b', 3], ['g', 2], ['b', 6], ['g', 2]], 15], [[14, 'glue'], [7, 'glue'], [9, 'glue'], [8, 'end']]), ('control layout', [[['b', 2], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 4], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 2]], 7], [[7, 'glue'], [7, 'glue'], [7, 'glue']])], [('regression: discardable items at line start', [[['b', 1], ['g', 1], ['b', 7], ['g', 2], ['b', 3], ['g', 1], ['b', 7], ['g', 2], ['b', 2], ['p', 0, -10000, False], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 2], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 6], ['g', 2], ['b', 5], ['p', 0, 10000, False], ['g', 1]], 6], [[1, 'glue'], [7, 'glue'], [3, 'glue'], [7, 'glue'], [2, 'forced'], [8, 'penalty'], [6, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 4], ['g', 1], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 2], ['b', 7], ['g', 1], ['b', 4], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 1]], 18], [[9, 'forced'], [13, 'penalty'], [14, 'glue'], [4, 'end']]), ('partial-repair probe', [[['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, 9999, False], ['g', 2], ['b', 4], ['g', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 3], ['g', 1]], 13], [[13, 'glue'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 0, -10000, False], ['g', 2], ['b', 7], ['p', 1, 50, True], ['g', 1], ['g', 1]], 17], [[9, 'forced'], [9, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 3], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2]], 16], [[13, 'glue'], [14, 'glue'], [7, 'end']]), ('control layout', [[['b', 6], ['g', 1], ['b', 7], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['g', 1], ['b', 3], ['g', 2]], 6], [[6, 'glue'], [7, 'glue'], [6, 'glue'], [3, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 1], ['p', 1, 50, True], ['g', 2], ['b', 1], ['p', 0, 900, False], ['g', 1], ['b', 1], ['g', 1], ['g', 1], ['b', 7], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1]], 9], [[10, 'penalty'], [3, 'glue'], [7, 'forced'], [6, 'penalty'], [7, 'glue'], [4, 'end']]), ('regression: discardable items at line start', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 2], ['b', 7], ['g', 1], ['b', 7], ['g', 2], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 2]], 12], [[5, 'glue'], [7, 'glue'], [7, 'glue'], [10, 'forced'], [5, 'end']]), ('partial-repair probe', [[['b', 4], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['g', 1], ['b', 1], ['p', 0, -10000, False], ['g', 1], ['g', 1], ['b', 6], ['p', 1, 50, True], ['g', 2]], 16], [[10, 'forced'], [8, 'end']]), ('partial-repair probe', [[['b', 7], ['g', 2], ['b', 3], ['g', 2], ['b', 3], ['g', 1], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 3], ['g', 2]], 6], [[7, 'glue'], [3, 'glue'], [3, 'glue'], [8, 'penalty'], [7, 'glue'], [5, 'end']]), ('inhibited penalty', [[['b', 5], ['p', 0, 10000, False], ['b', 4], ['g', 1], ['b', 3]], 7], [[9, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 1], ['p', 0, 10000, False], ['g', 1], ['b', 3], ['g', 1], ['b', 2], ['g', 1], ['b', 4], ['g', 2]], 15], [[15, 'end']]), ('control layout', [[['b', 7], ['p', 1, 50, True], ['g', 1], ['b', 5], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 2], ['b', 5], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 4], ['p', 0, 10000, False], ['g', 1]], 17], [[13, 'glue'], [14, 'glue'], [5, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 2], ['b', 3], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 7], ['g', 1], ['g', 1], ['b', 1], ['g', 2], ['b', 7], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 1], ['b', 5], ['g', 1]], 6], [[4, 'glue'], [5, 'glue'], [12, 'penalty'], [7, 'glue'], [1, 'glue'], [8, 'penalty'], [4, 'glue'], [6, 'end']]), ('regression: discardable items at line start', [[['b', 3], ['g', 2], ['b', 4], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 1], ['g', 2], ['b', 3], ['g', 2], ['b', 6], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 8], [[3, 'glue'], [4, 'forced'], [6, 'glue'], [6, 'glue'], [3, 'end']]), ('partial-repair probe', [[['b', 5], ['p', 1, 50, True], ['g', 2], ['b', 3], ['g', 1], ['b', 2], ['g', 2], ['b', 5], ['g', 1], ['b', 2], ['g', 2], ['b', 7], ['g', 1], ['g', 1]], 17], [[13, 'glue'], [17, 'glue']]), ('partial-repair probe', [[['b', 2], ['g', 1], ['b', 4], ['p', 0, 900, False], ['g', 2], ['b', 6], ['g', 2], ['b', 1], ['g', 1], ['b', 6], ['g', 2], ['b', 3], ['p', 0, 10000, False], ['g', 1], ['b', 4], ['g', 1], ['g', 1], ['b', 7], ['g', 1]], 8], [[7, 'penalty'], [6, 'glue'], [8, 'glue'], [8, 'glue'], [8, 'end']]), ('hyphen penalty taken', [[['b', 5], ['p', 1, 50, True], ['b', 4], ['g', 1], ['b', 3]], 7], [[6, 'penalty'], [4, 'glue'], [3, 'end']]), ('forced break', [[['b', 2], ['g', 1], ['b', 2], ['p', 0, -10000, False], ['b', 3]], 20], [[5, 'forced'], [3, 'end']]), ('control layout', [[['b', 5], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2]], 15], [[14, 'glue'], [5, 'end']]), ('control layout', [[['b', 1], ['p', 1, 50, True], ['g', 1], ['b', 3], ['p', 1, 50, True], ['g', 1], ['b', 4], ['g', 2], ['b', 2], ['p', 1, 50, True], ['g', 1]], 15], [[15, 'end']])], [('regression: discardable items at line start', [[['b', 4], ['g', 1], ['g', 1], ['b', 5], ['g', 1], ['b', 3], ['g', 2], ['b', 1], ['p', 0, -10000, False], ['p', 1, 50, True], ['g', 1], ['b', 5], ['p', 1, 50, True], ['g', 1], ['b', 7], ['p', 1, 50, True], ['g', 1]], 14], [[11, 'glue'], [6, 'forced'], [14, 'end']]), ('regression: discardable items at line start', [[['b', 7], ['g', 2], ['b', 7], ['g', 1], ['b', 5], ['p', 0, 10000, False], ['g', 1], ['b', 6], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1]], 10], [[7, 'glue'], [7, 'glue'], [13, 'penalty']]), ('partial-repair probe', [[['b', 1], ['p', 0, -10000, False], ['g', 1], ['b', 6], ['p', 0, 9999, False], ['p', 1, 50, True], ['g', 1], ['b', 2], ['p', 1, 50, True], ['g', 2], ['b', 1], ['g', 1]], 6], [[1, 'forced'], [7, 'penalty'], [6, 'end']]), ('partial-repair probe', [[['b', 2], ['g', 2], ['b', 6], ['p', 0, 10000, False], ['g', 1], ['b', 1], ['p', 1, 50, True], ['p', 1, 50, True], ['g', 1], ['b', 4], ['p', 1, 50, True], ['g', 1], ['b', 3], ['g', 1], ['b', 1], ['g', 1], ['b', 4], ['p', 0, 10000, False], ['g', 1], ['b', 5], ['g', 2]], 12], [[13, 'penalty'], [10, 'glue'], [12, 'end']]), ('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', 4], ['g', 2], ['b', 6], ['g', 1], ['b', 6], ['g', 1], ['b', 2], ['p', 0, 10000, False], ['g', 1]], 14], [[12, 'glue'], [10, 'end']]), ('control layout', [[['b', 4], ['g', 2], ['b', 7], ['g', 1], ['b', 3], ['g', 2], ['b', 2], ['g', 2], ['b', 6], ['g', 2], ['b', 4], ['g', 2], ['b', 2], ['g', 1], ['b', 4], ['g', 1]], 10], [[4, 'glue'], [7, 'glue'], [7, 'glue'], [6, 'glue'], [8, 'glue'], [5, '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-discardable-items-at-line-start","generated_at":"2026-09-29T14:49:50.298515+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":"Drop every non-box item at the start of a line.","root_cause":"Only glue is discarded after a break; penalties survive at the line start.","sha256":"74bb09aaf936aecf65ff71f1da04fe68eea134be5b54f2f7b5e4c88b9082f6d3","title":"Box-glue-penalty breakpoints: discardable items at line start · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.163,"exit_code":1,"observations":[{"actual":[[7,"glue"],[8,"forced"],[6,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[7,"glue"],[3,"glue"],[5,"end"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"forced"],[5,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[6,"glue"],[3,"glue"],[5,"end"]],"passed":false},{"actual":[[7,"glue"],[7,"glue"],[13,"penalty"],[1,"end"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"glue"],[13,"penalty"]],"passed":false},{"actual":[[2,"glue"],[6,"glue"],[8,"penalty"],[5,"penalty"],[9,"penalty"],[3,"end"]],"check":"partial-repair probe","expected":[[2,"glue"],[6,"glue"],[7,"penalty"],[4,"penalty"],[8,"penalty"],[2,"end"]],"passed":false},{"actual":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[8,"glue"],[6,"end"]],"check":"partial-repair probe","expected":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[6,"glue"],[6,"end"]],"passed":false},{"actual":[[6,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":true},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"check":"control layout","expected":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"passed":true},{"actual":[[7,"glue"],[7,"glue"],[7,"glue"]],"check":"control layout","expected":[[7,"glue"],[7,"glue"],[7,"glue"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [8, \"forced\"], [6, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [7, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"expected\": [[7, \"glue\"], [7, \"forced\"], [5, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [6, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"passed\": false}, {\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"], [1, \"end\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[2, \"glue\"], [6, \"glue\"], [8, \"penalty\"], [5, \"penalty\"], [9, \"penalty\"], [3, \"end\"]], \"expected\": [[2, \"glue\"], [6, \"glue\"], [7, \"penalty\"], [4, \"penalty\"], [8, \"penalty\"], [2, \"end\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [8, \"glue\"], [6, \"end\"]], \"expected\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [6, \"glue\"], [6, \"end\"]], \"passed\": false}, {\"check\": \"hyphen penalty taken\", \"actual\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"expected\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.144,"exit_code":1,"observations":[{"actual":[[7,"glue"],[7,"forced"],[6,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[6,"glue"],[3,"glue"],[5,"end"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"forced"],[5,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[6,"glue"],[3,"glue"],[5,"end"]],"passed":false},{"actual":[[7,"glue"],[7,"glue"],[13,"penalty"],[1,"end"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"glue"],[13,"penalty"]],"passed":false},{"actual":[[2,"glue"],[6,"glue"],[7,"penalty"],[4,"penalty"],[8,"penalty"],[2,"end"]],"check":"partial-repair probe","expected":[[2,"glue"],[6,"glue"],[7,"penalty"],[4,"penalty"],[8,"penalty"],[2,"end"]],"passed":true},{"actual":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[6,"glue"],[6,"end"]],"check":"partial-repair probe","expected":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[6,"glue"],[6,"end"]],"passed":true},{"actual":[[6,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":true},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"check":"control layout","expected":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"passed":true},{"actual":[[7,"glue"],[7,"glue"],[7,"glue"]],"check":"control layout","expected":[[7,"glue"],[7,"glue"],[7,"glue"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [7, \"forced\"], [6, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [6, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"expected\": [[7, \"glue\"], [7, \"forced\"], [5, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [6, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"passed\": false}, {\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"], [1, \"end\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[2, \"glue\"], [6, \"glue\"], [7, \"penalty\"], [4, \"penalty\"], [8, \"penalty\"], [2, \"end\"]], \"expected\": [[2, \"glue\"], [6, \"glue\"], [7, \"penalty\"], [4, \"penalty\"], [8, \"penalty\"], [2, \"end\"]], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [6, \"glue\"], [6, \"end\"]], \"expected\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [6, \"glue\"], [6, \"end\"]], \"passed\": true}, {\"check\": \"hyphen penalty taken\", \"actual\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"expected\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.453,"exit_code":0,"observations":[{"actual":[[7,"glue"],[7,"forced"],[5,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[6,"glue"],[3,"glue"],[5,"end"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"forced"],[5,"glue"],[2,"glue"],[7,"glue"],[7,"glue"],[8,"penalty"],[6,"glue"],[3,"glue"],[5,"end"]],"passed":true},{"actual":[[7,"glue"],[7,"glue"],[13,"penalty"]],"check":"regression: discardable items at line start","expected":[[7,"glue"],[7,"glue"],[13,"penalty"]],"passed":true},{"actual":[[2,"glue"],[6,"glue"],[7,"penalty"],[4,"penalty"],[8,"penalty"],[2,"end"]],"check":"partial-repair probe","expected":[[2,"glue"],[6,"glue"],[7,"penalty"],[4,"penalty"],[8,"penalty"],[2,"end"]],"passed":true},{"actual":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[6,"glue"],[6,"end"]],"check":"partial-repair probe","expected":[[6,"glue"],[6,"glue"],[6,"glue"],[5,"glue"],[2,"penalty"],[6,"glue"],[6,"end"]],"passed":true},{"actual":[[6,"penalty"],[4,"glue"],[3,"end"]],"check":"hyphen penalty taken","expected":[[6,"penalty"],[4,"glue"],[3,"end"]],"passed":true},{"actual":[[5,"forced"],[3,"end"]],"check":"forced break","expected":[[5,"forced"],[3,"end"]],"passed":true},{"actual":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"check":"control layout","expected":[[14,"glue"],[7,"glue"],[9,"glue"],[8,"end"]],"passed":true},{"actual":[[7,"glue"],[7,"glue"],[7,"glue"]],"check":"control layout","expected":[[7,"glue"],[7,"glue"],[7,"glue"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [7, \"forced\"], [5, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [6, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"expected\": [[7, \"glue\"], [7, \"forced\"], [5, \"glue\"], [2, \"glue\"], [7, \"glue\"], [7, \"glue\"], [8, \"penalty\"], [6, \"glue\"], [3, \"glue\"], [5, \"end\"]], \"passed\": true}, {\"check\": \"regression: discardable items at line start\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [13, \"penalty\"]], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [[2, \"glue\"], [6, \"glue\"], [7, \"penalty\"], [4, \"penalty\"], [8, \"penalty\"], [2, \"end\"]], \"expected\": [[2, \"glue\"], [6, \"glue\"], [7, \"penalty\"], [4, \"penalty\"], [8, \"penalty\"], [2, \"end\"]], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [6, \"glue\"], [6, \"end\"]], \"expected\": [[6, \"glue\"], [6, \"glue\"], [6, \"glue\"], [5, \"glue\"], [2, \"penalty\"], [6, \"glue\"], [6, \"end\"]], \"passed\": true}, {\"check\": \"hyphen penalty taken\", \"actual\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"expected\": [[6, \"penalty\"], [4, \"glue\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"forced break\", \"actual\": [[5, \"forced\"], [3, \"end\"]], \"expected\": [[5, \"forced\"], [3, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"expected\": [[14, \"glue\"], [7, \"glue\"], [9, \"glue\"], [8, \"end\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"expected\": [[7, \"glue\"], [7, \"glue\"], [7, \"glue\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}