FA-68086 / Traffic signal timing plans / Open access
Time-of-day plan schedule: the day mask is read with Monday as bit zero · case 01
Time-of-day plan schedule returns a wrong result when the day mask is read with Monday as bit zero.
ROOT CAUSE
The day-of-week bit is taken from the wrong end of the mask, swapping Sunday and Saturday programs.
VERIFIED REPAIR
Restore the day mask bit order rule so that the step reads `mask >> eff & 1`.
Unsuccessful approach: Treating Monday as bit zero shifts every day program by one day.
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 >> (6 - 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': [[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)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | 5 | 5 | Passed |
| timing oracle 1 | 7 | 7 | Passed |
| timing oracle 2 | 4 | 4 | Passed |
| timing oracle 3 | 7 | 8 | Failed |
| timing oracle 4 | 2 | 2 | Passed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | 3 | 9 | Failed |
| timing oracle 7 | 6 | 1 | Failed |
SHA-256 / 73d5fbabec2d4940d5b4259780fdfb2822ee42cb4f4e45f8c347a4b3848819d2
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) % 7 & 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': [[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)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | 1 | 5 | Failed |
| timing oracle 1 | 7 | 7 | Passed |
| timing oracle 2 | 6 | 4 | Failed |
| timing oracle 3 | 8 | 8 | Passed |
| timing oracle 4 | 2 | 2 | Passed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | 2 | 9 | Failed |
| timing oracle 7 | 1 | 1 | Passed |
SHA-256 / 8ba0b5ac6cefb709e4050da6dbd801f36495a44c448fcba53edbef41bd0f078b
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': [[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)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | 5 | 5 | Passed |
| timing oracle 1 | 7 | 7 | Passed |
| timing oracle 2 | 4 | 4 | Passed |
| timing oracle 3 | 8 | 8 | Passed |
| timing oracle 4 | 2 | 2 | Passed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | 9 | 9 | Passed |
| timing oracle 7 | 1 | 1 | Passed |
SHA-256 / bda59637476df913939a08a65ca3b0af2ac47e34371caf7c90c60a5bb5e91b60
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.938362+00:00.
Case digest / e0fa318af7c339ef37d43847d46650d08894d7299b1212ec7681ea5587ea58b7