FA-67876 / Traffic signal timing plans / Open access
Green split allocation: leftover seconds go to the smallest remainders · case 01
Green split allocation returns a wrong result when leftover seconds go to the smallest remainders.
ROOT CAUSE
The sort key is ascending on the fractional remainder, so the phases closest to their floors receive the spare seconds.
VERIFIED REPAIR
Restore the largest remainder distribution rule so that the step reads `key=lambda i: (-(ideal[i] - g[i]), i)`.
Unsuccessful approach: Sorting by descending remainder is right, but breaking ties toward the higher phase index violates the stipulated tie rule.
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] - 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': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'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': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'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': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'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': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]
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 | [22, 21, 21, 21] | [22, 21, 21, 21] | Passed |
| timing oracle 1 | [26, 26, 26] | [26, 26, 26] | Passed |
| timing oracle 2 | [26, 26, 25] | [26, 26, 25] | Passed |
| timing oracle 3 | [20, 35] | [20, 35] | Passed |
| timing oracle 4 | [27, 27] | [27, 27] | Passed |
| timing oracle 5 | [15, 11, 12, 31] | [16, 10, 11, 32] | Failed |
| timing oracle 6 | [46, 54, 16] | [46, 55, 15] | Failed |
| timing oracle 7 | [62, 24] | [63, 23] | Failed |
SHA-256 / 895f9c5e0ed7f34e83d72f111be42b06e4cee81181d6dca411d68ea2c849ff30
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': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'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': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'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': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'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': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]
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 | [21, 21, 21, 22] | [22, 21, 21, 21] | Failed |
| timing oracle 1 | [26, 26, 26] | [26, 26, 26] | Passed |
| timing oracle 2 | [25, 26, 26] | [26, 26, 25] | Failed |
| timing oracle 3 | [20, 35] | [20, 35] | Passed |
| timing oracle 4 | [27, 27] | [27, 27] | Passed |
| timing oracle 5 | [16, 10, 11, 32] | [16, 10, 11, 32] | Passed |
| timing oracle 6 | [46, 55, 15] | [46, 55, 15] | Passed |
| timing oracle 7 | [63, 23] | [63, 23] | Passed |
SHA-256 / 22028dc2ebee6294cfb71ecafe24bf6367afc1a8e2e8d04bcfa4edc552b2651e
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': 95, 'lost': 10, 'ratios': [[1, 20], [1, 20], [1, 20], [1, 20]], 'min_green': [7, 20, 20, 7]}, [22, 21, 21, 21]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 90, 'lost': 13, 'ratios': [[3, 20], [3, 20], [3, 20]], 'min_green': [10, 20, 15]}, [26, 26, 25]), ({'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': 85, 'lost': 16, 'ratios': [[9, 20], [6, 20], [8, 25], [9, 10]], 'min_green': [10, 5, 10, 5]}, [16, 10, 11, 32]), ({'cycle': 130, 'lost': 14, 'ratios': [[6, 20], [9, 25], [2, 20]], 'min_green': [7, 10, 10]}, [46, 55, 15]), ({'cycle': 95, 'lost': 9, 'ratios': [[8, 20], [3, 20]], 'min_green': [5, 7]}, [63, 23])], [({'cycle': 100, 'lost': 12, 'ratios': [[1, 10], [1, 10], [1, 10], [1, 10]], 'min_green': [5, 5, 5, 5]}, [22, 22, 22, 22]), ({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 120, 'lost': 9, 'ratios': [[5, 10], [5, 10]], 'min_green': [20, 10]}, [56, 55]), ({'cycle': 75, 'lost': 11, 'ratios': [[7, 10], [4, 25], [3, 20]], 'min_green': [15, 15, 5]}, [39, 15, 10]), ({'cycle': 70, 'lost': 16, 'ratios': [[1, 4], [1, 4]], 'min_green': [30, 30]}, 'infeasible'), ({'cycle': 100, 'lost': 9, 'ratios': [[3, 25], [5, 25], [9, 10], [3, 10]], 'min_green': [20, 10, 5, 5]}, [20, 12, 41, 18]), ({'cycle': 125, 'lost': 12, 'ratios': [[5, 10], [5, 10], [5, 10]], 'min_green': [20, 10, 10]}, [38, 38, 37]), ({'cycle': 105, 'lost': 8, 'ratios': [[9, 25], [1, 20], [7, 25], [3, 25]], 'min_green': [10, 5, 15, 5]}, [43, 6, 34, 14])], [({'cycle': 90, 'lost': 11, 'ratios': [[8, 10], [3, 25]], 'min_green': [10, 5]}, [69, 10]), ({'cycle': 80, 'lost': 12, 'ratios': [[1, 10], [2, 10], [3, 10]], 'min_green': [20, 20, 28]}, [20, 20, 28]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26]), ({'cycle': 110, 'lost': 13, 'ratios': [[4, 20], [4, 20], [4, 20], [4, 20]], 'min_green': [10, 7, 10, 5]}, [25, 24, 24, 24]), ({'cycle': 100, 'lost': 15, 'ratios': [[3, 10], [9, 25]], 'min_green': [5, 5]}, [39, 46]), ({'cycle': 60, 'lost': 10, 'ratios': [[8, 10], [1, 10]], 'min_green': [5, 15]}, [35, 15]), ({'cycle': 130, 'lost': 9, 'ratios': [[9, 25], [9, 25]], 'min_green': [7, 20]}, [61, 60]), ({'cycle': 100, 'lost': 16, 'ratios': [[9, 25], [5, 20]], 'min_green': [10, 10]}, [50, 34])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 110, 'lost': 11, 'ratios': [[2, 10], [2, 20], [4, 25], [3, 10]], 'min_green': [10, 7, 20, 20]}, [26, 13, 21, 39]), ({'cycle': 105, 'lost': 10, 'ratios': [[4, 10], [4, 10]], 'min_green': [15, 10]}, [48, 47]), ({'cycle': 115, 'lost': 9, 'ratios': [[5, 10], [7, 10], [4, 20], [3, 20]], 'min_green': [20, 5, 15, 10]}, [34, 47, 15, 10]), ({'cycle': 130, 'lost': 11, 'ratios': [[4, 10], [4, 10], [4, 10], [4, 10]], 'min_green': [20, 10, 15, 15]}, [30, 30, 30, 29]), ({'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': 15, 'ratios': [[8, 10], [5, 20], [9, 25], [2, 10]], 'min_green': [20, 7, 5, 10]}, [34, 11, 15, 10]), ({'cycle': 90, 'lost': 12, 'ratios': [[3, 10], [3, 10], [3, 10]], 'min_green': [7, 7, 7]}, [26, 26, 26])], [({'cycle': 65, 'lost': 10, 'ratios': [[1, 20], [9, 20]], 'min_green': [20, 35]}, [20, 35]), ({'cycle': 130, 'lost': 13, 'ratios': [[5, 20], [1, 10], [3, 20]], 'min_green': [5, 5, 20]}, [59, 23, 35]), ({'cycle': 105, 'lost': 12, 'ratios': [[3, 10], [3, 10]], 'min_green': [5, 15]}, [47, 46]), ({'cycle': 115, 'lost': 14, 'ratios': [[3, 20], [5, 10]], 'min_green': [10, 15]}, [23, 78]), ({'cycle': 85, 'lost': 12, 'ratios': [[6, 10], [8, 10]], 'min_green': [7, 20]}, [31, 42]), ({'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': 65, 'lost': 11, 'ratios': [[5, 10], [5, 10], [5, 10], [5, 10]], 'min_green': [20, 5, 10, 7]}, [20, 9, 13, 12])]]
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 | [22, 21, 21, 21] | [22, 21, 21, 21] | Passed |
| timing oracle 1 | [26, 26, 26] | [26, 26, 26] | Passed |
| timing oracle 2 | [26, 26, 25] | [26, 26, 25] | Passed |
| timing oracle 3 | [20, 35] | [20, 35] | Passed |
| timing oracle 4 | [27, 27] | [27, 27] | Passed |
| timing oracle 5 | [16, 10, 11, 32] | [16, 10, 11, 32] | Passed |
| timing oracle 6 | [46, 55, 15] | [46, 55, 15] | Passed |
| timing oracle 7 | [63, 23] | [63, 23] | Passed |
SHA-256 / 46f07ab05e059cad5a20e115231752e3d66b71eece06e16a19a5a794dc3ba492
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.967254+00:00.
Case digest / 4c85c384ea4cfd2a02f036261bb3aabe1e47d054b0fc1e0c42e22d54cb22a9fd