FA-68301 / Traffic signal timing plans / Open access
Conflict monitor fault scan: a yellow of exactly 2.7 s is flagged as short · case 01
Conflict monitor fault scan returns a wrong result when a yellow of exactly 2.7 s is flagged as short.
ROOT CAUSE
The inclusive comparison flags the permitted minimum yellow as a fault.
VERIFIED REPAIR
Restore the short yellow limit rule so that the step reads `if tenths < 27:`.
Unsuccessful approach: Using 3.0 s as the limit flags legal yellows between 2.7 and 3.0 s.
Case contract
Input {channels: [[channel, lit colors string over R/Y/G, enabled]], compat: unordered compatible pairs, yellow_durations: [[channel, tenths]]}. Disabled channels are ignored entirely. A channel with more than one lit color is 'multi'; with none lit is 'red-fail'; any channel showing G or Y takes part in the conflict check, and every live pair not listed as compatible is 'conflict:a-b' (a<b). A completed yellow shorter than 2.7 s is 'short-yellow'. Return the sorted fault strings.
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):
ok = {(min(a, b), max(a, b)) for a, b in x['compat']}
faults = []
live = []
for ch, col, en in x['channels']:
if not en:
continue
if len(col) > 1:
faults.append('multi:%d' % ch)
if col == '':
faults.append('red-fail:%d' % ch)
if 'G' in col or 'Y' in col:
live.append(ch)
live.sort()
for i in range(len(live)):
for j in range(i + 1, len(live)):
if (live[i], live[j]) not in ok:
faults.append('conflict:%d-%d' % (live[i], live[j]))
for ch, tenths in x['yellow_durations']:
if tenths <= 27:
faults.append('short-yellow:%d' % ch)
return sorted(faults)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'channels': [[1, 'RY', True], [2, 'RG', True], [3, '', False], [4, 'R', True], [5, 'RG', True], [6, 'GY', True]], 'compat': [[2, 3], [2, 5], [4, 6], [6, 5]], 'yellow_durations': [[2, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4']), ({'channels': [[1, 'RG', False], [2, 'GY', True], [3, 'Y', True], [4, 'R', True]], 'compat': [[4, 1], [4, 2], [4, 3]], 'yellow_durations': [[1, 25], [2, 26], [4, 30]]}, ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2']), ({'channels': [[1, 'G', True], [2, 'GY', True], [3, 'RY', True], [4, '', True], [5, 'R', True], [6, '', True]], 'compat': [[1, 3], [3, 4], [5, 4]], 'yellow_durations': []}, ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', True], [2, 'R', True], [3, '', True], [4, 'RY', True], [5, 'R', True]], 'compat': [[1, 3]], 'yellow_durations': [[1, 28], [3, 27], [5, 27]]}, ['conflict:1-4', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'Y', True], [3, 'RG', True], [4, 'Y', True], [5, 'R', True]], 'compat': [[4, 2], [2, 5], [3, 4], [3, 5]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'RY', True], [4, 'GY', False], [5, 'R', False]], 'compat': [[2, 3], [2, 5], [4, 3]], 'yellow_durations': [[5, 28]]}, ['multi:3', 'red-fail:1'])], [({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'RY', True], [2, 'Y', True], [3, 'R', True], [4, 'Y', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[4, 1], [5, 1], [4, 3]], 'yellow_durations': [[3, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-6', 'conflict:2-4', 'conflict:2-5', 'conflict:2-6', 'conflict:4-5', 'conflict:4-6', 'conflict:5-6', 'multi:1', 'multi:5', 'short-yellow:4']), ({'channels': [[1, '', True], [2, 'R', True], [3, 'G', True]], 'compat': [[3, 1], [2, 3]], 'yellow_durations': []}, ['red-fail:1']), ({'channels': [[1, 'R', True], [2, 'R', True], [3, 'GY', True]], 'compat': [[1, 2], [2, 3]], 'yellow_durations': []}, ['multi:3']), ({'channels': [[1, '', True], [2, 'Y', False], [3, 'RY', True]], 'compat': [[2, 1], [3, 1]], 'yellow_durations': [[3, 35]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'G', True], [4, 'GY', False]], 'compat': [[2, 1], [2, 4]], 'yellow_durations': [[4, 27]]}, ['red-fail:1']), ({'channels': [[1, 'GY', True], [2, '', True], [3, 'R', True]], 'compat': [[3, 1], [3, 2]], 'yellow_durations': [[1, 35], [3, 35]]}, ['multi:1', 'red-fail:2'])], [({'channels': [[1, 'RY', True], [2, 'RG', True], [3, 'R', False]], 'compat': [[2, 1]], 'yellow_durations': [[2, 27]]}, ['multi:1', 'multi:2']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'R', False], [2, 'R', True], [3, '', True], [4, 'R', True], [5, 'GY', True]], 'compat': [[1, 5], [2, 5], [3, 4]], 'yellow_durations': [[4, 28]]}, ['multi:5', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'GY', True], [3, '', True], [4, 'GY', True], [5, 'R', True], [6, 'Y', False]], 'compat': [[1, 2], [3, 1], [5, 1], [4, 3], [5, 4]], 'yellow_durations': [[1, 35]]}, ['conflict:2-4', 'multi:2', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'GY', True], [4, 'RG', False]], 'compat': [[4, 2]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, '', True], [5, 'RG', True], [6, '', True]], 'compat': [[6, 2], [4, 5]], 'yellow_durations': [[1, 25], [3, 27], [5, 35]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:2-5', 'multi:5', 'red-fail:4', 'red-fail:6', 'short-yellow:1']), ({'channels': [[1, 'Y', True], [2, '', True], [3, 'GY', True], [4, 'Y', True]], 'compat': [[1, 2], [4, 3]], 'yellow_durations': []}, ['conflict:1-3', 'conflict:1-4', 'multi:3', 'red-fail:2'])], [({'channels': [[1, 'RG', False], [2, 'R', False], [3, 'G', True]], 'compat': [[1, 2]], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'R', False], [3, 'RY', False], [4, '', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[1, 2], [4, 1], [1, 5], [1, 6], [5, 2], [3, 5], [3, 6]], 'yellow_durations': [[4, 27], [5, 26]]}, ['conflict:5-6', 'multi:5', 'red-fail:1', 'red-fail:4', 'short-yellow:5']), ({'channels': [[1, 'Y', True], [2, 'G', True], [3, 'GY', True], [4, 'R', True], [5, 'R', True], [6, 'G', False]], 'compat': [[2, 1], [6, 1], [3, 2], [2, 4], [3, 4], [3, 6], [6, 5]], 'yellow_durations': []}, ['conflict:1-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, 'R', True], [4, 'RY', True]], 'compat': [[4, 1], [4, 2], [3, 4]], 'yellow_durations': [[3, 27]]}, ['conflict:1-2', 'multi:1', 'multi:4']), ({'channels': [[1, 'R', True], [2, 'R', False], [3, 'R', True], [4, 'R', True], [5, 'R', True], [6, 'R', True]], 'compat': [[4, 2], [2, 6], [3, 4], [5, 3], [6, 4]], 'yellow_durations': [[1, 26], [2, 35]]}, ['short-yellow:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, 'R', True]], 'compat': [[1, 2], [1, 3], [4, 1], [3, 4]], 'yellow_durations': [[1, 28], [4, 27]]}, [])], [({'channels': [[1, 'G', True], [2, '', True], [3, 'R', True]], 'compat': [], 'yellow_durations': [[1, 25]]}, ['red-fail:2', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', False], [2, 'G', True], [3, 'R', False], [4, 'R', True], [5, 'Y', False]], 'compat': [[1, 2], [1, 3], [5, 1], [3, 2], [5, 2]], 'yellow_durations': [[3, 28]]}, []), ({'channels': [[1, 'Y', False], [2, 'R', False], [3, 'GY', True], [4, 'R', False], [5, 'R', True]], 'compat': [[2, 1], [3, 1], [4, 1], [2, 5], [3, 5], [4, 5]], 'yellow_durations': [[1, 25]]}, ['multi:3', 'short-yellow:1']), ({'channels': [[1, 'RY', True], [2, 'R', True], [3, 'GY', True], [4, 'R', True], [5, 'GY', True], [6, 'GY', True]], 'compat': [[2, 1], [1, 4], [5, 1], [6, 1], [3, 2], [3, 5], [3, 6]], 'yellow_durations': [[2, 26], [3, 27], [4, 28]]}, ['conflict:1-3', 'conflict:5-6', 'multi:1', 'multi:3', 'multi:5', 'multi:6', 'short-yellow:2']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'G', False]], 'compat': [], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'G', True], [3, 'RG', True], [4, 'R', True]], 'compat': [[3, 2], [4, 2], [3, 4]], 'yellow_durations': [[1, 27]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:2', 'short-yellow:4'] | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4'] | Failed |
| timing oracle 1 | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | Passed |
| timing oracle 2 | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | Passed |
| timing oracle 3 | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | Passed |
| timing oracle 4 | ['short-yellow:2'] | [] | Failed |
| timing oracle 5 | ['conflict:1-4', 'multi:4', 'red-fail:3', 'short-yellow:3', 'short-yellow:5'] | ['conflict:1-4', 'multi:4', 'red-fail:3'] | Failed |
| timing oracle 6 | ['conflict:2-3', 'multi:3'] | ['conflict:2-3', 'multi:3'] | Passed |
| timing oracle 7 | ['multi:3', 'red-fail:1'] | ['multi:3', 'red-fail:1'] | Passed |
SHA-256 / 6dddece15cc26653a5ab7e9f4d941c93043345245af9de4632c329c21f7e3871
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ok = {(min(a, b), max(a, b)) for a, b in x['compat']}
faults = []
live = []
for ch, col, en in x['channels']:
if not en:
continue
if len(col) > 1:
faults.append('multi:%d' % ch)
if col == '':
faults.append('red-fail:%d' % ch)
if 'G' in col or 'Y' in col:
live.append(ch)
live.sort()
for i in range(len(live)):
for j in range(i + 1, len(live)):
if (live[i], live[j]) not in ok:
faults.append('conflict:%d-%d' % (live[i], live[j]))
for ch, tenths in x['yellow_durations']:
if tenths < 30:
faults.append('short-yellow:%d' % ch)
return sorted(faults)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'channels': [[1, 'RY', True], [2, 'RG', True], [3, '', False], [4, 'R', True], [5, 'RG', True], [6, 'GY', True]], 'compat': [[2, 3], [2, 5], [4, 6], [6, 5]], 'yellow_durations': [[2, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4']), ({'channels': [[1, 'RG', False], [2, 'GY', True], [3, 'Y', True], [4, 'R', True]], 'compat': [[4, 1], [4, 2], [4, 3]], 'yellow_durations': [[1, 25], [2, 26], [4, 30]]}, ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2']), ({'channels': [[1, 'G', True], [2, 'GY', True], [3, 'RY', True], [4, '', True], [5, 'R', True], [6, '', True]], 'compat': [[1, 3], [3, 4], [5, 4]], 'yellow_durations': []}, ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', True], [2, 'R', True], [3, '', True], [4, 'RY', True], [5, 'R', True]], 'compat': [[1, 3]], 'yellow_durations': [[1, 28], [3, 27], [5, 27]]}, ['conflict:1-4', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'Y', True], [3, 'RG', True], [4, 'Y', True], [5, 'R', True]], 'compat': [[4, 2], [2, 5], [3, 4], [3, 5]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'RY', True], [4, 'GY', False], [5, 'R', False]], 'compat': [[2, 3], [2, 5], [4, 3]], 'yellow_durations': [[5, 28]]}, ['multi:3', 'red-fail:1'])], [({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'RY', True], [2, 'Y', True], [3, 'R', True], [4, 'Y', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[4, 1], [5, 1], [4, 3]], 'yellow_durations': [[3, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-6', 'conflict:2-4', 'conflict:2-5', 'conflict:2-6', 'conflict:4-5', 'conflict:4-6', 'conflict:5-6', 'multi:1', 'multi:5', 'short-yellow:4']), ({'channels': [[1, '', True], [2, 'R', True], [3, 'G', True]], 'compat': [[3, 1], [2, 3]], 'yellow_durations': []}, ['red-fail:1']), ({'channels': [[1, 'R', True], [2, 'R', True], [3, 'GY', True]], 'compat': [[1, 2], [2, 3]], 'yellow_durations': []}, ['multi:3']), ({'channels': [[1, '', True], [2, 'Y', False], [3, 'RY', True]], 'compat': [[2, 1], [3, 1]], 'yellow_durations': [[3, 35]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'G', True], [4, 'GY', False]], 'compat': [[2, 1], [2, 4]], 'yellow_durations': [[4, 27]]}, ['red-fail:1']), ({'channels': [[1, 'GY', True], [2, '', True], [3, 'R', True]], 'compat': [[3, 1], [3, 2]], 'yellow_durations': [[1, 35], [3, 35]]}, ['multi:1', 'red-fail:2'])], [({'channels': [[1, 'RY', True], [2, 'RG', True], [3, 'R', False]], 'compat': [[2, 1]], 'yellow_durations': [[2, 27]]}, ['multi:1', 'multi:2']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'R', False], [2, 'R', True], [3, '', True], [4, 'R', True], [5, 'GY', True]], 'compat': [[1, 5], [2, 5], [3, 4]], 'yellow_durations': [[4, 28]]}, ['multi:5', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'GY', True], [3, '', True], [4, 'GY', True], [5, 'R', True], [6, 'Y', False]], 'compat': [[1, 2], [3, 1], [5, 1], [4, 3], [5, 4]], 'yellow_durations': [[1, 35]]}, ['conflict:2-4', 'multi:2', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'GY', True], [4, 'RG', False]], 'compat': [[4, 2]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, '', True], [5, 'RG', True], [6, '', True]], 'compat': [[6, 2], [4, 5]], 'yellow_durations': [[1, 25], [3, 27], [5, 35]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:2-5', 'multi:5', 'red-fail:4', 'red-fail:6', 'short-yellow:1']), ({'channels': [[1, 'Y', True], [2, '', True], [3, 'GY', True], [4, 'Y', True]], 'compat': [[1, 2], [4, 3]], 'yellow_durations': []}, ['conflict:1-3', 'conflict:1-4', 'multi:3', 'red-fail:2'])], [({'channels': [[1, 'RG', False], [2, 'R', False], [3, 'G', True]], 'compat': [[1, 2]], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'R', False], [3, 'RY', False], [4, '', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[1, 2], [4, 1], [1, 5], [1, 6], [5, 2], [3, 5], [3, 6]], 'yellow_durations': [[4, 27], [5, 26]]}, ['conflict:5-6', 'multi:5', 'red-fail:1', 'red-fail:4', 'short-yellow:5']), ({'channels': [[1, 'Y', True], [2, 'G', True], [3, 'GY', True], [4, 'R', True], [5, 'R', True], [6, 'G', False]], 'compat': [[2, 1], [6, 1], [3, 2], [2, 4], [3, 4], [3, 6], [6, 5]], 'yellow_durations': []}, ['conflict:1-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, 'R', True], [4, 'RY', True]], 'compat': [[4, 1], [4, 2], [3, 4]], 'yellow_durations': [[3, 27]]}, ['conflict:1-2', 'multi:1', 'multi:4']), ({'channels': [[1, 'R', True], [2, 'R', False], [3, 'R', True], [4, 'R', True], [5, 'R', True], [6, 'R', True]], 'compat': [[4, 2], [2, 6], [3, 4], [5, 3], [6, 4]], 'yellow_durations': [[1, 26], [2, 35]]}, ['short-yellow:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, 'R', True]], 'compat': [[1, 2], [1, 3], [4, 1], [3, 4]], 'yellow_durations': [[1, 28], [4, 27]]}, [])], [({'channels': [[1, 'G', True], [2, '', True], [3, 'R', True]], 'compat': [], 'yellow_durations': [[1, 25]]}, ['red-fail:2', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', False], [2, 'G', True], [3, 'R', False], [4, 'R', True], [5, 'Y', False]], 'compat': [[1, 2], [1, 3], [5, 1], [3, 2], [5, 2]], 'yellow_durations': [[3, 28]]}, []), ({'channels': [[1, 'Y', False], [2, 'R', False], [3, 'GY', True], [4, 'R', False], [5, 'R', True]], 'compat': [[2, 1], [3, 1], [4, 1], [2, 5], [3, 5], [4, 5]], 'yellow_durations': [[1, 25]]}, ['multi:3', 'short-yellow:1']), ({'channels': [[1, 'RY', True], [2, 'R', True], [3, 'GY', True], [4, 'R', True], [5, 'GY', True], [6, 'GY', True]], 'compat': [[2, 1], [1, 4], [5, 1], [6, 1], [3, 2], [3, 5], [3, 6]], 'yellow_durations': [[2, 26], [3, 27], [4, 28]]}, ['conflict:1-3', 'conflict:5-6', 'multi:1', 'multi:3', 'multi:5', 'multi:6', 'short-yellow:2']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'G', False]], 'compat': [], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'G', True], [3, 'RG', True], [4, 'R', True]], 'compat': [[3, 2], [4, 2], [3, 4]], 'yellow_durations': [[1, 27]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:2', 'short-yellow:4'] | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4'] | Failed |
| timing oracle 1 | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | Passed |
| timing oracle 2 | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | Passed |
| timing oracle 3 | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | Passed |
| timing oracle 4 | ['short-yellow:2'] | [] | Failed |
| timing oracle 5 | ['conflict:1-4', 'multi:4', 'red-fail:3', 'short-yellow:1', 'short-yellow:3', 'short-yellow:5'] | ['conflict:1-4', 'multi:4', 'red-fail:3'] | Failed |
| timing oracle 6 | ['conflict:2-3', 'multi:3'] | ['conflict:2-3', 'multi:3'] | Passed |
| timing oracle 7 | ['multi:3', 'red-fail:1', 'short-yellow:5'] | ['multi:3', 'red-fail:1'] | Failed |
SHA-256 / 404474075f791a71861708ceeabfe1ddbdc613146f11b472a3339d7b0cd235fa
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ok = {(min(a, b), max(a, b)) for a, b in x['compat']}
faults = []
live = []
for ch, col, en in x['channels']:
if not en:
continue
if len(col) > 1:
faults.append('multi:%d' % ch)
if col == '':
faults.append('red-fail:%d' % ch)
if 'G' in col or 'Y' in col:
live.append(ch)
live.sort()
for i in range(len(live)):
for j in range(i + 1, len(live)):
if (live[i], live[j]) not in ok:
faults.append('conflict:%d-%d' % (live[i], live[j]))
for ch, tenths in x['yellow_durations']:
if tenths < 27:
faults.append('short-yellow:%d' % ch)
return sorted(faults)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'channels': [[1, 'RY', True], [2, 'RG', True], [3, '', False], [4, 'R', True], [5, 'RG', True], [6, 'GY', True]], 'compat': [[2, 3], [2, 5], [4, 6], [6, 5]], 'yellow_durations': [[2, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4']), ({'channels': [[1, 'RG', False], [2, 'GY', True], [3, 'Y', True], [4, 'R', True]], 'compat': [[4, 1], [4, 2], [4, 3]], 'yellow_durations': [[1, 25], [2, 26], [4, 30]]}, ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2']), ({'channels': [[1, 'G', True], [2, 'GY', True], [3, 'RY', True], [4, '', True], [5, 'R', True], [6, '', True]], 'compat': [[1, 3], [3, 4], [5, 4]], 'yellow_durations': []}, ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', True], [2, 'R', True], [3, '', True], [4, 'RY', True], [5, 'R', True]], 'compat': [[1, 3]], 'yellow_durations': [[1, 28], [3, 27], [5, 27]]}, ['conflict:1-4', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'Y', True], [3, 'RG', True], [4, 'Y', True], [5, 'R', True]], 'compat': [[4, 2], [2, 5], [3, 4], [3, 5]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'RY', True], [4, 'GY', False], [5, 'R', False]], 'compat': [[2, 3], [2, 5], [4, 3]], 'yellow_durations': [[5, 28]]}, ['multi:3', 'red-fail:1'])], [({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'RY', True], [2, 'Y', True], [3, 'R', True], [4, 'Y', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[4, 1], [5, 1], [4, 3]], 'yellow_durations': [[3, 27], [4, 26]]}, ['conflict:1-2', 'conflict:1-6', 'conflict:2-4', 'conflict:2-5', 'conflict:2-6', 'conflict:4-5', 'conflict:4-6', 'conflict:5-6', 'multi:1', 'multi:5', 'short-yellow:4']), ({'channels': [[1, '', True], [2, 'R', True], [3, 'G', True]], 'compat': [[3, 1], [2, 3]], 'yellow_durations': []}, ['red-fail:1']), ({'channels': [[1, 'R', True], [2, 'R', True], [3, 'GY', True]], 'compat': [[1, 2], [2, 3]], 'yellow_durations': []}, ['multi:3']), ({'channels': [[1, '', True], [2, 'Y', False], [3, 'RY', True]], 'compat': [[2, 1], [3, 1]], 'yellow_durations': [[3, 35]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, '', True], [2, 'G', False], [3, 'G', True], [4, 'GY', False]], 'compat': [[2, 1], [2, 4]], 'yellow_durations': [[4, 27]]}, ['red-fail:1']), ({'channels': [[1, 'GY', True], [2, '', True], [3, 'R', True]], 'compat': [[3, 1], [3, 2]], 'yellow_durations': [[1, 35], [3, 35]]}, ['multi:1', 'red-fail:2'])], [({'channels': [[1, 'RY', True], [2, 'RG', True], [3, 'R', False]], 'compat': [[2, 1]], 'yellow_durations': [[2, 27]]}, ['multi:1', 'multi:2']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'R', False], [2, 'R', True], [3, '', True], [4, 'R', True], [5, 'GY', True]], 'compat': [[1, 5], [2, 5], [3, 4]], 'yellow_durations': [[4, 28]]}, ['multi:5', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'GY', True], [3, '', True], [4, 'GY', True], [5, 'R', True], [6, 'Y', False]], 'compat': [[1, 2], [3, 1], [5, 1], [4, 3], [5, 4]], 'yellow_durations': [[1, 35]]}, ['conflict:2-4', 'multi:2', 'multi:4', 'red-fail:3']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'GY', True], [4, 'RG', False]], 'compat': [[4, 2]], 'yellow_durations': []}, ['conflict:2-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, '', True], [5, 'RG', True], [6, '', True]], 'compat': [[6, 2], [4, 5]], 'yellow_durations': [[1, 25], [3, 27], [5, 35]]}, ['conflict:1-2', 'conflict:1-5', 'conflict:2-5', 'multi:5', 'red-fail:4', 'red-fail:6', 'short-yellow:1']), ({'channels': [[1, 'Y', True], [2, '', True], [3, 'GY', True], [4, 'Y', True]], 'compat': [[1, 2], [4, 3]], 'yellow_durations': []}, ['conflict:1-3', 'conflict:1-4', 'multi:3', 'red-fail:2'])], [({'channels': [[1, 'RG', False], [2, 'R', False], [3, 'G', True]], 'compat': [[1, 2]], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'R', False], [3, 'RY', False], [4, '', True], [5, 'GY', True], [6, 'Y', True]], 'compat': [[1, 2], [4, 1], [1, 5], [1, 6], [5, 2], [3, 5], [3, 6]], 'yellow_durations': [[4, 27], [5, 26]]}, ['conflict:5-6', 'multi:5', 'red-fail:1', 'red-fail:4', 'short-yellow:5']), ({'channels': [[1, 'Y', True], [2, 'G', True], [3, 'GY', True], [4, 'R', True], [5, 'R', True], [6, 'G', False]], 'compat': [[2, 1], [6, 1], [3, 2], [2, 4], [3, 4], [3, 6], [6, 5]], 'yellow_durations': []}, ['conflict:1-3', 'multi:3']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, 'R', True], [4, 'RY', True]], 'compat': [[4, 1], [4, 2], [3, 4]], 'yellow_durations': [[3, 27]]}, ['conflict:1-2', 'multi:1', 'multi:4']), ({'channels': [[1, 'R', True], [2, 'R', False], [3, 'R', True], [4, 'R', True], [5, 'R', True], [6, 'R', True]], 'compat': [[4, 2], [2, 6], [3, 4], [5, 3], [6, 4]], 'yellow_durations': [[1, 26], [2, 35]]}, ['short-yellow:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'Y', True], [3, 'R', True], [4, 'R', True]], 'compat': [[1, 2], [1, 3], [4, 1], [3, 4]], 'yellow_durations': [[1, 28], [4, 27]]}, [])], [({'channels': [[1, 'G', True], [2, '', True], [3, 'R', True]], 'compat': [], 'yellow_durations': [[1, 25]]}, ['red-fail:2', 'short-yellow:1']), ({'channels': [[1, 'G', True], [2, 'R', True], [3, 'Y', True], [4, 'G', False]], 'compat': [[3, 1]], 'yellow_durations': [[2, 27]]}, []), ({'channels': [[1, 'G', False], [2, 'G', True], [3, 'R', False], [4, 'R', True], [5, 'Y', False]], 'compat': [[1, 2], [1, 3], [5, 1], [3, 2], [5, 2]], 'yellow_durations': [[3, 28]]}, []), ({'channels': [[1, 'Y', False], [2, 'R', False], [3, 'GY', True], [4, 'R', False], [5, 'R', True]], 'compat': [[2, 1], [3, 1], [4, 1], [2, 5], [3, 5], [4, 5]], 'yellow_durations': [[1, 25]]}, ['multi:3', 'short-yellow:1']), ({'channels': [[1, 'RY', True], [2, 'R', True], [3, 'GY', True], [4, 'R', True], [5, 'GY', True], [6, 'GY', True]], 'compat': [[2, 1], [1, 4], [5, 1], [6, 1], [3, 2], [3, 5], [3, 6]], 'yellow_durations': [[2, 26], [3, 27], [4, 28]]}, ['conflict:1-3', 'conflict:5-6', 'multi:1', 'multi:3', 'multi:5', 'multi:6', 'short-yellow:2']), ({'channels': [[1, 'R', True], [2, 'G', True], [3, 'G', False]], 'compat': [], 'yellow_durations': []}, []), ({'channels': [[1, '', True], [2, 'G', True], [3, 'RG', True], [4, 'R', True]], 'compat': [[3, 2], [4, 2], [3, 4]], 'yellow_durations': [[1, 27]]}, ['multi:3', 'red-fail:1']), ({'channels': [[1, 'GY', True], [2, 'G', True], [3, '', True]], 'compat': [], 'yellow_durations': [[1, 26]]}, ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow: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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| timing oracle 0 | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4'] | ['conflict:1-2', 'conflict:1-5', 'conflict:1-6', 'conflict:2-6', 'multi:1', 'multi:2', 'multi:5', 'multi:6', 'short-yellow:4'] | Passed |
| timing oracle 1 | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | ['conflict:2-3', 'multi:2', 'short-yellow:1', 'short-yellow:2'] | Passed |
| timing oracle 2 | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | ['conflict:1-2', 'conflict:2-3', 'multi:2', 'multi:3', 'red-fail:4', 'red-fail:6'] | Passed |
| timing oracle 3 | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | ['conflict:1-2', 'multi:1', 'red-fail:3', 'short-yellow:1'] | Passed |
| timing oracle 4 | [] | [] | Passed |
| timing oracle 5 | ['conflict:1-4', 'multi:4', 'red-fail:3'] | ['conflict:1-4', 'multi:4', 'red-fail:3'] | Passed |
| timing oracle 6 | ['conflict:2-3', 'multi:3'] | ['conflict:2-3', 'multi:3'] | Passed |
| timing oracle 7 | ['multi:3', 'red-fail:1'] | ['multi:3', 'red-fail:1'] | Passed |
SHA-256 / 20d855a1c5b8ccde48dbbe2d28d5ed3052527d54de324868057b55dacd1d48ef
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.935869+00:00.
Case digest / a198c6bfdb0dcd1a11a4ef552b00c349e6f31fe3f62abd4e3034e388bf9e689b