FAILURE MAP
← Case archive

FA-68211 / Traffic signal timing plans / Open access

Transit signal priority decision: the extension distance is not wrapped around the cycle · case 01

Transit signal priority decision returns a wrong result when the extension distance is not wrapped around the cycle.

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

ROOT CAUSE

Arrivals before green end in cycle time give a negative distance that passes the extension test.

VERIFIED REPAIR

Restore the extension distance rule so that the step reads `d = (a - ge) % C`.

Unsuccessful approach: The absolute distance treats arrivals well before green as if just after green end.

Case contract

Input {cycle, green_start, green_end (exclusive), max_ext, max_early, arrival (seconds, reduced modulo cycle), last_granted (cycle index or null), cycle_index, lockout}. A request within lockout cycles of the last grant (difference <= lockout) returns ['locked', 0]. Arrival in green needs nothing. If the arrival is less than max_ext seconds after green end (cyclically) green is extended through the arrival second: ['extend', d+1]. Otherwise green starts early by min(max_early, seconds until next green start).

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']
    a = x['arrival'] % C
    last = x['last_granted']
    if last is not None and x['cycle_index'] - last <= x['lockout']:
        return ['locked', 0]
    gs, ge = x['green_start'], x['green_end']
    if gs <= a < ge:
        return ['none', 0]
    d = a - ge
    if d < x['max_ext']:
        return ['extend', d + 1]
    wait = (gs - a) % C
    return ['early', min(x['max_early'], wait)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])], [({'cycle': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]
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 0['locked', 0]['locked', 0]Passed
timing oracle 1['none', 0]['none', 0]Passed
timing oracle 2['extend', -15]['early', 1]Failed
timing oracle 3['extend', -35]['early', 12]Failed
timing oracle 4['extend', -30]['early', 12]Failed
timing oracle 5['early', 20]['early', 20]Passed
timing oracle 6['extend', -16]['early', 2]Failed
timing oracle 7['extend', 1]['extend', 1]Passed

SHA-256 / 066874ffe60514d6bec4b4ef77380b0f992d2fa7b1f1d3ed182683b4e1f1a2d9

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']
    a = x['arrival'] % C
    last = x['last_granted']
    if last is not None and x['cycle_index'] - last <= x['lockout']:
        return ['locked', 0]
    gs, ge = x['green_start'], x['green_end']
    if gs <= a < ge:
        return ['none', 0]
    d = abs(a - ge)
    if d < x['max_ext']:
        return ['extend', d + 1]
    wait = (gs - a) % C
    return ['early', min(x['max_early'], wait)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])], [({'cycle': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]
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 0['locked', 0]['locked', 0]Passed
timing oracle 1['none', 0]['none', 0]Passed
timing oracle 2['extend', 17]['early', 1]Failed
timing oracle 3['early', 12]['early', 12]Passed
timing oracle 4['early', 12]['early', 12]Passed
timing oracle 5['early', 20]['early', 20]Passed
timing oracle 6['extend', 18]['early', 2]Failed
timing oracle 7['extend', 1]['extend', 1]Passed

SHA-256 / aced7f4b4ace8ac32006079a9eacd620818c2e0fff1e3d200190b7256628b623

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']
    a = x['arrival'] % C
    last = x['last_granted']
    if last is not None and x['cycle_index'] - last <= x['lockout']:
        return ['locked', 0]
    gs, ge = x['green_start'], x['green_end']
    if gs <= a < ge:
        return ['none', 0]
    d = (a - ge) % C
    if d < x['max_ext']:
        return ['extend', d + 1]
    wait = (gs - a) % C
    return ['early', min(x['max_early'], wait)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 130, 'green_start': 31, 'green_end': 90, 'max_ext': 11, 'max_early': 18, 'arrival': 239, 'last_granted': 12, 'cycle_index': 10, 'lockout': 3}, ['locked', 0]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 110, 'green_start': 54, 'green_end': 69, 'max_ext': 17, 'max_early': 15, 'arrival': 53, 'last_granted': None, 'cycle_index': 5, 'lockout': 2}, ['early', 1]), ({'cycle': 90, 'green_start': 42, 'green_end': 58, 'max_ext': 11, 'max_early': 12, 'arrival': 112, 'last_granted': 14, 'cycle_index': 17, 'lockout': 2}, ['early', 12]), ({'cycle': 130, 'green_start': 36, 'green_end': 55, 'max_ext': 11, 'max_early': 19, 'arrival': 284, 'last_granted': None, 'cycle_index': 5, 'lockout': 3}, ['early', 12]), ({'cycle': 130, 'green_start': 12, 'green_end': 47, 'max_ext': 16, 'max_early': 20, 'arrival': 222, 'last_granted': None, 'cycle_index': 22, 'lockout': 3}, ['early', 20]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])], [({'cycle': 120, 'green_start': 42, 'green_end': 99, 'max_ext': 17, 'max_early': 19, 'arrival': 244, 'last_granted': None, 'cycle_index': 8, 'lockout': 1}, ['early', 19]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 80, 'green_start': 40, 'green_end': 58, 'max_ext': 5, 'max_early': 18, 'arrival': 81, 'last_granted': 2, 'cycle_index': 20, 'lockout': 1}, ['early', 18]), ({'cycle': 130, 'green_start': 20, 'green_end': 52, 'max_ext': 18, 'max_early': 6, 'arrival': 274, 'last_granted': None, 'cycle_index': 16, 'lockout': 3}, ['early', 6]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 19, 'green_end': 54, 'max_ext': 12, 'max_early': 13, 'arrival': 77, 'last_granted': None, 'cycle_index': 4, 'lockout': 3}, ['early', 13]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2])], [({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0]), ({'cycle': 80, 'green_start': 32, 'green_end': 58, 'max_ext': 7, 'max_early': 7, 'arrival': 96, 'last_granted': None, 'cycle_index': 9, 'lockout': 1}, ['early', 7]), ({'cycle': 140, 'green_start': 38, 'green_end': 54, 'max_ext': 20, 'max_early': 8, 'arrival': 37, 'last_granted': 20, 'cycle_index': 8, 'lockout': 2}, ['locked', 0]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 110, 'green_start': 21, 'green_end': 65, 'max_ext': 15, 'max_early': 10, 'arrival': 120, 'last_granted': None, 'cycle_index': 18, 'lockout': 2}, ['early', 10]), ({'cycle': 80, 'green_start': 34, 'green_end': 71, 'max_ext': 19, 'max_early': 13, 'arrival': 85, 'last_granted': 4, 'cycle_index': 16, 'lockout': 1}, ['extend', 15]), ({'cycle': 100, 'green_start': 1, 'green_end': 50, 'max_ext': 17, 'max_early': 10, 'arrival': 91, 'last_granted': None, 'cycle_index': 19, 'lockout': 1}, ['early', 10])], [({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 120, 'green_start': 46, 'green_end': 90, 'max_ext': 9, 'max_early': 12, 'arrival': 279, 'last_granted': 4, 'cycle_index': 13, 'lockout': 3}, ['early', 7]), ({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 50, 'green_end': 86, 'max_ext': 17, 'max_early': 11, 'arrival': 2, 'last_granted': 2, 'cycle_index': 4, 'lockout': 1}, ['extend', 17]), ({'cycle': 120, 'green_start': 35, 'green_end': 87, 'max_ext': 5, 'max_early': 8, 'arrival': 258, 'last_granted': None, 'cycle_index': 18, 'lockout': 3}, ['early', 8]), ({'cycle': 90, 'green_start': 35, 'green_end': 60, 'max_ext': 12, 'max_early': 15, 'arrival': 214, 'last_granted': 0, 'cycle_index': 5, 'lockout': 3}, ['early', 1]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1]), ({'cycle': 100, 'green_start': 10, 'green_end': 50, 'max_ext': 10, 'max_early': 10, 'arrival': 250, 'last_granted': 3, 'cycle_index': 5, 'lockout': 2}, ['locked', 0])], [({'cycle': 100, 'green_start': 10, 'green_end': 45, 'max_ext': 10, 'max_early': 10, 'arrival': 110, 'last_granted': None, 'cycle_index': 4, 'lockout': 1}, ['none', 0]), ({'cycle': 100, 'green_start': 15, 'green_end': 54, 'max_ext': 8, 'max_early': 18, 'arrival': 259, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['extend', 6]), ({'cycle': 90, 'green_start': 26, 'green_end': 46, 'max_ext': 15, 'max_early': 5, 'arrival': 145, 'last_granted': None, 'cycle_index': 1, 'lockout': 1}, ['extend', 10]), ({'cycle': 90, 'green_start': 31, 'green_end': 48, 'max_ext': 14, 'max_early': 16, 'arrival': 19, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['early', 12]), ({'cycle': 110, 'green_start': 16, 'green_end': 66, 'max_ext': 17, 'max_early': 14, 'arrival': 65, 'last_granted': 18, 'cycle_index': 15, 'lockout': 1}, ['locked', 0]), ({'cycle': 130, 'green_start': 56, 'green_end': 77, 'max_ext': 7, 'max_early': 19, 'arrival': 165, 'last_granted': None, 'cycle_index': 14, 'lockout': 3}, ['early', 19]), ({'cycle': 100, 'green_start': 30, 'green_end': 45, 'max_ext': 20, 'max_early': 10, 'arrival': 28, 'last_granted': 1, 'cycle_index': 6, 'lockout': 2}, ['early', 2]), ({'cycle': 90, 'green_start': 0, 'green_end': 40, 'max_ext': 12, 'max_early': 8, 'arrival': 40, 'last_granted': None, 'cycle_index': 0, 'lockout': 1}, ['extend', 1])]]
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 0['locked', 0]['locked', 0]Passed
timing oracle 1['none', 0]['none', 0]Passed
timing oracle 2['early', 1]['early', 1]Passed
timing oracle 3['early', 12]['early', 12]Passed
timing oracle 4['early', 12]['early', 12]Passed
timing oracle 5['early', 20]['early', 20]Passed
timing oracle 6['early', 2]['early', 2]Passed
timing oracle 7['extend', 1]['extend', 1]Passed

SHA-256 / 8f4785ec91aeb9c5ecbd3d1ef1b8b4b17acbd28151e73a2cb90d0448345c018e

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

Case digest / 6a7d94c6597c64819211d87d4ffa2f74d8a819b5c08b722227266a998481c75e