FA-67886 / Traffic signal timing plans / Open access
Green split allocation: critical flow ratios are read as den over num · case 01
Green split allocation returns a wrong result when critical flow ratios are read as den over num.
ROOT CAUSE
The [num, den] pair is unpacked in the wrong order, so every phase uses the reciprocal of its flow ratio and light phases get the most green.
VERIFIED REPAIR
Restore the flow ratio parsing rule so that the step reads `Fraction(a, b)`.
Unsuccessful approach: Rounding through a float to one decimal still distorts the proportions of ratios such as 3/20.
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(b, a) 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': 80, 'lost': 13, 'ratios': [[2, 20], [9, 25], [7, 10], [3, 20]], 'min_green': [20, 20, 5, 7]}, [20, 20, 19, 8]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 85, 'lost': 9, 'ratios': [[6, 20], [1, 20], [6, 25], [9, 10]], 'min_green': [5, 7, 10, 7]}, [15, 7, 12, 42]), ({'cycle': 120, 'lost': 13, 'ratios': [[6, 20], [6, 20]], 'min_green': [20, 15]}, [54, 53]), ({'cycle': 75, 'lost': 10, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [15, 15, 5, 7]}, [17, 16, 16, 16]), ({'cycle': 80, 'lost': 16, 'ratios': [[2, 20], [7, 10]], 'min_green': [10, 7]}, [10, 54])], [({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [9, 20], [6, 10]], 'min_green': [10, 10, 5]}, [14, 25, 33]), ({'cycle': 65, 'lost': 8, 'ratios': [[9, 10], [6, 20]], 'min_green': [15, 10]}, [43, 14]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 125, 'lost': 10, 'ratios': [[9, 10], [9, 20]], 'min_green': [7, 7]}, [77, 38]), ({'cycle': 115, 'lost': 9, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 10, 20]}, [36, 35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 130, 'lost': 9, 'ratios': [[5, 25], [4, 10], [5, 20], [7, 20]], 'min_green': [10, 20, 10, 7]}, [20, 41, 25, 35])], [({'cycle': 65, 'lost': 8, 'ratios': [[2, 20], [2, 20]], 'min_green': [20, 5]}, [29, 28]), ({'cycle': 130, 'lost': 11, 'ratios': [[6, 10], [7, 20], [8, 10]], 'min_green': [5, 10, 7]}, [41, 24, 54]), ({'cycle': 115, 'lost': 14, 'ratios': [[1, 10], [1, 25], [6, 25]], 'min_green': [15, 10, 7]}, [26, 11, 64]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [7, 20, 5, 5]}, [16, 20, 14, 14]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 12, 'ratios': [[3, 20], [2, 10]], 'min_green': [20, 5]}, [44, 59])], [({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 115, 'lost': 11, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [15, 20, 10]}, [35, 35, 34]), ({'cycle': 100, 'lost': 15, 'ratios': [[4, 25], [7, 10]], 'min_green': [5, 20]}, [16, 69]), ({'cycle': 65, 'lost': 10, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [5, 15, 7]}, [19, 18, 18]), ({'cycle': 65, 'lost': 15, 'ratios': [[5, 10], [9, 10], [8, 25]], 'min_green': [5, 15, 20]}, [10, 20, 20]), ({'cycle': 95, 'lost': 14, 'ratios': [[1, 10], [2, 25], [4, 20]], 'min_green': [7, 10, 7]}, [21, 17, 43])], [({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 120, 'lost': 15, 'ratios': [[7, 25], [9, 20]], 'min_green': [15, 20]}, [40, 65]), ({'cycle': 115, 'lost': 8, 'ratios': [[9, 10], [1, 25], [2, 10]], 'min_green': [10, 10, 5]}, [78, 10, 19]), ({'cycle': 130, 'lost': 8, 'ratios': [[7, 20], [6, 25]], 'min_green': [5, 20]}, [72, 50]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20]}, [24, 23, 23]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10]}, [24, 23, 23]), ({'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])]]
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, 20, 5, 15] | [20, 20, 19, 8] | Failed |
| timing oracle 1 | [20, 20, 28] | [20, 20, 28] | Passed |
| timing oracle 2 | [22, 22, 22, 22] | [22, 22, 22, 22] | Passed |
| timing oracle 3 | [6, 44] | [35, 15] | Failed |
| timing oracle 4 | [9, 49, 11, 7] | [15, 7, 12, 42] | Failed |
| timing oracle 5 | [54, 53] | [54, 53] | Passed |
| timing oracle 6 | [17, 16, 16, 16] | [17, 16, 16, 16] | Passed |
| timing oracle 7 | [56, 8] | [10, 54] | Failed |
SHA-256 / ade6d76d3edee1bdc2467b0e60b4127119af76530b846a70cdfbfbeca83cf154
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(round(a / b, 1)) 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': 80, 'lost': 13, 'ratios': [[2, 20], [9, 25], [7, 10], [3, 20]], 'min_green': [20, 20, 5, 7]}, [20, 20, 19, 8]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 85, 'lost': 9, 'ratios': [[6, 20], [1, 20], [6, 25], [9, 10]], 'min_green': [5, 7, 10, 7]}, [15, 7, 12, 42]), ({'cycle': 120, 'lost': 13, 'ratios': [[6, 20], [6, 20]], 'min_green': [20, 15]}, [54, 53]), ({'cycle': 75, 'lost': 10, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [15, 15, 5, 7]}, [17, 16, 16, 16]), ({'cycle': 80, 'lost': 16, 'ratios': [[2, 20], [7, 10]], 'min_green': [10, 7]}, [10, 54])], [({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [9, 20], [6, 10]], 'min_green': [10, 10, 5]}, [14, 25, 33]), ({'cycle': 65, 'lost': 8, 'ratios': [[9, 10], [6, 20]], 'min_green': [15, 10]}, [43, 14]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 125, 'lost': 10, 'ratios': [[9, 10], [9, 20]], 'min_green': [7, 7]}, [77, 38]), ({'cycle': 115, 'lost': 9, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 10, 20]}, [36, 35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 130, 'lost': 9, 'ratios': [[5, 25], [4, 10], [5, 20], [7, 20]], 'min_green': [10, 20, 10, 7]}, [20, 41, 25, 35])], [({'cycle': 65, 'lost': 8, 'ratios': [[2, 20], [2, 20]], 'min_green': [20, 5]}, [29, 28]), ({'cycle': 130, 'lost': 11, 'ratios': [[6, 10], [7, 20], [8, 10]], 'min_green': [5, 10, 7]}, [41, 24, 54]), ({'cycle': 115, 'lost': 14, 'ratios': [[1, 10], [1, 25], [6, 25]], 'min_green': [15, 10, 7]}, [26, 11, 64]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [7, 20, 5, 5]}, [16, 20, 14, 14]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 12, 'ratios': [[3, 20], [2, 10]], 'min_green': [20, 5]}, [44, 59])], [({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 115, 'lost': 11, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [15, 20, 10]}, [35, 35, 34]), ({'cycle': 100, 'lost': 15, 'ratios': [[4, 25], [7, 10]], 'min_green': [5, 20]}, [16, 69]), ({'cycle': 65, 'lost': 10, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [5, 15, 7]}, [19, 18, 18]), ({'cycle': 65, 'lost': 15, 'ratios': [[5, 10], [9, 10], [8, 25]], 'min_green': [5, 15, 20]}, [10, 20, 20]), ({'cycle': 95, 'lost': 14, 'ratios': [[1, 10], [2, 25], [4, 20]], 'min_green': [7, 10, 7]}, [21, 17, 43])], [({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 120, 'lost': 15, 'ratios': [[7, 25], [9, 20]], 'min_green': [15, 20]}, [40, 65]), ({'cycle': 115, 'lost': 8, 'ratios': [[9, 10], [1, 25], [2, 10]], 'min_green': [10, 10, 5]}, [78, 10, 19]), ({'cycle': 130, 'lost': 8, 'ratios': [[7, 20], [6, 25]], 'min_green': [5, 20]}, [72, 50]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20]}, [24, 23, 23]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10]}, [24, 23, 23]), ({'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])]]
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 | [20, 21, 19, 7] | [20, 20, 19, 8] | Failed |
| timing oracle 1 | [20, 20, 28] | [20, 20, 28] | Passed |
| timing oracle 2 | [22, 22, 22, 22] | [22, 22, 22, 22] | Passed |
| timing oracle 3 | [35, 15] | [35, 15] | Passed |
| timing oracle 4 | [15, 7, 10, 44] | [15, 7, 12, 42] | Failed |
| timing oracle 5 | [54, 53] | [54, 53] | Passed |
| timing oracle 6 | [17, 16, 16, 16] | [17, 16, 16, 16] | Passed |
| timing oracle 7 | [10, 54] | [10, 54] | Passed |
SHA-256 / 99503adb3de9c00dd2e90bccd6b024a48a0ec7716d2bfa2a477dfab6bb7b815f
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': 80, 'lost': 13, 'ratios': [[2, 20], [9, 25], [7, 10], [3, 20]], 'min_green': [20, 20, 5, 7]}, [20, 20, 19, 8]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 85, 'lost': 9, 'ratios': [[6, 20], [1, 20], [6, 25], [9, 10]], 'min_green': [5, 7, 10, 7]}, [15, 7, 12, 42]), ({'cycle': 120, 'lost': 13, 'ratios': [[6, 20], [6, 20]], 'min_green': [20, 15]}, [54, 53]), ({'cycle': 75, 'lost': 10, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [15, 15, 5, 7]}, [17, 16, 16, 16]), ({'cycle': 80, 'lost': 16, 'ratios': [[2, 20], [7, 10]], 'min_green': [10, 7]}, [10, 54])], [({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 85, 'lost': 13, 'ratios': [[5, 20], [9, 20], [6, 10]], 'min_green': [10, 10, 5]}, [14, 25, 33]), ({'cycle': 65, 'lost': 8, 'ratios': [[9, 10], [6, 20]], 'min_green': [15, 10]}, [43, 14]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 125, 'lost': 10, 'ratios': [[9, 10], [9, 20]], 'min_green': [7, 7]}, [77, 38]), ({'cycle': 115, 'lost': 9, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 10, 20]}, [36, 35, 35]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 130, 'lost': 9, 'ratios': [[5, 25], [4, 10], [5, 20], [7, 20]], 'min_green': [10, 20, 10, 7]}, [20, 41, 25, 35])], [({'cycle': 65, 'lost': 8, 'ratios': [[2, 20], [2, 20]], 'min_green': [20, 5]}, [29, 28]), ({'cycle': 130, 'lost': 11, 'ratios': [[6, 10], [7, 20], [8, 10]], 'min_green': [5, 10, 7]}, [41, 24, 54]), ({'cycle': 115, 'lost': 14, 'ratios': [[1, 10], [1, 25], [6, 25]], 'min_green': [15, 10, 7]}, [26, 11, 64]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 75, 'lost': 11, 'ratios': [[2, 20], [2, 20], [2, 20], [2, 20]], 'min_green': [7, 20, 5, 5]}, [16, 20, 14, 14]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 70, 'lost': 16, 'ratios': [[3, 10], [1, 10]], 'min_green': [27, 27]}, [27, 27]), ({'cycle': 115, 'lost': 12, 'ratios': [[3, 20], [2, 10]], 'min_green': [20, 5]}, [44, 59])], [({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 115, 'lost': 11, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [15, 20, 10]}, [35, 35, 34]), ({'cycle': 100, 'lost': 15, 'ratios': [[4, 25], [7, 10]], 'min_green': [5, 20]}, [16, 69]), ({'cycle': 65, 'lost': 10, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [5, 15, 7]}, [19, 18, 18]), ({'cycle': 65, 'lost': 15, 'ratios': [[5, 10], [9, 10], [8, 25]], 'min_green': [5, 15, 20]}, [10, 20, 20]), ({'cycle': 95, 'lost': 14, 'ratios': [[1, 10], [2, 25], [4, 20]], 'min_green': [7, 10, 7]}, [21, 17, 43])], [({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 120, 'lost': 15, 'ratios': [[7, 25], [9, 20]], 'min_green': [15, 20]}, [40, 65]), ({'cycle': 115, 'lost': 8, 'ratios': [[9, 10], [1, 25], [2, 10]], 'min_green': [10, 10, 5]}, [78, 10, 19]), ({'cycle': 130, 'lost': 8, 'ratios': [[7, 20], [6, 25]], 'min_green': [5, 20]}, [72, 50]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 20], [2, 20], [2, 20]], 'min_green': [10, 20, 20]}, [24, 23, 23]), ({'cycle': 80, 'lost': 10, 'ratios': [[2, 10], [2, 10], [2, 10]], 'min_green': [15, 5, 10]}, [24, 23, 23]), ({'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])]]
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 | [20, 20, 19, 8] | [20, 20, 19, 8] | Passed |
| timing oracle 1 | [20, 20, 28] | [20, 20, 28] | Passed |
| timing oracle 2 | [22, 22, 22, 22] | [22, 22, 22, 22] | Passed |
| timing oracle 3 | [35, 15] | [35, 15] | Passed |
| timing oracle 4 | [15, 7, 12, 42] | [15, 7, 12, 42] | Passed |
| timing oracle 5 | [54, 53] | [54, 53] | Passed |
| timing oracle 6 | [17, 16, 16, 16] | [17, 16, 16, 16] | Passed |
| timing oracle 7 | [10, 54] | [10, 54] | Passed |
SHA-256 / c2a77f4ab03998989e906b80eadfc839a16ed2f01191907fdf95c9f685c58e3f
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.045265+00:00.
Case digest / 7ba154dbbfb4a0c7bf8cff3a596774a1b9ba62a9e243a83dd0452ecd02dc0ab3