{"abstract":"Transit signal priority decision returns a wrong result when early green always uses the maximum advance.","category":"Traffic signal timing plans","checks":8,"contract":"Input {cycle, green_start, green_end (exclusive), max_ext, max_early, arrival (seconds, reduced modulo cycle), last_granted (cycle index or null), cycle_index, lockout}. A request within lockout cycles of the last grant (difference <= lockout) returns ['locked', 0]. Arrival in green needs nothing. If the arrival is less than max_ext seconds after green end (cyclically) green is extended through the arrival second: ['extend', d+1]. Otherwise green starts early by min(max_early, seconds until next green start).","evaluation_group":"w2-traffic_signal_timing_plans-transit-priority","failed_approach":"Always taking the maximum advance can start green before the bus even needs it.","family":"w2-traffic_signal_timing_plans-transit-priority-early-amount","id":"FA-68221","implementations":{"attempt":{"sha256":"806ceb3afe5e6ae32df2f8cb57ef45bf3fc4d33fd71232b7fea65b55c71f7bf3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    a = x['arrival'] % C\n    last = x['last_granted']\n    if last is not None and x['cycle_index'] - last <= x['lockout']:\n        return ['locked', 0]\n    gs, ge = x['green_start'], x['green_end']\n    if gs <= a < ge:\n        return ['none', 0]\n    d = (a - ge) % C\n    if d < x['max_ext']:\n        return ['extend', d + 1]\n    wait = (gs - a) % C\n    return ['early', x['max_early']]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 80, 'green_start': 28, 'green_end': 61, 'max_ext': 15, 'max_early': 12, 'arrival': 236, 'last_granted': 0, 'cycle_index': 17, 'lockout': 3}, ['early', 12]), ({'cycle': 140, 'green_start': 18, 'green_end': 72, 'max_ext': 19, 'max_early': 15, 'arrival': 359, 'last_granted': 1, 'cycle_index': 10, 'lockout': 2}, ['extend', 8]), ({'cycle': 100, 'green_start': 40, 'green_end': 85, 'max_ext': 20, 'max_early': 14, 'arrival': 228, 'last_granted': 0, 'cycle_index': 12, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 52, 'green_end': 85, 'max_ext': 13, 'max_early': 14, 'arrival': 329, 'last_granted': None, 'cycle_index': 10, 'lockout': 2}, ['early', 14]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 110, 'green_start': 40, 'green_end': 91, 'max_ext': 19, 'max_early': 8, 'arrival': 226, 'last_granted': 8, 'cycle_index': 16, 'lockout': 1}, ['early', 8])], [({'cycle': 120, 'green_start': 37, 'green_end': 94, 'max_ext': 13, 'max_early': 20, 'arrival': 14, 'last_granted': None, 'cycle_index': 2, 'lockout': 2}, ['early', 20]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 120, 'green_start': 21, 'green_end': 39, 'max_ext': 5, 'max_early': 15, 'arrival': 133, 'last_granted': 14, 'cycle_index': 21, 'lockout': 2}, ['early', 8]), ({'cycle': 130, 'green_start': 37, 'green_end': 74, 'max_ext': 16, 'max_early': 18, 'arrival': 6, 'last_granted': 9, 'cycle_index': 14, 'lockout': 1}, ['early', 18]), ({'cycle': 90, 'green_start': 27, 'green_end': 67, 'max_ext': 11, 'max_early': 10, 'arrival': 89, 'last_granted': 11, 'cycle_index': 6, 'lockout': 1}, ['locked', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 100, 'green_start': 45, 'green_end': 87, 'max_ext': 6, 'max_early': 20, 'arrival': 121, 'last_granted': None, 'cycle_index': 7, 'lockout': 3}, ['early', 20])], [({'cycle': 80, 'green_start': 33, 'green_end': 69, 'max_ext': 9, 'max_early': 10, 'arrival': 169, 'last_granted': None, 'cycle_index': 21, 'lockout': 1}, ['early', 10]), ({'cycle': 140, 'green_start': 27, 'green_end': 68, 'max_ext': 6, 'max_early': 9, 'arrival': 217, 'last_granted': None, 'cycle_index': 21, 'lockout': 2}, ['early', 9]), ({'cycle': 90, 'green_start': 2, 'green_end': 25, 'max_ext': 16, 'max_early': 17, 'arrival': 132, 'last_granted': None, 'cycle_index': 18, 'lockout': 1}, ['early', 17]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 26, 'green_end': 51, 'max_ext': 5, 'max_early': 15, 'arrival': 129, 'last_granted': 8, 'cycle_index': 17, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 140, 'green_start': 52, 'green_end': 106, 'max_ext': 6, 'max_early': 8, 'arrival': 98, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 9, 'green_end': 55, 'max_ext': 8, 'max_early': 6, 'arrival': 190, 'last_granted': 9, 'cycle_index': 20, 'lockout': 3}, ['early', 6]), ({'cycle': 80, 'green_start': 35, 'green_end': 60, 'max_ext': 19, 'max_early': 12, 'arrival': 62, 'last_granted': None, 'cycle_index': 9, 'lockout': 3}, ['extend', 3]), ({'cycle': 120, 'green_start': 17, 'green_end': 67, 'max_ext': 15, 'max_early': 10, 'arrival': 10, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 7]), ({'cycle': 120, 'green_start': 31, 'green_end': 81, 'max_ext': 14, 'max_early': 11, 'arrival': 340, 'last_granted': 0, 'cycle_index': 8, 'lockout': 3}, ['early', 11]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 80, 'green_start': 37, 'green_end': 55, 'max_ext': 5, 'max_early': 9, 'arrival': 11, 'last_granted': 7, 'cycle_index': 11, 'lockout': 2}, ['early', 9])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 19, 'green_end': 57, 'max_ext': 8, 'max_early': 12, 'arrival': 305, 'last_granted': 14, 'cycle_index': 11, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 3, 'green_end': 37, 'max_ext': 9, 'max_early': 10, 'arrival': 224, 'last_granted': 2, 'cycle_index': 14, 'lockout': 3}, ['early', 10]), ({'cycle': 120, 'green_start': 54, 'green_end': 83, 'max_ext': 7, 'max_early': 15, 'arrival': 7, 'last_granted': None, 'cycle_index': 1, 'lockout': 2}, ['early', 15]), ({'cycle': 140, 'green_start': 2, 'green_end': 49, 'max_ext': 8, 'max_early': 8, 'arrival': 204, 'last_granted': 0, 'cycle_index': 15, 'lockout': 3}, ['early', 8]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 130, 'green_start': 18, 'green_end': 47, 'max_ext': 19, 'max_early': 16, 'arrival': 138, 'last_granted': 4, 'cycle_index': 20, 'lockout': 1}, ['early', 10]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]\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":"1f0e367ed4fce97b9f3e6c87b72ab5f8ca11e0a14551d0075c7820c57fea2ac1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    a = x['arrival'] % C\n    last = x['last_granted']\n    if last is not None and x['cycle_index'] - last <= x['lockout']:\n        return ['locked', 0]\n    gs, ge = x['green_start'], x['green_end']\n    if gs <= a < ge:\n        return ['none', 0]\n    d = (a - ge) % C\n    if d < x['max_ext']:\n        return ['extend', d + 1]\n    wait = (gs - a) % C\n    return ['early', wait]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 80, 'green_start': 28, 'green_end': 61, 'max_ext': 15, 'max_early': 12, 'arrival': 236, 'last_granted': 0, 'cycle_index': 17, 'lockout': 3}, ['early', 12]), ({'cycle': 140, 'green_start': 18, 'green_end': 72, 'max_ext': 19, 'max_early': 15, 'arrival': 359, 'last_granted': 1, 'cycle_index': 10, 'lockout': 2}, ['extend', 8]), ({'cycle': 100, 'green_start': 40, 'green_end': 85, 'max_ext': 20, 'max_early': 14, 'arrival': 228, 'last_granted': 0, 'cycle_index': 12, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 52, 'green_end': 85, 'max_ext': 13, 'max_early': 14, 'arrival': 329, 'last_granted': None, 'cycle_index': 10, 'lockout': 2}, ['early', 14]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 110, 'green_start': 40, 'green_end': 91, 'max_ext': 19, 'max_early': 8, 'arrival': 226, 'last_granted': 8, 'cycle_index': 16, 'lockout': 1}, ['early', 8])], [({'cycle': 120, 'green_start': 37, 'green_end': 94, 'max_ext': 13, 'max_early': 20, 'arrival': 14, 'last_granted': None, 'cycle_index': 2, 'lockout': 2}, ['early', 20]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 120, 'green_start': 21, 'green_end': 39, 'max_ext': 5, 'max_early': 15, 'arrival': 133, 'last_granted': 14, 'cycle_index': 21, 'lockout': 2}, ['early', 8]), ({'cycle': 130, 'green_start': 37, 'green_end': 74, 'max_ext': 16, 'max_early': 18, 'arrival': 6, 'last_granted': 9, 'cycle_index': 14, 'lockout': 1}, ['early', 18]), ({'cycle': 90, 'green_start': 27, 'green_end': 67, 'max_ext': 11, 'max_early': 10, 'arrival': 89, 'last_granted': 11, 'cycle_index': 6, 'lockout': 1}, ['locked', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 100, 'green_start': 45, 'green_end': 87, 'max_ext': 6, 'max_early': 20, 'arrival': 121, 'last_granted': None, 'cycle_index': 7, 'lockout': 3}, ['early', 20])], [({'cycle': 80, 'green_start': 33, 'green_end': 69, 'max_ext': 9, 'max_early': 10, 'arrival': 169, 'last_granted': None, 'cycle_index': 21, 'lockout': 1}, ['early', 10]), ({'cycle': 140, 'green_start': 27, 'green_end': 68, 'max_ext': 6, 'max_early': 9, 'arrival': 217, 'last_granted': None, 'cycle_index': 21, 'lockout': 2}, ['early', 9]), ({'cycle': 90, 'green_start': 2, 'green_end': 25, 'max_ext': 16, 'max_early': 17, 'arrival': 132, 'last_granted': None, 'cycle_index': 18, 'lockout': 1}, ['early', 17]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 26, 'green_end': 51, 'max_ext': 5, 'max_early': 15, 'arrival': 129, 'last_granted': 8, 'cycle_index': 17, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 140, 'green_start': 52, 'green_end': 106, 'max_ext': 6, 'max_early': 8, 'arrival': 98, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 9, 'green_end': 55, 'max_ext': 8, 'max_early': 6, 'arrival': 190, 'last_granted': 9, 'cycle_index': 20, 'lockout': 3}, ['early', 6]), ({'cycle': 80, 'green_start': 35, 'green_end': 60, 'max_ext': 19, 'max_early': 12, 'arrival': 62, 'last_granted': None, 'cycle_index': 9, 'lockout': 3}, ['extend', 3]), ({'cycle': 120, 'green_start': 17, 'green_end': 67, 'max_ext': 15, 'max_early': 10, 'arrival': 10, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 7]), ({'cycle': 120, 'green_start': 31, 'green_end': 81, 'max_ext': 14, 'max_early': 11, 'arrival': 340, 'last_granted': 0, 'cycle_index': 8, 'lockout': 3}, ['early', 11]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 80, 'green_start': 37, 'green_end': 55, 'max_ext': 5, 'max_early': 9, 'arrival': 11, 'last_granted': 7, 'cycle_index': 11, 'lockout': 2}, ['early', 9])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 19, 'green_end': 57, 'max_ext': 8, 'max_early': 12, 'arrival': 305, 'last_granted': 14, 'cycle_index': 11, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 3, 'green_end': 37, 'max_ext': 9, 'max_early': 10, 'arrival': 224, 'last_granted': 2, 'cycle_index': 14, 'lockout': 3}, ['early', 10]), ({'cycle': 120, 'green_start': 54, 'green_end': 83, 'max_ext': 7, 'max_early': 15, 'arrival': 7, 'last_granted': None, 'cycle_index': 1, 'lockout': 2}, ['early', 15]), ({'cycle': 140, 'green_start': 2, 'green_end': 49, 'max_ext': 8, 'max_early': 8, 'arrival': 204, 'last_granted': 0, 'cycle_index': 15, 'lockout': 3}, ['early', 8]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 130, 'green_start': 18, 'green_end': 47, 'max_ext': 19, 'max_early': 16, 'arrival': 138, 'last_granted': 4, 'cycle_index': 20, 'lockout': 1}, ['early', 10]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]\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":"9820bd7ff4862345a1f9bafe3bf229120a48f7b81448cf657660d71a86670152","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    a = x['arrival'] % C\n    last = x['last_granted']\n    if last is not None and x['cycle_index'] - last <= x['lockout']:\n        return ['locked', 0]\n    gs, ge = x['green_start'], x['green_end']\n    if gs <= a < ge:\n        return ['none', 0]\n    d = (a - ge) % C\n    if d < x['max_ext']:\n        return ['extend', d + 1]\n    wait = (gs - a) % C\n    return ['early', min(x['max_early'], wait)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 80, 'green_start': 28, 'green_end': 61, 'max_ext': 15, 'max_early': 12, 'arrival': 236, 'last_granted': 0, 'cycle_index': 17, 'lockout': 3}, ['early', 12]), ({'cycle': 140, 'green_start': 18, 'green_end': 72, 'max_ext': 19, 'max_early': 15, 'arrival': 359, 'last_granted': 1, 'cycle_index': 10, 'lockout': 2}, ['extend', 8]), ({'cycle': 100, 'green_start': 40, 'green_end': 85, 'max_ext': 20, 'max_early': 14, 'arrival': 228, 'last_granted': 0, 'cycle_index': 12, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 52, 'green_end': 85, 'max_ext': 13, 'max_early': 14, 'arrival': 329, 'last_granted': None, 'cycle_index': 10, 'lockout': 2}, ['early', 14]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 110, 'green_start': 40, 'green_end': 91, 'max_ext': 19, 'max_early': 8, 'arrival': 226, 'last_granted': 8, 'cycle_index': 16, 'lockout': 1}, ['early', 8])], [({'cycle': 120, 'green_start': 37, 'green_end': 94, 'max_ext': 13, 'max_early': 20, 'arrival': 14, 'last_granted': None, 'cycle_index': 2, 'lockout': 2}, ['early', 20]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 120, 'green_start': 21, 'green_end': 39, 'max_ext': 5, 'max_early': 15, 'arrival': 133, 'last_granted': 14, 'cycle_index': 21, 'lockout': 2}, ['early', 8]), ({'cycle': 130, 'green_start': 37, 'green_end': 74, 'max_ext': 16, 'max_early': 18, 'arrival': 6, 'last_granted': 9, 'cycle_index': 14, 'lockout': 1}, ['early', 18]), ({'cycle': 90, 'green_start': 27, 'green_end': 67, 'max_ext': 11, 'max_early': 10, 'arrival': 89, 'last_granted': 11, 'cycle_index': 6, 'lockout': 1}, ['locked', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 100, 'green_start': 45, 'green_end': 87, 'max_ext': 6, 'max_early': 20, 'arrival': 121, 'last_granted': None, 'cycle_index': 7, 'lockout': 3}, ['early', 20])], [({'cycle': 80, 'green_start': 33, 'green_end': 69, 'max_ext': 9, 'max_early': 10, 'arrival': 169, 'last_granted': None, 'cycle_index': 21, 'lockout': 1}, ['early', 10]), ({'cycle': 140, 'green_start': 27, 'green_end': 68, 'max_ext': 6, 'max_early': 9, 'arrival': 217, 'last_granted': None, 'cycle_index': 21, 'lockout': 2}, ['early', 9]), ({'cycle': 90, 'green_start': 2, 'green_end': 25, 'max_ext': 16, 'max_early': 17, 'arrival': 132, 'last_granted': None, 'cycle_index': 18, 'lockout': 1}, ['early', 17]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 26, 'green_end': 51, 'max_ext': 5, 'max_early': 15, 'arrival': 129, 'last_granted': 8, 'cycle_index': 17, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 140, 'green_start': 52, 'green_end': 106, 'max_ext': 6, 'max_early': 8, 'arrival': 98, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 9, 'green_end': 55, 'max_ext': 8, 'max_early': 6, 'arrival': 190, 'last_granted': 9, 'cycle_index': 20, 'lockout': 3}, ['early', 6]), ({'cycle': 80, 'green_start': 35, 'green_end': 60, 'max_ext': 19, 'max_early': 12, 'arrival': 62, 'last_granted': None, 'cycle_index': 9, 'lockout': 3}, ['extend', 3]), ({'cycle': 120, 'green_start': 17, 'green_end': 67, 'max_ext': 15, 'max_early': 10, 'arrival': 10, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 7]), ({'cycle': 120, 'green_start': 31, 'green_end': 81, 'max_ext': 14, 'max_early': 11, 'arrival': 340, 'last_granted': 0, 'cycle_index': 8, 'lockout': 3}, ['early', 11]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 80, 'green_start': 37, 'green_end': 55, 'max_ext': 5, 'max_early': 9, 'arrival': 11, 'last_granted': 7, 'cycle_index': 11, 'lockout': 2}, ['early', 9])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 19, 'green_end': 57, 'max_ext': 8, 'max_early': 12, 'arrival': 305, 'last_granted': 14, 'cycle_index': 11, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 3, 'green_end': 37, 'max_ext': 9, 'max_early': 10, 'arrival': 224, 'last_granted': 2, 'cycle_index': 14, 'lockout': 3}, ['early', 10]), ({'cycle': 120, 'green_start': 54, 'green_end': 83, 'max_ext': 7, 'max_early': 15, 'arrival': 7, 'last_granted': None, 'cycle_index': 1, 'lockout': 2}, ['early', 15]), ({'cycle': 140, 'green_start': 2, 'green_end': 49, 'max_ext': 8, 'max_early': 8, 'arrival': 204, 'last_granted': 0, 'cycle_index': 15, 'lockout': 3}, ['early', 8]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 130, 'green_start': 18, 'green_end': 47, 'max_ext': 19, 'max_early': 16, 'arrival': 138, 'last_granted': 4, 'cycle_index': 20, 'lockout': 1}, ['early', 10]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]\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-transit-priority-early-amount","generated_at":"2026-09-29T14:48:00.247176+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 early green amount rule so that the step reads `min(x['max_early'], wait)`.","root_cause":"Early green is not limited by max_early, truncating conflicting phases arbitrarily.","sha256":"a528106a85502edc4e81633199c5573ad32f7801156b317b7d0ef396700dd6e0","title":"Transit signal priority decision: early green always uses the maximum advance · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.157,"exit_code":1,"observations":[{"actual":["early",10],"check":"timing oracle 0","expected":["early",2],"passed":false},{"actual":["early",12],"check":"timing oracle 1","expected":["early",12],"passed":true},{"actual":["extend",8],"check":"timing oracle 2","expected":["extend",8],"passed":true},{"actual":["early",14],"check":"timing oracle 3","expected":["early",12],"passed":false},{"actual":["early",14],"check":"timing oracle 4","expected":["early",14],"passed":true},{"actual":["locked",0],"check":"timing oracle 5","expected":["locked",0],"passed":true},{"actual":["extend",1],"check":"timing oracle 6","expected":["extend",1],"passed":true},{"actual":["early",8],"check":"timing oracle 7","expected":["early",8],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"early\", 10], \"expected\": [\"early\", 2], \"passed\": false}, {\"check\": \"timing oracle 1\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"extend\", 8], \"expected\": [\"extend\", 8], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [\"early\", 14], \"expected\": [\"early\", 12], \"passed\": false}, {\"check\": \"timing oracle 4\", \"actual\": [\"early\", 14], \"expected\": [\"early\", 14], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"early\", 8], \"expected\": [\"early\", 8], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.794,"exit_code":1,"observations":[{"actual":["early",2],"check":"timing oracle 0","expected":["early",2],"passed":true},{"actual":["early",32],"check":"timing oracle 1","expected":["early",12],"passed":false},{"actual":["extend",8],"check":"timing oracle 2","expected":["extend",8],"passed":true},{"actual":["early",12],"check":"timing oracle 3","expected":["early",12],"passed":true},{"actual":["early",53],"check":"timing oracle 4","expected":["early",14],"passed":false},{"actual":["locked",0],"check":"timing oracle 5","expected":["locked",0],"passed":true},{"actual":["extend",1],"check":"timing oracle 6","expected":["extend",1],"passed":true},{"actual":["early",34],"check":"timing oracle 7","expected":["early",8],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"early\", 2], \"expected\": [\"early\", 2], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"early\", 32], \"expected\": [\"early\", 12], \"passed\": false}, {\"check\": \"timing oracle 2\", \"actual\": [\"extend\", 8], \"expected\": [\"extend\", 8], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"early\", 53], \"expected\": [\"early\", 14], \"passed\": false}, {\"check\": \"timing oracle 5\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"early\", 34], \"expected\": [\"early\", 8], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.116,"exit_code":0,"observations":[{"actual":["early",2],"check":"timing oracle 0","expected":["early",2],"passed":true},{"actual":["early",12],"check":"timing oracle 1","expected":["early",12],"passed":true},{"actual":["extend",8],"check":"timing oracle 2","expected":["extend",8],"passed":true},{"actual":["early",12],"check":"timing oracle 3","expected":["early",12],"passed":true},{"actual":["early",14],"check":"timing oracle 4","expected":["early",14],"passed":true},{"actual":["locked",0],"check":"timing oracle 5","expected":["locked",0],"passed":true},{"actual":["extend",1],"check":"timing oracle 6","expected":["extend",1],"passed":true},{"actual":["early",8],"check":"timing oracle 7","expected":["early",8],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"early\", 2], \"expected\": [\"early\", 2], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"extend\", 8], \"expected\": [\"extend\", 8], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"early\", 14], \"expected\": [\"early\", 14], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"early\", 8], \"expected\": [\"early\", 8], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}