FAILURE MAP
← Case archive

FA-67896 / Traffic signal timing plans / Open access

Green split allocation: minimum green seconds are taken from the longest green regardless of its own minimum · case 01

Green split allocation returns a wrong result when minimum green seconds are taken from the longest green regardless of its own minimum.

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

ROOT CAUSE

The donor is chosen by raw green, so a long phase already at its own minimum is pushed below it.

VERIFIED REPAIR

Restore the minimum green donor rule so that the step reads `(g[j] - mins[j], -j)`.

Unsuccessful approach: Using the surplus is correct, but ties then go to the higher phase index contrary to the contract.

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'] - 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], -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': 85, 'lost': 9, 'ratios': [[1, 10], [4, 25], [7, 20], [8, 20]], 'min_green': [20, 7, 20, 15]}, [20, 11, 25, 20]), ({'cycle': 75, 'lost': 16, 'ratios': [[7, 10], [4, 20], [6, 10]], 'min_green': [20, 10, 10]}, [27, 10, 22]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 125, 'lost': 9, 'ratios': [[3, 10], [8, 25], [5, 25]], 'min_green': [15, 7, 10]}, [43, 45, 28]), ({'cycle': 65, 'lost': 16, 'ratios': [[7, 25], [2, 20], [1, 10], [1, 20]], 'min_green': [20, 10, 7, 10]}, [21, 10, 8, 10]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 115, 'lost': 8, 'ratios': [[1, 20], [8, 10], [8, 10], [9, 10]], 'min_green': [20, 15, 7, 15]}, [20, 31, 24, 32]), ({'cycle': 80, 'lost': 11, 'ratios': [[3, 20], [3, 25], [1, 10], [9, 10]], 'min_green': [15, 15, 15, 5]}, [15, 15, 15, 24])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [6, 25], [9, 20], [5, 20]], 'min_green': [15, 5, 10, 20]}, [23, 11, 19, 20]), ({'cycle': 70, 'lost': 12, 'ratios': [[9, 20], [2, 20], [5, 10]], 'min_green': [7, 20, 15]}, [15, 20, 23]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 9, 'ratios': [[8, 20], [1, 20], [8, 25]], 'min_green': [5, 15, 5]}, [30, 15, 31]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [1, 25], [6, 20], [5, 25]], 'min_green': [20, 20, 10, 15]}, [40, 20, 30, 21]), ({'cycle': 85, 'lost': 10, 'ratios': [[6, 25], [9, 10]], 'min_green': [10, 7]}, [16, 59]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10], [1, 25], [4, 10]], 'min_green': [7, 20, 5, 20]}, [29, 31, 5, 30])], [({'cycle': 60, 'lost': 11, 'ratios': [[3, 25], [9, 20]], 'min_green': [5, 10]}, [10, 39]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10], [3, 10]], 'min_green': [20, 5, 20, 20]}, [20, 17, 20, 20]), ({'cycle': 85, 'lost': 9, 'ratios': [[7, 10], [7, 10], [2, 20], [3, 10]], 'min_green': [15, 5, 20, 7]}, [26, 17, 20, 13]), ({'cycle': 70, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [15, 5, 5, 15]}, [16, 16, 15, 15]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 100, 'lost': 9, 'ratios': [[6, 10], [2, 20], [9, 10], [1, 25]], 'min_green': [10, 20, 20, 20]}, [20, 20, 31, 20])], [({'cycle': 85, 'lost': 9, 'ratios': [[2, 20], [2, 20], [9, 20]], 'min_green': [10, 15, 15]}, [12, 15, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[9, 10], [4, 10], [2, 25]], 'min_green': [15, 5, 10]}, [51, 25, 10]), ({'cycle': 80, 'lost': 9, 'ratios': [[9, 25], [5, 20], [6, 10], [5, 25]], 'min_green': [7, 15, 10, 20]}, [16, 15, 20, 20]), ({'cycle': 70, 'lost': 11, 'ratios': [[5, 10], [1, 20], [6, 25], [4, 10]], 'min_green': [15, 15, 5, 7]}, [20, 15, 11, 13]), ({'cycle': 90, 'lost': 15, 'ratios': [[5, 20], [3, 10], [1, 25]], 'min_green': [5, 15, 15]}, [25, 35, 15]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 12, 'ratios': [[7, 10], [9, 10], [9, 25], [9, 25]], 'min_green': [5, 20, 15, 5]}, [19, 28, 15, 11]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27])], [({'cycle': 125, 'lost': 13, 'ratios': [[9, 10], [6, 10], [7, 25], [1, 10]], 'min_green': [15, 7, 10, 15]}, [44, 36, 17, 15]), ({'cycle': 95, 'lost': 15, 'ratios': [[8, 25], [8, 10], [8, 10]], 'min_green': [20, 10, 7]}, [20, 31, 29]), ({'cycle': 70, 'lost': 13, 'ratios': [[7, 25], [2, 20], [6, 10], [4, 10]], 'min_green': [10, 10, 15, 5]}, [12, 10, 22, 13]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 12, 'ratios': [[6, 20], [1, 20], [9, 25]], 'min_green': [20, 15, 20]}, [50, 15, 53]), ({'cycle': 125, 'lost': 11, 'ratios': [[1, 25], [5, 25], [1, 10], [6, 25]], 'min_green': [20, 20, 7, 15]}, [20, 39, 20, 35]), ({'cycle': 120, 'lost': 16, 'ratios': [[5, 25], [5, 20], [7, 20], [2, 10]], 'min_green': [5, 10, 5, 20]}, [21, 26, 36, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])]]
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, 12, 22, 22][20, 11, 25, 20]Failed
timing oracle 1[25, 10, 24][27, 10, 22]Failed
timing oracle 2[22, 22, 22, 22][22, 22, 22, 22]Passed
timing oracle 3[43, 45, 28][43, 45, 28]Passed
timing oracle 4[20, 10, 9, 10][21, 10, 8, 10]Failed
timing oracle 5[20, 35][20, 35]Passed
timing oracle 6[20, 29, 29, 29][20, 31, 24, 32]Failed
timing oracle 7[15, 15, 15, 24][15, 15, 15, 24]Passed

