FAILURE MAP
← Case archive

FA-67966 / Traffic signal timing plans / Open access

Actuated phase gap-out and max-out: an actuation exactly at gap expiry is treated as a gap · case 01

Actuated phase gap-out and max-out returns a wrong result when an actuation exactly at gap expiry is treated as a gap.

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

ROOT CAUSE

An actuation arriving at the instant the passage timer expires is dropped instead of extending the phase.

THE FAILURE

An actuation arriving at the instant the passage timer expires is dropped instead of extending the phase.

Unsuccessful approach: Dropping the min-green condition breaks the chain when an actuation arrives after a gap that is still inside minimum green.

Case contract

Input {min_green, gap, max_green, actuations: integer seconds since green start (any order), conflict_call: seconds or null}. Each actuation at a keeps the phase eligible until a+gap; an actuation exactly at expiry extends; actuations during min green always extend. Gap-out time = max(min_green, final expiry). With no conflicting call return ['rest', gap time]. The max timer starts at the call (a call before green start counts as 0); max-out at call+max_green. If gap time <= max-out the phase ends by 'gap-out' at max(gap time, call), else by 'max-out'.

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):
    m, p, M = x['min_green'], x['gap'], x['max_green']
    exp = 0
    for a in sorted(x['actuations']):
        if a >= exp and a > m:
            break
        exp = max(exp, a + p)
    gap_end = max(m, exp)
    tc = x['conflict_call']
    if tc is None:
        return ['rest', gap_end]
    tc = max(tc, 0)
    max_end = tc + M
    if gap_end <= max_end:
        return ['gap-out', max(gap_end, tc)]
    return ['max-out', max_end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 3, 'max_green': 26, 'actuations': [0, 2, 3, 4, 6, 7, 8, 13, 14, 15, 19, 21, 22, 29, 31, 33, 35, 36, 38, 39, 42, 44, 46, 48, 49, 50, 51, 54, 56, 57, 58, 59], 'conflict_call': -4}, ['gap-out', 11]), ({'min_green': 8, 'gap': 5, 'max_green': 15, 'actuations': [39, 3, 10], 'conflict_call': 6}, ['gap-out', 8]), ({'min_green': 7, 'gap': 3, 'max_green': 21, 'actuations': [1, 2, 5, 8, 9, 13, 16, 19, 21, 23, 24, 28, 29, 30, 31, 32, 36, 40, 43, 46, 48, 49, 50, 51, 52, 54, 56, 57], 'conflict_call': 18}, ['gap-out', 18]), ({'min_green': 7, 'gap': 5, 'max_green': 15, 'actuations': [37, 46, 22, 42, 49, 34, 25, 9, 6, 47, 28, 15, 20, 0, 39, 17, 13, 33, 55, 48, 32, 21, 52, 19, 18, 50, 41, 57, 54, 5, 44, 16, 59, 23, 14, 7, 43], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 8, 'gap': 4, 'max_green': 20, 'actuations': [2, 3, 5, 8, 11, 12, 14, 16, 19, 20, 22, 24, 25, 26, 29, 31, 32, 33, 35, 36, 37, 38, 39, 43, 48, 49, 50, 53, 55, 56, 59], 'conflict_call': 13}, ['max-out', 33]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15])], [({'min_green': 7, 'gap': 5, 'max_green': 42, 'actuations': [10, 15, 18, 42, 51, 53], 'conflict_call': 35}, ['gap-out', 35]), ({'min_green': 4, 'gap': 4, 'max_green': 31, 'actuations': [1, 21, 25, 32, 37, 53], 'conflict_call': None}, ['rest', 5]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 9, 'gap': 3, 'max_green': 35, 'actuations': [4, 5, 7, 10, 24, 26, 34, 35, 51, 52, 53], 'conflict_call': 25}, ['gap-out', 25]), ({'min_green': 4, 'gap': 3, 'max_green': 17, 'actuations': [1, 5, 6, 10, 11, 15, 16, 19, 22, 24, 25, 28, 31, 33, 37, 38, 42, 50], 'conflict_call': None}, ['rest', 4]), ({'min_green': 4, 'gap': 2, 'max_green': 45, 'actuations': [2, 3, 5, 11, 28, 39, 49, 57], 'conflict_call': 34}, ['gap-out', 34])], [({'min_green': 4, 'gap': 5, 'max_green': 39, 'actuations': [9, 10, 11, 12, 13, 16, 24, 26, 32, 34, 39, 40, 42, 44, 52, 54, 55, 59], 'conflict_call': 14}, ['gap-out', 14]), ({'min_green': 6, 'gap': 2, 'max_green': 22, 'actuations': [6, 9, 12, 13, 23, 24, 26, 27, 28, 33, 34, 35, 36, 40, 42, 43, 52, 53, 59], 'conflict_call': None}, ['rest', 8]), ({'min_green': 7, 'gap': 3, 'max_green': 33, 'actuations': [2, 7, 8, 9, 10, 13, 18, 22, 26, 30, 32, 34, 35, 36, 41, 43, 51, 58, 59], 'conflict_call': None}, ['rest', 16]), ({'min_green': 7, 'gap': 4, 'max_green': 30, 'actuations': [20, 22, 23, 31, 44, 49, 55, 56, 58], 'conflict_call': 9}, ['gap-out', 9]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 7, 'gap': 3, 'max_green': 35, 'actuations': [1, 2, 4, 6, 10, 11, 15, 19, 23, 29, 39, 42, 43, 45, 48, 51, 58], 'conflict_call': 24}, ['gap-out', 24]), ({'min_green': 5, 'gap': 3, 'max_green': 20, 'actuations': [1, 4, 7, 10, 13], 'conflict_call': 2}, ['gap-out', 16]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3])], [({'min_green': 4, 'gap': 2, 'max_green': 45, 'actuations': [4, 11, 12, 13, 15, 24, 26, 28, 30, 32, 33, 34, 38, 39, 41, 44, 46, 48, 59], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 10, 'gap': 4, 'max_green': 42, 'actuations': [6, 9, 12, 14, 39, 41, 46, 48, 52, 57, 58], 'conflict_call': None}, ['rest', 18]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7]), ({'min_green': 8, 'gap': 5, 'max_green': 32, 'actuations': [0, 1, 2, 3, 4, 6, 9, 10, 15, 16, 19, 22, 24, 26, 30, 32, 33, 34, 37, 39, 41, 47, 48, 49, 50, 52, 53, 58], 'conflict_call': 3}, ['max-out', 35]), ({'min_green': 10, 'gap': 2, 'max_green': 19, 'actuations': [7, 13, 25, 33, 34, 36, 52, 56], 'conflict_call': 6}, ['gap-out', 10]), ({'min_green': 7, 'gap': 3, 'max_green': 36, 'actuations': [0, 3, 9, 13, 21, 23, 26, 36, 38, 45, 57], 'conflict_call': -6}, ['gap-out', 7])], [({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 10, 'gap': 3, 'max_green': 19, 'actuations': [2, 3, 4, 5, 6, 7, 11, 12, 14, 15, 19, 22, 24, 25, 27, 30, 31, 32, 34, 36, 37, 38, 44, 45, 47, 50, 53, 54, 55, 56], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 10, 'gap': 2, 'max_green': 37, 'actuations': [5, 8, 11, 15, 17, 35, 37], 'conflict_call': None}, ['rest', 10]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 5, 'gap': 3, 'max_green': 33, 'actuations': [0, 3, 5, 12, 13, 17, 23, 25, 32, 33, 35, 36, 41, 43, 44, 45, 46, 47, 49, 50, 52, 54, 55, 56, 58, 59], 'conflict_call': 7}, ['gap-out', 8]), ({'min_green': 10, 'gap': 5, 'max_green': 31, 'actuations': [3, 6, 14, 22, 25, 28, 30, 34, 37, 47, 49, 56], 'conflict_call': None}, ['rest', 11]), ({'min_green': 6, 'gap': 5, 'max_green': 36, 'actuations': [0, 2, 5, 7, 9, 10, 12, 13, 15, 17, 18, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 37, 38, 39, 42, 43, 45, 51, 55, 56, 57, 58, 59], 'conflict_call': 32}, ['gap-out', 50]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7])]]
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['gap-out', 6]['gap-out', 15]Failed
timing oracle 1['gap-out', 11]['gap-out', 11]Passed
timing oracle 2['gap-out', 8]['gap-out', 8]Passed
timing oracle 3['gap-out', 18]['gap-out', 18]Passed
timing oracle 4['max-out', 15]['max-out', 15]Passed
timing oracle 5['max-out', 33]['max-out', 33]Passed
timing oracle 6['gap-out', 8]['max-out', 15]Failed
timing oracle 7['gap-out', 7]['gap-out', 15]Failed

