FAILURE MAP
← Case archive

FA-68081 / Traffic signal timing plans / Open access

Time-of-day plan schedule: events are compared at hour granularity · case 01

Time-of-day plan schedule returns a wrong result when events are compared at hour granularity.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

An event starting exactly at the current minute is not yet considered active, so the previous plan persists for one minute.

VERIFIED REPAIR

Restore the event start boundary rule so that the step reads `mins(st) <= t`.

Unsuccessful approach: Comparing whole hours activates a 15:30 event already at 15:00.

Case 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'.

Why this case matters

Signal timing arithmetic is exact and integer or rational; a wrong rule silently produces unsafe or inefficient timing plans.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    def mins(s):
        h, m = s.split(':')
        return int(h) * 60 + int(m)
    dow, hm, mo, dy = x['now']
    t = mins(hm)
    eff = dow
    for hmo, hdy, as_dow in x['holidays']:
        if hmo == mo and hdy == dy:
            eff = as_dow
    best = None
    for mask, st, plan in x['events']:
        if mask >> eff & 1 and mins(st) < t:
            if best is None or mins(st) >= best[0]:
                best = (mins(st), plan)
    if best is not None:
        return best[1]
    for back in range(1, 8):
        d = (dow - back) % 7
        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]
        if cand:
            return sorted(cand, key=lambda c: c[0])[-1][1]
    return 'free'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'events': [[61, '04:00', 3], [1, '13:30', 2], [2, '23:15', 4], [65, '01:30', 2], [1, '06:45', 5], [125, '16:45', 1]], 'holidays': [], 'now': [0, '01:30', 5, 23]}, 2), ({'events': [[88, '03:00', 1], [96, '19:15', 6], [1, '04:30', 4], [65, '09:15', 3]], 'holidays': [[10, 20, 3], [9, 16, 0]], 'now': [0, '04:15', 4, 16]}, 6), ({'events': [[98, '09:45', 7], [96, '06:45', 5]], 'holidays': [], 'now': [5, '09:44', 4, 17]}, 5), ({'events': [[110, '21:45', 2], [62, '12:45', 2], [62, '03:15', 7]], 'holidays': [[12, 2, 0]], 'now': [4, '03:15', 6, 22]}, 7), ({'events': [[62, '21:45', 3], [1, '15:30', 5], [65, '17:15', 5]], 'holidays': [[10, 4, 4], [7, 21, 0]], 'now': [3, '04:15', 12, 27]}, 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': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:45', 5], [127, '16:15', 2], [2, '20:15', 6], [3, '00:00', 2]], 'holidays': [[7, 19, 1], [5, 21, 1]], 'now': [6, '03:45', 6, 9]}, 2), ({'events': [[62, '01:15', 9], [65, '10:30', 6], [47, '01:15', 4], [1, '12:30', 2], [3, '10:45', 3]], 'holidays': [], 'now': [4, '01:15', 3, 11]}, 9), ({'events': [[62, '21:00', 7], [29, '04:45', 8], [96, '20:45', 9], [104, '00:00', 8], [23, '15:45', 6]], 'holidays': [[1, 8, 3], [11, 6, 0]], 'now': [5, '04:45', 11, 6]}, 8), ({'events': [[62, '12:15', 4], [11, '05:30', 1], [32, '00:30', 6], [69, '12:00', 5], [65, '10:00', 6], [53, '16:00', 2]], 'holidays': [], 'now': [3, '05:15', 7, 25]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '12:45', 1], [127, '12:15', 3], [64, '17:15', 2], [32, '06:15', 3], [65, '09:15', 8]], 'holidays': [], 'now': [6, '17:00', 1, 5]}, 1)], [({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[96, '23:45', 9], [65, '21:45', 9], [62, '04:30', 2]], 'holidays': [], 'now': [5, '23:45', 4, 5]}, 9), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[64, '02:45', 9], [96, '22:00', 7], [3, '22:15', 5], [11, '08:00', 8], [32, '18:30', 3], [64, '21:15', 7]], 'holidays': [[9, 22, 2], [11, 12, 3]], 'now': [0, '08:00', 11, 12]}, 8), ({'events': [[122, '21:15', 2], [111, '21:45', 7]], 'holidays': [[7, 5, 1]], 'now': [6, '21:15', 2, 23]}, 2), ({'events': [[2, '14:15', 8], [32, '22:00', 3], [3, '03:45', 6]], 'holidays': [[6, 10, 2]], 'now': [1, '14:00', 11, 14]}, 6), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '07:30', 2], [62, '16:45', 1], [3, '11:00', 6], [41, '00:30', 5], [33, '13:30', 4]], 'holidays': [], 'now': [2, '16:45', 4, 18]}, 1)], [({'events': [[71, '07:15', 7], [43, '07:45', 3], [64, '16:30', 2]], 'holidays': [], 'now': [0, '07:45', 6, 24]}, 3), ({'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': [[3, '16:15', 1], [32, '20:45', 7]], 'holidays': [], 'now': [0, '16:15', 6, 23]}, 1), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '02:45', 8], [27, '05:30', 9], [125, '10:00', 1], [1, '18:15', 1], [3, '01:15', 9]], 'holidays': [[9, 12, 5], [9, 7, 4]], 'now': [1, '05:30', 5, 26]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[126, '23:30', 9], [2, '23:45', 9], [125, '20:45', 8], [38, '10:15', 5], [96, '23:00', 3], [65, '04:45', 9]], 'holidays': [[8, 7, 4], [5, 2, 3]], 'now': [1, '23:07', 8, 7]}, 8), ({'events': [[62, '14:15', 9], [1, '05:00', 1], [127, '10:30', 3], [3, '09:45', 6], [65, '04:45', 6]], 'holidays': [[1, 25, 1], [8, 20, 3]], 'now': [1, '09:30', 1, 25]}, 3)], [({'events': [[127, '15:15', 4], [99, '21:30', 1], [127, '15:45', 9]], 'holidays': [], 'now': [4, '15:15', 2, 11]}, 4), ({'events': [[16, '08:15', 6], [122, '03:15', 9], [62, '18:15', 5], [1, '02:15', 1], [1, '23:30', 9], [1, '06:15', 6]], 'holidays': [], 'now': [4, '03:15', 1, 12]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '03:15', 3], [1, '02:00', 4], [32, '18:30', 4], [62, '10:00', 1], [13, '14:15', 1]], 'holidays': [], 'now': [0, '14:15', 7, 9]}, 1), ({'events': [[3, '15:00', 5], [2, '22:00', 1], [127, '00:15', 6], [2, '16:15', 5], [47, '11:15', 1], [99, '04:45', 4]], 'holidays': [[10, 23, 2]], 'now': [3, '00:00', 2, 2]}, 1), ({'events': [[127, '14:30', 1]], 'holidays': [[10, 11, 1]], 'now': [1, '14:30', 1, 16]}, 1)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('timing oracle' + ' %d' % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
timing oracle 012Failed
timing oracle 166Passed
timing oracle 255Passed
timing oracle 327Failed
timing oracle 433Passed
timing oracle 522Passed
timing oracle 699Passed
timing oracle 745Failed

SHA-256 / 88091c6d7b09dbccaa24d75a686d8b5e5a70ac94890b339a74e2ba91ee1612ac

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    def mins(s):
        h, m = s.split(':')
        return int(h) * 60 + int(m)
    dow, hm, mo, dy = x['now']
    t = mins(hm)
    eff = dow
    for hmo, hdy, as_dow in x['holidays']:
        if hmo == mo and hdy == dy:
            eff = as_dow
    best = None
    for mask, st, plan in x['events']:
        if mask >> eff & 1 and mins(st) // 60 <= t // 60:
            if best is None or mins(st) >= best[0]:
                best = (mins(st), plan)
    if best is not None:
        return best[1]
    for back in range(1, 8):
        d = (dow - back) % 7
        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]
        if cand:
            return sorted(cand, key=lambda c: c[0])[-1][1]
    return 'free'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'events': [[61, '04:00', 3], [1, '13:30', 2], [2, '23:15', 4], [65, '01:30', 2], [1, '06:45', 5], [125, '16:45', 1]], 'holidays': [], 'now': [0, '01:30', 5, 23]}, 2), ({'events': [[88, '03:00', 1], [96, '19:15', 6], [1, '04:30', 4], [65, '09:15', 3]], 'holidays': [[10, 20, 3], [9, 16, 0]], 'now': [0, '04:15', 4, 16]}, 6), ({'events': [[98, '09:45', 7], [96, '06:45', 5]], 'holidays': [], 'now': [5, '09:44', 4, 17]}, 5), ({'events': [[110, '21:45', 2], [62, '12:45', 2], [62, '03:15', 7]], 'holidays': [[12, 2, 0]], 'now': [4, '03:15', 6, 22]}, 7), ({'events': [[62, '21:45', 3], [1, '15:30', 5], [65, '17:15', 5]], 'holidays': [[10, 4, 4], [7, 21, 0]], 'now': [3, '04:15', 12, 27]}, 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': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:45', 5], [127, '16:15', 2], [2, '20:15', 6], [3, '00:00', 2]], 'holidays': [[7, 19, 1], [5, 21, 1]], 'now': [6, '03:45', 6, 9]}, 2), ({'events': [[62, '01:15', 9], [65, '10:30', 6], [47, '01:15', 4], [1, '12:30', 2], [3, '10:45', 3]], 'holidays': [], 'now': [4, '01:15', 3, 11]}, 9), ({'events': [[62, '21:00', 7], [29, '04:45', 8], [96, '20:45', 9], [104, '00:00', 8], [23, '15:45', 6]], 'holidays': [[1, 8, 3], [11, 6, 0]], 'now': [5, '04:45', 11, 6]}, 8), ({'events': [[62, '12:15', 4], [11, '05:30', 1], [32, '00:30', 6], [69, '12:00', 5], [65, '10:00', 6], [53, '16:00', 2]], 'holidays': [], 'now': [3, '05:15', 7, 25]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '12:45', 1], [127, '12:15', 3], [64, '17:15', 2], [32, '06:15', 3], [65, '09:15', 8]], 'holidays': [], 'now': [6, '17:00', 1, 5]}, 1)], [({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[96, '23:45', 9], [65, '21:45', 9], [62, '04:30', 2]], 'holidays': [], 'now': [5, '23:45', 4, 5]}, 9), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[64, '02:45', 9], [96, '22:00', 7], [3, '22:15', 5], [11, '08:00', 8], [32, '18:30', 3], [64, '21:15', 7]], 'holidays': [[9, 22, 2], [11, 12, 3]], 'now': [0, '08:00', 11, 12]}, 8), ({'events': [[122, '21:15', 2], [111, '21:45', 7]], 'holidays': [[7, 5, 1]], 'now': [6, '21:15', 2, 23]}, 2), ({'events': [[2, '14:15', 8], [32, '22:00', 3], [3, '03:45', 6]], 'holidays': [[6, 10, 2]], 'now': [1, '14:00', 11, 14]}, 6), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '07:30', 2], [62, '16:45', 1], [3, '11:00', 6], [41, '00:30', 5], [33, '13:30', 4]], 'holidays': [], 'now': [2, '16:45', 4, 18]}, 1)], [({'events': [[71, '07:15', 7], [43, '07:45', 3], [64, '16:30', 2]], 'holidays': [], 'now': [0, '07:45', 6, 24]}, 3), ({'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': [[3, '16:15', 1], [32, '20:45', 7]], 'holidays': [], 'now': [0, '16:15', 6, 23]}, 1), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '02:45', 8], [27, '05:30', 9], [125, '10:00', 1], [1, '18:15', 1], [3, '01:15', 9]], 'holidays': [[9, 12, 5], [9, 7, 4]], 'now': [1, '05:30', 5, 26]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[126, '23:30', 9], [2, '23:45', 9], [125, '20:45', 8], [38, '10:15', 5], [96, '23:00', 3], [65, '04:45', 9]], 'holidays': [[8, 7, 4], [5, 2, 3]], 'now': [1, '23:07', 8, 7]}, 8), ({'events': [[62, '14:15', 9], [1, '05:00', 1], [127, '10:30', 3], [3, '09:45', 6], [65, '04:45', 6]], 'holidays': [[1, 25, 1], [8, 20, 3]], 'now': [1, '09:30', 1, 25]}, 3)], [({'events': [[127, '15:15', 4], [99, '21:30', 1], [127, '15:45', 9]], 'holidays': [], 'now': [4, '15:15', 2, 11]}, 4), ({'events': [[16, '08:15', 6], [122, '03:15', 9], [62, '18:15', 5], [1, '02:15', 1], [1, '23:30', 9], [1, '06:15', 6]], 'holidays': [], 'now': [4, '03:15', 1, 12]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '03:15', 3], [1, '02:00', 4], [32, '18:30', 4], [62, '10:00', 1], [13, '14:15', 1]], 'holidays': [], 'now': [0, '14:15', 7, 9]}, 1), ({'events': [[3, '15:00', 5], [2, '22:00', 1], [127, '00:15', 6], [2, '16:15', 5], [47, '11:15', 1], [99, '04:45', 4]], 'holidays': [[10, 23, 2]], 'now': [3, '00:00', 2, 2]}, 1), ({'events': [[127, '14:30', 1]], 'holidays': [[10, 11, 1]], 'now': [1, '14:30', 1, 16]}, 1)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('timing oracle' + ' %d' % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
timing oracle 022Passed
timing oracle 146Failed
timing oracle 275Failed
timing oracle 377Passed
timing oracle 433Passed
timing oracle 522Passed
timing oracle 699Passed
timing oracle 755Passed

SHA-256 / 5575b2566c21dc9c8c479069398224ed9dee331709740e717500ac432d3d3dd5

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    def mins(s):
        h, m = s.split(':')
        return int(h) * 60 + int(m)
    dow, hm, mo, dy = x['now']
    t = mins(hm)
    eff = dow
    for hmo, hdy, as_dow in x['holidays']:
        if hmo == mo and hdy == dy:
            eff = as_dow
    best = None
    for mask, st, plan in x['events']:
        if mask >> eff & 1 and mins(st) <= t:
            if best is None or mins(st) >= best[0]:
                best = (mins(st), plan)
    if best is not None:
        return best[1]
    for back in range(1, 8):
        d = (dow - back) % 7
        cand = [(mins(st), plan) for mask, st, plan in x['events'] if mask >> d & 1]
        if cand:
            return sorted(cand, key=lambda c: c[0])[-1][1]
    return 'free'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'events': [[61, '04:00', 3], [1, '13:30', 2], [2, '23:15', 4], [65, '01:30', 2], [1, '06:45', 5], [125, '16:45', 1]], 'holidays': [], 'now': [0, '01:30', 5, 23]}, 2), ({'events': [[88, '03:00', 1], [96, '19:15', 6], [1, '04:30', 4], [65, '09:15', 3]], 'holidays': [[10, 20, 3], [9, 16, 0]], 'now': [0, '04:15', 4, 16]}, 6), ({'events': [[98, '09:45', 7], [96, '06:45', 5]], 'holidays': [], 'now': [5, '09:44', 4, 17]}, 5), ({'events': [[110, '21:45', 2], [62, '12:45', 2], [62, '03:15', 7]], 'holidays': [[12, 2, 0]], 'now': [4, '03:15', 6, 22]}, 7), ({'events': [[62, '21:45', 3], [1, '15:30', 5], [65, '17:15', 5]], 'holidays': [[10, 4, 4], [7, 21, 0]], 'now': [3, '04:15', 12, 27]}, 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': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5)], [({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[127, '06:45', 5], [127, '16:15', 2], [2, '20:15', 6], [3, '00:00', 2]], 'holidays': [[7, 19, 1], [5, 21, 1]], 'now': [6, '03:45', 6, 9]}, 2), ({'events': [[62, '01:15', 9], [65, '10:30', 6], [47, '01:15', 4], [1, '12:30', 2], [3, '10:45', 3]], 'holidays': [], 'now': [4, '01:15', 3, 11]}, 9), ({'events': [[62, '21:00', 7], [29, '04:45', 8], [96, '20:45', 9], [104, '00:00', 8], [23, '15:45', 6]], 'holidays': [[1, 8, 3], [11, 6, 0]], 'now': [5, '04:45', 11, 6]}, 8), ({'events': [[62, '12:15', 4], [11, '05:30', 1], [32, '00:30', 6], [69, '12:00', 5], [65, '10:00', 6], [53, '16:00', 2]], 'holidays': [], 'now': [3, '05:15', 7, 25]}, 2), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '12:45', 1], [127, '12:15', 3], [64, '17:15', 2], [32, '06:15', 3], [65, '09:15', 8]], 'holidays': [], 'now': [6, '17:00', 1, 5]}, 1)], [({'events': [[62, '06:00', 2], [65, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[96, '23:45', 9], [65, '21:45', 9], [62, '04:30', 2]], 'holidays': [], 'now': [5, '23:45', 4, 5]}, 9), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[64, '02:45', 9], [96, '22:00', 7], [3, '22:15', 5], [11, '08:00', 8], [32, '18:30', 3], [64, '21:15', 7]], 'holidays': [[9, 22, 2], [11, 12, 3]], 'now': [0, '08:00', 11, 12]}, 8), ({'events': [[122, '21:15', 2], [111, '21:45', 7]], 'holidays': [[7, 5, 1]], 'now': [6, '21:15', 2, 23]}, 2), ({'events': [[2, '14:15', 8], [32, '22:00', 3], [3, '03:45', 6]], 'holidays': [[6, 10, 2]], 'now': [1, '14:00', 11, 14]}, 6), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '07:30', 2], [62, '16:45', 1], [3, '11:00', 6], [41, '00:30', 5], [33, '13:30', 4]], 'holidays': [], 'now': [2, '16:45', 4, 18]}, 1)], [({'events': [[71, '07:15', 7], [43, '07:45', 3], [64, '16:30', 2]], 'holidays': [], 'now': [0, '07:45', 6, 24]}, 3), ({'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': [[3, '16:15', 1], [32, '20:45', 7]], 'holidays': [], 'now': [0, '16:15', 6, 23]}, 1), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '02:45', 8], [27, '05:30', 9], [125, '10:00', 1], [1, '18:15', 1], [3, '01:15', 9]], 'holidays': [[9, 12, 5], [9, 7, 4]], 'now': [1, '05:30', 5, 26]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[126, '23:30', 9], [2, '23:45', 9], [125, '20:45', 8], [38, '10:15', 5], [96, '23:00', 3], [65, '04:45', 9]], 'holidays': [[8, 7, 4], [5, 2, 3]], 'now': [1, '23:07', 8, 7]}, 8), ({'events': [[62, '14:15', 9], [1, '05:00', 1], [127, '10:30', 3], [3, '09:45', 6], [65, '04:45', 6]], 'holidays': [[1, 25, 1], [8, 20, 3]], 'now': [1, '09:30', 1, 25]}, 3)], [({'events': [[127, '15:15', 4], [99, '21:30', 1], [127, '15:45', 9]], 'holidays': [], 'now': [4, '15:15', 2, 11]}, 4), ({'events': [[16, '08:15', 6], [122, '03:15', 9], [62, '18:15', 5], [1, '02:15', 1], [1, '23:30', 9], [1, '06:15', 6]], 'holidays': [], 'now': [4, '03:15', 1, 12]}, 9), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '03:15', 3], [1, '02:00', 4], [32, '18:30', 4], [62, '10:00', 1], [13, '14:15', 1]], 'holidays': [], 'now': [0, '14:15', 7, 9]}, 1), ({'events': [[3, '15:00', 5], [2, '22:00', 1], [127, '00:15', 6], [2, '16:15', 5], [47, '11:15', 1], [99, '04:45', 4]], 'holidays': [[10, 23, 2]], 'now': [3, '00:00', 2, 2]}, 1), ({'events': [[127, '14:30', 1]], 'holidays': [[10, 11, 1]], 'now': [1, '14:30', 1, 16]}, 1)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('timing oracle' + ' %d' % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
timing oracle 022Passed
timing oracle 166Passed
timing oracle 255Passed
timing oracle 377Passed
timing oracle 433Passed
timing oracle 522Passed
timing oracle 699Passed
timing oracle 755Passed

SHA-256 / fe0c80f0bdca2998976beb6fd60946a41795f8ca99f009d45a407abe6e6191ca

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:47:58.934722+00:00.

Case digest / c87575c24576d153f29e331bd2a1dd278b1a34caefa80462674f1f8d8e9de887