SHA-256 / 96130bb6b432426b072657864303ff09fc90abb129ee80e1ddbafeb9042744ff

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']
    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': 85, 'lost': 9, 'ratios': [[1, 10], [4, 25], [7, 20], [8, 20]], 'min_green': [20, 7, 20, 15]}, [20, 11, 25, 20]), ({'cycle': 75, 'lost': 16, 'ratios': [[7, 10], [4, 20], [6, 10]], 'min_green': [20, 10, 10]}, [27, 10, 22]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 125, 'lost': 9, 'ratios': [[3, 10], [8, 25], [5, 25]], 'min_green': [15, 7, 10]}, [43, 45, 28]), ({'cycle': 65, 'lost': 16, 'ratios': [[7, 25], [2, 20], [1, 10], [1, 20]], 'min_green': [20, 10, 7, 10]}, [21, 10, 8, 10]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 115, 'lost': 8, 'ratios': [[1, 20], [8, 10], [8, 10], [9, 10]], 'min_green': [20, 15, 7, 15]}, [20, 31, 24, 32]), ({'cycle': 80, 'lost': 11, 'ratios': [[3, 20], [3, 25], [1, 10], [9, 10]], 'min_green': [15, 15, 15, 5]}, [15, 15, 15, 24])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [6, 25], [9, 20], [5, 20]], 'min_green': [15, 5, 10, 20]}, [23, 11, 19, 20]), ({'cycle': 70, 'lost': 12, 'ratios': [[9, 20], [2, 20], [5, 10]], 'min_green': [7, 20, 15]}, [15, 20, 23]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 9, 'ratios': [[8, 20], [1, 20], [8, 25]], 'min_green': [5, 15, 5]}, [30, 15, 31]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [1, 25], [6, 20], [5, 25]], 'min_green': [20, 20, 10, 15]}, [40, 20, 30, 21]), ({'cycle': 85, 'lost': 10, 'ratios': [[6, 25], [9, 10]], 'min_green': [10, 7]}, [16, 59]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10], [1, 25], [4, 10]], 'min_green': [7, 20, 5, 20]}, [29, 31, 5, 30])], [({'cycle': 60, 'lost': 11, 'ratios': [[3, 25], [9, 20]], 'min_green': [5, 10]}, [10, 39]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10], [3, 10]], 'min_green': [20, 5, 20, 20]}, [20, 17, 20, 20]), ({'cycle': 85, 'lost': 9, 'ratios': [[7, 10], [7, 10], [2, 20], [3, 10]], 'min_green': [15, 5, 20, 7]}, [26, 17, 20, 13]), ({'cycle': 70, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [15, 5, 5, 15]}, [16, 16, 15, 15]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 100, 'lost': 9, 'ratios': [[6, 10], [2, 20], [9, 10], [1, 25]], 'min_green': [10, 20, 20, 20]}, [20, 20, 31, 20])], [({'cycle': 85, 'lost': 9, 'ratios': [[2, 20], [2, 20], [9, 20]], 'min_green': [10, 15, 15]}, [12, 15, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[9, 10], [4, 10], [2, 25]], 'min_green': [15, 5, 10]}, [51, 25, 10]), ({'cycle': 80, 'lost': 9, 'ratios': [[9, 25], [5, 20], [6, 10], [5, 25]], 'min_green': [7, 15, 10, 20]}, [16, 15, 20, 20]), ({'cycle': 70, 'lost': 11, 'ratios': [[5, 10], [1, 20], [6, 25], [4, 10]], 'min_green': [15, 15, 5, 7]}, [20, 15, 11, 13]), ({'cycle': 90, 'lost': 15, 'ratios': [[5, 20], [3, 10], [1, 25]], 'min_green': [5, 15, 15]}, [25, 35, 15]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 12, 'ratios': [[7, 10], [9, 10], [9, 25], [9, 25]], 'min_green': [5, 20, 15, 5]}, [19, 28, 15, 11]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27])], [({'cycle': 125, 'lost': 13, 'ratios': [[9, 10], [6, 10], [7, 25], [1, 10]], 'min_green': [15, 7, 10, 15]}, [44, 36, 17, 15]), ({'cycle': 95, 'lost': 15, 'ratios': [[8, 25], [8, 10], [8, 10]], 'min_green': [20, 10, 7]}, [20, 31, 29]), ({'cycle': 70, 'lost': 13, 'ratios': [[7, 25], [2, 20], [6, 10], [4, 10]], 'min_green': [10, 10, 15, 5]}, [12, 10, 22, 13]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 12, 'ratios': [[6, 20], [1, 20], [9, 25]], 'min_green': [20, 15, 20]}, [50, 15, 53]), ({'cycle': 125, 'lost': 11, 'ratios': [[1, 25], [5, 25], [1, 10], [6, 25]], 'min_green': [20, 20, 7, 15]}, [20, 39, 20, 35]), ({'cycle': 120, 'lost': 16, 'ratios': [[5, 25], [5, 20], [7, 20], [2, 10]], 'min_green': [5, 10, 5, 20]}, [21, 26, 36, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])]]
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, 12, 25, 19][20, 11, 25, 20]Failed
timing oracle 1[27, 10, 22][27, 10, 22]Passed
timing oracle 2[22, 22, 22, 22][22, 22, 22, 22]Passed
timing oracle 3[43, 45, 28][43, 45, 28]Passed
timing oracle 4[21, 10, 8, 10][21, 10, 8, 10]Passed
timing oracle 5[20, 35][20, 35]Passed
timing oracle 6[20, 32, 24, 31][20, 31, 24, 32]Failed
timing oracle 7[15, 15, 15, 24][15, 15, 15, 24]Passed

