{"abstract":"Transit signal priority decision returns a wrong result when the extension distance is not wrapped around the cycle.","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":"The absolute distance treats arrivals well before green as if just after green end.","family":"w2-traffic_signal_timing_plans-transit-priority-extension-wrap","id":"FA-68211","implementations":{"attempt":{"sha256":"aced7f4b4ace8ac32006079a9eacd620818c2e0fff1e3d200190b7256628b623","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 = abs(a - ge)\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': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'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': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'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': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'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': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'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': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'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': 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': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, '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': 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': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'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': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'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': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'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': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'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': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'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])]]\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":"066874ffe60514d6bec4b4ef77380b0f992d2fa7b1f1d3ed182683b4e1f1a2d9","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\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': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'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': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'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': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'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': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'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': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'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': 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': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, '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': 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': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'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': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'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': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'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': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'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': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'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])]]\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":"8f4785ec91aeb9c5ecbd3d1ef1b8b4b17acbd28151e73a2cb90d0448345c018e","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': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'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': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'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': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'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': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'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': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'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': 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': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, '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': 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': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'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': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'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': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'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': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'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': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'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])]]\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-extension-wrap","generated_at":"2026-09-29T14:48:00.105614+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 extension distance rule so that the step reads `d = (a - ge) % C`.","root_cause":"Arrivals before green end in cycle time give a negative distance that passes the extension test.","sha256":"6a7d94c6597c64819211d87d4ffa2f74d8a819b5c08b722227266a998481c75e","title":"Transit signal priority decision: the extension distance is not wrapped around the cycle · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.144,"exit_code":1,"observations":[{"actual":["locked",0],"check":"timing oracle 0","expected":["locked",0],"passed":true},{"actual":["none",0],"check":"timing oracle 1","expected":["none",0],"passed":true},{"actual":["extend",17],"check":"timing oracle 2","expected":["early",1],"passed":false},{"actual":["early",12],"check":"timing oracle 3","expected":["early",12],"passed":true},{"actual":["early",12],"check":"timing oracle 4","expected":["early",12],"passed":true},{"actual":["early",20],"check":"timing oracle 5","expected":["early",20],"passed":true},{"actual":["extend",18],"check":"timing oracle 6","expected":["early",2],"passed":false},{"actual":["extend",1],"check":"timing oracle 7","expected":["extend",1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"none\", 0], \"expected\": [\"none\", 0], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"extend\", 17], \"expected\": [\"early\", 1], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"early\", 20], \"expected\": [\"early\", 20], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"extend\", 18], \"expected\": [\"early\", 2], \"passed\": false}, {\"check\": \"timing oracle 7\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.061,"exit_code":1,"observations":[{"actual":["locked",0],"check":"timing oracle 0","expected":["locked",0],"passed":true},{"actual":["none",0],"check":"timing oracle 1","expected":["none",0],"passed":true},{"actual":["extend",-15],"check":"timing oracle 2","expected":["early",1],"passed":false},{"actual":["extend",-35],"check":"timing oracle 3","expected":["early",12],"passed":false},{"actual":["extend",-30],"check":"timing oracle 4","expected":["early",12],"passed":false},{"actual":["early",20],"check":"timing oracle 5","expected":["early",20],"passed":true},{"actual":["extend",-16],"check":"timing oracle 6","expected":["early",2],"passed":false},{"actual":["extend",1],"check":"timing oracle 7","expected":["extend",1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"none\", 0], \"expected\": [\"none\", 0], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"extend\", -15], \"expected\": [\"early\", 1], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [\"extend\", -35], \"expected\": [\"early\", 12], \"passed\": false}, {\"check\": \"timing oracle 4\", \"actual\": [\"extend\", -30], \"expected\": [\"early\", 12], \"passed\": false}, {\"check\": \"timing oracle 5\", \"actual\": [\"early\", 20], \"expected\": [\"early\", 20], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"extend\", -16], \"expected\": [\"early\", 2], \"passed\": false}, {\"check\": \"timing oracle 7\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.515,"exit_code":0,"observations":[{"actual":["locked",0],"check":"timing oracle 0","expected":["locked",0],"passed":true},{"actual":["none",0],"check":"timing oracle 1","expected":["none",0],"passed":true},{"actual":["early",1],"check":"timing oracle 2","expected":["early",1],"passed":true},{"actual":["early",12],"check":"timing oracle 3","expected":["early",12],"passed":true},{"actual":["early",12],"check":"timing oracle 4","expected":["early",12],"passed":true},{"actual":["early",20],"check":"timing oracle 5","expected":["early",20],"passed":true},{"actual":["early",2],"check":"timing oracle 6","expected":["early",2],"passed":true},{"actual":["extend",1],"check":"timing oracle 7","expected":["extend",1],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [\"locked\", 0], \"expected\": [\"locked\", 0], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [\"none\", 0], \"expected\": [\"none\", 0], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [\"early\", 1], \"expected\": [\"early\", 1], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [\"early\", 12], \"expected\": [\"early\", 12], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [\"early\", 20], \"expected\": [\"early\", 20], \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": [\"early\", 2], \"expected\": [\"early\", 2], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [\"extend\", 1], \"expected\": [\"extend\", 1], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}