SHA-256 / 5354657c027a96e148b507e8deb3862fbe36e1c7eb67585a8f49406265c63850

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    m, p, M = x['min_green'], x['gap'], x['max_green']
    exp = 0
    for a in sorted(x['actuations']):
        if a > exp:
            break
        exp = max(exp, a + p)
    gap_end = max(m, exp)
    tc = x['conflict_call']
    if tc is None:
        return ['rest', gap_end]
    tc = max(tc, 0)
    max_end = tc + M
    if gap_end <= max_end:
        return ['gap-out', max(gap_end, tc)]
    return ['max-out', max_end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 3, 'max_green': 26, 'actuations': [0, 2, 3, 4, 6, 7, 8, 13, 14, 15, 19, 21, 22, 29, 31, 33, 35, 36, 38, 39, 42, 44, 46, 48, 49, 50, 51, 54, 56, 57, 58, 59], 'conflict_call': -4}, ['gap-out', 11]), ({'min_green': 8, 'gap': 5, 'max_green': 15, 'actuations': [39, 3, 10], 'conflict_call': 6}, ['gap-out', 8]), ({'min_green': 7, 'gap': 3, 'max_green': 21, 'actuations': [1, 2, 5, 8, 9, 13, 16, 19, 21, 23, 24, 28, 29, 30, 31, 32, 36, 40, 43, 46, 48, 49, 50, 51, 52, 54, 56, 57], 'conflict_call': 18}, ['gap-out', 18]), ({'min_green': 7, 'gap': 5, 'max_green': 15, 'actuations': [37, 46, 22, 42, 49, 34, 25, 9, 6, 47, 28, 15, 20, 0, 39, 17, 13, 33, 55, 48, 32, 21, 52, 19, 18, 50, 41, 57, 54, 5, 44, 16, 59, 23, 14, 7, 43], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 8, 'gap': 4, 'max_green': 20, 'actuations': [2, 3, 5, 8, 11, 12, 14, 16, 19, 20, 22, 24, 25, 26, 29, 31, 32, 33, 35, 36, 37, 38, 39, 43, 48, 49, 50, 53, 55, 56, 59], 'conflict_call': 13}, ['max-out', 33]), ({'min_green': 6, 'gap': 2, 'max_green': 15, 'actuations': [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38], 'conflict_call': -3}, ['max-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15])], [({'min_green': 7, 'gap': 5, 'max_green': 42, 'actuations': [10, 15, 18, 42, 51, 53], 'conflict_call': 35}, ['gap-out', 35]), ({'min_green': 4, 'gap': 4, 'max_green': 31, 'actuations': [1, 21, 25, 32, 37, 53], 'conflict_call': None}, ['rest', 5]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 9, 'gap': 3, 'max_green': 35, 'actuations': [4, 5, 7, 10, 24, 26, 34, 35, 51, 52, 53], 'conflict_call': 25}, ['gap-out', 25]), ({'min_green': 4, 'gap': 3, 'max_green': 17, 'actuations': [1, 5, 6, 10, 11, 15, 16, 19, 22, 24, 25, 28, 31, 33, 37, 38, 42, 50], 'conflict_call': None}, ['rest', 4]), ({'min_green': 4, 'gap': 2, 'max_green': 45, 'actuations': [2, 3, 5, 11, 28, 39, 49, 57], 'conflict_call': 34}, ['gap-out', 34])], [({'min_green': 4, 'gap': 5, 'max_green': 39, 'actuations': [9, 10, 11, 12, 13, 16, 24, 26, 32, 34, 39, 40, 42, 44, 52, 54, 55, 59], 'conflict_call': 14}, ['gap-out', 14]), ({'min_green': 6, 'gap': 2, 'max_green': 22, 'actuations': [6, 9, 12, 13, 23, 24, 26, 27, 28, 33, 34, 35, 36, 40, 42, 43, 52, 53, 59], 'conflict_call': None}, ['rest', 8]), ({'min_green': 7, 'gap': 3, 'max_green': 33, 'actuations': [2, 7, 8, 9, 10, 13, 18, 22, 26, 30, 32, 34, 35, 36, 41, 43, 51, 58, 59], 'conflict_call': None}, ['rest', 16]), ({'min_green': 7, 'gap': 4, 'max_green': 30, 'actuations': [20, 22, 23, 31, 44, 49, 55, 56, 58], 'conflict_call': 9}, ['gap-out', 9]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 7, 'gap': 3, 'max_green': 35, 'actuations': [1, 2, 4, 6, 10, 11, 15, 19, 23, 29, 39, 42, 43, 45, 48, 51, 58], 'conflict_call': 24}, ['gap-out', 24]), ({'min_green': 5, 'gap': 3, 'max_green': 20, 'actuations': [1, 4, 7, 10, 13], 'conflict_call': 2}, ['gap-out', 16]), ({'min_green': 10, 'gap': 2, 'max_green': 3, 'actuations': [], 'conflict_call': 0}, ['max-out', 3])], [({'min_green': 4, 'gap': 2, 'max_green': 45, 'actuations': [4, 11, 12, 13, 15, 24, 26, 28, 30, 32, 33, 34, 38, 39, 41, 44, 46, 48, 59], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 10, 'gap': 4, 'max_green': 42, 'actuations': [6, 9, 12, 14, 39, 41, 46, 48, 52, 57, 58], 'conflict_call': None}, ['rest', 18]), ({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 6, 'gap': 2, 'max_green': 12, 'actuations': [1, 3, 5, 7, 9, 11, 13], 'conflict_call': 3}, ['gap-out', 15]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7]), ({'min_green': 8, 'gap': 5, 'max_green': 32, 'actuations': [0, 1, 2, 3, 4, 6, 9, 10, 15, 16, 19, 22, 24, 26, 30, 32, 33, 34, 37, 39, 41, 47, 48, 49, 50, 52, 53, 58], 'conflict_call': 3}, ['max-out', 35]), ({'min_green': 10, 'gap': 2, 'max_green': 19, 'actuations': [7, 13, 25, 33, 34, 36, 52, 56], 'conflict_call': 6}, ['gap-out', 10]), ({'min_green': 7, 'gap': 3, 'max_green': 36, 'actuations': [0, 3, 9, 13, 21, 23, 26, 36, 38, 45, 57], 'conflict_call': -6}, ['gap-out', 7])], [({'min_green': 5, 'gap': 3, 'max_green': 10, 'actuations': [0, 3, 6, 9, 12], 'conflict_call': 5}, ['gap-out', 15]), ({'min_green': 10, 'gap': 3, 'max_green': 19, 'actuations': [2, 3, 4, 5, 6, 7, 11, 12, 14, 15, 19, 22, 24, 25, 27, 30, 31, 32, 34, 36, 37, 38, 44, 45, 47, 50, 53, 54, 55, 56], 'conflict_call': 15}, ['gap-out', 15]), ({'min_green': 10, 'gap': 2, 'max_green': 37, 'actuations': [5, 8, 11, 15, 17, 35, 37], 'conflict_call': None}, ['rest', 10]), ({'min_green': 5, 'gap': 3, 'max_green': 25, 'actuations': [9, 3, 6], 'conflict_call': None}, ['rest', 12]), ({'min_green': 5, 'gap': 3, 'max_green': 33, 'actuations': [0, 3, 5, 12, 13, 17, 23, 25, 32, 33, 35, 36, 41, 43, 44, 45, 46, 47, 49, 50, 52, 54, 55, 56, 58, 59], 'conflict_call': 7}, ['gap-out', 8]), ({'min_green': 10, 'gap': 5, 'max_green': 31, 'actuations': [3, 6, 14, 22, 25, 28, 30, 34, 37, 47, 49, 56], 'conflict_call': None}, ['rest', 11]), ({'min_green': 6, 'gap': 5, 'max_green': 36, 'actuations': [0, 2, 5, 7, 9, 10, 12, 13, 15, 17, 18, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 37, 38, 39, 42, 43, 45, 51, 55, 56, 57, 58, 59], 'conflict_call': 32}, ['gap-out', 50]), ({'min_green': 12, 'gap': 3, 'max_green': 5, 'actuations': [1], 'conflict_call': 2}, ['max-out', 7])]]
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['gap-out', 15]['gap-out', 15]Passed
timing oracle 1['gap-out', 11]['gap-out', 11]Passed
timing oracle 2['gap-out', 8]['gap-out', 8]Passed
timing oracle 3['gap-out', 18]['gap-out', 18]Passed
timing oracle 4['max-out', 15]['max-out', 15]Passed
timing oracle 5['gap-out', 13]['max-out', 33]Failed
timing oracle 6['max-out', 15]['max-out', 15]Passed
timing oracle 7['gap-out', 6]['gap-out', 15]Failed

SHA-256 / e6233ee6d2ce7faeef50b97892e39631bbd22b8c3a3dd0c569d1940de06300c5

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 81fb804eb123807b91b7f73d1a26a85794eba77d0c2fb306942bb9f3c2b0e370