FAILURE MAP
← Case archive

FA-67871 / Traffic signal timing plans / Open access

Green split allocation: the whole cycle is distributed as green · case 01

Green split allocation returns a wrong result when the whole cycle is distributed as green.

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

ROOT CAUSE

Lost time is never subtracted, so the splits add up to the full cycle and overrun the clearance intervals.

VERIFIED REPAIR

Restore the effective green rule so that the step reads `G = x['cycle'] - x['lost']`.

Unsuccessful approach: Subtracting an extra second per phase double counts lost time and under-allocates green.

Case contract

Input {cycle, lost, ratios: per-phase critical flow ratios [num, den], min_green: per-phase minima}. Effective green G = cycle - lost is shared in proportion to the ratios; each phase gets the floor of its ideal share and remaining seconds go one each by largest fractional remainder (ties to the lower phase index). Then each phase below its minimum (in index order) takes seconds one at a time from the phase with the largest surplus over its own minimum (ties to the lower index). If the minima exceed G return 'infeasible'. Return the list of integer greens.

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
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
    G = x['cycle']
    ys = [Fraction(a, b) for a, b in x['ratios']]
    mins = x['min_green']
    if sum(mins) > G:
        return 'infeasible'
    Y = sum(ys)
    ideal = [G * y / Y for y in ys]
    g = [int(v) for v in ideal]
    left = G - sum(g)
    order = sorted(range(len(g)), key=lambda i: (-(ideal[i] - g[i]), i))
    for i in order[:left]:
        g[i] += 1
    for i in range(len(g)):
        while g[i] < mins[i]:
            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))
            g[donor] -= 1
            g[i] += 1
    return g
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [10, 5, 10, 7]}, [18, 18, 18, 17]), ({'cycle': 130, 'lost': 11, 'ratios': [[1, 20], [1, 20]], 'min_green': [15, 10]}, [60, 59]), ({'cycle': 60, 'lost': 9, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 15, 15, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[8, 20], [2, 20], [1, 10]], 'min_green': [15, 5, 10]}, [66, 16, 16]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 7, 15]}, [27, 27, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15])], [({'cycle': 85, 'lost': 11, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [20, 7, 20, 10]}, [20, 16, 20, 18]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 14, 'ratios': [[5, 20], [2, 10], [4, 10]], 'min_green': [10, 7, 7]}, [31, 25, 50]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [7, 25], [9, 20], [2, 25]], 'min_green': [20, 5, 5, 7]}, [20, 19, 26, 7]), ({'cycle': 90, 'lost': 12, 'ratios': [[4, 25], [2, 10], [7, 20]], 'min_green': [10, 20, 20]}, [18, 22, 38]), ({'cycle': 65, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [10, 5, 5]}, [18, 17, 17])], [({'cycle': 75, 'lost': 8, 'ratios': [[5, 20], [6, 25], [2, 10], [9, 10]], 'min_green': [20, 7, 20, 15]}, [20, 9, 20, 18]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 60, 'lost': 13, 'ratios': [[5, 20], [5, 20], [5, 20]], 'min_green': [7, 10, 10]}, [16, 16, 15]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 115, 'lost': 15, 'ratios': [[9, 20], [7, 10], [1, 20]], 'min_green': [15, 7, 10]}, [38, 52, 10]), ({'cycle': 80, 'lost': 14, 'ratios': [[8, 20], [7, 25], [4, 20], [7, 10]], 'min_green': [7, 7, 10, 5]}, [17, 12, 10, 27]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 10, 'ratios': [[5, 20], [1, 20]], 'min_green': [15, 15]}, [75, 15])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [5, 20], [3, 25]], 'min_green': [5, 20, 20]}, [10, 50, 24]), ({'cycle': 80, 'lost': 10, 'ratios': [[4, 25], [4, 25], [9, 25], [6, 20]], 'min_green': [20, 20, 7, 20]}, [20, 20, 9, 21]), ({'cycle': 75, 'lost': 9, 'ratios': [[4, 25], [6, 20]], 'min_green': [15, 5]}, [23, 43]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 60, 'lost': 13, 'ratios': [[1, 20], [6, 25], [8, 20], [3, 20]], 'min_green': [20, 20, 7, 20]}, 'infeasible'), ({'cycle': 60, 'lost': 15, 'ratios': [[7, 25], [2, 25], [2, 25], [7, 20]], 'min_green': [20, 20, 15, 15]}, 'infeasible')], [({'cycle': 85, 'lost': 14, 'ratios': [[7, 20], [3, 20]], 'min_green': [5, 7]}, [50, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 13, 'ratios': [[9, 25], [8, 25], [8, 20], [9, 10]], 'min_green': [20, 20, 7, 15]}, [20, 20, 22, 45]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 10], [2, 10]], 'min_green': [7, 5]}, [32, 32]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 80, 'lost': 13, 'ratios': [[8, 10], [5, 10]], 'min_green': [7, 7]}, [41, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 65, 'lost': 10, 'ratios': [[9, 20], [7, 25], [8, 25]], 'min_green': [20, 5, 10]}, [23, 15, 17])]]
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[20, 45][20, 35]Failed
timing oracle 1[20, 20, 20, 20][18, 18, 18, 17]Failed
timing oracle 2[65, 65][60, 59]Failed
timing oracle 3infeasibleinfeasiblePassed
timing oracle 4[74, 18, 18][66, 16, 16]Failed
timing oracle 5[43, 27][27, 27]Failed
timing oracle 6[30, 30, 30][27, 27, 26]Failed
timing oracle 7[45, 15][35, 15]Failed

