{"abstract":"Time-of-day plan schedule returns a wrong result when the day mask is read with Monday as bit zero.","category":"Traffic signal timing plans","checks":8,"contract":"Input {events: [[day mask (bit0 = Sunday), 'HH:MM', plan]], holidays: [[month, day, as_dow]], now: [dow, 'HH:MM', month, day]}. A holiday makes today's events come from its as_dow day type. The active plan is the event for today with the latest start <= now (later-listed wins at equal start). If none, the latest event of the most recent earlier real weekday that has events (up to 7 days back, same tie rule). Otherwise 'free'.","evaluation_group":"w2-traffic_signal_timing_plans-tod-schedule","failed_approach":"Treating Monday as bit zero shifts every day program by one day.","family":"w2-traffic_signal_timing_plans-tod-schedule-mask-bit","id":"FA-68086","implementations":{"attempt":{"sha256":"8ba0b5ac6cefb709e4050da6dbd801f36495a44c448fcba53edbef41bd0f078b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def mins(s):\n        h, m = s.split(':')\n        return int(h) * 60 + int(m)\n    dow, hm, mo, dy = x['now']\n    t = mins(hm)\n    eff = dow\n    for hmo, hdy, as_dow in x['holidays']:\n        if hmo == mo and hdy == dy:\n            eff = as_dow\n    best = None\n    for mask, st, plan in x['events']:\n        if mask >> (eff - 1) % 7 & 1 and mins(st) <= t:\n            if best is None or mins(st) >= best[0]:\n                best = (mins(st), plan)\n    if best is not None:\n        return best[1]\n    for back in range(1, 8):\n        d = (dow - back) % 7\n        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]\n        if cand:\n            return sorted(cand, key=lambda c: c[0])[-1][1]\n    return 'free'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'events': [[16, '22:00', 5], [32, '02:00', 5], [55, '03:30', 1], [65, '03:15', 1], [1, '06:45', 4], [34, '05:30', 5]], 'holidays': [[11, 19, 5]], 'now': [1, '16:07', 11, 19]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[79, '19:00', 9], [127, '20:30', 6], [43, '04:30', 4], [32, '23:30', 6], [46, '01:15', 4]], 'holidays': [[4, 15, 1]], 'now': [4, '01:30', 4, 15]}, 4), ({'events': [[19, '00:30', 7], [25, '12:00', 7], [124, '21:30', 2], [127, '07:00', 8], [60, '00:30', 1], [96, '11:00', 8]], 'holidays': [], 'now': [6, '14:07', 10, 16]}, 8), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[32, '16:00', 9], [3, '00:30', 3], [62, '21:30', 2]], 'holidays': [[11, 5, 0], [11, 28, 3]], 'now': [5, '17:15', 2, 26]}, 9), ({'events': [[96, '02:15', 6], [65, '16:15', 9], [21, '09:00', 3], [17, '23:15', 1]], 'holidays': [], 'now': [1, '08:44', 11, 20]}, 1)], [({'events': [[65, '18:45', 7], [2, '10:15', 7], [82, '10:45', 9], [3, '15:00', 6], [23, '00:30', 6]], 'holidays': [[8, 3, 3], [1, 15, 4]], 'now': [6, '23:44', 1, 15]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[65, '02:00', 1], [83, '08:15', 1], [10, '11:30', 5], [23, '02:00', 7], [3, '11:45', 5], [15, '15:15', 8]], 'holidays': [], 'now': [4, '14:07', 1, 15]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[22, '01:30', 1], [3, '12:15', 9], [76, '22:15', 7], [65, '13:45', 3]], 'holidays': [], 'now': [3, '02:44', 8, 10]}, 7), ({'events': [[73, '10:45', 2], [64, '17:15', 8], [32, '16:00', 5], [35, '12:00', 8]], 'holidays': [[6, 16, 3]], 'now': [6, '19:44', 2, 12]}, 8), ({'events': [[8, '19:00', 6], [96, '12:15', 3], [65, '03:45', 9]], 'holidays': [[11, 10, 4]], 'now': [6, '16:07', 11, 6]}, 3)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[92, '03:30', 2], [58, '10:30', 2], [25, '22:30', 7], [28, '15:30', 1]], 'holidays': [], 'now': [1, '11:00', 8, 20]}, 2), ({'events': [[111, '17:00', 9], [127, '20:30', 2], [65, '14:45', 6], [96, '09:45', 5], [2, '13:00', 3]], 'holidays': [[10, 23, 6], [10, 2, 6]], 'now': [5, '03:30', 10, 23]}, 2), ({'events': [[2, '11:00', 7], [110, '23:15', 6], [3, '03:45', 1], [65, '17:30', 4]], 'holidays': [[4, 8, 5]], 'now': [0, '11:00', 1, 23]}, 1), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[5, '02:45', 3], [70, '07:45', 8], [32, '15:45', 1], [32, '12:45', 7], [2, '06:15', 9]], 'holidays': [], 'now': [1, '16:30', 11, 7]}, 8), ({'events': [[2, '07:45', 9], [37, '01:30', 6], [84, '13:45', 2], [96, '22:00', 3]], 'holidays': [], 'now': [1, '13:45', 11, 14]}, 9)], [({'events': [[65, '13:45', 5], [127, '22:00', 6], [3, '19:30', 8], [8, '11:15', 3], [32, '05:30', 1]], 'holidays': [[10, 3, 6]], 'now': [4, '13:45', 1, 2]}, 6), ({'events': [[32, '12:00', 6], [3, '07:15', 9], [1, '14:45', 3]], 'holidays': [], 'now': [1, '09:00', 8, 28]}, 9), ({'events': [[3, '13:45', 3], [3, '14:30', 9], [51, '02:45', 1], [64, '05:15', 7], [32, '16:15', 3]], 'holidays': [[1, 27, 3], [5, 19, 5]], 'now': [6, '14:30', 12, 6]}, 7), ({'events': [[1, '02:45', 9], [65, '06:45', 3], [2, '05:00', 5]], 'holidays': [], 'now': [6, '06:45', 8, 23]}, 3), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[123, '01:30', 5], [8, '06:00', 6], [127, '21:15', 1], [96, '23:30', 9], [1, '17:45', 1]], 'holidays': [[7, 5, 5], [4, 4, 5]], 'now': [4, '01:30', 2, 9]}, 5)], [({'events': [[62, '16:00', 6], [2, '00:00', 6], [2, '08:00', 8], [62, '21:00', 9], [62, '01:30', 4], [127, '12:15', 3]], 'holidays': [[9, 16, 2], [3, 23, 5]], 'now': [5, '08:00', 11, 16]}, 4), ({'events': [[126, '09:45', 7], [29, '02:00', 3], [65, '06:00', 9]], 'holidays': [[6, 28, 1], [6, 17, 2]], 'now': [1, '04:15', 12, 16]}, 9), ({'events': [[32, '08:30', 1], [31, '14:15', 1], [2, '16:15', 2], [2, '02:00', 5]], 'holidays': [[5, 3, 0], [7, 8, 2]], 'now': [2, '08:30', 11, 16]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '12:00', 5], [1, '12:00', 1]], 'holidays': [], 'now': [1, '16:00', 3, 2]}, 1), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[35, '13:15', 4], [1, '14:00', 6]], 'holidays': [], 'now': [6, '14:00', 2, 18]}, 4), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9)]]\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":"73d5fbabec2d4940d5b4259780fdfb2822ee42cb4f4e45f8c347a4b3848819d2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def mins(s):\n        h, m = s.split(':')\n        return int(h) * 60 + int(m)\n    dow, hm, mo, dy = x['now']\n    t = mins(hm)\n    eff = dow\n    for hmo, hdy, as_dow in x['holidays']:\n        if hmo == mo and hdy == dy:\n            eff = as_dow\n    best = None\n    for mask, st, plan in x['events']:\n        if mask >> (6 - eff) & 1 and mins(st) <= t:\n            if best is None or mins(st) >= best[0]:\n                best = (mins(st), plan)\n    if best is not None:\n        return best[1]\n    for back in range(1, 8):\n        d = (dow - back) % 7\n        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]\n        if cand:\n            return sorted(cand, key=lambda c: c[0])[-1][1]\n    return 'free'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'events': [[16, '22:00', 5], [32, '02:00', 5], [55, '03:30', 1], [65, '03:15', 1], [1, '06:45', 4], [34, '05:30', 5]], 'holidays': [[11, 19, 5]], 'now': [1, '16:07', 11, 19]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[79, '19:00', 9], [127, '20:30', 6], [43, '04:30', 4], [32, '23:30', 6], [46, '01:15', 4]], 'holidays': [[4, 15, 1]], 'now': [4, '01:30', 4, 15]}, 4), ({'events': [[19, '00:30', 7], [25, '12:00', 7], [124, '21:30', 2], [127, '07:00', 8], [60, '00:30', 1], [96, '11:00', 8]], 'holidays': [], 'now': [6, '14:07', 10, 16]}, 8), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[32, '16:00', 9], [3, '00:30', 3], [62, '21:30', 2]], 'holidays': [[11, 5, 0], [11, 28, 3]], 'now': [5, '17:15', 2, 26]}, 9), ({'events': [[96, '02:15', 6], [65, '16:15', 9], [21, '09:00', 3], [17, '23:15', 1]], 'holidays': [], 'now': [1, '08:44', 11, 20]}, 1)], [({'events': [[65, '18:45', 7], [2, '10:15', 7], [82, '10:45', 9], [3, '15:00', 6], [23, '00:30', 6]], 'holidays': [[8, 3, 3], [1, 15, 4]], 'now': [6, '23:44', 1, 15]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[65, '02:00', 1], [83, '08:15', 1], [10, '11:30', 5], [23, '02:00', 7], [3, '11:45', 5], [15, '15:15', 8]], 'holidays': [], 'now': [4, '14:07', 1, 15]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[22, '01:30', 1], [3, '12:15', 9], [76, '22:15', 7], [65, '13:45', 3]], 'holidays': [], 'now': [3, '02:44', 8, 10]}, 7), ({'events': [[73, '10:45', 2], [64, '17:15', 8], [32, '16:00', 5], [35, '12:00', 8]], 'holidays': [[6, 16, 3]], 'now': [6, '19:44', 2, 12]}, 8), ({'events': [[8, '19:00', 6], [96, '12:15', 3], [65, '03:45', 9]], 'holidays': [[11, 10, 4]], 'now': [6, '16:07', 11, 6]}, 3)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[92, '03:30', 2], [58, '10:30', 2], [25, '22:30', 7], [28, '15:30', 1]], 'holidays': [], 'now': [1, '11:00', 8, 20]}, 2), ({'events': [[111, '17:00', 9], [127, '20:30', 2], [65, '14:45', 6], [96, '09:45', 5], [2, '13:00', 3]], 'holidays': [[10, 23, 6], [10, 2, 6]], 'now': [5, '03:30', 10, 23]}, 2), ({'events': [[2, '11:00', 7], [110, '23:15', 6], [3, '03:45', 1], [65, '17:30', 4]], 'holidays': [[4, 8, 5]], 'now': [0, '11:00', 1, 23]}, 1), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[5, '02:45', 3], [70, '07:45', 8], [32, '15:45', 1], [32, '12:45', 7], [2, '06:15', 9]], 'holidays': [], 'now': [1, '16:30', 11, 7]}, 8), ({'events': [[2, '07:45', 9], [37, '01:30', 6], [84, '13:45', 2], [96, '22:00', 3]], 'holidays': [], 'now': [1, '13:45', 11, 14]}, 9)], [({'events': [[65, '13:45', 5], [127, '22:00', 6], [3, '19:30', 8], [8, '11:15', 3], [32, '05:30', 1]], 'holidays': [[10, 3, 6]], 'now': [4, '13:45', 1, 2]}, 6), ({'events': [[32, '12:00', 6], [3, '07:15', 9], [1, '14:45', 3]], 'holidays': [], 'now': [1, '09:00', 8, 28]}, 9), ({'events': [[3, '13:45', 3], [3, '14:30', 9], [51, '02:45', 1], [64, '05:15', 7], [32, '16:15', 3]], 'holidays': [[1, 27, 3], [5, 19, 5]], 'now': [6, '14:30', 12, 6]}, 7), ({'events': [[1, '02:45', 9], [65, '06:45', 3], [2, '05:00', 5]], 'holidays': [], 'now': [6, '06:45', 8, 23]}, 3), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[123, '01:30', 5], [8, '06:00', 6], [127, '21:15', 1], [96, '23:30', 9], [1, '17:45', 1]], 'holidays': [[7, 5, 5], [4, 4, 5]], 'now': [4, '01:30', 2, 9]}, 5)], [({'events': [[62, '16:00', 6], [2, '00:00', 6], [2, '08:00', 8], [62, '21:00', 9], [62, '01:30', 4], [127, '12:15', 3]], 'holidays': [[9, 16, 2], [3, 23, 5]], 'now': [5, '08:00', 11, 16]}, 4), ({'events': [[126, '09:45', 7], [29, '02:00', 3], [65, '06:00', 9]], 'holidays': [[6, 28, 1], [6, 17, 2]], 'now': [1, '04:15', 12, 16]}, 9), ({'events': [[32, '08:30', 1], [31, '14:15', 1], [2, '16:15', 2], [2, '02:00', 5]], 'holidays': [[5, 3, 0], [7, 8, 2]], 'now': [2, '08:30', 11, 16]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '12:00', 5], [1, '12:00', 1]], 'holidays': [], 'now': [1, '16:00', 3, 2]}, 1), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[35, '13:15', 4], [1, '14:00', 6]], 'holidays': [], 'now': [6, '14:00', 2, 18]}, 4), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9)]]\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":"bda59637476df913939a08a65ca3b0af2ac47e34371caf7c90c60a5bb5e91b60","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def mins(s):\n        h, m = s.split(':')\n        return int(h) * 60 + int(m)\n    dow, hm, mo, dy = x['now']\n    t = mins(hm)\n    eff = dow\n    for hmo, hdy, as_dow in x['holidays']:\n        if hmo == mo and hdy == dy:\n            eff = as_dow\n    best = None\n    for mask, st, plan in x['events']:\n        if mask >> eff & 1 and mins(st) <= t:\n            if best is None or mins(st) >= best[0]:\n                best = (mins(st), plan)\n    if best is not None:\n        return best[1]\n    for back in range(1, 8):\n        d = (dow - back) % 7\n        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]\n        if cand:\n            return sorted(cand, key=lambda c: c[0])[-1][1]\n    return 'free'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'events': [[16, '22:00', 5], [32, '02:00', 5], [55, '03:30', 1], [65, '03:15', 1], [1, '06:45', 4], [34, '05:30', 5]], 'holidays': [[11, 19, 5]], 'now': [1, '16:07', 11, 19]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[79, '19:00', 9], [127, '20:30', 6], [43, '04:30', 4], [32, '23:30', 6], [46, '01:15', 4]], 'holidays': [[4, 15, 1]], 'now': [4, '01:30', 4, 15]}, 4), ({'events': [[19, '00:30', 7], [25, '12:00', 7], [124, '21:30', 2], [127, '07:00', 8], [60, '00:30', 1], [96, '11:00', 8]], 'holidays': [], 'now': [6, '14:07', 10, 16]}, 8), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[32, '16:00', 9], [3, '00:30', 3], [62, '21:30', 2]], 'holidays': [[11, 5, 0], [11, 28, 3]], 'now': [5, '17:15', 2, 26]}, 9), ({'events': [[96, '02:15', 6], [65, '16:15', 9], [21, '09:00', 3], [17, '23:15', 1]], 'holidays': [], 'now': [1, '08:44', 11, 20]}, 1)], [({'events': [[65, '18:45', 7], [2, '10:15', 7], [82, '10:45', 9], [3, '15:00', 6], [23, '00:30', 6]], 'holidays': [[8, 3, 3], [1, 15, 4]], 'now': [6, '23:44', 1, 15]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[65, '02:00', 1], [83, '08:15', 1], [10, '11:30', 5], [23, '02:00', 7], [3, '11:45', 5], [15, '15:15', 8]], 'holidays': [], 'now': [4, '14:07', 1, 15]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[22, '01:30', 1], [3, '12:15', 9], [76, '22:15', 7], [65, '13:45', 3]], 'holidays': [], 'now': [3, '02:44', 8, 10]}, 7), ({'events': [[73, '10:45', 2], [64, '17:15', 8], [32, '16:00', 5], [35, '12:00', 8]], 'holidays': [[6, 16, 3]], 'now': [6, '19:44', 2, 12]}, 8), ({'events': [[8, '19:00', 6], [96, '12:15', 3], [65, '03:45', 9]], 'holidays': [[11, 10, 4]], 'now': [6, '16:07', 11, 6]}, 3)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9), ({'events': [[92, '03:30', 2], [58, '10:30', 2], [25, '22:30', 7], [28, '15:30', 1]], 'holidays': [], 'now': [1, '11:00', 8, 20]}, 2), ({'events': [[111, '17:00', 9], [127, '20:30', 2], [65, '14:45', 6], [96, '09:45', 5], [2, '13:00', 3]], 'holidays': [[10, 23, 6], [10, 2, 6]], 'now': [5, '03:30', 10, 23]}, 2), ({'events': [[2, '11:00', 7], [110, '23:15', 6], [3, '03:45', 1], [65, '17:30', 4]], 'holidays': [[4, 8, 5]], 'now': [0, '11:00', 1, 23]}, 1), ({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[5, '02:45', 3], [70, '07:45', 8], [32, '15:45', 1], [32, '12:45', 7], [2, '06:15', 9]], 'holidays': [], 'now': [1, '16:30', 11, 7]}, 8), ({'events': [[2, '07:45', 9], [37, '01:30', 6], [84, '13:45', 2], [96, '22:00', 3]], 'holidays': [], 'now': [1, '13:45', 11, 14]}, 9)], [({'events': [[65, '13:45', 5], [127, '22:00', 6], [3, '19:30', 8], [8, '11:15', 3], [32, '05:30', 1]], 'holidays': [[10, 3, 6]], 'now': [4, '13:45', 1, 2]}, 6), ({'events': [[32, '12:00', 6], [3, '07:15', 9], [1, '14:45', 3]], 'holidays': [], 'now': [1, '09:00', 8, 28]}, 9), ({'events': [[3, '13:45', 3], [3, '14:30', 9], [51, '02:45', 1], [64, '05:15', 7], [32, '16:15', 3]], 'holidays': [[1, 27, 3], [5, 19, 5]], 'now': [6, '14:30', 12, 6]}, 7), ({'events': [[1, '02:45', 9], [65, '06:45', 3], [2, '05:00', 5]], 'holidays': [], 'now': [6, '06:45', 8, 23]}, 3), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[123, '01:30', 5], [8, '06:00', 6], [127, '21:15', 1], [96, '23:30', 9], [1, '17:45', 1]], 'holidays': [[7, 5, 5], [4, 4, 5]], 'now': [4, '01:30', 2, 9]}, 5)], [({'events': [[62, '16:00', 6], [2, '00:00', 6], [2, '08:00', 8], [62, '21:00', 9], [62, '01:30', 4], [127, '12:15', 3]], 'holidays': [[9, 16, 2], [3, 23, 5]], 'now': [5, '08:00', 11, 16]}, 4), ({'events': [[126, '09:45', 7], [29, '02:00', 3], [65, '06:00', 9]], 'holidays': [[6, 28, 1], [6, 17, 2]], 'now': [1, '04:15', 12, 16]}, 9), ({'events': [[32, '08:30', 1], [31, '14:15', 1], [2, '16:15', 2], [2, '02:00', 5]], 'holidays': [[5, 3, 0], [7, 8, 2]], 'now': [2, '08:30', 11, 16]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '12:00', 5], [1, '12:00', 1]], 'holidays': [], 'now': [1, '16:00', 3, 2]}, 1), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[35, '13:15', 4], [1, '14:00', 6]], 'holidays': [], 'now': [6, '14:00', 2, 18]}, 4), ({'events': [[62, '22:00', 1], [65, '23:00', 9], [127, '05:00', 3]], 'holidays': [[1, 1, 0]], 'now': [1, '02:00', 1, 1]}, 9)]]\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-tod-schedule-mask-bit","generated_at":"2026-09-29T14:47:58.938362+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 day mask bit order rule so that the step reads `mask >> eff & 1`.","root_cause":"The day-of-week bit is taken from the wrong end of the mask, swapping Sunday and Saturday programs.","sha256":"e0fa318af7c339ef37d43847d46650d08894d7299b1212ec7681ea5587ea58b7","title":"Time-of-day plan schedule: the day mask is read with Monday as bit zero · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.222,"exit_code":1,"observations":[{"actual":1,"check":"timing oracle 0","expected":5,"passed":false},{"actual":7,"check":"timing oracle 1","expected":7,"passed":true},{"actual":6,"check":"timing oracle 2","expected":4,"passed":false},{"actual":8,"check":"timing oracle 3","expected":8,"passed":true},{"actual":2,"check":"timing oracle 4","expected":2,"passed":true},{"actual":9,"check":"timing oracle 5","expected":9,"passed":true},{"actual":2,"check":"timing oracle 6","expected":9,"passed":false},{"actual":1,"check":"timing oracle 7","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": 1, \"expected\": 5, \"passed\": false}, {\"check\": \"timing oracle 1\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": 6, \"expected\": 4, \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": 2, \"expected\": 9, \"passed\": false}, {\"check\": \"timing oracle 7\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.751,"exit_code":1,"observations":[{"actual":5,"check":"timing oracle 0","expected":5,"passed":true},{"actual":7,"check":"timing oracle 1","expected":7,"passed":true},{"actual":4,"check":"timing oracle 2","expected":4,"passed":true},{"actual":7,"check":"timing oracle 3","expected":8,"passed":false},{"actual":2,"check":"timing oracle 4","expected":2,"passed":true},{"actual":9,"check":"timing oracle 5","expected":9,"passed":true},{"actual":3,"check":"timing oracle 6","expected":9,"passed":false},{"actual":6,"check":"timing oracle 7","expected":1,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": 7, \"expected\": 8, \"passed\": false}, {\"check\": \"timing oracle 4\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": 3, \"expected\": 9, \"passed\": false}, {\"check\": \"timing oracle 7\", \"actual\": 6, \"expected\": 1, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.645,"exit_code":0,"observations":[{"actual":5,"check":"timing oracle 0","expected":5,"passed":true},{"actual":7,"check":"timing oracle 1","expected":7,"passed":true},{"actual":4,"check":"timing oracle 2","expected":4,"passed":true},{"actual":8,"check":"timing oracle 3","expected":8,"passed":true},{"actual":2,"check":"timing oracle 4","expected":2,"passed":true},{"actual":9,"check":"timing oracle 5","expected":9,"passed":true},{"actual":9,"check":"timing oracle 6","expected":9,"passed":true},{"actual":1,"check":"timing oracle 7","expected":1,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": 5, \"expected\": 5, \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": 7, \"expected\": 7, \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"timing oracle 6\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}