SHA-256 / d910c7633d83e8ecebf0565e652f8408464e81b26da31343d44ef52bdb247b8d

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': 85, 'lost': 9, 'ratios': [[1, 10], [4, 25], [7, 20], [8, 20]], 'min_green': [20, 7, 20, 15]}, [20, 11, 25, 20]), ({'cycle': 75, 'lost': 16, 'ratios': [[7, 10], [4, 20], [6, 10]], 'min_green': [20, 10, 10]}, [27, 10, 22]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 125, 'lost': 9, 'ratios': [[3, 10], [8, 25], [5, 25]], 'min_green': [15, 7, 10]}, [43, 45, 28]), ({'cycle': 65, 'lost': 16, 'ratios': [[7, 25], [2, 20], [1, 10], [1, 20]], 'min_green': [20, 10, 7, 10]}, [21, 10, 8, 10]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 115, 'lost': 8, 'ratios': [[1, 20], [8, 10], [8, 10], [9, 10]], 'min_green': [20, 15, 7, 15]}, [20, 31, 24, 32]), ({'cycle': 80, 'lost': 11, 'ratios': [[3, 20], [3, 25], [1, 10], [9, 10]], 'min_green': [15, 15, 15, 5]}, [15, 15, 15, 24])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [6, 25], [9, 20], [5, 20]], 'min_green': [15, 5, 10, 20]}, [23, 11, 19, 20]), ({'cycle': 70, 'lost': 12, 'ratios': [[9, 20], [2, 20], [5, 10]], 'min_green': [7, 20, 15]}, [15, 20, 23]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 85, 'lost': 9, 'ratios': [[8, 20], [1, 20], [8, 25]], 'min_green': [5, 15, 5]}, [30, 15, 31]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [1, 25], [6, 20], [5, 25]], 'min_green': [20, 20, 10, 15]}, [40, 20, 30, 21]), ({'cycle': 85, 'lost': 10, 'ratios': [[6, 25], [9, 10]], 'min_green': [10, 7]}, [16, 59]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10], [1, 25], [4, 10]], 'min_green': [7, 20, 5, 20]}, [29, 31, 5, 30])], [({'cycle': 60, 'lost': 11, 'ratios': [[3, 25], [9, 20]], 'min_green': [5, 10]}, [10, 39]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 10], [3, 10], [3, 10], [3, 10]], 'min_green': [20, 5, 20, 20]}, [20, 17, 20, 20]), ({'cycle': 85, 'lost': 9, 'ratios': [[7, 10], [7, 10], [2, 20], [3, 10]], 'min_green': [15, 5, 20, 7]}, [26, 17, 20, 13]), ({'cycle': 70, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [15, 5, 5, 15]}, [16, 16, 15, 15]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 100, 'lost': 9, 'ratios': [[6, 10], [2, 20], [9, 10], [1, 25]], 'min_green': [10, 20, 20, 20]}, [20, 20, 31, 20])], [({'cycle': 85, 'lost': 9, 'ratios': [[2, 20], [2, 20], [9, 20]], 'min_green': [10, 15, 15]}, [12, 15, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[9, 10], [4, 10], [2, 25]], 'min_green': [15, 5, 10]}, [51, 25, 10]), ({'cycle': 80, 'lost': 9, 'ratios': [[9, 25], [5, 20], [6, 10], [5, 25]], 'min_green': [7, 15, 10, 20]}, [16, 15, 20, 20]), ({'cycle': 70, 'lost': 11, 'ratios': [[5, 10], [1, 20], [6, 25], [4, 10]], 'min_green': [15, 15, 5, 7]}, [20, 15, 11, 13]), ({'cycle': 90, 'lost': 15, 'ratios': [[5, 20], [3, 10], [1, 25]], 'min_green': [5, 15, 15]}, [25, 35, 15]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 85, 'lost': 12, 'ratios': [[7, 10], [9, 10], [9, 25], [9, 25]], 'min_green': [5, 20, 15, 5]}, [19, 28, 15, 11]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27])], [({'cycle': 125, 'lost': 13, 'ratios': [[9, 10], [6, 10], [7, 25], [1, 10]], 'min_green': [15, 7, 10, 15]}, [44, 36, 17, 15]), ({'cycle': 95, 'lost': 15, 'ratios': [[8, 25], [8, 10], [8, 10]], 'min_green': [20, 10, 7]}, [20, 31, 29]), ({'cycle': 70, 'lost': 13, 'ratios': [[7, 25], [2, 20], [6, 10], [4, 10]], 'min_green': [10, 10, 15, 5]}, [12, 10, 22, 13]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 12, 'ratios': [[6, 20], [1, 20], [9, 25]], 'min_green': [20, 15, 20]}, [50, 15, 53]), ({'cycle': 125, 'lost': 11, 'ratios': [[1, 25], [5, 25], [1, 10], [6, 25]], 'min_green': [20, 20, 7, 15]}, [20, 39, 20, 35]), ({'cycle': 120, 'lost': 16, 'ratios': [[5, 25], [5, 20], [7, 20], [2, 10]], 'min_green': [5, 10, 5, 20]}, [21, 26, 36, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])]]
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, 11, 25, 20][20, 11, 25, 20]Passed
timing oracle 1[27, 10, 22][27, 10, 22]Passed
timing oracle 2[22, 22, 22, 22][22, 22, 22, 22]Passed
timing oracle 3[43, 45, 28][43, 45, 28]Passed
timing oracle 4[21, 10, 8, 10][21, 10, 8, 10]Passed
timing oracle 5[20, 35][20, 35]Passed
timing oracle 6[20, 31, 24, 32][20, 31, 24, 32]Passed
timing oracle 7[15, 15, 15, 24][15, 15, 15, 24]Passed

SHA-256 / 17beb014b0bfebdeda5eb90322b2262a7869b3cc5eb71b48e0da8dd4ca464593

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

Case digest / e6534cdafd9e0527a09a98aefc6726558fefd905ec66195c839b53c7df8c9e31