FA-67811 / Elevator dispatch scheduling / Open access
Energy saving car shutdown: minimum fleet guard · case 01
The group shuts down below the minimum number of active cars.
ROOT CAUSE
The guard allows shutting down the last required car.
VERIFIED REPAIR
Shut down only while more than min_active cars are active.
Unsuccessful approach: Guarding one car above the minimum keeps an extra car running.
Case contract
Samples [t, demand, max wait]. If the max wait exceeds 45 s and some car is shut down, one car is reactivated and the low-demand timer cleared. Otherwise, while demand < low_demand, a timer runs from the first low sample; once it has run 600 s or more and more than min_active cars are active, one car shuts down and the timer restarts at that time. Any sample with normal demand clears the timer. Output active cars per sample.
Why this case matters
Lift group controllers make these decisions many times per minute; a wrong answer strands passengers, wastes trips or overrides a safety rule.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
active = x['cars']
low_since = None
out = []
for t, demand, wait in x['samples']:
if wait > 45 and active < x['cars']:
active += 1
low_since = None
elif demand < x['low_demand']:
if low_since is None:
low_since = t
elif t - low_since >= 600 and active >= x['min_active']:
active -= 1
low_since = t
else:
low_since = None
out.append(active)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 10', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [1200, 5, 46], [1800, 2, 10], [2400, 15, 10], [3000, 4, 80], [3600, 2, 80]]}, [3, 3, 3, 3, 3, 2]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('control 1', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 6, 30], [120, 0, 46], [720, 5, 30], [1320, 4, 30], [1620, 0, 10], [2220, 2, 10], [2520, 5, 46], [2580, 6, 10], [2640, 15, 10], [2700, 15, 10]]}, [6, 6, 6, 6, 6, 5, 6, 6, 6, 6]), ('control 4', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 5, 45], [900, 6, 10], [1500, 5, 30], [1560, 2, 80], [1860, 2, 45], [2460, 2, 80], [2520, 4, 10], [2820, 6, 80], [3420, 4, 46], [3720, 4, 46]]}, [4, 4, 4, 4, 4, 3, 3, 4, 4, 4]), ('control 7', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 5, 46], [600, 15, 30], [900, 2, 46]]}, [3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 80', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [660, 5, 80], [960, 4, 46], [1560, 2, 10], [1620, 15, 45], [1920, 0, 46], [1980, 2, 46], [2580, 4, 46], [3180, 0, 30], [3480, 4, 10]]}, [4, 4, 4, 3, 3, 4, 4, 3, 2, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 12', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 4, 30], [120, 6, 45], [180, 4, 80], [780, 5, 10], [1080, 5, 80], [1680, 15, 10]]}, [6, 6, 6, 6, 6, 6]), ('control 15', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [660, 6, 10], [960, 15, 10]]}, [4, 4, 4]), ('control 18', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 0, 80], [900, 15, 46], [1200, 15, 30], [1500, 6, 46], [2100, 6, 80], [2700, 6, 46], [3300, 2, 10], [3900, 2, 46], [4200, 15, 30], [4500, 4, 30]]}, [4, 4, 4, 4, 4, 4, 4, 3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 69', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 30], [660, 0, 46], [960, 15, 10], [1560, 0, 10], [1620, 0, 30], [2220, 0, 10], [2520, 0, 30]]}, [3, 3, 3, 3, 3, 2, 2]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 23', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 6, 30], [720, 2, 46], [1320, 5, 10], [1620, 5, 10], [1920, 5, 46], [2520, 5, 45], [2580, 4, 46], [2640, 15, 80], [2940, 6, 30]]}, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3]), ('control 26', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 80], [360, 0, 30], [420, 15, 30], [720, 15, 30], [1320, 15, 10], [1920, 5, 80], [2520, 6, 45], [2820, 0, 10]]}, [4, 4, 4, 4, 4, 4, 4, 4]), ('control 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 34', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [360, 4, 10], [660, 15, 46], [1260, 15, 10], [1860, 15, 30], [2160, 4, 30], [2760, 4, 46], [3360, 15, 46], [3960, 6, 30]]}, [3, 3, 3, 3, 3, 3, 2, 3, 3]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('control 37', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 0, 10], [660, 15, 10], [720, 2, 80], [780, 4, 30], [840, 4, 10], [1140, 4, 46], [1200, 4, 46], [1800, 4, 10]]}, [4, 4, 4, 4, 4, 4, 4, 3]), ('control 40', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [1200, 15, 46], [1260, 6, 30], [1320, 4, 10], [1920, 2, 10], [1980, 2, 10], [2040, 15, 46], [2340, 15, 30]]}, [6, 6, 6, 6, 5, 5, 6, 6]), ('control 43', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 80], [120, 5, 45], [180, 6, 46], [240, 2, 10], [300, 6, 45], [600, 2, 80]]}, [4, 4, 4, 4, 4, 4])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 45', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 5, 45], [900, 0, 10], [960, 5, 46], [1560, 4, 46], [1620, 0, 10], [1920, 4, 45], [2520, 0, 46], [2820, 4, 46], [3120, 2, 45], [3720, 5, 45]]}, [6, 6, 6, 6, 6, 6, 5, 6, 6, 6]), ('control 48', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 4, 10], [360, 0, 30], [960, 4, 46], [1020, 15, 45], [1620, 5, 45], [1680, 2, 80], [1740, 6, 45], [2340, 15, 46], [2940, 4, 30], [3000, 4, 30]]}, [4, 4, 3, 3, 3, 4, 4, 4, 4, 4]), ('control 51', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 4, 46], [960, 5, 80], [1020, 15, 46]]}, [3, 3, 3, 3])]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| regression: minimum active cars | [2, 1, 0, 0] | [2, 1, 1, 1] | Failed |
| sampled regression 76 | [4, 4, 3, 2, 1, 1, 1, 0, 1] | [4, 4, 3, 2, 1, 1, 1, 1, 2] | Failed |
| control 10 | [3, 3, 3, 3, 3, 2] | [3, 3, 3, 3, 3, 2] | Passed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | Passed |
| control 1 | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Passed |
| control 4 | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | Passed |
| control 7 | [3, 3, 3] | [3, 3, 3] | Passed |
SHA-256 / f3a1332dd61bb9fc2ca4d6ce89b8f70b81e607573b7b09fd487d0371dcd3936c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
active = x['cars']
low_since = None
out = []
for t, demand, wait in x['samples']:
if wait > 45 and active < x['cars']:
active += 1
low_since = None
elif demand < x['low_demand']:
if low_since is None:
low_since = t
elif t - low_since >= 600 and active > x['min_active'] + 1:
active -= 1
low_since = t
else:
low_since = None
out.append(active)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 10', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [1200, 5, 46], [1800, 2, 10], [2400, 15, 10], [3000, 4, 80], [3600, 2, 80]]}, [3, 3, 3, 3, 3, 2]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('control 1', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 6, 30], [120, 0, 46], [720, 5, 30], [1320, 4, 30], [1620, 0, 10], [2220, 2, 10], [2520, 5, 46], [2580, 6, 10], [2640, 15, 10], [2700, 15, 10]]}, [6, 6, 6, 6, 6, 5, 6, 6, 6, 6]), ('control 4', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 5, 45], [900, 6, 10], [1500, 5, 30], [1560, 2, 80], [1860, 2, 45], [2460, 2, 80], [2520, 4, 10], [2820, 6, 80], [3420, 4, 46], [3720, 4, 46]]}, [4, 4, 4, 4, 4, 3, 3, 4, 4, 4]), ('control 7', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 5, 46], [600, 15, 30], [900, 2, 46]]}, [3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 80', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [660, 5, 80], [960, 4, 46], [1560, 2, 10], [1620, 15, 45], [1920, 0, 46], [1980, 2, 46], [2580, 4, 46], [3180, 0, 30], [3480, 4, 10]]}, [4, 4, 4, 3, 3, 4, 4, 3, 2, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 12', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 4, 30], [120, 6, 45], [180, 4, 80], [780, 5, 10], [1080, 5, 80], [1680, 15, 10]]}, [6, 6, 6, 6, 6, 6]), ('control 15', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [660, 6, 10], [960, 15, 10]]}, [4, 4, 4]), ('control 18', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 0, 80], [900, 15, 46], [1200, 15, 30], [1500, 6, 46], [2100, 6, 80], [2700, 6, 46], [3300, 2, 10], [3900, 2, 46], [4200, 15, 30], [4500, 4, 30]]}, [4, 4, 4, 4, 4, 4, 4, 3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 69', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 30], [660, 0, 46], [960, 15, 10], [1560, 0, 10], [1620, 0, 30], [2220, 0, 10], [2520, 0, 30]]}, [3, 3, 3, 3, 3, 2, 2]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 23', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 6, 30], [720, 2, 46], [1320, 5, 10], [1620, 5, 10], [1920, 5, 46], [2520, 5, 45], [2580, 4, 46], [2640, 15, 80], [2940, 6, 30]]}, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3]), ('control 26', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 80], [360, 0, 30], [420, 15, 30], [720, 15, 30], [1320, 15, 10], [1920, 5, 80], [2520, 6, 45], [2820, 0, 10]]}, [4, 4, 4, 4, 4, 4, 4, 4]), ('control 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 34', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [360, 4, 10], [660, 15, 46], [1260, 15, 10], [1860, 15, 30], [2160, 4, 30], [2760, 4, 46], [3360, 15, 46], [3960, 6, 30]]}, [3, 3, 3, 3, 3, 3, 2, 3, 3]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('control 37', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 0, 10], [660, 15, 10], [720, 2, 80], [780, 4, 30], [840, 4, 10], [1140, 4, 46], [1200, 4, 46], [1800, 4, 10]]}, [4, 4, 4, 4, 4, 4, 4, 3]), ('control 40', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [1200, 15, 46], [1260, 6, 30], [1320, 4, 10], [1920, 2, 10], [1980, 2, 10], [2040, 15, 46], [2340, 15, 30]]}, [6, 6, 6, 6, 5, 5, 6, 6]), ('control 43', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 80], [120, 5, 45], [180, 6, 46], [240, 2, 10], [300, 6, 45], [600, 2, 80]]}, [4, 4, 4, 4, 4, 4])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 45', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 5, 45], [900, 0, 10], [960, 5, 46], [1560, 4, 46], [1620, 0, 10], [1920, 4, 45], [2520, 0, 46], [2820, 4, 46], [3120, 2, 45], [3720, 5, 45]]}, [6, 6, 6, 6, 6, 6, 5, 6, 6, 6]), ('control 48', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 4, 10], [360, 0, 30], [960, 4, 46], [1020, 15, 45], [1620, 5, 45], [1680, 2, 80], [1740, 6, 45], [2340, 15, 46], [2940, 4, 30], [3000, 4, 30]]}, [4, 4, 3, 3, 3, 4, 4, 4, 4, 4]), ('control 51', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 4, 46], [960, 5, 80], [1020, 15, 46]]}, [3, 3, 3, 3])]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| regression: minimum active cars | [2, 2, 2, 2] | [2, 1, 1, 1] | Failed |
| sampled regression 76 | [4, 4, 3, 2, 2, 2, 2, 2, 3] | [4, 4, 3, 2, 1, 1, 1, 1, 2] | Failed |
| control 10 | [3, 3, 3, 3, 3, 3] | [3, 3, 3, 3, 3, 2] | Failed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | Passed |
| control 1 | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Passed |
| control 4 | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | Passed |
| control 7 | [3, 3, 3] | [3, 3, 3] | Passed |
SHA-256 / 072a8f0120a64b0675bef44f1e0f54d66e5ad4243a55928d16881b139dbf7bd3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
active = x['cars']
low_since = None
out = []
for t, demand, wait in x['samples']:
if wait > 45 and active < x['cars']:
active += 1
low_since = None
elif demand < x['low_demand']:
if low_since is None:
low_since = t
elif t - low_since >= 600 and active > x['min_active']:
active -= 1
low_since = t
else:
low_since = None
out.append(active)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 10', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [1200, 5, 46], [1800, 2, 10], [2400, 15, 10], [3000, 4, 80], [3600, 2, 80]]}, [3, 3, 3, 3, 3, 2]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('control 1', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 6, 30], [120, 0, 46], [720, 5, 30], [1320, 4, 30], [1620, 0, 10], [2220, 2, 10], [2520, 5, 46], [2580, 6, 10], [2640, 15, 10], [2700, 15, 10]]}, [6, 6, 6, 6, 6, 5, 6, 6, 6, 6]), ('control 4', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 5, 45], [900, 6, 10], [1500, 5, 30], [1560, 2, 80], [1860, 2, 45], [2460, 2, 80], [2520, 4, 10], [2820, 6, 80], [3420, 4, 46], [3720, 4, 46]]}, [4, 4, 4, 4, 4, 3, 3, 4, 4, 4]), ('control 7', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 5, 46], [600, 15, 30], [900, 2, 46]]}, [3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 80', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [660, 5, 80], [960, 4, 46], [1560, 2, 10], [1620, 15, 45], [1920, 0, 46], [1980, 2, 46], [2580, 4, 46], [3180, 0, 30], [3480, 4, 10]]}, [4, 4, 4, 3, 3, 4, 4, 3, 2, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 12', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 4, 30], [120, 6, 45], [180, 4, 80], [780, 5, 10], [1080, 5, 80], [1680, 15, 10]]}, [6, 6, 6, 6, 6, 6]), ('control 15', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 46], [660, 6, 10], [960, 15, 10]]}, [4, 4, 4]), ('control 18', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 0, 80], [900, 15, 46], [1200, 15, 30], [1500, 6, 46], [2100, 6, 80], [2700, 6, 46], [3300, 2, 10], [3900, 2, 46], [4200, 15, 30], [4500, 4, 30]]}, [4, 4, 4, 4, 4, 4, 4, 3, 3, 3])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('control 69', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 30], [660, 0, 46], [960, 15, 10], [1560, 0, 10], [1620, 0, 30], [2220, 0, 10], [2520, 0, 30]]}, [3, 3, 3, 3, 3, 2, 2]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 23', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 6, 30], [720, 2, 46], [1320, 5, 10], [1620, 5, 10], [1920, 5, 46], [2520, 5, 45], [2580, 4, 46], [2640, 15, 80], [2940, 6, 30]]}, [3, 3, 3, 3, 3, 3, 3, 3, 3, 3]), ('control 26', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 80], [360, 0, 30], [420, 15, 30], [720, 15, 30], [1320, 15, 10], [1920, 5, 80], [2520, 6, 45], [2820, 0, 10]]}, [4, 4, 4, 4, 4, 4, 4, 4]), ('control 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('control 34', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [360, 4, 10], [660, 15, 46], [1260, 15, 10], [1860, 15, 30], [2160, 4, 30], [2760, 4, 46], [3360, 15, 46], [3960, 6, 30]]}, [3, 3, 3, 3, 3, 3, 2, 3, 3]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('boundary: successive shutdowns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [900, 1, 10], [1200, 1, 10]]}, [4, 3, 3, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('control 37', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 0, 10], [660, 15, 10], [720, 2, 80], [780, 4, 30], [840, 4, 10], [1140, 4, 46], [1200, 4, 46], [1800, 4, 10]]}, [4, 4, 4, 4, 4, 4, 4, 3]), ('control 40', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 45], [1200, 15, 46], [1260, 6, 30], [1320, 4, 10], [1920, 2, 10], [1980, 2, 10], [2040, 15, 46], [2340, 15, 30]]}, [6, 6, 6, 6, 5, 5, 6, 6]), ('control 43', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 6, 80], [120, 5, 45], [180, 6, 46], [240, 2, 10], [300, 6, 45], [600, 2, 80]]}, [4, 4, 4, 4, 4, 4])], [('regression: minimum active cars', {'cars': 2, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [1200, 1, 10], [1800, 1, 10]]}, [2, 1, 1, 1]), ('sampled regression 76', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 0, 30], [900, 0, 46], [1500, 0, 80], [2100, 2, 30], [2700, 2, 45], [2760, 0, 30], [3060, 4, 30], [3660, 4, 45], [4260, 4, 46]]}, [4, 4, 3, 2, 1, 1, 1, 1, 2]), ('boundary: demand returns', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 6, 10], [600, 1, 10], [900, 1, 10]]}, [4, 4, 4, 4]), ('boundary: long wait reactivates', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10], [660, 1, 46], [720, 1, 45]]}, [3, 2, 3, 3]), ('boundary: long wait with all cars active', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [300, 1, 80], [600, 1, 10]]}, [3, 3, 2]), ('control 45', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 5, 45], [900, 0, 10], [960, 5, 46], [1560, 4, 46], [1620, 0, 10], [1920, 4, 45], [2520, 0, 46], [2820, 4, 46], [3120, 2, 45], [3720, 5, 45]]}, [6, 6, 6, 6, 6, 6, 5, 6, 6, 6]), ('control 48', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 4, 10], [360, 0, 30], [960, 4, 46], [1020, 15, 45], [1620, 5, 45], [1680, 2, 80], [1740, 6, 45], [2340, 15, 46], [2940, 4, 30], [3000, 4, 30]]}, [4, 4, 3, 3, 3, 4, 4, 4, 4, 4]), ('control 51', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 2, 30], [660, 4, 46], [960, 5, 80], [1020, 15, 46]]}, [3, 3, 3, 3])]]
for label, args, expected in fixtures[N-1]:
check(label, 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 |
|---|---|---|---|
| regression: minimum active cars | [2, 1, 1, 1] | [2, 1, 1, 1] | Passed |
| sampled regression 76 | [4, 4, 3, 2, 1, 1, 1, 1, 2] | [4, 4, 3, 2, 1, 1, 1, 1, 2] | Passed |
| control 10 | [3, 3, 3, 3, 3, 2] | [3, 3, 3, 3, 3, 2] | Passed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | Passed |
| control 1 | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Passed |
| control 4 | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | Passed |
| control 7 | [3, 3, 3] | [3, 3, 3] | Passed |
SHA-256 / 675e508a4998a3341974ca2b4e9d44ebe07bf88e90caa5d0b0679e0fdd9b02da
Verification & scope
Stipulated toy lift-control contract for a bounded teaching model; it makes no claim of conformance to any lift code or vendor dispatcher and omits real safety cases. 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.369077+00:00.
Case digest / db512f32866b7645991eb75c6c203968c7aaa7e823e72959d85094b493f95a1e