SHA-256 / 106ebb1baeb4f5d958b6027efdffe317926671c486fd12fc6d6dd786ccfb004e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
    G = x['cycle'] - x['lost'] - len(x['ratios'])
    ys = [Fraction(a, b) for a, b in x['ratios']]
    mins = x['min_green']
    if sum(mins) > G:
        return 'infeasible'
    Y = sum(ys)
    ideal = [G * y / Y for y in ys]
    g = [int(v) for v in ideal]
    left = G - sum(g)
    order = sorted(range(len(g)), key=lambda i: (-(ideal[i] - g[i]), i))
    for i in order[:left]:
        g[i] += 1
    for i in range(len(g)):
        while g[i] < mins[i]:
            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))
            g[donor] -= 1
            g[i] += 1
    return g
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [10, 5, 10, 7]}, [18, 18, 18, 17]), ({'cycle': 130, 'lost': 11, 'ratios': [[1, 20], [1, 20]], 'min_green': [15, 10]}, [60, 59]), ({'cycle': 60, 'lost': 9, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 15, 15, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[8, 20], [2, 20], [1, 10]], 'min_green': [15, 5, 10]}, [66, 16, 16]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 7, 15]}, [27, 27, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15])], [({'cycle': 85, 'lost': 11, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [20, 7, 20, 10]}, [20, 16, 20, 18]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 14, 'ratios': [[5, 20], [2, 10], [4, 10]], 'min_green': [10, 7, 7]}, [31, 25, 50]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [7, 25], [9, 20], [2, 25]], 'min_green': [20, 5, 5, 7]}, [20, 19, 26, 7]), ({'cycle': 90, 'lost': 12, 'ratios': [[4, 25], [2, 10], [7, 20]], 'min_green': [10, 20, 20]}, [18, 22, 38]), ({'cycle': 65, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [10, 5, 5]}, [18, 17, 17])], [({'cycle': 75, 'lost': 8, 'ratios': [[5, 20], [6, 25], [2, 10], [9, 10]], 'min_green': [20, 7, 20, 15]}, [20, 9, 20, 18]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 60, 'lost': 13, 'ratios': [[5, 20], [5, 20], [5, 20]], 'min_green': [7, 10, 10]}, [16, 16, 15]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 115, 'lost': 15, 'ratios': [[9, 20], [7, 10], [1, 20]], 'min_green': [15, 7, 10]}, [38, 52, 10]), ({'cycle': 80, 'lost': 14, 'ratios': [[8, 20], [7, 25], [4, 20], [7, 10]], 'min_green': [7, 7, 10, 5]}, [17, 12, 10, 27]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 10, 'ratios': [[5, 20], [1, 20]], 'min_green': [15, 15]}, [75, 15])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [5, 20], [3, 25]], 'min_green': [5, 20, 20]}, [10, 50, 24]), ({'cycle': 80, 'lost': 10, 'ratios': [[4, 25], [4, 25], [9, 25], [6, 20]], 'min_green': [20, 20, 7, 20]}, [20, 20, 9, 21]), ({'cycle': 75, 'lost': 9, 'ratios': [[4, 25], [6, 20]], 'min_green': [15, 5]}, [23, 43]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 60, 'lost': 13, 'ratios': [[1, 20], [6, 25], [8, 20], [3, 20]], 'min_green': [20, 20, 7, 20]}, 'infeasible'), ({'cycle': 60, 'lost': 15, 'ratios': [[7, 25], [2, 25], [2, 25], [7, 20]], 'min_green': [20, 20, 15, 15]}, 'infeasible')], [({'cycle': 85, 'lost': 14, 'ratios': [[7, 20], [3, 20]], 'min_green': [5, 7]}, [50, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 13, 'ratios': [[9, 25], [8, 25], [8, 20], [9, 10]], 'min_green': [20, 20, 7, 15]}, [20, 20, 22, 45]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 10], [2, 10]], 'min_green': [7, 5]}, [32, 32]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 80, 'lost': 13, 'ratios': [[8, 10], [5, 10]], 'min_green': [7, 7]}, [41, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 65, 'lost': 10, 'ratios': [[9, 20], [7, 25], [8, 25]], 'min_green': [20, 5, 10]}, [23, 15, 17])]]
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 0infeasible[20, 35]Failed
timing oracle 1[17, 17, 17, 16][18, 18, 18, 17]Failed
timing oracle 2[59, 58][60, 59]Failed
timing oracle 3infeasibleinfeasiblePassed
timing oracle 4[63, 16, 16][66, 16, 16]Failed
timing oracle 5infeasible[27, 27]Failed
timing oracle 6[26, 26, 25][27, 27, 26]Failed
timing oracle 7[33, 15][35, 15]Failed

