{"abstract":"Actuated phase gap-out and max-out returns a wrong result when the max timer runs from the start of green.","category":"Traffic signal timing plans","checks":8,"contract":"Input {min_green, gap, max_green, actuations: integer seconds since green start (any order), conflict_call: seconds or null}. Each actuation at a keeps the phase eligible until a+gap; an actuation exactly at expiry extends; actuations during min green always extend. Gap-out time = max(min_green, final expiry). With no conflicting call return ['rest', gap time]. The max timer starts at the call (a call before green start counts as 0); max-out at call+max_green. If gap time <= max-out the phase ends by 'gap-out' at max(gap time, call), else by 'max-out'.","evaluation_group":"w2-traffic_signal_timing_plans-gap-max-out","failed_approach":"Subtracting min green from the call-based timer is still not the stipulated max-out instant.","family":"w2-traffic_signal_timing_plans-gap-max-out-max-timer-start","id":"FA-67971","implementations":{"attempt":{"sha256":"8aed73e3405174c22fe6d63ec6799029c02a1b6a1b909485513638fe471dcf6f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    m, p, M = x['min_green'], x['gap'], x['max_green']\n    exp = 0\n    for a in sorted(x['actuations']):\n        if a > exp and a > m:\n            break\n        exp = max(exp, a + p)\n    gap_end = max(m, exp)\n    tc = x['conflict_call']\n    if tc is None:\n        return ['rest', gap_end]\n    tc = max(tc, 0)\n    max_end = tc + M - m\n    if gap_end <= max_end:\n        return ['gap-out', max(gap_end, tc)]\n    return ['max-out', max_end]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'min_green': 4, 'gap': 4, 'max_green': 38, 'actuations': [2, 5, 6, 7, 8, 14, 16, 20, 23, 24, 26, 30, 32, 35, 41, 44, 49, 51, 54, 56, 59], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 7, 'gap': 5, 'max_green': 40, 'actuations': [2, 3, 5, 7, 10, 12, 13, 14, 15, 18, 19, 20, 25, 29, 32, 33, 35, 37, 39, 44, 45, 46, 51, 52, 54, 57], 'conflict_call': 34}, ['gap-out', 62]), ({'min_green': 8, 'gap': 5, 'max_green': 37, 'actuations': [2, 6, 8, 10, 11, 12, 14, 16, 17, 18, 19, 24, 25, 27, 28, 30, 31, 35, 37, 39, 43, 45, 46, 47, 48, 49, 50, 51, 55, 57], 'conflict_call': 20}, ['max-out', 57]), ({'min_green': 7, 'gap': 3, 'max_green': 15, 'actuations': [46, 42, 45, 38, 32, 27, 3, 9, 1, 15, 24, 16, 56, 2, 22, 40, 20, 14, 7, 28, 26, 8, 55, 58, 29, 5, 48, 59, 34, 35, 11], 'conflict_call': 23}, ['gap-out', 23]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 3, 'max_green': 20, 'actuations': [1, 4, 7, 10, 13], 'conflict_call': 2}, ['gap-out', 16]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 9, 'gap': 4, 'max_green': 38, 'actuations': [13, 39, 8, 1, 36, 52, 20, 18, 53, 9, 45, 56, 55, 17, 2, 58, 23, 42, 26, 24, 14, 7, 34, 11, 33, 30, 51, 54, 28, 35, 50], 'conflict_call': 27}, ['gap-out', 49])], [({'min_green': 6, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 4, 5, 8, 9, 10, 13, 14, 19, 21, 22, 27, 28, 30, 31, 33, 35, 38, 39, 40, 42, 44, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59], 'conflict_call': 16}, ['gap-out', 17]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7]), ({'min_green': 4, 'gap': 2, 'max_green': 38, 'actuations': [0, 5, 6, 7, 10, 11, 16, 17, 20, 21, 24, 27, 29, 31, 33, 34, 35, 39, 41, 43, 46, 47, 48, 49, 52, 55, 57, 58], 'conflict_call': 11}, ['gap-out', 11]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 4, 'gap': 5, 'max_green': 23, 'actuations': [1, 3, 6, 8, 11, 12, 15, 20, 25, 27, 28, 29, 31, 35, 37, 38, 41, 42, 43, 44, 50, 57], 'conflict_call': 10}, ['max-out', 33]), ({'min_green': 10, 'gap': 5, 'max_green': 25, 'actuations': [1, 3, 7, 9, 10, 14, 16, 18, 19, 23, 24, 26, 27, 28, 30, 34, 35, 37, 38, 42, 43, 44, 46, 49, 54, 59], 'conflict_call': 20}, ['max-out', 45]), ({'min_green': 10, 'gap': 3, 'max_green': 43, 'actuations': [0, 4, 7, 12, 14, 21, 24, 25, 41, 44, 47, 59], 'conflict_call': 10}, ['gap-out', 10]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3])], [({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 31, 'actuations': [7, 8, 11, 14, 15, 21, 27, 32, 37, 46, 52, 57], 'conflict_call': None}, ['rest', 4]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 5, 'max_green': 22, 'actuations': [1, 3, 5, 9, 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 27, 29, 31, 32, 34, 36, 37, 38, 40, 47, 49, 52, 55, 56, 57, 58, 59], 'conflict_call': 32}, ['gap-out', 45]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 5, 'gap': 4, 'max_green': 44, 'actuations': [1, 3, 4, 5, 6, 7, 10, 16, 17, 19, 20, 21, 25, 26, 28, 29, 32, 33, 34, 35, 38, 39, 41, 43, 44, 47, 49, 52, 56, 57, 58, 59], 'conflict_call': None}, ['rest', 14]), ({'min_green': 8, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 3, 6, 9, 11, 12, 14, 15, 17, 18, 19, 21, 22, 25, 27, 30, 31, 36, 38, 41, 42, 43, 45, 48, 52, 53, 55, 57, 59], 'conflict_call': 31}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 45, 'actuations': [2, 3, 4, 5, 6, 7, 11, 12, 15, 17, 18, 20, 21, 22, 23, 25, 28, 29, 34, 35, 36, 37, 39, 41, 42, 49, 50, 51, 55, 56], 'conflict_call': 29}, ['gap-out', 47])], [({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 33, 'actuations': [13, 36, 51, 10, 4, 20, 44, 6, 49, 32, 40, 7, 47, 14, 21, 31, 29, 8, 9, 56, 53, 50, 38, 5, 24, 27, 12, 17, 45, 52, 54], 'conflict_call': -6}, ['max-out', 33]), ({'min_green': 9, 'gap': 5, 'max_green': 34, 'actuations': [0, 2, 8, 9, 10, 11, 14, 16, 18, 23, 27, 29, 30, 31, 36, 38, 39, 40, 48, 50, 53, 55, 56], 'conflict_call': 33}, ['gap-out', 45]), ({'min_green': 10, 'gap': 5, 'max_green': 28, 'actuations': [13, 1, 18, 8, 59, 45, 3, 31, 4, 36, 12, 50, 6, 46, 7, 34, 40, 54, 19, 53, 48, 20, 52, 25, 57, 47, 5, 24, 16], 'conflict_call': 31}, ['gap-out', 31]), ({'min_green': 7, 'gap': 2, 'max_green': 31, 'actuations': [0, 2, 3, 7, 9, 19, 21, 23, 25, 28, 30, 38, 41, 43, 44, 48, 49, 51, 53, 56, 57], 'conflict_call': None}, ['rest', 11]), ({'min_green': 8, 'gap': 4, 'max_green': 44, 'actuations': [0, 2, 4, 6, 9, 12, 13, 15, 17, 18, 19, 23, 26, 29, 30, 32, 33, 35, 36, 38, 40, 41, 42, 44, 45, 47, 48, 49, 50, 51, 55, 56], 'conflict_call': 15}, ['max-out', 59])], [({'min_green': 7, 'gap': 5, 'max_green': 38, 'actuations': [1, 3, 5, 6, 8, 9, 10, 11, 12, 13, 16, 18, 21, 23, 25, 26, 29, 31, 33, 34, 37, 38, 40, 41, 43, 44, 46, 48, 53, 54, 56, 57, 59], 'conflict_call': 12}, ['max-out', 50]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 7, 'gap': 3, 'max_green': 19, 'actuations': [0, 2, 5, 6, 7, 12, 15, 17, 21, 24, 25, 26, 27, 28, 29, 33, 34, 36, 38, 39, 40, 41, 44, 45, 47, 49, 50, 53, 54, 56], 'conflict_call': 0}, ['gap-out', 10]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 5, 'gap': 4, 'max_green': 41, 'actuations': [1, 2, 4, 6, 7, 8, 10, 13, 14, 17, 18, 19, 20, 21, 25, 26, 27, 28, 32, 35, 37, 38, 39, 40, 41, 43, 45, 47, 48, 50, 54, 55, 59], 'conflict_call': 31}, ['gap-out', 63]), ({'min_green': 10, 'gap': 4, 'max_green': 21, 'actuations': [5, 30, 36, 38, 46, 55], 'conflict_call': 34}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 28, 'actuations': [2, 7, 57], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15])]]\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":"c52f611598d42d39a2a981c89d329d08c7d8e0c8f46f2ca793b4fde89c55f1ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    m, p, M = x['min_green'], x['gap'], x['max_green']\n    exp = 0\n    for a in sorted(x['actuations']):\n        if a > exp and a > m:\n            break\n        exp = max(exp, a + p)\n    gap_end = max(m, exp)\n    tc = x['conflict_call']\n    if tc is None:\n        return ['rest', gap_end]\n    tc = max(tc, 0)\n    max_end = M\n    if gap_end <= max_end:\n        return ['gap-out', max(gap_end, tc)]\n    return ['max-out', max_end]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'min_green': 4, 'gap': 4, 'max_green': 38, 'actuations': [2, 5, 6, 7, 8, 14, 16, 20, 23, 24, 26, 30, 32, 35, 41, 44, 49, 51, 54, 56, 59], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 7, 'gap': 5, 'max_green': 40, 'actuations': [2, 3, 5, 7, 10, 12, 13, 14, 15, 18, 19, 20, 25, 29, 32, 33, 35, 37, 39, 44, 45, 46, 51, 52, 54, 57], 'conflict_call': 34}, ['gap-out', 62]), ({'min_green': 8, 'gap': 5, 'max_green': 37, 'actuations': [2, 6, 8, 10, 11, 12, 14, 16, 17, 18, 19, 24, 25, 27, 28, 30, 31, 35, 37, 39, 43, 45, 46, 47, 48, 49, 50, 51, 55, 57], 'conflict_call': 20}, ['max-out', 57]), ({'min_green': 7, 'gap': 3, 'max_green': 15, 'actuations': [46, 42, 45, 38, 32, 27, 3, 9, 1, 15, 24, 16, 56, 2, 22, 40, 20, 14, 7, 28, 26, 8, 55, 58, 29, 5, 48, 59, 34, 35, 11], 'conflict_call': 23}, ['gap-out', 23]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 3, 'max_green': 20, 'actuations': [1, 4, 7, 10, 13], 'conflict_call': 2}, ['gap-out', 16]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 9, 'gap': 4, 'max_green': 38, 'actuations': [13, 39, 8, 1, 36, 52, 20, 18, 53, 9, 45, 56, 55, 17, 2, 58, 23, 42, 26, 24, 14, 7, 34, 11, 33, 30, 51, 54, 28, 35, 50], 'conflict_call': 27}, ['gap-out', 49])], [({'min_green': 6, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 4, 5, 8, 9, 10, 13, 14, 19, 21, 22, 27, 28, 30, 31, 33, 35, 38, 39, 40, 42, 44, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59], 'conflict_call': 16}, ['gap-out', 17]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7]), ({'min_green': 4, 'gap': 2, 'max_green': 38, 'actuations': [0, 5, 6, 7, 10, 11, 16, 17, 20, 21, 24, 27, 29, 31, 33, 34, 35, 39, 41, 43, 46, 47, 48, 49, 52, 55, 57, 58], 'conflict_call': 11}, ['gap-out', 11]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 4, 'gap': 5, 'max_green': 23, 'actuations': [1, 3, 6, 8, 11, 12, 15, 20, 25, 27, 28, 29, 31, 35, 37, 38, 41, 42, 43, 44, 50, 57], 'conflict_call': 10}, ['max-out', 33]), ({'min_green': 10, 'gap': 5, 'max_green': 25, 'actuations': [1, 3, 7, 9, 10, 14, 16, 18, 19, 23, 24, 26, 27, 28, 30, 34, 35, 37, 38, 42, 43, 44, 46, 49, 54, 59], 'conflict_call': 20}, ['max-out', 45]), ({'min_green': 10, 'gap': 3, 'max_green': 43, 'actuations': [0, 4, 7, 12, 14, 21, 24, 25, 41, 44, 47, 59], 'conflict_call': 10}, ['gap-out', 10]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3])], [({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 31, 'actuations': [7, 8, 11, 14, 15, 21, 27, 32, 37, 46, 52, 57], 'conflict_call': None}, ['rest', 4]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 5, 'max_green': 22, 'actuations': [1, 3, 5, 9, 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 27, 29, 31, 32, 34, 36, 37, 38, 40, 47, 49, 52, 55, 56, 57, 58, 59], 'conflict_call': 32}, ['gap-out', 45]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 5, 'gap': 4, 'max_green': 44, 'actuations': [1, 3, 4, 5, 6, 7, 10, 16, 17, 19, 20, 21, 25, 26, 28, 29, 32, 33, 34, 35, 38, 39, 41, 43, 44, 47, 49, 52, 56, 57, 58, 59], 'conflict_call': None}, ['rest', 14]), ({'min_green': 8, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 3, 6, 9, 11, 12, 14, 15, 17, 18, 19, 21, 22, 25, 27, 30, 31, 36, 38, 41, 42, 43, 45, 48, 52, 53, 55, 57, 59], 'conflict_call': 31}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 45, 'actuations': [2, 3, 4, 5, 6, 7, 11, 12, 15, 17, 18, 20, 21, 22, 23, 25, 28, 29, 34, 35, 36, 37, 39, 41, 42, 49, 50, 51, 55, 56], 'conflict_call': 29}, ['gap-out', 47])], [({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 33, 'actuations': [13, 36, 51, 10, 4, 20, 44, 6, 49, 32, 40, 7, 47, 14, 21, 31, 29, 8, 9, 56, 53, 50, 38, 5, 24, 27, 12, 17, 45, 52, 54], 'conflict_call': -6}, ['max-out', 33]), ({'min_green': 9, 'gap': 5, 'max_green': 34, 'actuations': [0, 2, 8, 9, 10, 11, 14, 16, 18, 23, 27, 29, 30, 31, 36, 38, 39, 40, 48, 50, 53, 55, 56], 'conflict_call': 33}, ['gap-out', 45]), ({'min_green': 10, 'gap': 5, 'max_green': 28, 'actuations': [13, 1, 18, 8, 59, 45, 3, 31, 4, 36, 12, 50, 6, 46, 7, 34, 40, 54, 19, 53, 48, 20, 52, 25, 57, 47, 5, 24, 16], 'conflict_call': 31}, ['gap-out', 31]), ({'min_green': 7, 'gap': 2, 'max_green': 31, 'actuations': [0, 2, 3, 7, 9, 19, 21, 23, 25, 28, 30, 38, 41, 43, 44, 48, 49, 51, 53, 56, 57], 'conflict_call': None}, ['rest', 11]), ({'min_green': 8, 'gap': 4, 'max_green': 44, 'actuations': [0, 2, 4, 6, 9, 12, 13, 15, 17, 18, 19, 23, 26, 29, 30, 32, 33, 35, 36, 38, 40, 41, 42, 44, 45, 47, 48, 49, 50, 51, 55, 56], 'conflict_call': 15}, ['max-out', 59])], [({'min_green': 7, 'gap': 5, 'max_green': 38, 'actuations': [1, 3, 5, 6, 8, 9, 10, 11, 12, 13, 16, 18, 21, 23, 25, 26, 29, 31, 33, 34, 37, 38, 40, 41, 43, 44, 46, 48, 53, 54, 56, 57, 59], 'conflict_call': 12}, ['max-out', 50]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 7, 'gap': 3, 'max_green': 19, 'actuations': [0, 2, 5, 6, 7, 12, 15, 17, 21, 24, 25, 26, 27, 28, 29, 33, 34, 36, 38, 39, 40, 41, 44, 45, 47, 49, 50, 53, 54, 56], 'conflict_call': 0}, ['gap-out', 10]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 5, 'gap': 4, 'max_green': 41, 'actuations': [1, 2, 4, 6, 7, 8, 10, 13, 14, 17, 18, 19, 20, 21, 25, 26, 27, 28, 32, 35, 37, 38, 39, 40, 41, 43, 45, 47, 48, 50, 54, 55, 59], 'conflict_call': 31}, ['gap-out', 63]), ({'min_green': 10, 'gap': 4, 'max_green': 21, 'actuations': [5, 30, 36, 38, 46, 55], 'conflict_call': 34}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 28, 'actuations': [2, 7, 57], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15])]]\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":"eece92289fd2b32c7b078480a6b72ceafd8de8a1191675ae710dc55c66d0fc2d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    m, p, M = x['min_green'], x['gap'], x['max_green']\n    exp = 0\n    for a in sorted(x['actuations']):\n        if a > exp and a > m:\n            break\n        exp = max(exp, a + p)\n    gap_end = max(m, exp)\n    tc = x['conflict_call']\n    if tc is None:\n        return ['rest', gap_end]\n    tc = max(tc, 0)\n    max_end = tc + M\n    if gap_end <= max_end:\n        return ['gap-out', max(gap_end, tc)]\n    return ['max-out', max_end]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'min_green': 4, 'gap': 4, 'max_green': 38, 'actuations': [2, 5, 6, 7, 8, 14, 16, 20, 23, 24, 26, 30, 32, 35, 41, 44, 49, 51, 54, 56, 59], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 7, 'gap': 5, 'max_green': 40, 'actuations': [2, 3, 5, 7, 10, 12, 13, 14, 15, 18, 19, 20, 25, 29, 32, 33, 35, 37, 39, 44, 45, 46, 51, 52, 54, 57], 'conflict_call': 34}, ['gap-out', 62]), ({'min_green': 8, 'gap': 5, 'max_green': 37, 'actuations': [2, 6, 8, 10, 11, 12, 14, 16, 17, 18, 19, 24, 25, 27, 28, 30, 31, 35, 37, 39, 43, 45, 46, 47, 48, 49, 50, 51, 55, 57], 'conflict_call': 20}, ['max-out', 57]), ({'min_green': 7, 'gap': 3, 'max_green': 15, 'actuations': [46, 42, 45, 38, 32, 27, 3, 9, 1, 15, 24, 16, 56, 2, 22, 40, 20, 14, 7, 28, 26, 8, 55, 58, 29, 5, 48, 59, 34, 35, 11], 'conflict_call': 23}, ['gap-out', 23]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 3, 'max_green': 20, 'actuations': [1, 4, 7, 10, 13], 'conflict_call': 2}, ['gap-out', 16]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 9, 'gap': 4, 'max_green': 38, 'actuations': [13, 39, 8, 1, 36, 52, 20, 18, 53, 9, 45, 56, 55, 17, 2, 58, 23, 42, 26, 24, 14, 7, 34, 11, 33, 30, 51, 54, 28, 35, 50], 'conflict_call': 27}, ['gap-out', 49])], [({'min_green': 6, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 4, 5, 8, 9, 10, 13, 14, 19, 21, 22, 27, 28, 30, 31, 33, 35, 38, 39, 40, 42, 44, 46, 47, 48, 49, 51, 54, 55, 56, 57, 59], 'conflict_call': 16}, ['gap-out', 17]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7]), ({'min_green': 4, 'gap': 2, 'max_green': 38, 'actuations': [0, 5, 6, 7, 10, 11, 16, 17, 20, 21, 24, 27, 29, 31, 33, 34, 35, 39, 41, 43, 46, 47, 48, 49, 52, 55, 57, 58], 'conflict_call': 11}, ['gap-out', 11]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 4, 'gap': 5, 'max_green': 23, 'actuations': [1, 3, 6, 8, 11, 12, 15, 20, 25, 27, 28, 29, 31, 35, 37, 38, 41, 42, 43, 44, 50, 57], 'conflict_call': 10}, ['max-out', 33]), ({'min_green': 10, 'gap': 5, 'max_green': 25, 'actuations': [1, 3, 7, 9, 10, 14, 16, 18, 19, 23, 24, 26, 27, 28, 30, 34, 35, 37, 38, 42, 43, 44, 46, 49, 54, 59], 'conflict_call': 20}, ['max-out', 45]), ({'min_green': 10, 'gap': 3, 'max_green': 43, 'actuations': [0, 4, 7, 12, 14, 21, 24, 25, 41, 44, 47, 59], 'conflict_call': 10}, ['gap-out', 10]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3])], [({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 31, 'actuations': [7, 8, 11, 14, 15, 21, 27, 32, 37, 46, 52, 57], 'conflict_call': None}, ['rest', 4]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3]), ({'min_green': 5, 'gap': 5, 'max_green': 22, 'actuations': [1, 3, 5, 9, 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 27, 29, 31, 32, 34, 36, 37, 38, 40, 47, 49, 52, 55, 56, 57, 58, 59], 'conflict_call': 32}, ['gap-out', 45]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 5, 'gap': 4, 'max_green': 44, 'actuations': [1, 3, 4, 5, 6, 7, 10, 16, 17, 19, 20, 21, 25, 26, 28, 29, 32, 33, 34, 35, 38, 39, 41, 43, 44, 47, 49, 52, 56, 57, 58, 59], 'conflict_call': None}, ['rest', 14]), ({'min_green': 8, 'gap': 3, 'max_green': 29, 'actuations': [0, 2, 3, 6, 9, 11, 12, 14, 15, 17, 18, 19, 21, 22, 25, 27, 30, 31, 36, 38, 41, 42, 43, 45, 48, 52, 53, 55, 57, 59], 'conflict_call': 31}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 45, 'actuations': [2, 3, 4, 5, 6, 7, 11, 12, 15, 17, 18, 20, 21, 22, 23, 25, 28, 29, 34, 35, 36, 37, 39, 41, 42, 49, 50, 51, 55, 56], 'conflict_call': 29}, ['gap-out', 47])], [({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 4, 'gap': 3, 'max_green': 33, 'actuations': [13, 36, 51, 10, 4, 20, 44, 6, 49, 32, 40, 7, 47, 14, 21, 31, 29, 8, 9, 56, 53, 50, 38, 5, 24, 27, 12, 17, 45, 52, 54], 'conflict_call': -6}, ['max-out', 33]), ({'min_green': 9, 'gap': 5, 'max_green': 34, 'actuations': [0, 2, 8, 9, 10, 11, 14, 16, 18, 23, 27, 29, 30, 31, 36, 38, 39, 40, 48, 50, 53, 55, 56], 'conflict_call': 33}, ['gap-out', 45]), ({'min_green': 10, 'gap': 5, 'max_green': 28, 'actuations': [13, 1, 18, 8, 59, 45, 3, 31, 4, 36, 12, 50, 6, 46, 7, 34, 40, 54, 19, 53, 48, 20, 52, 25, 57, 47, 5, 24, 16], 'conflict_call': 31}, ['gap-out', 31]), ({'min_green': 7, 'gap': 2, 'max_green': 31, 'actuations': [0, 2, 3, 7, 9, 19, 21, 23, 25, 28, 30, 38, 41, 43, 44, 48, 49, 51, 53, 56, 57], 'conflict_call': None}, ['rest', 11]), ({'min_green': 8, 'gap': 4, 'max_green': 44, 'actuations': [0, 2, 4, 6, 9, 12, 13, 15, 17, 18, 19, 23, 26, 29, 30, 32, 33, 35, 36, 38, 40, 41, 42, 44, 45, 47, 48, 49, 50, 51, 55, 56], 'conflict_call': 15}, ['max-out', 59])], [({'min_green': 7, 'gap': 5, 'max_green': 38, 'actuations': [1, 3, 5, 6, 8, 9, 10, 11, 12, 13, 16, 18, 21, 23, 25, 26, 29, 31, 33, 34, 37, 38, 40, 41, 43, 44, 46, 48, 53, 54, 56, 57, 59], 'conflict_call': 12}, ['max-out', 50]), ({'min_green': 8, 'gap': 3, 'max_green': 30, 'actuations': [2, 6], 'conflict_call': 20}, ['gap-out', 20]), ({'min_green': 7, 'gap': 3, 'max_green': 19, 'actuations': [0, 2, 5, 6, 7, 12, 15, 17, 21, 24, 25, 26, 27, 28, 29, 33, 34, 36, 38, 39, 40, 41, 44, 45, 47, 49, 50, 53, 54, 56], 'conflict_call': 0}, ['gap-out', 10]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 5, 'gap': 4, 'max_green': 41, 'actuations': [1, 2, 4, 6, 7, 8, 10, 13, 14, 17, 18, 19, 20, 21, 25, 26, 27, 28, 32, 35, 37, 38, 39, 40, 41, 43, 45, 47, 48, 50, 54, 55, 59], 'conflict_call': 31}, ['gap-out', 63]), ({'min_green': 10, 'gap': 4, 'max_green': 21, 'actuations': [5, 30, 36, 38, 46, 55], 'conflict_call': 34}, ['gap-out', 34]), ({'min_green': 4, 'gap': 5, 'max_green': 28, 'actuations': [2, 7, 57], 'conflict_call': None}, ['rest', 12]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15])]]\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-gap-max-out-max-timer-start","generated_at":"2026-09-29T14:47:57.886220+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 max timer start rule so that the step reads `max_end = tc + M`.","root_cause":"Max green is timed from green start instead of from the conflicting call, cutting phases short when the call arrives late.","sha256":"6dcd5f2c54d3575f4c394ae74423d127068a9ca9708f0860e9e7aa79cf59c178","title":"Actuated phase gap-out and max-out: the max timer runs from the start of green · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.78,"exit_code":1,"observations":[{"actual":["gap-out",15],"check":"timing oracle 0","expected":["gap-out",15],"passed":true},{"actual":["gap-out",62],"check":"timing oracle 1","expected":["gap-out",62],"passed":true},{"actual":["max-out",49],"check":"timing oracle 2","expected":["max-out",57],"passed":false},{"actual":["gap-out",23],"check":"timing oracle 3","expected":["gap-out",23],"passed":true},{"actual":["max-out",-7],"check":"timing oracle 4","expected":["max-out",3],"passed":false},{"actual":["gap-out",16],"check":"timing oracle 5","expected":["gap-out",16],"passed":true},{"actual":["gap-out",20],"check":"timing oracle 6","expected":["gap-out",20],"passed":true},{"actual":["gap-out",49],"check":"timing oracle 7","expected":["gap-out",49],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"gap-out\", 15], \"expected\": [\"gap-out\", 15], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"gap-out\", 62], \"expected\": [\"gap-out\", 62], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"max-out\", 49], \"expected\": [\"max-out\", 57], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [\"gap-out\", 23], \"expected\": [\"gap-out\", 23], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"max-out\", -7], \"expected\": [\"max-out\", 3], \"passed\": false}, {\"check\": \"timing oracle 5\", \"actual\": [\"gap-out\", 16], \"expected\": [\"gap-out\", 16], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"gap-out\", 20], \"expected\": [\"gap-out\", 20], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"gap-out\", 49], \"expected\": [\"gap-out\", 49], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.465,"exit_code":1,"observations":[{"actual":["gap-out",15],"check":"timing oracle 0","expected":["gap-out",15],"passed":true},{"actual":["max-out",40],"check":"timing oracle 1","expected":["gap-out",62],"passed":false},{"actual":["max-out",37],"check":"timing oracle 2","expected":["max-out",57],"passed":false},{"actual":["max-out",15],"check":"timing oracle 3","expected":["gap-out",23],"passed":false},{"actual":["max-out",3],"check":"timing oracle 4","expected":["max-out",3],"passed":true},{"actual":["gap-out",16],"check":"timing oracle 5","expected":["gap-out",16],"passed":true},{"actual":["gap-out",20],"check":"timing oracle 6","expected":["gap-out",20],"passed":true},{"actual":["max-out",38],"check":"timing oracle 7","expected":["gap-out",49],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"gap-out\", 15], \"expected\": [\"gap-out\", 15], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"max-out\", 40], \"expected\": [\"gap-out\", 62], \"passed\": false}, {\"check\": \"timing oracle 2\", \"actual\": [\"max-out\", 37], \"expected\": [\"max-out\", 57], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [\"max-out\", 15], \"expected\": [\"gap-out\", 23], \"passed\": false}, {\"check\": \"timing oracle 4\", \"actual\": [\"max-out\", 3], \"expected\": [\"max-out\", 3], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"gap-out\", 16], \"expected\": [\"gap-out\", 16], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"gap-out\", 20], \"expected\": [\"gap-out\", 20], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"max-out\", 38], \"expected\": [\"gap-out\", 49], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.063,"exit_code":0,"observations":[{"actual":["gap-out",15],"check":"timing oracle 0","expected":["gap-out",15],"passed":true},{"actual":["gap-out",62],"check":"timing oracle 1","expected":["gap-out",62],"passed":true},{"actual":["max-out",57],"check":"timing oracle 2","expected":["max-out",57],"passed":true},{"actual":["gap-out",23],"check":"timing oracle 3","expected":["gap-out",23],"passed":true},{"actual":["max-out",3],"check":"timing oracle 4","expected":["max-out",3],"passed":true},{"actual":["gap-out",16],"check":"timing oracle 5","expected":["gap-out",16],"passed":true},{"actual":["gap-out",20],"check":"timing oracle 6","expected":["gap-out",20],"passed":true},{"actual":["gap-out",49],"check":"timing oracle 7","expected":["gap-out",49],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"gap-out\", 15], \"expected\": [\"gap-out\", 15], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"gap-out\", 62], \"expected\": [\"gap-out\", 62], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"max-out\", 57], \"expected\": [\"max-out\", 57], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [\"gap-out\", 23], \"expected\": [\"gap-out\", 23], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"max-out\", 3], \"expected\": [\"max-out\", 3], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"gap-out\", 16], \"expected\": [\"gap-out\", 16], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"gap-out\", 20], \"expected\": [\"gap-out\", 20], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"gap-out\", 49], \"expected\": [\"gap-out\", 49], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}