FAILURE MAP
← Case archive

FA-67881 / Traffic signal timing plans / Open access

Green split allocation: base shares are rounded to nearest before remainder distribution · case 01

Green split allocation returns a wrong result when base shares are rounded to nearest before remainder distribution.

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

ROOT CAUSE

Rounding the base shares can overshoot G, making the leftover count negative and the slice silently wrong.

VERIFIED REPAIR

Restore the base share rounding rule so that the step reads `g = [int(v) for v in ideal]`.

Unsuccessful approach: Half-up rounding still overshoots G whenever several phases round up at once.

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 = [round(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': 130, 'lost': 13, 'ratios': [[2, 25], [4, 25], [8, 10], [9, 20]], 'min_green': [20, 20, 7, 5]}, [20, 20, 42, 35]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [7, 10, 10, 15]}, [10, 13, 13, 15]), ({'cycle': 60, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [15, 10, 20, 7]}, 'infeasible'), ({'cycle': 130, 'lost': 15, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [7, 15, 5, 5]}, [29, 29, 29, 28]), ({'cycle': 65, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 5, 20]}, [18, 16, 20])], [({'cycle': 90, 'lost': 15, 'ratios': [[7, 10], [9, 10], [5, 10], [8, 10]], 'min_green': [15, 15, 10, 15]}, [18, 23, 13, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 110, 'lost': 8, 'ratios': [[1, 20], [3, 10], [8, 25]], 'min_green': [20, 20, 20]}, [20, 41, 41]), ({'cycle': 80, 'lost': 16, 'ratios': [[5, 10], [7, 20], [9, 20], [8, 25]], 'min_green': [7, 10, 7, 20]}, [15, 14, 15, 20]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 75, 'lost': 13, 'ratios': [[1, 10], [5, 10], [7, 25], [9, 10]], 'min_green': [5, 20, 15, 7]}, [5, 20, 15, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 10], [9, 10]], 'min_green': [5, 7]}, [30, 29])], [({'cycle': 125, 'lost': 10, 'ratios': [[7, 20], [5, 25], [8, 20]], 'min_green': [20, 10, 15]}, [42, 24, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [5, 15, 5]}, [29, 29, 28]), ({'cycle': 95, 'lost': 8, 'ratios': [[4, 25], [2, 25]], 'min_green': [5, 15]}, [58, 29]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 110, 'lost': 15, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [20, 10, 7]}, [32, 32, 31]), ({'cycle': 80, 'lost': 11, 'ratios': [[6, 20], [5, 20], [1, 10]], 'min_green': [15, 10, 10]}, [32, 26, 11]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 125, 'lost': 14, 'ratios': [[2, 10], [2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10, 7]}, [28, 28, 28, 27]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 11, 'ratios': [[6, 20], [9, 10]], 'min_green': [7, 5]}, [22, 67]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[5, 25], [1, 25]], 'min_green': [20, 15]}, [39, 15]), ({'cycle': 80, 'lost': 8, 'ratios': [[6, 10], [3, 20], [8, 20], [6, 25]], 'min_green': [10, 15, 15, 7]}, [24, 15, 21, 12]), ({'cycle': 75, 'lost': 8, 'ratios': [[7, 10], [5, 20], [8, 25], [7, 10]], 'min_green': [20, 7, 15, 7]}, [24, 8, 15, 20])], [({'cycle': 115, 'lost': 13, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [15, 10, 15, 7]}, [26, 26, 25, 25]), ({'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': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 5, 20, 7]}, [20, 18, 20, 19]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [9, 10]], 'min_green': [7, 10]}, [7, 77]), ({'cycle': 70, 'lost': 15, 'ratios': [[4, 20], [4, 20]], 'min_green': [5, 7]}, [28, 27]), ({'cycle': 110, 'lost': 9, 'ratios': [[4, 20], [4, 20], [4, 20]], 'min_green': [10, 15, 20]}, [34, 34, 33])]]
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, 37][20, 35]Failed
timing oracle 1[20, 20, 42, 35][20, 20, 42, 35]Passed
timing oracle 2[26, 26, 26][26, 26, 26]Passed
timing oracle 3[35, 15][35, 15]Passed
timing oracle 4[12, 14, 14, 15][10, 13, 13, 15]Failed
timing oracle 5infeasibleinfeasiblePassed
timing oracle 6[30, 30, 30, 29][29, 29, 29, 28]Failed
timing oracle 7[18, 16, 20][18, 16, 20]Passed

SHA-256 / 5893745e9e78fae1d7cc774fd9429e6e5d2e9d515bf745f65b512ead8fce0a3b

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 + Fraction(1, 2)) 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': 130, 'lost': 13, 'ratios': [[2, 25], [4, 25], [8, 10], [9, 20]], 'min_green': [20, 20, 7, 5]}, [20, 20, 42, 35]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [7, 10, 10, 15]}, [10, 13, 13, 15]), ({'cycle': 60, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [15, 10, 20, 7]}, 'infeasible'), ({'cycle': 130, 'lost': 15, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [7, 15, 5, 5]}, [29, 29, 29, 28]), ({'cycle': 65, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 5, 20]}, [18, 16, 20])], [({'cycle': 90, 'lost': 15, 'ratios': [[7, 10], [9, 10], [5, 10], [8, 10]], 'min_green': [15, 15, 10, 15]}, [18, 23, 13, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 110, 'lost': 8, 'ratios': [[1, 20], [3, 10], [8, 25]], 'min_green': [20, 20, 20]}, [20, 41, 41]), ({'cycle': 80, 'lost': 16, 'ratios': [[5, 10], [7, 20], [9, 20], [8, 25]], 'min_green': [7, 10, 7, 20]}, [15, 14, 15, 20]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 75, 'lost': 13, 'ratios': [[1, 10], [5, 10], [7, 25], [9, 10]], 'min_green': [5, 20, 15, 7]}, [5, 20, 15, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 10], [9, 10]], 'min_green': [5, 7]}, [30, 29])], [({'cycle': 125, 'lost': 10, 'ratios': [[7, 20], [5, 25], [8, 20]], 'min_green': [20, 10, 15]}, [42, 24, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [5, 15, 5]}, [29, 29, 28]), ({'cycle': 95, 'lost': 8, 'ratios': [[4, 25], [2, 25]], 'min_green': [5, 15]}, [58, 29]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 110, 'lost': 15, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [20, 10, 7]}, [32, 32, 31]), ({'cycle': 80, 'lost': 11, 'ratios': [[6, 20], [5, 20], [1, 10]], 'min_green': [15, 10, 10]}, [32, 26, 11]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 125, 'lost': 14, 'ratios': [[2, 10], [2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10, 7]}, [28, 28, 28, 27]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 11, 'ratios': [[6, 20], [9, 10]], 'min_green': [7, 5]}, [22, 67]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[5, 25], [1, 25]], 'min_green': [20, 15]}, [39, 15]), ({'cycle': 80, 'lost': 8, 'ratios': [[6, 10], [3, 20], [8, 20], [6, 25]], 'min_green': [10, 15, 15, 7]}, [24, 15, 21, 12]), ({'cycle': 75, 'lost': 8, 'ratios': [[7, 10], [5, 20], [8, 25], [7, 10]], 'min_green': [20, 7, 15, 7]}, [24, 8, 15, 20])], [({'cycle': 115, 'lost': 13, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [15, 10, 15, 7]}, [26, 26, 25, 25]), ({'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': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 5, 20, 7]}, [20, 18, 20, 19]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [9, 10]], 'min_green': [7, 10]}, [7, 77]), ({'cycle': 70, 'lost': 15, 'ratios': [[4, 20], [4, 20]], 'min_green': [5, 7]}, [28, 27]), ({'cycle': 110, 'lost': 9, 'ratios': [[4, 20], [4, 20], [4, 20]], 'min_green': [10, 15, 20]}, [34, 34, 33])]]
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, 37][20, 35]Failed
timing oracle 1[20, 20, 42, 35][20, 20, 42, 35]Passed
timing oracle 2[26, 26, 26][26, 26, 26]Passed
timing oracle 3[35, 15][35, 15]Passed
timing oracle 4[12, 14, 14, 15][10, 13, 13, 15]Failed
timing oracle 5infeasibleinfeasiblePassed
timing oracle 6[30, 30, 30, 29][29, 29, 29, 28]Failed
timing oracle 7[18, 16, 20][18, 16, 20]Passed

