FAILURE MAP
← Case archive

FA-68091 / Traffic signal timing plans / Open access

Time-of-day plan schedule: carryover after a holiday uses the holiday day type · case 01

Time-of-day plan schedule returns a wrong result when carryover after a holiday uses the holiday day type.

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

ROOT CAUSE

The previous-day search starts from the substituted holiday day type instead of the real weekday.

VERIFIED REPAIR

Restore the previous day carryover rule so that the step reads `d = (dow - back) % 7`.

Unsuccessful approach: Searching forward in the week picks up tomorrow evening events instead of last night events.

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 = (eff - 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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[2, '02:00', 1], [3, '16:00', 5], [96, '17:45', 2], [19, '15:45', 8], [1, '21:45', 7], [71, '17:00', 6]], 'holidays': [[8, 1, 0]], 'now': [1, '15:00', 8, 1]}, 7), ({'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': [[1, '08:15', 7], [1, '22:45', 9], [3, '16:00', 9], [32, '13:00', 4], [57, '08:00', 7]], 'holidays': [[12, 1, 1], [6, 6, 4]], 'now': [6, '17:00', 4, 2]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '12:00', 4], [3, '06:15', 6]], 'holidays': [[3, 16, 1]], 'now': [4, '02:44', 3, 16]}, 4), ({'events': [[91, '14:15', 4], [64, '18:15', 3], [43, '21:30', 1], [3, '09:45', 9], [90, '08:45', 8]], 'holidays': [[4, 12, 5], [3, 4, 0]], 'now': [6, '04:07', 4, 12]}, 1), ({'events': [[127, '06:45', 7]], 'holidays': [], 'now': [4, '02:00', 11, 22]}, 7)], [({'events': [[2, '17:45', 3], [3, '14:00', 8], [64, '04:45', 8], [64, '18:30', 7], [13, '12:45', 2], [64, '02:30', 2]], 'holidays': [[7, 10, 5]], 'now': [2, '12:45', 7, 10]}, 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, '23:15', 7], [116, '22:00', 9]], 'holidays': [[5, 2, 5], [8, 24, 6]], 'now': [0, '23:15', 7, 2]}, 7), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[96, '07:30', 1], [45, '06:30', 2], [3, '20:00', 6], [64, '11:45', 4]], 'holidays': [[11, 14, 2]], 'now': [0, '00:00', 11, 14]}, 4), ({'events': [[8, '02:15', 5]], 'holidays': [[2, 18, 5]], 'now': [3, '10:45', 4, 27]}, 5), ({'events': [[2, '22:45', 9], [64, '15:15', 7]], 'holidays': [[4, 21, 0], [2, 15, 1]], 'now': [4, '23:44', 4, 21]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 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': [[127, '13:30', 1], [127, '23:15', 2], [127, '02:30', 4], [96, '08:00', 6], [62, '22:45', 1]], 'holidays': [[8, 19, 6], [2, 4, 5]], 'now': [3, '21:07', 3, 22]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '17:45', 9], [77, '15:00', 2], [3, '23:30', 3]], 'holidays': [[11, 14, 4]], 'now': [1, '00:15', 10, 2]}, 3), ({'events': [[64, '00:30', 3], [65, '23:00', 6], [127, '16:15', 3], [65, '03:30', 2], [32, '08:00', 5], [86, '08:00', 4]], 'holidays': [[9, 23, 0], [5, 9, 1]], 'now': [2, '00:30', 9, 23]}, 3), ({'events': [[65, '20:00', 6], [6, '11:00', 8]], 'holidays': [[12, 21, 0], [2, 7, 1]], 'now': [5, '05:30', 2, 7]}, 8), ({'events': [[62, '20:45', 3], [121, '00:00', 8]], 'holidays': [[3, 11, 5], [11, 17, 1]], 'now': [4, '08:00', 11, 17]}, 3), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2)], [({'events': [[65, '07:45', 2], [19, '13:30', 4], [3, '01:45', 7], [2, '19:00', 9], [64, '06:30', 6], [1, '07:00', 4]], 'holidays': [], 'now': [2, '07:00', 5, 11]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[2, '05:30', 8], [32, '21:15', 3], [3, '01:00', 8], [96, '00:45', 9]], 'holidays': [[7, 28, 4], [5, 5, 3]], 'now': [6, '01:00', 7, 28]}, 3), ({'events': [[96, '02:15', 5], [96, '18:00', 3], [1, '01:30', 2], [3, '09:30', 8], [2, '02:15', 6]], 'holidays': [[8, 10, 2], [5, 15, 1]], 'now': [6, '05:00', 7, 7]}, 5), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '08:45', 3], [127, '19:30', 4], [2, '07:15', 5], [1, '19:45', 5], [64, '05:30', 7]], 'holidays': [[5, 20, 0]], 'now': [1, '04:00', 5, 20]}, 5), ({'events': [[65, '05:15', 9], [64, '21:45', 7], [3, '03:00', 5]], 'holidays': [[1, 17, 5], [10, 11, 0]], 'now': [2, '02:07', 10, 11]}, 5), ({'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': [[64, '11:45', 2], [8, '11:30', 6]], 'holidays': [[6, 10, 3]], 'now': [4, '11:30', 6, 16]}, 6), ({'events': [[3, '20:30', 5], [101, '18:15', 4], [127, '17:45', 2]], 'holidays': [[8, 2, 4]], 'now': [0, '12:15', 8, 2]}, 4), ({'events': [[62, '19:45', 4], [96, '18:15', 6]], 'holidays': [[9, 17, 4]], 'now': [0, '18:15', 9, 17]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[1, '07:00', 9], [62, '05:00', 6]], 'holidays': [[1, 9, 2], [7, 9, 2]], 'now': [6, '15:00', 7, 18]}, 6), ({'events': [[123, '20:45', 5], [64, '04:30', 1], [37, '01:15', 4], [70, '12:45', 1], [64, '07:15', 4], [126, '19:15', 8]], 'holidays': [[11, 20, 3]], 'now': [6, '00:00', 11, 20]}, 5)]]
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 077Passed
timing oracle 127Failed
timing oracle 299Passed
timing oracle 344Passed
timing oracle 455Passed
timing oracle 564Failed
timing oracle 641Failed
timing oracle 777Passed

SHA-256 / b424cbf5232a1e9d7deaca51ceb8ca857152c8e2f51f0aea9b3b6d821f392706

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) <= 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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[2, '02:00', 1], [3, '16:00', 5], [96, '17:45', 2], [19, '15:45', 8], [1, '21:45', 7], [71, '17:00', 6]], 'holidays': [[8, 1, 0]], 'now': [1, '15:00', 8, 1]}, 7), ({'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': [[1, '08:15', 7], [1, '22:45', 9], [3, '16:00', 9], [32, '13:00', 4], [57, '08:00', 7]], 'holidays': [[12, 1, 1], [6, 6, 4]], 'now': [6, '17:00', 4, 2]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '12:00', 4], [3, '06:15', 6]], 'holidays': [[3, 16, 1]], 'now': [4, '02:44', 3, 16]}, 4), ({'events': [[91, '14:15', 4], [64, '18:15', 3], [43, '21:30', 1], [3, '09:45', 9], [90, '08:45', 8]], 'holidays': [[4, 12, 5], [3, 4, 0]], 'now': [6, '04:07', 4, 12]}, 1), ({'events': [[127, '06:45', 7]], 'holidays': [], 'now': [4, '02:00', 11, 22]}, 7)], [({'events': [[2, '17:45', 3], [3, '14:00', 8], [64, '04:45', 8], [64, '18:30', 7], [13, '12:45', 2], [64, '02:30', 2]], 'holidays': [[7, 10, 5]], 'now': [2, '12:45', 7, 10]}, 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, '23:15', 7], [116, '22:00', 9]], 'holidays': [[5, 2, 5], [8, 24, 6]], 'now': [0, '23:15', 7, 2]}, 7), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[96, '07:30', 1], [45, '06:30', 2], [3, '20:00', 6], [64, '11:45', 4]], 'holidays': [[11, 14, 2]], 'now': [0, '00:00', 11, 14]}, 4), ({'events': [[8, '02:15', 5]], 'holidays': [[2, 18, 5]], 'now': [3, '10:45', 4, 27]}, 5), ({'events': [[2, '22:45', 9], [64, '15:15', 7]], 'holidays': [[4, 21, 0], [2, 15, 1]], 'now': [4, '23:44', 4, 21]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 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': [[127, '13:30', 1], [127, '23:15', 2], [127, '02:30', 4], [96, '08:00', 6], [62, '22:45', 1]], 'holidays': [[8, 19, 6], [2, 4, 5]], 'now': [3, '21:07', 3, 22]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '17:45', 9], [77, '15:00', 2], [3, '23:30', 3]], 'holidays': [[11, 14, 4]], 'now': [1, '00:15', 10, 2]}, 3), ({'events': [[64, '00:30', 3], [65, '23:00', 6], [127, '16:15', 3], [65, '03:30', 2], [32, '08:00', 5], [86, '08:00', 4]], 'holidays': [[9, 23, 0], [5, 9, 1]], 'now': [2, '00:30', 9, 23]}, 3), ({'events': [[65, '20:00', 6], [6, '11:00', 8]], 'holidays': [[12, 21, 0], [2, 7, 1]], 'now': [5, '05:30', 2, 7]}, 8), ({'events': [[62, '20:45', 3], [121, '00:00', 8]], 'holidays': [[3, 11, 5], [11, 17, 1]], 'now': [4, '08:00', 11, 17]}, 3), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2)], [({'events': [[65, '07:45', 2], [19, '13:30', 4], [3, '01:45', 7], [2, '19:00', 9], [64, '06:30', 6], [1, '07:00', 4]], 'holidays': [], 'now': [2, '07:00', 5, 11]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[2, '05:30', 8], [32, '21:15', 3], [3, '01:00', 8], [96, '00:45', 9]], 'holidays': [[7, 28, 4], [5, 5, 3]], 'now': [6, '01:00', 7, 28]}, 3), ({'events': [[96, '02:15', 5], [96, '18:00', 3], [1, '01:30', 2], [3, '09:30', 8], [2, '02:15', 6]], 'holidays': [[8, 10, 2], [5, 15, 1]], 'now': [6, '05:00', 7, 7]}, 5), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '08:45', 3], [127, '19:30', 4], [2, '07:15', 5], [1, '19:45', 5], [64, '05:30', 7]], 'holidays': [[5, 20, 0]], 'now': [1, '04:00', 5, 20]}, 5), ({'events': [[65, '05:15', 9], [64, '21:45', 7], [3, '03:00', 5]], 'holidays': [[1, 17, 5], [10, 11, 0]], 'now': [2, '02:07', 10, 11]}, 5), ({'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': [[64, '11:45', 2], [8, '11:30', 6]], 'holidays': [[6, 10, 3]], 'now': [4, '11:30', 6, 16]}, 6), ({'events': [[3, '20:30', 5], [101, '18:15', 4], [127, '17:45', 2]], 'holidays': [[8, 2, 4]], 'now': [0, '12:15', 8, 2]}, 4), ({'events': [[62, '19:45', 4], [96, '18:15', 6]], 'holidays': [[9, 17, 4]], 'now': [0, '18:15', 9, 17]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[1, '07:00', 9], [62, '05:00', 6]], 'holidays': [[1, 9, 2], [7, 9, 2]], 'now': [6, '15:00', 7, 18]}, 6), ({'events': [[123, '20:45', 5], [64, '04:30', 1], [37, '01:15', 4], [70, '12:45', 1], [64, '07:15', 4], [126, '19:15', 8]], 'holidays': [[11, 20, 3]], 'now': [6, '00:00', 11, 20]}, 5)]]
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 077Passed
timing oracle 167Failed
timing oracle 219Failed
timing oracle 394Failed
timing oracle 455Passed
timing oracle 564Failed
timing oracle 611Passed
timing oracle 777Passed

SHA-256 / 8c15ddb73176b470f8c88d61784f4e9e261aa5afe0c8dfad10b4d54a1d0ad429

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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[2, '02:00', 1], [3, '16:00', 5], [96, '17:45', 2], [19, '15:45', 8], [1, '21:45', 7], [71, '17:00', 6]], 'holidays': [[8, 1, 0]], 'now': [1, '15:00', 8, 1]}, 7), ({'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': [[1, '08:15', 7], [1, '22:45', 9], [3, '16:00', 9], [32, '13:00', 4], [57, '08:00', 7]], 'holidays': [[12, 1, 1], [6, 6, 4]], 'now': [6, '17:00', 4, 2]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '12:00', 4], [3, '06:15', 6]], 'holidays': [[3, 16, 1]], 'now': [4, '02:44', 3, 16]}, 4), ({'events': [[91, '14:15', 4], [64, '18:15', 3], [43, '21:30', 1], [3, '09:45', 9], [90, '08:45', 8]], 'holidays': [[4, 12, 5], [3, 4, 0]], 'now': [6, '04:07', 4, 12]}, 1), ({'events': [[127, '06:45', 7]], 'holidays': [], 'now': [4, '02:00', 11, 22]}, 7)], [({'events': [[2, '17:45', 3], [3, '14:00', 8], [64, '04:45', 8], [64, '18:30', 7], [13, '12:45', 2], [64, '02:30', 2]], 'holidays': [[7, 10, 5]], 'now': [2, '12:45', 7, 10]}, 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, '23:15', 7], [116, '22:00', 9]], 'holidays': [[5, 2, 5], [8, 24, 6]], 'now': [0, '23:15', 7, 2]}, 7), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[96, '07:30', 1], [45, '06:30', 2], [3, '20:00', 6], [64, '11:45', 4]], 'holidays': [[11, 14, 2]], 'now': [0, '00:00', 11, 14]}, 4), ({'events': [[8, '02:15', 5]], 'holidays': [[2, 18, 5]], 'now': [3, '10:45', 4, 27]}, 5), ({'events': [[2, '22:45', 9], [64, '15:15', 7]], 'holidays': [[4, 21, 0], [2, 15, 1]], 'now': [4, '23:44', 4, 21]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 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': [[127, '13:30', 1], [127, '23:15', 2], [127, '02:30', 4], [96, '08:00', 6], [62, '22:45', 1]], 'holidays': [[8, 19, 6], [2, 4, 5]], 'now': [3, '21:07', 3, 22]}, 1), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[96, '17:45', 9], [77, '15:00', 2], [3, '23:30', 3]], 'holidays': [[11, 14, 4]], 'now': [1, '00:15', 10, 2]}, 3), ({'events': [[64, '00:30', 3], [65, '23:00', 6], [127, '16:15', 3], [65, '03:30', 2], [32, '08:00', 5], [86, '08:00', 4]], 'holidays': [[9, 23, 0], [5, 9, 1]], 'now': [2, '00:30', 9, 23]}, 3), ({'events': [[65, '20:00', 6], [6, '11:00', 8]], 'holidays': [[12, 21, 0], [2, 7, 1]], 'now': [5, '05:30', 2, 7]}, 8), ({'events': [[62, '20:45', 3], [121, '00:00', 8]], 'holidays': [[3, 11, 5], [11, 17, 1]], 'now': [4, '08:00', 11, 17]}, 3), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2)], [({'events': [[65, '07:45', 2], [19, '13:30', 4], [3, '01:45', 7], [2, '19:00', 9], [64, '06:30', 6], [1, '07:00', 4]], 'holidays': [], 'now': [2, '07:00', 5, 11]}, 9), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[2, '05:30', 8], [32, '21:15', 3], [3, '01:00', 8], [96, '00:45', 9]], 'holidays': [[7, 28, 4], [5, 5, 3]], 'now': [6, '01:00', 7, 28]}, 3), ({'events': [[96, '02:15', 5], [96, '18:00', 3], [1, '01:30', 2], [3, '09:30', 8], [2, '02:15', 6]], 'holidays': [[8, 10, 2], [5, 15, 1]], 'now': [6, '05:00', 7, 7]}, 5), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[2, '08:45', 3], [127, '19:30', 4], [2, '07:15', 5], [1, '19:45', 5], [64, '05:30', 7]], 'holidays': [[5, 20, 0]], 'now': [1, '04:00', 5, 20]}, 5), ({'events': [[65, '05:15', 9], [64, '21:45', 7], [3, '03:00', 5]], 'holidays': [[1, 17, 5], [10, 11, 0]], 'now': [2, '02:07', 10, 11]}, 5), ({'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': [[64, '11:45', 2], [8, '11:30', 6]], 'holidays': [[6, 10, 3]], 'now': [4, '11:30', 6, 16]}, 6), ({'events': [[3, '20:30', 5], [101, '18:15', 4], [127, '17:45', 2]], 'holidays': [[8, 2, 4]], 'now': [0, '12:15', 8, 2]}, 4), ({'events': [[62, '19:45', 4], [96, '18:15', 6]], 'holidays': [[9, 17, 4]], 'now': [0, '18:15', 9, 17]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[1, '07:00', 9], [62, '05:00', 6]], 'holidays': [[1, 9, 2], [7, 9, 2]], 'now': [6, '15:00', 7, 18]}, 6), ({'events': [[123, '20:45', 5], [64, '04:30', 1], [37, '01:15', 4], [70, '12:45', 1], [64, '07:15', 4], [126, '19:15', 8]], 'holidays': [[11, 20, 3]], 'now': [6, '00:00', 11, 20]}, 5)]]
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 077Passed
timing oracle 177Passed
timing oracle 299Passed
timing oracle 344Passed
timing oracle 455Passed
timing oracle 544Passed
timing oracle 611Passed
timing oracle 777Passed

SHA-256 / c4fae13eaadca0e73c5e8b8b2210172e49afd09f257f76637be047fcd57febd0

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.973515+00:00.

Case digest / d429667cd002b9a34c3bc8619fe8cc938b728c9fb5d3fac529e84b912747b533