FA-68041 / Traffic signal timing plans / Open access
Coordinated local cycle timer: splits shorter than the cycle are accepted · case 01
Coordinated local cycle timer returns a wrong result when splits shorter than the cycle are accepted.
ROOT CAUSE
Only overlong split tables are rejected, so a short table leaves a dark gap at the end of the cycle.
VERIFIED REPAIR
Restore the split sum validation rule so that the step reads `if sum(s for _, s in sp) != C:`.
Unsuccessful approach: Checking the largest split alone does not validate the table total.
Case contract
Input {cycle, offset, master, splits: [[phase, split s]] in sequence starting with the coordinated phase, yellow, red, ref}. Splits must sum to the cycle, else 'bad-splits'. Local time = (master - offset) mod cycle, where the offset marks the start of coordinated green (ref 'begin') or the end of coordinated green (ref 'end'). Each split is green then yellow then all-red. Return [phase, interval, seconds remaining].
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):
C = x['cycle']
sp = x['splits']
y, r = x['yellow'], x['red']
if sum(s for _, s in sp) > C:
return 'bad-splits'
lc = (x['master'] - x['offset']) % C
if x['ref'] == 'end':
lc = (lc + sp[0][1] - y - r) % C
start = 0
for ph, s in sp:
ge = start + s - y - r
if lc < ge:
return [ph, 'green', ge - lc]
if lc < ge + y:
return [ph, 'yellow', ge + y - lc]
if lc < start + s:
return [ph, 'red', start + s - lc]
start += s
return ['free', 'dark', 0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 92, 'offset': 61, 'master': 911, 'splits': [[2, 16], [4, 40], [6, 36]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 18]), ({'cycle': 110, 'offset': 102, 'master': 693, 'splits': [[2, 36], [4, 32], [6, 37]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 116, 'master': 414, 'splits': [[2, 28], [4, 36], [6, 34], [8, 22]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 69, 'offset': 24, 'master': 562, 'splits': [[2, 25], [4, 26], [6, 13]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 117, 'offset': 57, 'master': 934, 'splits': [[2, 29], [4, 30], [6, 27], [8, 36]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 93, 'offset': 12, 'master': 316, 'splits': [[2, 40], [4, 30], [6, 13], [8, 15]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 97, 'offset': 24, 'master': 364, 'splits': [[2, 13], [4, 26], [6, 16], [8, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 96, 'offset': 7, 'master': 143, 'splits': [[2, 26], [4, 33], [6, 32]], 'yellow': 3, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 102, 'offset': 99, 'master': 769, 'splits': [[2, 32], [4, 35], [6, 16], [8, 14]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 72, 'offset': 54, 'master': 138, 'splits': [[2, 13], [4, 34], [6, 25]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'red', 1])], [({'cycle': 88, 'offset': 68, 'master': 958, 'splits': [[2, 30], [4, 14], [6, 39]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 19, 'master': 173, 'splits': [[2, 24], [4, 35], [6, 32], [8, 29]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 77, 'offset': 17, 'master': 15, 'splits': [[2, 12], [4, 17], [6, 30], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [8, 'red', 2]), ({'cycle': 73, 'offset': 16, 'master': 221, 'splits': [[2, 22], [4, 12], [6, 34]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 45, 'offset': 36, 'master': 84, 'splits': [[2, 26], [4, 19]], 'yellow': 3, 'red': 2, 'ref': 'end'}, [2, 'red', 2]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 114, 'offset': 64, 'master': 776, 'splits': [[2, 27], [4, 31], [6, 21], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 64, 'offset': 7, 'master': 813, 'splits': [[2, 18], [4, 26], [6, 20]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [4, 'yellow', 4]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 98, 'offset': 4, 'master': 47, 'splits': [[2, 39], [4, 12], [6, 31], [8, 16]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'yellow', 3]), ({'cycle': 72, 'offset': 25, 'master': 319, 'splits': [[2, 37], [4, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 108, 'offset': 82, 'master': 957, 'splits': [[2, 21], [4, 30], [6, 34], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 96, 'offset': 76, 'master': 103, 'splits': [[2, 16], [4, 32], [6, 14], [8, 29]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 87, 'offset': 58, 'master': 226, 'splits': [[2, 19], [4, 16], [6, 19], [8, 28]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 125, 'offset': 21, 'master': 401, 'splits': [[2, 14], [4, 40], [6, 32], [8, 34]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 51, 'offset': 43, 'master': 478, 'splits': [[2, 38], [4, 18]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 79, 'offset': 42, 'master': 241, 'splits': [[2, 27], [4, 37], [6, 15]], 'yellow': 4, 'red': 2, 'ref': 'end'}, [4, 'red', 2])]]
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 | [4, 'green', 10] | [4, 'green', 10] | Passed |
| timing oracle 1 | [2, 'green', 25] | [2, 'green', 25] | Passed |
| timing oracle 2 | [4, 'green', 18] | [4, 'green', 18] | Passed |
| timing oracle 3 | [6, 'green', 28] | bad-splits | Failed |
| timing oracle 4 | [6, 'green', 22] | bad-splits | Failed |
| timing oracle 5 | [2, 'green', 14] | bad-splits | Failed |
| timing oracle 6 | bad-splits | bad-splits | Passed |
| timing oracle 7 | bad-splits | bad-splits | Passed |
SHA-256 / a309a83dab09a30fd9d9b5f2e296d5c740e339cfd75a5524667051a6a47d0fde
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
C = x['cycle']
sp = x['splits']
y, r = x['yellow'], x['red']
if max(s for _, s in sp) > C:
return 'bad-splits'
lc = (x['master'] - x['offset']) % C
if x['ref'] == 'end':
lc = (lc + sp[0][1] - y - r) % C
start = 0
for ph, s in sp:
ge = start + s - y - r
if lc < ge:
return [ph, 'green', ge - lc]
if lc < ge + y:
return [ph, 'yellow', ge + y - lc]
if lc < start + s:
return [ph, 'red', start + s - lc]
start += s
return ['free', 'dark', 0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 92, 'offset': 61, 'master': 911, 'splits': [[2, 16], [4, 40], [6, 36]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 18]), ({'cycle': 110, 'offset': 102, 'master': 693, 'splits': [[2, 36], [4, 32], [6, 37]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 116, 'master': 414, 'splits': [[2, 28], [4, 36], [6, 34], [8, 22]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 69, 'offset': 24, 'master': 562, 'splits': [[2, 25], [4, 26], [6, 13]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 117, 'offset': 57, 'master': 934, 'splits': [[2, 29], [4, 30], [6, 27], [8, 36]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 93, 'offset': 12, 'master': 316, 'splits': [[2, 40], [4, 30], [6, 13], [8, 15]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 97, 'offset': 24, 'master': 364, 'splits': [[2, 13], [4, 26], [6, 16], [8, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 96, 'offset': 7, 'master': 143, 'splits': [[2, 26], [4, 33], [6, 32]], 'yellow': 3, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 102, 'offset': 99, 'master': 769, 'splits': [[2, 32], [4, 35], [6, 16], [8, 14]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 72, 'offset': 54, 'master': 138, 'splits': [[2, 13], [4, 34], [6, 25]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'red', 1])], [({'cycle': 88, 'offset': 68, 'master': 958, 'splits': [[2, 30], [4, 14], [6, 39]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 19, 'master': 173, 'splits': [[2, 24], [4, 35], [6, 32], [8, 29]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 77, 'offset': 17, 'master': 15, 'splits': [[2, 12], [4, 17], [6, 30], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [8, 'red', 2]), ({'cycle': 73, 'offset': 16, 'master': 221, 'splits': [[2, 22], [4, 12], [6, 34]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 45, 'offset': 36, 'master': 84, 'splits': [[2, 26], [4, 19]], 'yellow': 3, 'red': 2, 'ref': 'end'}, [2, 'red', 2]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 114, 'offset': 64, 'master': 776, 'splits': [[2, 27], [4, 31], [6, 21], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 64, 'offset': 7, 'master': 813, 'splits': [[2, 18], [4, 26], [6, 20]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [4, 'yellow', 4]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 98, 'offset': 4, 'master': 47, 'splits': [[2, 39], [4, 12], [6, 31], [8, 16]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'yellow', 3]), ({'cycle': 72, 'offset': 25, 'master': 319, 'splits': [[2, 37], [4, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 108, 'offset': 82, 'master': 957, 'splits': [[2, 21], [4, 30], [6, 34], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 96, 'offset': 76, 'master': 103, 'splits': [[2, 16], [4, 32], [6, 14], [8, 29]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 87, 'offset': 58, 'master': 226, 'splits': [[2, 19], [4, 16], [6, 19], [8, 28]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 125, 'offset': 21, 'master': 401, 'splits': [[2, 14], [4, 40], [6, 32], [8, 34]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 51, 'offset': 43, 'master': 478, 'splits': [[2, 38], [4, 18]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 79, 'offset': 42, 'master': 241, 'splits': [[2, 27], [4, 37], [6, 15]], 'yellow': 4, 'red': 2, 'ref': 'end'}, [4, 'red', 2])]]
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 | [4, 'green', 10] | [4, 'green', 10] | Passed |
| timing oracle 1 | [2, 'green', 25] | [2, 'green', 25] | Passed |
| timing oracle 2 | [4, 'green', 18] | [4, 'green', 18] | Passed |
| timing oracle 3 | [6, 'green', 28] | bad-splits | Failed |
| timing oracle 4 | [6, 'green', 22] | bad-splits | Failed |
| timing oracle 5 | [2, 'green', 14] | bad-splits | Failed |
| timing oracle 6 | [8, 'green', 1] | bad-splits | Failed |
| timing oracle 7 | [6, 'yellow', 3] | bad-splits | Failed |
SHA-256 / 20d01f27560072794b2e9f75778e3171c203ccbbe0b6ca5fbe6745edab73e557
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
C = x['cycle']
sp = x['splits']
y, r = x['yellow'], x['red']
if sum(s for _, s in sp) != C:
return 'bad-splits'
lc = (x['master'] - x['offset']) % C
if x['ref'] == 'end':
lc = (lc + sp[0][1] - y - r) % C
start = 0
for ph, s in sp:
ge = start + s - y - r
if lc < ge:
return [ph, 'green', ge - lc]
if lc < ge + y:
return [ph, 'yellow', ge + y - lc]
if lc < start + s:
return [ph, 'red', start + s - lc]
start += s
return ['free', 'dark', 0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 92, 'offset': 61, 'master': 911, 'splits': [[2, 16], [4, 40], [6, 36]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 18]), ({'cycle': 110, 'offset': 102, 'master': 693, 'splits': [[2, 36], [4, 32], [6, 37]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 116, 'master': 414, 'splits': [[2, 28], [4, 36], [6, 34], [8, 22]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 69, 'offset': 24, 'master': 562, 'splits': [[2, 25], [4, 26], [6, 13]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 117, 'offset': 57, 'master': 934, 'splits': [[2, 29], [4, 30], [6, 27], [8, 36]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 93, 'offset': 12, 'master': 316, 'splits': [[2, 40], [4, 30], [6, 13], [8, 15]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 97, 'offset': 24, 'master': 364, 'splits': [[2, 13], [4, 26], [6, 16], [8, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 96, 'offset': 7, 'master': 143, 'splits': [[2, 26], [4, 33], [6, 32]], 'yellow': 3, 'red': 1, 'ref': 'end'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 102, 'offset': 99, 'master': 769, 'splits': [[2, 32], [4, 35], [6, 16], [8, 14]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 72, 'offset': 54, 'master': 138, 'splits': [[2, 13], [4, 34], [6, 25]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'red', 1])], [({'cycle': 88, 'offset': 68, 'master': 958, 'splits': [[2, 30], [4, 14], [6, 39]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 125, 'offset': 19, 'master': 173, 'splits': [[2, 24], [4, 35], [6, 32], [8, 29]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 77, 'offset': 17, 'master': 15, 'splits': [[2, 12], [4, 17], [6, 30], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [8, 'red', 2]), ({'cycle': 73, 'offset': 16, 'master': 221, 'splits': [[2, 22], [4, 12], [6, 34]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 45, 'offset': 36, 'master': 84, 'splits': [[2, 26], [4, 19]], 'yellow': 3, 'red': 2, 'ref': 'end'}, [2, 'red', 2]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 114, 'offset': 64, 'master': 776, 'splits': [[2, 27], [4, 31], [6, 21], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 64, 'offset': 7, 'master': 813, 'splits': [[2, 18], [4, 26], [6, 20]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [4, 'yellow', 4]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 98, 'offset': 4, 'master': 47, 'splits': [[2, 39], [4, 12], [6, 31], [8, 16]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'yellow', 3]), ({'cycle': 72, 'offset': 25, 'master': 319, 'splits': [[2, 37], [4, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 108, 'offset': 82, 'master': 957, 'splits': [[2, 21], [4, 30], [6, 34], [8, 18]], 'yellow': 4, 'red': 2, 'ref': 'end'}, 'bad-splits')], [({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 96, 'offset': 76, 'master': 103, 'splits': [[2, 16], [4, 32], [6, 14], [8, 29]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 87, 'offset': 58, 'master': 226, 'splits': [[2, 19], [4, 16], [6, 19], [8, 28]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 125, 'offset': 21, 'master': 401, 'splits': [[2, 14], [4, 40], [6, 32], [8, 34]], 'yellow': 3, 'red': 2, 'ref': 'end'}, 'bad-splits'), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 51, 'offset': 43, 'master': 478, 'splits': [[2, 38], [4, 18]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 79, 'offset': 42, 'master': 241, 'splits': [[2, 27], [4, 37], [6, 15]], 'yellow': 4, 'red': 2, 'ref': 'end'}, [4, 'red', 2])]]
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 | [4, 'green', 10] | [4, 'green', 10] | Passed |
| timing oracle 1 | [2, 'green', 25] | [2, 'green', 25] | Passed |
| timing oracle 2 | [4, 'green', 18] | [4, 'green', 18] | Passed |
| timing oracle 3 | bad-splits | bad-splits | Passed |
| timing oracle 4 | bad-splits | bad-splits | Passed |
| timing oracle 5 | bad-splits | bad-splits | Passed |
| timing oracle 6 | bad-splits | bad-splits | Passed |
| timing oracle 7 | bad-splits | bad-splits | Passed |
SHA-256 / b241942d967c744b1614771849f25808fe18279b45243a2cdf07e9d79130556e
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.543048+00:00.
Case digest / 4f819e1668e890bf8d2e9388cdd32eb0ba358ea1078360dd2fd9a00171e21f02