SHA-256 / 51c53bbac09f14ee7126b96372eb05785308aa2e250f7969d62d1d9bc02d9734

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(x):
    G = x['cycle'] - x['lost']
    ys = [Fraction(a, b) for a, b in x['ratios']]
    mins = x['min_green']
    if sum(mins) > G:
        return 'infeasible'
    Y = sum(ys)
    ideal = [G * y / Y for y in ys]
    g = [int(v) for v in ideal]
    left = G - sum(g)
    order = sorted(range(len(g)), key=lambda i: (-(ideal[i] - g[i]), i))
    for i in order[:left]:
        g[i] += 1
    for i in range(len(g)):
        while g[i] < mins[i]:
            donor = max(range(len(g)), key=lambda j: (g[j] - mins[j], -j))
            g[donor] -= 1
            g[i] += 1
    return g
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [10, 5, 10, 7]}, [18, 18, 18, 17]), ({'cycle': 130, 'lost': 11, 'ratios': [[1, 20], [1, 20]], 'min_green': [15, 10]}, [60, 59]), ({'cycle': 60, 'lost': 9, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 15, 15, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[8, 20], [2, 20], [1, 10]], 'min_green': [15, 5, 10]}, [66, 16, 16]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 7, 15]}, [27, 27, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15])], [({'cycle': 85, 'lost': 11, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [20, 7, 20, 10]}, [20, 16, 20, 18]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 14, 'ratios': [[5, 20], [2, 10], [4, 10]], 'min_green': [10, 7, 7]}, [31, 25, 50]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [7, 25], [9, 20], [2, 25]], 'min_green': [20, 5, 5, 7]}, [20, 19, 26, 7]), ({'cycle': 90, 'lost': 12, 'ratios': [[4, 25], [2, 10], [7, 20]], 'min_green': [10, 20, 20]}, [18, 22, 38]), ({'cycle': 65, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [10, 5, 5]}, [18, 17, 17])], [({'cycle': 75, 'lost': 8, 'ratios': [[5, 20], [6, 25], [2, 10], [9, 10]], 'min_green': [20, 7, 20, 15]}, [20, 9, 20, 18]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 60, 'lost': 13, 'ratios': [[5, 20], [5, 20], [5, 20]], 'min_green': [7, 10, 10]}, [16, 16, 15]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 115, 'lost': 15, 'ratios': [[9, 20], [7, 10], [1, 20]], 'min_green': [15, 7, 10]}, [38, 52, 10]), ({'cycle': 80, 'lost': 14, 'ratios': [[8, 20], [7, 25], [4, 20], [7, 10]], 'min_green': [7, 7, 10, 5]}, [17, 12, 10, 27]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 10, 'ratios': [[5, 20], [1, 20]], 'min_green': [15, 15]}, [75, 15])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [5, 20], [3, 25]], 'min_green': [5, 20, 20]}, [10, 50, 24]), ({'cycle': 80, 'lost': 10, 'ratios': [[4, 25], [4, 25], [9, 25], [6, 20]], 'min_green': [20, 20, 7, 20]}, [20, 20, 9, 21]), ({'cycle': 75, 'lost': 9, 'ratios': [[4, 25], [6, 20]], 'min_green': [15, 5]}, [23, 43]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 60, 'lost': 13, 'ratios': [[1, 20], [6, 25], [8, 20], [3, 20]], 'min_green': [20, 20, 7, 20]}, 'infeasible'), ({'cycle': 60, 'lost': 15, 'ratios': [[7, 25], [2, 25], [2, 25], [7, 20]], 'min_green': [20, 20, 15, 15]}, 'infeasible')], [({'cycle': 85, 'lost': 14, 'ratios': [[7, 20], [3, 20]], 'min_green': [5, 7]}, [50, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 120, 'lost': 13, 'ratios': [[9, 25], [8, 25], [8, 20], [9, 10]], 'min_green': [20, 20, 7, 15]}, [20, 20, 22, 45]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 10], [2, 10]], 'min_green': [7, 5]}, [32, 32]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 80, 'lost': 13, 'ratios': [[8, 10], [5, 10]], 'min_green': [7, 7]}, [41, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 65, 'lost': 10, 'ratios': [[9, 20], [7, 25], [8, 25]], 'min_green': [20, 5, 10]}, [23, 15, 17])]]
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[20, 35][20, 35]Passed
timing oracle 1[18, 18, 18, 17][18, 18, 18, 17]Passed
timing oracle 2[60, 59][60, 59]Passed
timing oracle 3infeasibleinfeasiblePassed
timing oracle 4[66, 16, 16][66, 16, 16]Passed
timing oracle 5[27, 27][27, 27]Passed
timing oracle 6[27, 27, 26][27, 27, 26]Passed
timing oracle 7[35, 15][35, 15]Passed

SHA-256 / d7088cf619c4c7c3246840ec4075e8f60420d987f4589dc942fd4a97bd2eb434

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

Case digest / 7de3c902b84bd343a7baa0bdac24bbc8fe49c3c2512ec0d15534fe7f6f8166be