FA-68026 / Traffic signal timing plans / Open access
Coordinated local cycle timer: the offset is added to the master clock · case 01
Coordinated local cycle timer returns a wrong result when the offset is added to the master clock.
ROOT CAUSE
Adding the offset shifts the local cycle the wrong way, so the intersection runs early by twice its offset.
VERIFIED REPAIR
Restore the offset subtraction rule so that the step reads `(x['master'] - x['offset']) % C`.
Unsuccessful approach: The absolute difference is wrong whenever the master clock is behind the offset within the first cycle.
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': 97, 'offset': 74, 'master': 66, 'splits': [[2, 28], [4, 37], [6, 32]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [2, 'green', 8]), ({'cycle': 109, 'offset': 101, 'master': 219, 'splits': [[2, 27], [4, 38], [6, 26], [8, 13]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 30, 'master': 306, 'splits': [[2, 15], [4, 32]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 105, 'offset': 36, 'master': 667, 'splits': [[2, 15], [4, 33], [6, 40], [8, 12]], 'yellow': 4, 'red': 1, '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': 88, 'offset': 4, 'master': 126, 'splits': [[2, 27], [4, 40], [6, 21]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [4, 'green', 6]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25])], [({'cycle': 63, 'offset': 57, 'master': 778, 'splits': [[2, 15], [4, 31], [6, 22]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 62, 'offset': 20, 'master': 999, 'splits': [[2, 20], [4, 37]], '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': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 89, 'offset': 32, 'master': 82, 'splits': [[2, 39], [4, 21], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [4, 'green', 6]), ({'cycle': 75, 'offset': 42, 'master': 10, 'splits': [[2, 38], [4, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 27]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 136, 'offset': 108, 'master': 748, 'splits': [[2, 32], [4, 31], [6, 40], [8, 38]], 'yellow': 3, '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': 90, 'offset': 44, 'master': 143, 'splits': [[2, 29], [4, 40], [6, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 76, 'offset': 22, 'master': 517, 'splits': [[2, 35], [4, 12], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'green', 2]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 73, 'offset': 66, 'master': 19, 'splits': [[2, 21], [4, 19], [6, 17], [8, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, [4, 'green', 9]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 71, 'offset': 31, 'master': 983, 'splits': [[2, 30], [4, 27], [6, 19]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 59, 'offset': 10, 'master': 266, 'splits': [[2, 22], [4, 17], [6, 15]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits')], [({'cycle': 96, 'offset': 85, 'master': 624, 'splits': [[2, 40], [4, 37], [6, 24]], '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': 113, 'offset': 93, 'master': 56, 'splits': [[2, 40], [4, 28], [6, 15], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [6, 'green', 3]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 40, 'offset': 24, 'master': 26, 'splits': [[2, 17], [4, 23]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'green', 11]), ({'cycle': 57, 'offset': 53, 'master': 5, 'splits': [[2, 28], [4, 13], [6, 21]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 12, 'master': 106, 'splits': [[2, 25], [4, 22]], 'yellow': 3, 'red': 1, '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': 70, 'offset': 10, 'master': 112, 'splits': [[2, 21], [4, 27], [6, 22]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 11]), ({'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': 52, 'offset': 23, 'master': 249, 'splits': [[2, 34], [4, 13]], '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': 64, 'offset': 44, 'master': 37, 'splits': [[2, 16], [4, 29], [6, 19]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [6, 'green', 1]), ({'cycle': 87, 'offset': 64, 'master': 242, 'splits': [[2, 19], [4, 21], [6, 23], [8, 19]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 70, 'offset': 6, 'master': 678, 'splits': [[2, 24], [4, 16], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits')]]
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, 'green', 26] | [2, 'green', 8] | Failed |
| timing oracle 1 | bad-splits | bad-splits | Passed |
| timing oracle 2 | bad-splits | bad-splits | Passed |
| timing oracle 3 | bad-splits | bad-splits | Passed |
| timing oracle 4 | bad-splits | bad-splits | Passed |
| timing oracle 5 | [2, 'green', 15] | [4, 'green', 10] | Failed |
| timing oracle 6 | [4, 'yellow', 1] | [4, 'green', 6] | Failed |
| timing oracle 7 | [2, 'green', 45] | [2, 'green', 25] | Failed |
SHA-256 / 52eeb8c87770bd6b7455dfa6cbc52053df3fb9bbc02825965df812402ce48edb
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 sum(s for _, s in sp) != C:
return 'bad-splits'
lc = abs(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': 97, 'offset': 74, 'master': 66, 'splits': [[2, 28], [4, 37], [6, 32]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [2, 'green', 8]), ({'cycle': 109, 'offset': 101, 'master': 219, 'splits': [[2, 27], [4, 38], [6, 26], [8, 13]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 30, 'master': 306, 'splits': [[2, 15], [4, 32]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 105, 'offset': 36, 'master': 667, 'splits': [[2, 15], [4, 33], [6, 40], [8, 12]], 'yellow': 4, 'red': 1, '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': 88, 'offset': 4, 'master': 126, 'splits': [[2, 27], [4, 40], [6, 21]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [4, 'green', 6]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25])], [({'cycle': 63, 'offset': 57, 'master': 778, 'splits': [[2, 15], [4, 31], [6, 22]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 62, 'offset': 20, 'master': 999, 'splits': [[2, 20], [4, 37]], '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': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 89, 'offset': 32, 'master': 82, 'splits': [[2, 39], [4, 21], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [4, 'green', 6]), ({'cycle': 75, 'offset': 42, 'master': 10, 'splits': [[2, 38], [4, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 27]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 136, 'offset': 108, 'master': 748, 'splits': [[2, 32], [4, 31], [6, 40], [8, 38]], 'yellow': 3, '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': 90, 'offset': 44, 'master': 143, 'splits': [[2, 29], [4, 40], [6, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 76, 'offset': 22, 'master': 517, 'splits': [[2, 35], [4, 12], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'green', 2]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 73, 'offset': 66, 'master': 19, 'splits': [[2, 21], [4, 19], [6, 17], [8, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, [4, 'green', 9]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 71, 'offset': 31, 'master': 983, 'splits': [[2, 30], [4, 27], [6, 19]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 59, 'offset': 10, 'master': 266, 'splits': [[2, 22], [4, 17], [6, 15]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits')], [({'cycle': 96, 'offset': 85, 'master': 624, 'splits': [[2, 40], [4, 37], [6, 24]], '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': 113, 'offset': 93, 'master': 56, 'splits': [[2, 40], [4, 28], [6, 15], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [6, 'green', 3]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 40, 'offset': 24, 'master': 26, 'splits': [[2, 17], [4, 23]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'green', 11]), ({'cycle': 57, 'offset': 53, 'master': 5, 'splits': [[2, 28], [4, 13], [6, 21]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 12, 'master': 106, 'splits': [[2, 25], [4, 22]], 'yellow': 3, 'red': 1, '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': 70, 'offset': 10, 'master': 112, 'splits': [[2, 21], [4, 27], [6, 22]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 11]), ({'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': 52, 'offset': 23, 'master': 249, 'splits': [[2, 34], [4, 13]], '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': 64, 'offset': 44, 'master': 37, 'splits': [[2, 16], [4, 29], [6, 19]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [6, 'green', 1]), ({'cycle': 87, 'offset': 64, 'master': 242, 'splits': [[2, 19], [4, 21], [6, 23], [8, 19]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 70, 'offset': 6, 'master': 678, 'splits': [[2, 24], [4, 16], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits')]]
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', 29] | [2, 'green', 8] | Failed |
| timing oracle 1 | bad-splits | bad-splits | Passed |
| timing oracle 2 | bad-splits | bad-splits | Passed |
| timing oracle 3 | bad-splits | bad-splits | Passed |
| timing oracle 4 | bad-splits | bad-splits | Passed |
| timing oracle 5 | [4, 'green', 10] | [4, 'green', 10] | Passed |
| timing oracle 6 | [4, 'green', 6] | [4, 'green', 6] | Passed |
| timing oracle 7 | [4, 'green', 15] | [2, 'green', 25] | Failed |
SHA-256 / 21ed47715d6402f02c9fcfe5bdc6530815d40e05d59195bfa0698412dfa4d3d4
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': 97, 'offset': 74, 'master': 66, 'splits': [[2, 28], [4, 37], [6, 32]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [2, 'green', 8]), ({'cycle': 109, 'offset': 101, 'master': 219, 'splits': [[2, 27], [4, 38], [6, 26], [8, 13]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 30, 'master': 306, 'splits': [[2, 15], [4, 32]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 105, 'offset': 36, 'master': 667, 'splits': [[2, 15], [4, 33], [6, 40], [8, 12]], 'yellow': 4, 'red': 1, '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': 88, 'offset': 4, 'master': 126, 'splits': [[2, 27], [4, 40], [6, 21]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [4, 'green', 6]), ({'cycle': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25])], [({'cycle': 63, 'offset': 57, 'master': 778, 'splits': [[2, 15], [4, 31], [6, 22]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 62, 'offset': 20, 'master': 999, 'splits': [[2, 20], [4, 37]], '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': 80, 'offset': 70, 'master': 10, 'splits': [[2, 50], [4, 30]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [2, 'green', 25]), ({'cycle': 89, 'offset': 32, 'master': 82, 'splits': [[2, 39], [4, 21], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [4, 'green', 6]), ({'cycle': 75, 'offset': 42, 'master': 10, 'splits': [[2, 38], [4, 37]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 27]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 136, 'offset': 108, 'master': 748, 'splits': [[2, 32], [4, 31], [6, 40], [8, 38]], 'yellow': 3, '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': 90, 'offset': 44, 'master': 143, 'splits': [[2, 29], [4, 40], [6, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 76, 'offset': 22, 'master': 517, 'splits': [[2, 35], [4, 12], [6, 29]], 'yellow': 3, 'red': 1, 'ref': 'end'}, [6, 'green', 2]), ({'cycle': 100, 'offset': 5, 'master': 3, 'splits': [[2, 50], [4, 30], [8, 25]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 73, 'offset': 66, 'master': 19, 'splits': [[2, 21], [4, 19], [6, 17], [8, 16]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, [4, 'green', 9]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 71, 'offset': 31, 'master': 983, 'splits': [[2, 30], [4, 27], [6, 19]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 59, 'offset': 10, 'master': 266, 'splits': [[2, 22], [4, 17], [6, 15]], 'yellow': 4, 'red': 1, 'ref': 'end'}, 'bad-splits')], [({'cycle': 96, 'offset': 85, 'master': 624, 'splits': [[2, 40], [4, 37], [6, 24]], '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': 113, 'offset': 93, 'master': 56, 'splits': [[2, 40], [4, 28], [6, 15], [8, 30]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [6, 'green', 3]), ({'cycle': 90, 'offset': 30, 'master': 45, 'splits': [[2, 40], [4, 25], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'end'}, [4, 'green', 10]), ({'cycle': 40, 'offset': 24, 'master': 26, 'splits': [[2, 17], [4, 23]], 'yellow': 3, 'red': 1, 'ref': 'begin'}, [2, 'green', 11]), ({'cycle': 57, 'offset': 53, 'master': 5, 'splits': [[2, 28], [4, 13], [6, 21]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 42, 'offset': 12, 'master': 106, 'splits': [[2, 25], [4, 22]], 'yellow': 3, 'red': 1, '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': 70, 'offset': 10, 'master': 112, 'splits': [[2, 21], [4, 27], [6, 22]], 'yellow': 3, 'red': 2, 'ref': 'begin'}, [4, 'green', 11]), ({'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': 52, 'offset': 23, 'master': 249, 'splits': [[2, 34], [4, 13]], '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': 64, 'offset': 44, 'master': 37, 'splits': [[2, 16], [4, 29], [6, 19]], 'yellow': 4, 'red': 2, 'ref': 'begin'}, [6, 'green', 1]), ({'cycle': 87, 'offset': 64, 'master': 242, 'splits': [[2, 19], [4, 21], [6, 23], [8, 19]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits'), ({'cycle': 70, 'offset': 6, 'master': 678, 'splits': [[2, 24], [4, 16], [6, 25]], 'yellow': 4, 'red': 1, 'ref': 'begin'}, 'bad-splits')]]
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 | [2, 'green', 8] | [2, 'green', 8] | Passed |
| timing oracle 1 | bad-splits | bad-splits | Passed |
| timing oracle 2 | bad-splits | bad-splits | Passed |
| timing oracle 3 | bad-splits | bad-splits | Passed |
| timing oracle 4 | bad-splits | bad-splits | Passed |
| timing oracle 5 | [4, 'green', 10] | [4, 'green', 10] | Passed |
| timing oracle 6 | [4, 'green', 6] | [4, 'green', 6] | Passed |
| timing oracle 7 | [2, 'green', 25] | [2, 'green', 25] | Passed |
SHA-256 / 8bf41114d20da076710a0763d3fb5be9d9f48fdd33a28baa4a0e6e03d83f6444
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.374992+00:00.
Case digest / 0e74cfc513de6e4a5a17d118ceb1ce4a4ba89ba9a642b9d29cfa17a0204feadc