{"abstract":"Green split allocation returns a wrong result when leftover seconds go to the smallest remainders.","category":"Traffic signal timing plans","checks":8,"contract":"Input {cycle, lost, ratios: per-phase critical flow ratios [num, den], min_green: per-phase minima}. Effective green G = cycle - lost is shared in proportion to the ratios; each phase gets the floor of its ideal share and remaining seconds go one each by largest fractional remainder (ties to the lower phase index). Then each phase below its minimum (in index order) takes seconds one at a time from the phase with the largest surplus over its own minimum (ties to the lower index). If the minima exceed G return 'infeasible'. Return the list of integer greens.","evaluation_group":"w2-traffic_signal_timing_plans-green-split","failed_approach":"Sorting by descending remainder is right, but breaking ties toward the higher phase index violates the stipulated tie rule.","family":"w2-traffic_signal_timing_plans-green-split-remainder-order","id":"FA-67876","implementations":{"attempt":{"sha256":"22028dc2ebee6294cfb71ecafe24bf6367afc1a8e2e8d04bcfa4edc552b2651e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    G = x['cycle'] - x['lost']\n    ys = [Fraction(a, b) for a, b in x['ratios']]\n    mins = x['min_green']\n    if sum(mins) > G:\n        return 'infeasible'\n    Y = sum(ys)\n    ideal = [G * y / Y for y in ys]\n    g = [int(v) for v in ideal]\n    left = G - sum(g)\n    order = sorted(range(len(g)), key=lambda i: (-(ideal[i] - g[i]), -i))\n    for i in order[:left]:\n        g[i] += 1\n    for i in range(len(g)):\n        while g[i] < mins[i]:\n            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))\n            g[donor] -= 1\n            g[i] += 1\n    return g\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('timing oracle' + ' %d' % i, 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":"895f9c5e0ed7f34e83d72f111be42b06e4cee81181d6dca411d68ea2c849ff30","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    G = x['cycle'] - x['lost']\n    ys = [Fraction(a, b) for a, b in x['ratios']]\n    mins = x['min_green']\n    if sum(mins) > G:\n        return 'infeasible'\n    Y = sum(ys)\n    ideal = [G * y / Y for y in ys]\n    g = [int(v) for v in ideal]\n    left = G - sum(g)\n    order = sorted(range(len(g)), key=lambda i: (ideal[i] - g[i], i))\n    for i in order[:left]:\n        g[i] += 1\n    for i in range(len(g)):\n        while g[i] < mins[i]:\n            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))\n            g[donor] -= 1\n            g[i] += 1\n    return g\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('timing oracle' + ' %d' % i, 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":"46f07ab05e059cad5a20e115231752e3d66b71eece06e16a19a5a794dc3ba492","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    G = x['cycle'] - x['lost']\n    ys = [Fraction(a, b) for a, b in x['ratios']]\n    mins = x['min_green']\n    if sum(mins) > G:\n        return 'infeasible'\n    Y = sum(ys)\n    ideal = [G * y / Y for y in ys]\n    g = [int(v) for v in ideal]\n    left = G - sum(g)\n    order = sorted(range(len(g)), key=lambda i: (-(ideal[i] - g[i]), i))\n    for i in order[:left]:\n        g[i] += 1\n    for i in range(len(g)):\n        while g[i] < mins[i]:\n            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))\n            g[donor] -= 1\n            g[i] += 1\n    return g\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('timing oracle' + ' %d' % i, 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, bounded toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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-traffic_signal_timing_plans-green-split-remainder-order","generated_at":"2026-09-29T14:47:56.967254+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Signal timing arithmetic is exact and integer or rational; a wrong rule silently produces unsafe or inefficient timing plans.","repair":"Restore the largest remainder distribution rule so that the step reads `key=lambda i: (-(ideal[i] - g[i]), i)`.","root_cause":"The sort key is ascending on the fractional remainder, so the phases closest to their floors receive the spare seconds.","sha256":"4c85c384ea4cfd2a02f036261bb3aabe1e47d054b0fc1e0c42e22d54cb22a9fd","title":"Green split allocation: leftover seconds go to the smallest remainders · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.355,"exit_code":1,"observations":[{"actual":[21,21,21,22],"check":"timing oracle 0","expected":[22,21,21,21],"passed":false},{"actual":[26,26,26],"check":"timing oracle 1","expected":[26,26,26],"passed":true},{"actual":[25,26,26],"check":"timing oracle 2","expected":[26,26,25],"passed":false},{"actual":[20,35],"check":"timing oracle 3","expected":[20,35],"passed":true},{"actual":[27,27],"check":"timing oracle 4","expected":[27,27],"passed":true},{"actual":[16,10,11,32],"check":"timing oracle 5","expected":[16,10,11,32],"passed":true},{"actual":[46,55,15],"check":"timing oracle 6","expected":[46,55,15],"passed":true},{"actual":[63,23],"check":"timing oracle 7","expected":[63,23],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [21, 21, 21, 22], \"expected\": [22, 21, 21, 21], \"passed\": false}, {\"check\": \"timing oracle 1\", \"actual\": [26, 26, 26], \"expected\": [26, 26, 26], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [25, 26, 26], \"expected\": [26, 26, 25], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [20, 35], \"expected\": [20, 35], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [27, 27], \"expected\": [27, 27], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [16, 10, 11, 32], \"expected\": [16, 10, 11, 32], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [46, 55, 15], \"expected\": [46, 55, 15], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [63, 23], \"expected\": [63, 23], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.952,"exit_code":1,"observations":[{"actual":[22,21,21,21],"check":"timing oracle 0","expected":[22,21,21,21],"passed":true},{"actual":[26,26,26],"check":"timing oracle 1","expected":[26,26,26],"passed":true},{"actual":[26,26,25],"check":"timing oracle 2","expected":[26,26,25],"passed":true},{"actual":[20,35],"check":"timing oracle 3","expected":[20,35],"passed":true},{"actual":[27,27],"check":"timing oracle 4","expected":[27,27],"passed":true},{"actual":[15,11,12,31],"check":"timing oracle 5","expected":[16,10,11,32],"passed":false},{"actual":[46,54,16],"check":"timing oracle 6","expected":[46,55,15],"passed":false},{"actual":[62,24],"check":"timing oracle 7","expected":[63,23],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [22, 21, 21, 21], \"expected\": [22, 21, 21, 21], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [26, 26, 26], \"expected\": [26, 26, 26], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [26, 26, 25], \"expected\": [26, 26, 25], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [20, 35], \"expected\": [20, 35], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [27, 27], \"expected\": [27, 27], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [15, 11, 12, 31], \"expected\": [16, 10, 11, 32], \"passed\": false}, {\"check\": \"timing oracle 6\", \"actual\": [46, 54, 16], \"expected\": [46, 55, 15], \"passed\": false}, {\"check\": \"timing oracle 7\", \"actual\": [62, 24], \"expected\": [63, 23], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.242,"exit_code":0,"observations":[{"actual":[22,21,21,21],"check":"timing oracle 0","expected":[22,21,21,21],"passed":true},{"actual":[26,26,26],"check":"timing oracle 1","expected":[26,26,26],"passed":true},{"actual":[26,26,25],"check":"timing oracle 2","expected":[26,26,25],"passed":true},{"actual":[20,35],"check":"timing oracle 3","expected":[20,35],"passed":true},{"actual":[27,27],"check":"timing oracle 4","expected":[27,27],"passed":true},{"actual":[16,10,11,32],"check":"timing oracle 5","expected":[16,10,11,32],"passed":true},{"actual":[46,55,15],"check":"timing oracle 6","expected":[46,55,15],"passed":true},{"actual":[63,23],"check":"timing oracle 7","expected":[63,23],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [22, 21, 21, 21], \"expected\": [22, 21, 21, 21], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [26, 26, 26], \"expected\": [26, 26, 26], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [26, 26, 25], \"expected\": [26, 26, 25], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [20, 35], \"expected\": [20, 35], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [27, 27], \"expected\": [27, 27], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [16, 10, 11, 32], \"expected\": [16, 10, 11, 32], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [46, 55, 15], \"expected\": [46, 55, 15], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [63, 23], \"expected\": [63, 23], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}