FA-67891 / Traffic signal timing plans / Open access
Green split allocation: feasibility compares the single largest minimum with G · case 01
Green split allocation returns a wrong result when feasibility compares the single largest minimum with G.
ROOT CAUSE
Only the largest minimum is compared with G, so plans whose minima jointly exceed the effective green are not reported infeasible.
VERIFIED REPAIR
Restore the feasibility check rule so that the step reads `if sum(mins) > G:`.
Unsuccessful approach: An inclusive comparison rejects the exactly feasible case where the minima use all of G.
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 max(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': 12, 'ratios': [[6, 20], [5, 10]], 'min_green': [10, 15]}, [27, 46]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 75, 'lost': 10, 'ratios': [[1, 20], [6, 10], [1, 10], [2, 10]], 'min_green': [5, 15, 5, 10]}, [5, 39, 7, 14]), ({'cycle': 90, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [10, 5, 5, 15]}, [21, 21, 20, 20]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 20, 20, 5]}, 'infeasible'), ({'cycle': 80, 'lost': 14, 'ratios': [[6, 10], [2, 10], [6, 25]], 'min_green': [5, 15, 15]}, [36, 15, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 16, 'ratios': [[9, 10], [7, 10], [3, 25], [6, 10]], 'min_green': [15, 20, 20, 10]}, 'infeasible')], [({'cycle': 80, 'lost': 10, 'ratios': [[3, 10], [3, 10]], 'min_green': [10, 7]}, [35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[8, 10], [8, 20], [4, 10], [9, 25]], 'min_green': [10, 15, 20, 7]}, 'infeasible'), ({'cycle': 90, 'lost': 14, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [7, 20, 10, 20]}, [17, 20, 19, 20]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 80, 'lost': 15, 'ratios': [[2, 20], [9, 25], [4, 20], [3, 25]], 'min_green': [15, 20, 15, 20]}, 'infeasible'), ({'cycle': 105, 'lost': 12, 'ratios': [[4, 20], [4, 20]], 'min_green': [10, 15]}, [47, 46])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 8, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20, 10]}, [27, 27, 27, 26]), ({'cycle': 130, 'lost': 13, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 10, 5, 10]}, [30, 29, 29, 29]), ({'cycle': 90, 'lost': 9, 'ratios': [[8, 10], [4, 20]], 'min_green': [20, 20]}, [61, 20]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 11, 'ratios': [[4, 25], [8, 10], [9, 20], [4, 20]], 'min_green': [20, 20, 20, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[7, 20], [4, 25], [6, 25]], 'min_green': [15, 7, 5]}, [46, 21, 31]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22])], [({'cycle': 130, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [20, 20, 20]}, [41, 40, 40]), ({'cycle': 60, 'lost': 13, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 5]}, 'infeasible'), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 25], [8, 10], [8, 10], [7, 25]], 'min_green': [5, 10, 5, 10]}, [10, 21, 18, 10]), ({'cycle': 120, 'lost': 9, 'ratios': [[2, 10], [6, 10], [1, 10], [1, 25]], 'min_green': [10, 5, 5, 5]}, [23, 71, 12, 5]), ({'cycle': 110, 'lost': 15, 'ratios': [[4, 20], [9, 25]], 'min_green': [15, 7]}, [34, 61]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[4, 20], [4, 20]], 'min_green': [7, 10]}, [42, 42]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28])], [({'cycle': 120, 'lost': 11, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 15, 7]}, [37, 36, 36]), ({'cycle': 75, 'lost': 8, 'ratios': [[2, 20], [3, 10], [8, 10]], 'min_green': [7, 20, 15]}, [7, 20, 40]), ({'cycle': 60, 'lost': 11, 'ratios': [[6, 20], [5, 25], [9, 25], [6, 20]], 'min_green': [10, 20, 5, 15]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[1, 10], [1, 10]], 'min_green': [10, 5]}, [46, 45]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 14, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [20, 7, 15, 5]}, [20, 19, 19, 18]), ({'cycle': 125, 'lost': 8, 'ratios': [[8, 20], [8, 10]], 'min_green': [20, 20]}, [39, 78])]]
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 | [27, 46] | [27, 46] | Passed |
| timing oracle 1 | [20, 20, 28] | [20, 20, 28] | Passed |
| timing oracle 2 | [5, 39, 7, 14] | [5, 39, 7, 14] | Passed |
| timing oracle 3 | [21, 21, 20, 20] | [21, 21, 20, 20] | Passed |
| timing oracle 4 | [8, 19, 19, 5] | infeasible | Failed |
| timing oracle 5 | [36, 15, 15] | [36, 15, 15] | Passed |
| timing oracle 6 | [20, 35] | [20, 35] | Passed |
| timing oracle 7 | [14, 20, 20, 10] | infeasible | Failed |
SHA-256 / ae56fdbbef8336146607499a0e1498111c183f2a16d86ecaf4e9ad49d27cde49
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': 12, 'ratios': [[6, 20], [5, 10]], 'min_green': [10, 15]}, [27, 46]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 75, 'lost': 10, 'ratios': [[1, 20], [6, 10], [1, 10], [2, 10]], 'min_green': [5, 15, 5, 10]}, [5, 39, 7, 14]), ({'cycle': 90, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [10, 5, 5, 15]}, [21, 21, 20, 20]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 20, 20, 5]}, 'infeasible'), ({'cycle': 80, 'lost': 14, 'ratios': [[6, 10], [2, 10], [6, 25]], 'min_green': [5, 15, 15]}, [36, 15, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 16, 'ratios': [[9, 10], [7, 10], [3, 25], [6, 10]], 'min_green': [15, 20, 20, 10]}, 'infeasible')], [({'cycle': 80, 'lost': 10, 'ratios': [[3, 10], [3, 10]], 'min_green': [10, 7]}, [35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[8, 10], [8, 20], [4, 10], [9, 25]], 'min_green': [10, 15, 20, 7]}, 'infeasible'), ({'cycle': 90, 'lost': 14, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [7, 20, 10, 20]}, [17, 20, 19, 20]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 80, 'lost': 15, 'ratios': [[2, 20], [9, 25], [4, 20], [3, 25]], 'min_green': [15, 20, 15, 20]}, 'infeasible'), ({'cycle': 105, 'lost': 12, 'ratios': [[4, 20], [4, 20]], 'min_green': [10, 15]}, [47, 46])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 8, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20, 10]}, [27, 27, 27, 26]), ({'cycle': 130, 'lost': 13, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 10, 5, 10]}, [30, 29, 29, 29]), ({'cycle': 90, 'lost': 9, 'ratios': [[8, 10], [4, 20]], 'min_green': [20, 20]}, [61, 20]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 11, 'ratios': [[4, 25], [8, 10], [9, 20], [4, 20]], 'min_green': [20, 20, 20, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[7, 20], [4, 25], [6, 25]], 'min_green': [15, 7, 5]}, [46, 21, 31]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22])], [({'cycle': 130, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [20, 20, 20]}, [41, 40, 40]), ({'cycle': 60, 'lost': 13, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 5]}, 'infeasible'), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 25], [8, 10], [8, 10], [7, 25]], 'min_green': [5, 10, 5, 10]}, [10, 21, 18, 10]), ({'cycle': 120, 'lost': 9, 'ratios': [[2, 10], [6, 10], [1, 10], [1, 25]], 'min_green': [10, 5, 5, 5]}, [23, 71, 12, 5]), ({'cycle': 110, 'lost': 15, 'ratios': [[4, 20], [9, 25]], 'min_green': [15, 7]}, [34, 61]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[4, 20], [4, 20]], 'min_green': [7, 10]}, [42, 42]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28])], [({'cycle': 120, 'lost': 11, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 15, 7]}, [37, 36, 36]), ({'cycle': 75, 'lost': 8, 'ratios': [[2, 20], [3, 10], [8, 10]], 'min_green': [7, 20, 15]}, [7, 20, 40]), ({'cycle': 60, 'lost': 11, 'ratios': [[6, 20], [5, 25], [9, 25], [6, 20]], 'min_green': [10, 20, 5, 15]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[1, 10], [1, 10]], 'min_green': [10, 5]}, [46, 45]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 14, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [20, 7, 15, 5]}, [20, 19, 19, 18]), ({'cycle': 125, 'lost': 8, 'ratios': [[8, 20], [8, 10]], 'min_green': [20, 20]}, [39, 78])]]
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 | [27, 46] | [27, 46] | Passed |
| timing oracle 1 | infeasible | [20, 20, 28] | Failed |
| timing oracle 2 | [5, 39, 7, 14] | [5, 39, 7, 14] | Passed |
| timing oracle 3 | [21, 21, 20, 20] | [21, 21, 20, 20] | Passed |
| timing oracle 4 | infeasible | infeasible | Passed |
| timing oracle 5 | [36, 15, 15] | [36, 15, 15] | Passed |
| timing oracle 6 | infeasible | [20, 35] | Failed |
| timing oracle 7 | infeasible | infeasible | Passed |
SHA-256 / 2c8dcb42d11b245f701ab8f9c32fc9a65847b776fca2bd417f9004b8b6b6a657
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': 12, 'ratios': [[6, 20], [5, 10]], 'min_green': [10, 15]}, [27, 46]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 75, 'lost': 10, 'ratios': [[1, 20], [6, 10], [1, 10], [2, 10]], 'min_green': [5, 15, 5, 10]}, [5, 39, 7, 14]), ({'cycle': 90, 'lost': 8, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [10, 5, 5, 15]}, [21, 21, 20, 20]), ({'cycle': 65, 'lost': 14, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 20, 20, 5]}, 'infeasible'), ({'cycle': 80, 'lost': 14, 'ratios': [[6, 10], [2, 10], [6, 25]], 'min_green': [5, 15, 15]}, [36, 15, 15]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 16, 'ratios': [[9, 10], [7, 10], [3, 25], [6, 10]], 'min_green': [15, 20, 20, 10]}, 'infeasible')], [({'cycle': 80, 'lost': 10, 'ratios': [[3, 10], [3, 10]], 'min_green': [10, 7]}, [35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 65, 'lost': 14, 'ratios': [[8, 10], [8, 20], [4, 10], [9, 25]], 'min_green': [10, 15, 20, 7]}, 'infeasible'), ({'cycle': 90, 'lost': 14, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [7, 20, 10, 20]}, [17, 20, 19, 20]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 80, 'lost': 15, 'ratios': [[2, 20], [9, 25], [4, 20], [3, 25]], 'min_green': [15, 20, 15, 20]}, 'infeasible'), ({'cycle': 105, 'lost': 12, 'ratios': [[4, 20], [4, 20]], 'min_green': [10, 15]}, [47, 46])], [({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 8, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20, 10]}, [27, 27, 27, 26]), ({'cycle': 130, 'lost': 13, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 10, 5, 10]}, [30, 29, 29, 29]), ({'cycle': 90, 'lost': 9, 'ratios': [[8, 10], [4, 20]], 'min_green': [20, 20]}, [61, 20]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 80, 'lost': 11, 'ratios': [[4, 25], [8, 10], [9, 20], [4, 20]], 'min_green': [20, 20, 20, 15]}, 'infeasible'), ({'cycle': 110, 'lost': 12, 'ratios': [[7, 20], [4, 25], [6, 25]], 'min_green': [15, 7, 5]}, [46, 21, 31]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22])], [({'cycle': 130, 'lost': 9, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [20, 20, 20]}, [41, 40, 40]), ({'cycle': 60, 'lost': 13, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 5]}, 'infeasible'), ({'cycle': 75, 'lost': 16, 'ratios': [[9, 25], [8, 10], [8, 10], [7, 25]], 'min_green': [5, 10, 5, 10]}, [10, 21, 18, 10]), ({'cycle': 120, 'lost': 9, 'ratios': [[2, 10], [6, 10], [1, 10], [1, 25]], 'min_green': [10, 5, 5, 5]}, [23, 71, 12, 5]), ({'cycle': 110, 'lost': 15, 'ratios': [[4, 20], [9, 25]], 'min_green': [15, 7]}, [34, 61]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 100, 'lost': 16, 'ratios': [[4, 20], [4, 20]], 'min_green': [7, 10]}, [42, 42]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28])], [({'cycle': 120, 'lost': 11, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 15, 7]}, [37, 36, 36]), ({'cycle': 75, 'lost': 8, 'ratios': [[2, 20], [3, 10], [8, 10]], 'min_green': [7, 20, 15]}, [7, 20, 40]), ({'cycle': 60, 'lost': 11, 'ratios': [[6, 20], [5, 25], [9, 25], [6, 20]], 'min_green': [10, 20, 5, 15]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[1, 10], [1, 10]], 'min_green': [10, 5]}, [46, 45]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 90, 'lost': 14, 'ratios': [[5, 20], [5, 20], [5, 20], [5, 20]], 'min_green': [20, 7, 15, 5]}, [20, 19, 19, 18]), ({'cycle': 125, 'lost': 8, 'ratios': [[8, 20], [8, 10]], 'min_green': [20, 20]}, [39, 78])]]
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 | [27, 46] | [27, 46] | Passed |
| timing oracle 1 | [20, 20, 28] | [20, 20, 28] | Passed |
| timing oracle 2 | [5, 39, 7, 14] | [5, 39, 7, 14] | Passed |
| timing oracle 3 | [21, 21, 20, 20] | [21, 21, 20, 20] | Passed |
| timing oracle 4 | infeasible | infeasible | Passed |
| timing oracle 5 | [36, 15, 15] | [36, 15, 15] | Passed |
| timing oracle 6 | [20, 35] | [20, 35] | Passed |
| timing oracle 7 | infeasible | infeasible | Passed |
SHA-256 / 116179c22c14dfb33c42d79485b8355cde91e08ea25c1176a38dce5469eab5af
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.130166+00:00.
Case digest / d926ddbc0259140c00bb150de98d05c69467c1b33428c851e58b0204cac7d135