FA-68106 / Traffic signal timing plans / Open access
Time-of-day plan schedule: the carryover search looks back only one day · case 01
Time-of-day plan schedule returns a wrong result when the carryover search looks back only one day.
ROOT CAUSE
Only yesterday is searched, so a weekly program whose previous event was several days ago falls to free mode.
VERIFIED REPAIR
Restore the carryover search depth rule so that the step reads `range(1, 8)`.
Unsuccessful approach: Six days back misses the same weekday one week earlier when today has only later 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, 2):
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': [[2, '16:45', 2], [65, '09:30', 6], [3, '02:45', 7], [117, '23:00', 6], [71, '09:15', 2], [96, '07:30', 3]], 'holidays': [[3, 12, 3]], 'now': [4, '09:30', 12, 4]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '05:15', 6], [64, '10:45', 6], [96, '09:45', 1], [2, '12:15', 8]], 'holidays': [], 'now': [3, '10:45', 10, 12]}, 8), ({'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, '02:45', 1]], 'holidays': [[10, 23, 5]], 'now': [0, '02:15', 10, 23]}, 1), ({'events': [[109, '05:30', 6], [54, '02:30', 9], [65, '20:30', 8], [10, '13:15', 2], [65, '17:15', 9], [119, '20:30', 9]], 'holidays': [], 'now': [3, '20:30', 3, 22]}, 2)], [({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '05:30', 2]], 'holidays': [[2, 4, 0]], 'now': [5, '08:45', 7, 2]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[3, '09:30', 4], [2, '00:15', 6], [6, '11:45', 6], [104, '14:30', 8], [64, '02:45', 4]], 'holidays': [[9, 4, 5], [11, 19, 4]], 'now': [6, '15:30', 11, 24]}, 8), ({'events': [[2, '08:15', 5]], 'holidays': [[5, 27, 6]], 'now': [1, '14:45', 5, 27]}, 5), ({'events': [[70, '11:15', 8], [127, '18:00', 5], [65, '14:15', 8], [3, '08:30', 5], [1, '10:45', 8], [96, '00:30', 4]], 'holidays': [[7, 6, 5], [8, 2, 0]], 'now': [1, '12:15', 7, 6]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '13:45', 4], [2, '20:15', 7], [119, '13:15', 7], [93, '19:15', 1], [62, '03:00', 7]], 'holidays': [[8, 8, 0], [1, 15, 3]], 'now': [6, '03:44', 5, 19]}, 4)], [({'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': [[85, '18:45', 2], [42, '03:00', 5], [100, '07:30', 8], [3, '05:00', 6], [127, '05:15', 9], [1, '12:15', 7]], 'holidays': [[6, 20, 2]], 'now': [2, '00:30', 6, 20]}, 9), ({'events': [[96, '19:00', 5]], 'holidays': [], 'now': [0, '19:00', 2, 26]}, 5), ({'events': [[64, '12:15', 2], [32, '10:15', 5], [62, '08:30', 6], [58, '07:00', 7], [32, '21:45', 7]], 'holidays': [[4, 10, 3], [4, 6, 3]], 'now': [4, '08:30', 4, 6]}, 6), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[32, '21:30', 8], [32, '00:00', 1]], 'holidays': [], 'now': [2, '00:00', 8, 17]}, 8), ({'events': [[2, '18:30', 5], [2, '23:00', 6], [1, '00:15', 7]], 'holidays': [[4, 14, 2]], 'now': [5, '18:30', 2, 12]}, 6)], [({'events': [[2, '00:15', 9], [96, '03:00', 1], [65, '08:30', 5]], 'holidays': [[1, 23, 6], [7, 18, 3]], 'now': [3, '03:00', 1, 21]}, 9), ({'events': [[2, '18:15', 6], [14, '04:45', 2], [96, '23:00', 5], [116, '16:45', 4], [32, '21:00', 1], [64, '08:15', 8]], 'holidays': [], 'now': [1, '08:15', 9, 3]}, 2), ({'events': [[3, '08:15', 1], [127, '04:30', 8], [3, '12:30', 4]], 'holidays': [[3, 23, 2]], 'now': [5, '04:30', 5, 15]}, 8), ({'events': [[87, '22:45', 4]], 'holidays': [[7, 23, 0], [12, 2, 6]], 'now': [5, '22:45', 1, 27]}, 4), ({'events': [[96, '21:00', 9], [1, '10:15', 3], [3, '23:45', 2]], 'holidays': [[9, 6, 3], [4, 25, 6]], 'now': [3, '14:15', 3, 28]}, 2), ({'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, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7)], [({'events': [[2, '16:45', 2], [65, '01:45', 3], [3, '07:30', 8]], 'holidays': [], 'now': [5, '14:30', 2, 20]}, 2), ({'events': [[3, '15:30', 5], [62, '17:00', 8], [3, '17:00', 8], [32, '17:00', 8], [65, '18:45', 7], [62, '14:15', 7]], 'holidays': [[2, 25, 3]], 'now': [5, '23:30', 10, 8]}, 8), ({'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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[12, '19:30', 2], [31, '20:00', 9], [65, '04:30', 6]], 'holidays': [[12, 9, 3], [8, 9, 4]], 'now': [2, '23:15', 8, 9]}, 9), ({'events': [[96, '11:00', 9]], 'holidays': [], 'now': [1, '11:00', 1, 23]}, 9), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[1, '16:15', 8]], 'holidays': [[2, 15, 6]], 'now': [0, '10:45', 5, 11]}, 8)]]
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 | free | 6 | Failed |
| timing oracle 1 | 2 | 2 | Passed |
| timing oracle 2 | 5 | 5 | Passed |
| timing oracle 3 | free | 7 | Failed |
| timing oracle 4 | free | 8 | Failed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | free | 1 | Failed |
| timing oracle 7 | 2 | 2 | Passed |
SHA-256 / d0cb840623c70cba95fb210a637813eb09679986991fde9bf38598db5579edcc
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, 7):
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': [[2, '16:45', 2], [65, '09:30', 6], [3, '02:45', 7], [117, '23:00', 6], [71, '09:15', 2], [96, '07:30', 3]], 'holidays': [[3, 12, 3]], 'now': [4, '09:30', 12, 4]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '05:15', 6], [64, '10:45', 6], [96, '09:45', 1], [2, '12:15', 8]], 'holidays': [], 'now': [3, '10:45', 10, 12]}, 8), ({'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, '02:45', 1]], 'holidays': [[10, 23, 5]], 'now': [0, '02:15', 10, 23]}, 1), ({'events': [[109, '05:30', 6], [54, '02:30', 9], [65, '20:30', 8], [10, '13:15', 2], [65, '17:15', 9], [119, '20:30', 9]], 'holidays': [], 'now': [3, '20:30', 3, 22]}, 2)], [({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '05:30', 2]], 'holidays': [[2, 4, 0]], 'now': [5, '08:45', 7, 2]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[3, '09:30', 4], [2, '00:15', 6], [6, '11:45', 6], [104, '14:30', 8], [64, '02:45', 4]], 'holidays': [[9, 4, 5], [11, 19, 4]], 'now': [6, '15:30', 11, 24]}, 8), ({'events': [[2, '08:15', 5]], 'holidays': [[5, 27, 6]], 'now': [1, '14:45', 5, 27]}, 5), ({'events': [[70, '11:15', 8], [127, '18:00', 5], [65, '14:15', 8], [3, '08:30', 5], [1, '10:45', 8], [96, '00:30', 4]], 'holidays': [[7, 6, 5], [8, 2, 0]], 'now': [1, '12:15', 7, 6]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '13:45', 4], [2, '20:15', 7], [119, '13:15', 7], [93, '19:15', 1], [62, '03:00', 7]], 'holidays': [[8, 8, 0], [1, 15, 3]], 'now': [6, '03:44', 5, 19]}, 4)], [({'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': [[85, '18:45', 2], [42, '03:00', 5], [100, '07:30', 8], [3, '05:00', 6], [127, '05:15', 9], [1, '12:15', 7]], 'holidays': [[6, 20, 2]], 'now': [2, '00:30', 6, 20]}, 9), ({'events': [[96, '19:00', 5]], 'holidays': [], 'now': [0, '19:00', 2, 26]}, 5), ({'events': [[64, '12:15', 2], [32, '10:15', 5], [62, '08:30', 6], [58, '07:00', 7], [32, '21:45', 7]], 'holidays': [[4, 10, 3], [4, 6, 3]], 'now': [4, '08:30', 4, 6]}, 6), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[32, '21:30', 8], [32, '00:00', 1]], 'holidays': [], 'now': [2, '00:00', 8, 17]}, 8), ({'events': [[2, '18:30', 5], [2, '23:00', 6], [1, '00:15', 7]], 'holidays': [[4, 14, 2]], 'now': [5, '18:30', 2, 12]}, 6)], [({'events': [[2, '00:15', 9], [96, '03:00', 1], [65, '08:30', 5]], 'holidays': [[1, 23, 6], [7, 18, 3]], 'now': [3, '03:00', 1, 21]}, 9), ({'events': [[2, '18:15', 6], [14, '04:45', 2], [96, '23:00', 5], [116, '16:45', 4], [32, '21:00', 1], [64, '08:15', 8]], 'holidays': [], 'now': [1, '08:15', 9, 3]}, 2), ({'events': [[3, '08:15', 1], [127, '04:30', 8], [3, '12:30', 4]], 'holidays': [[3, 23, 2]], 'now': [5, '04:30', 5, 15]}, 8), ({'events': [[87, '22:45', 4]], 'holidays': [[7, 23, 0], [12, 2, 6]], 'now': [5, '22:45', 1, 27]}, 4), ({'events': [[96, '21:00', 9], [1, '10:15', 3], [3, '23:45', 2]], 'holidays': [[9, 6, 3], [4, 25, 6]], 'now': [3, '14:15', 3, 28]}, 2), ({'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, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7)], [({'events': [[2, '16:45', 2], [65, '01:45', 3], [3, '07:30', 8]], 'holidays': [], 'now': [5, '14:30', 2, 20]}, 2), ({'events': [[3, '15:30', 5], [62, '17:00', 8], [3, '17:00', 8], [32, '17:00', 8], [65, '18:45', 7], [62, '14:15', 7]], 'holidays': [[2, 25, 3]], 'now': [5, '23:30', 10, 8]}, 8), ({'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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[12, '19:30', 2], [31, '20:00', 9], [65, '04:30', 6]], 'holidays': [[12, 9, 3], [8, 9, 4]], 'now': [2, '23:15', 8, 9]}, 9), ({'events': [[96, '11:00', 9]], 'holidays': [], 'now': [1, '11:00', 1, 23]}, 9), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[1, '16:15', 8]], 'holidays': [[2, 15, 6]], 'now': [0, '10:45', 5, 11]}, 8)]]
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 | 6 | 6 | Passed |
| timing oracle 1 | 2 | 2 | Passed |
| timing oracle 2 | 5 | 5 | Passed |
| timing oracle 3 | free | 7 | Failed |
| timing oracle 4 | 8 | 8 | Passed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | free | 1 | Failed |
| timing oracle 7 | 2 | 2 | Passed |
SHA-256 / fd5a9eee013bb5f5af384420c9cb0dc82446387c375981f5350960976346755b
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': [[2, '16:45', 2], [65, '09:30', 6], [3, '02:45', 7], [117, '23:00', 6], [71, '09:15', 2], [96, '07:30', 3]], 'holidays': [[3, 12, 3]], 'now': [4, '09:30', 12, 4]}, 6), ({'events': [[62, '06:00', 2], [65, '06:00', 6]], 'holidays': [[12, 25, 0]], 'now': [3, '08:00', 6, 25]}, 2), ({'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': [[96, '05:15', 6], [64, '10:45', 6], [96, '09:45', 1], [2, '12:15', 8]], 'holidays': [], 'now': [3, '10:45', 10, 12]}, 8), ({'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, '02:45', 1]], 'holidays': [[10, 23, 5]], 'now': [0, '02:15', 10, 23]}, 1), ({'events': [[109, '05:30', 6], [54, '02:30', 9], [65, '20:30', 8], [10, '13:15', 2], [65, '17:15', 9], [119, '20:30', 9]], 'holidays': [], 'now': [3, '20:30', 3, 22]}, 2)], [({'events': [[127, '06:30', 2], [62, '06:00', 5]], 'holidays': [], 'now': [2, '06:45', 3, 3]}, 2), ({'events': [[3, '05:30', 2]], 'holidays': [[2, 4, 0]], 'now': [5, '08:45', 7, 2]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[3, '09:30', 4], [2, '00:15', 6], [6, '11:45', 6], [104, '14:30', 8], [64, '02:45', 4]], 'holidays': [[9, 4, 5], [11, 19, 4]], 'now': [6, '15:30', 11, 24]}, 8), ({'events': [[2, '08:15', 5]], 'holidays': [[5, 27, 6]], 'now': [1, '14:45', 5, 27]}, 5), ({'events': [[70, '11:15', 8], [127, '18:00', 5], [65, '14:15', 8], [3, '08:30', 5], [1, '10:45', 8], [96, '00:30', 4]], 'holidays': [[7, 6, 5], [8, 2, 0]], 'now': [1, '12:15', 7, 6]}, 4), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[127, '13:45', 4], [2, '20:15', 7], [119, '13:15', 7], [93, '19:15', 1], [62, '03:00', 7]], 'holidays': [[8, 8, 0], [1, 15, 3]], 'now': [6, '03:44', 5, 19]}, 4)], [({'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': [[85, '18:45', 2], [42, '03:00', 5], [100, '07:30', 8], [3, '05:00', 6], [127, '05:15', 9], [1, '12:15', 7]], 'holidays': [[6, 20, 2]], 'now': [2, '00:30', 6, 20]}, 9), ({'events': [[96, '19:00', 5]], 'holidays': [], 'now': [0, '19:00', 2, 26]}, 5), ({'events': [[64, '12:15', 2], [32, '10:15', 5], [62, '08:30', 6], [58, '07:00', 7], [32, '21:45', 7]], 'holidays': [[4, 10, 3], [4, 6, 3]], 'now': [4, '08:30', 4, 6]}, 6), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[32, '21:30', 8], [32, '00:00', 1]], 'holidays': [], 'now': [2, '00:00', 8, 17]}, 8), ({'events': [[2, '18:30', 5], [2, '23:00', 6], [1, '00:15', 7]], 'holidays': [[4, 14, 2]], 'now': [5, '18:30', 2, 12]}, 6)], [({'events': [[2, '00:15', 9], [96, '03:00', 1], [65, '08:30', 5]], 'holidays': [[1, 23, 6], [7, 18, 3]], 'now': [3, '03:00', 1, 21]}, 9), ({'events': [[2, '18:15', 6], [14, '04:45', 2], [96, '23:00', 5], [116, '16:45', 4], [32, '21:00', 1], [64, '08:15', 8]], 'holidays': [], 'now': [1, '08:15', 9, 3]}, 2), ({'events': [[3, '08:15', 1], [127, '04:30', 8], [3, '12:30', 4]], 'holidays': [[3, 23, 2]], 'now': [5, '04:30', 5, 15]}, 8), ({'events': [[87, '22:45', 4]], 'holidays': [[7, 23, 0], [12, 2, 6]], 'now': [5, '22:45', 1, 27]}, 4), ({'events': [[96, '21:00', 9], [1, '10:15', 3], [3, '23:45', 2]], 'holidays': [[9, 6, 3], [4, 25, 6]], 'now': [3, '14:15', 3, 28]}, 2), ({'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, '08:00', 6]], 'holidays': [[7, 4, 0]], 'now': [4, '07:00', 7, 4]}, 2), ({'events': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7)], [({'events': [[2, '16:45', 2], [65, '01:45', 3], [3, '07:30', 8]], 'holidays': [], 'now': [5, '14:30', 2, 20]}, 2), ({'events': [[3, '15:30', 5], [62, '17:00', 8], [3, '17:00', 8], [32, '17:00', 8], [65, '18:45', 7], [62, '14:15', 7]], 'holidays': [[2, 25, 3]], 'now': [5, '23:30', 10, 8]}, 8), ({'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': [[8, '21:00', 7]], 'holidays': [], 'now': [3, '20:59', 1, 2]}, 7), ({'events': [[12, '19:30', 2], [31, '20:00', 9], [65, '04:30', 6]], 'holidays': [[12, 9, 3], [8, 9, 4]], 'now': [2, '23:15', 8, 9]}, 9), ({'events': [[96, '11:00', 9]], 'holidays': [], 'now': [1, '11:00', 1, 23]}, 9), ({'events': [[2, '06:00', 3], [2, '09:00', 4], [2, '15:30', 5]], 'holidays': [], 'now': [1, '15:30', 5, 5]}, 5), ({'events': [[1, '16:15', 8]], 'holidays': [[2, 15, 6]], 'now': [0, '10:45', 5, 11]}, 8)]]
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 | 6 | 6 | Passed |
| timing oracle 1 | 2 | 2 | Passed |
| timing oracle 2 | 5 | 5 | Passed |
| timing oracle 3 | 7 | 7 | Passed |
| timing oracle 4 | 8 | 8 | Passed |
| timing oracle 5 | 9 | 9 | Passed |
| timing oracle 6 | 1 | 1 | Passed |
| timing oracle 7 | 2 | 2 | Passed |
SHA-256 / 7be5fecc5e47f62ee9c2f74bab0ac21f310355a573b50b660ba26bb0c0bd3598
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:59.109864+00:00.
Case digest / abed3208c10ee984522596afdeac04e3c0be76dd2100dca67f574f04dec6935e