SHA-256 / b428bc06384b6d6e7c0fe3506b328705d3566b958763588df2a9ba9605e6e51d

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': 130, 'lost': 13, 'ratios': [[2, 25], [4, 25], [8, 10], [9, 20]], 'min_green': [20, 20, 7, 5]}, [20, 20, 42, 35]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [7, 10, 10, 15]}, [10, 13, 13, 15]), ({'cycle': 60, 'lost': 9, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [15, 10, 20, 7]}, 'infeasible'), ({'cycle': 130, 'lost': 15, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [7, 15, 5, 5]}, [29, 29, 29, 28]), ({'cycle': 65, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [7, 5, 20]}, [18, 16, 20])], [({'cycle': 90, 'lost': 15, 'ratios': [[7, 10], [9, 10], [5, 10], [8, 10]], 'min_green': [15, 15, 10, 15]}, [18, 23, 13, 21]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 110, 'lost': 8, 'ratios': [[1, 20], [3, 10], [8, 25]], 'min_green': [20, 20, 20]}, [20, 41, 41]), ({'cycle': 80, 'lost': 16, 'ratios': [[5, 10], [7, 20], [9, 20], [8, 25]], 'min_green': [7, 10, 7, 20]}, [15, 14, 15, 20]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 75, 'lost': 13, 'ratios': [[1, 10], [5, 10], [7, 25], [9, 10]], 'min_green': [5, 20, 15, 7]}, [5, 20, 15, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 10], [9, 10]], 'min_green': [5, 7]}, [30, 29])], [({'cycle': 125, 'lost': 10, 'ratios': [[7, 20], [5, 25], [8, 20]], 'min_green': [20, 10, 15]}, [42, 24, 49]), ({'cycle': 95, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [5, 15, 5]}, [29, 29, 28]), ({'cycle': 95, 'lost': 8, 'ratios': [[4, 25], [2, 25]], 'min_green': [5, 15]}, [58, 29]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 110, 'lost': 15, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [20, 10, 7]}, [32, 32, 31]), ({'cycle': 80, 'lost': 11, 'ratios': [[6, 20], [5, 20], [1, 10]], 'min_green': [15, 10, 10]}, [32, 26, 11]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 125, 'lost': 14, 'ratios': [[2, 10], [2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10, 7]}, [28, 28, 28, 27]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 11, 'ratios': [[6, 20], [9, 10]], 'min_green': [7, 5]}, [22, 67]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 70, 'lost': 16, 'ratios': [[5, 25], [1, 25]], 'min_green': [20, 15]}, [39, 15]), ({'cycle': 80, 'lost': 8, 'ratios': [[6, 10], [3, 20], [8, 20], [6, 25]], 'min_green': [10, 15, 15, 7]}, [24, 15, 21, 12]), ({'cycle': 75, 'lost': 8, 'ratios': [[7, 10], [5, 20], [8, 25], [7, 10]], 'min_green': [20, 7, 15, 7]}, [24, 8, 15, 20])], [({'cycle': 115, 'lost': 13, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [15, 10, 15, 7]}, [26, 26, 25, 25]), ({'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': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 5, 20, 7]}, [20, 18, 20, 19]), ({'cycle': 100, 'lost': 16, 'ratios': [[1, 20], [9, 10]], 'min_green': [7, 10]}, [7, 77]), ({'cycle': 70, 'lost': 15, 'ratios': [[4, 20], [4, 20]], 'min_green': [5, 7]}, [28, 27]), ({'cycle': 110, 'lost': 9, 'ratios': [[4, 20], [4, 20], [4, 20]], 'min_green': [10, 15, 20]}, [34, 34, 33])]]
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[20, 20, 42, 35][20, 20, 42, 35]Passed
timing oracle 2[26, 26, 26][26, 26, 26]Passed
timing oracle 3[35, 15][35, 15]Passed
timing oracle 4[10, 13, 13, 15][10, 13, 13, 15]Passed
timing oracle 5infeasibleinfeasiblePassed
timing oracle 6[29, 29, 29, 28][29, 29, 29, 28]Passed
timing oracle 7[18, 16, 20][18, 16, 20]Passed

SHA-256 / 0ce3abede140df6006f6b1a01a673145fbe5e7aca60282d8aa44804fdc830b45

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

Case digest / ed8b1c0cdb673452f69debb453d4a368e952090a371b0d85d09fc435981c002a