FA-67801 / Elevator dispatch scheduling / Open access
Energy saving car shutdown: reactivation trigger · case 01
A car is reactivated at exactly 45 s, or reactivation runs past the fleet size.
ROOT CAUSE
The waiting-time comparison is inclusive.
VERIFIED REPAIR
Reactivate only when the wait exceeds 45 s and a car is shut down.
Unsuccessful approach: Dropping the fleet check activates cars that do not exist and resets the timer needlessly.
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 = [[('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 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]), ('sampled regression 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 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]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('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]), ('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 6', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 2, 80], [1500, 0, 10], [1560, 4, 45], [1620, 6, 45], [2220, 5, 80], [2280, 4, 80], [2880, 0, 80], [3180, 2, 10]]}, [6, 6, 6, 6, 6, 6, 6, 5, 5]), ('boundary: 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 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])], [('sampled regression 42', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 15, 10], [120, 4, 30], [720, 2, 46], [1320, 4, 45]]}, [6, 6, 5, 4]), ('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]), ('sampled regression 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]), ('control 11', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 4, 45], [900, 15, 30], [1200, 6, 46], [1800, 6, 80], [1860, 5, 30], [2160, 4, 10], [2220, 4, 46], [2280, 0, 30]]}, [4, 4, 4, 4, 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]), ('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])], [('sampled regression 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]), ('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]), ('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 3, 3]), ('control 16', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 46], [120, 5, 80], [420, 15, 30], [1020, 6, 45], [1620, 15, 46], [1680, 0, 46], [1980, 4, 80], [2580, 4, 80]]}, [6, 6, 6, 6, 6, 6, 6, 5]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('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: 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]), ('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('control 22', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [600, 6, 46], [660, 5, 46], [720, 15, 80], [780, 15, 80], [1080, 2, 46], [1380, 4, 80], [1440, 0, 10]]}, [6, 6, 6, 6, 6, 6, 6, 6]), ('boundary: 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 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]), ('sampled regression 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 |
|---|---|---|---|
| sampled regression 28 | [3, 3, 2, 3, 3, 3, 3] | [3, 3, 2, 2, 3, 3, 3] | Failed |
| boundary: long wait with all cars active | [3, 3, 2] | [3, 3, 2] | Passed |
| sampled regression 48 | [4, 4, 3, 4, 4, 4, 4, 4, 4, 4] | [4, 4, 3, 3, 3, 4, 4, 4, 4, 4] | Failed |
| control 1 | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Passed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | 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 |
| control 10 | [3, 3, 3, 3, 3, 2] | [3, 3, 3, 3, 3, 2] | Passed |
SHA-256 / f4d4b83a2167c3c5d555a9f3b5cfa70d93bbace6b3c57cb8cabb047147fc7fe3
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:
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 = [[('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 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]), ('sampled regression 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 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]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('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]), ('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 6', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 2, 80], [1500, 0, 10], [1560, 4, 45], [1620, 6, 45], [2220, 5, 80], [2280, 4, 80], [2880, 0, 80], [3180, 2, 10]]}, [6, 6, 6, 6, 6, 6, 6, 5, 5]), ('boundary: 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 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])], [('sampled regression 42', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 15, 10], [120, 4, 30], [720, 2, 46], [1320, 4, 45]]}, [6, 6, 5, 4]), ('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]), ('sampled regression 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]), ('control 11', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 4, 45], [900, 15, 30], [1200, 6, 46], [1800, 6, 80], [1860, 5, 30], [2160, 4, 10], [2220, 4, 46], [2280, 0, 30]]}, [4, 4, 4, 4, 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]), ('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])], [('sampled regression 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]), ('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]), ('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 3, 3]), ('control 16', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 46], [120, 5, 80], [420, 15, 30], [1020, 6, 45], [1620, 15, 46], [1680, 0, 46], [1980, 4, 80], [2580, 4, 80]]}, [6, 6, 6, 6, 6, 6, 6, 5]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('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: 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]), ('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('control 22', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [600, 6, 46], [660, 5, 46], [720, 15, 80], [780, 15, 80], [1080, 2, 46], [1380, 4, 80], [1440, 0, 10]]}, [6, 6, 6, 6, 6, 6, 6, 6]), ('boundary: 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 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]), ('sampled regression 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 |
|---|---|---|---|
| sampled regression 28 | [3, 3, 2, 2, 3, 3, 4] | [3, 3, 2, 2, 3, 3, 3] | Failed |
| boundary: long wait with all cars active | [3, 4, 4] | [3, 3, 2] | Failed |
| sampled regression 48 | [4, 4, 5, 5, 5, 6, 6, 7, 7, 7] | [4, 4, 3, 3, 3, 4, 4, 4, 4, 4] | Failed |
| control 1 | [6, 7, 7, 7, 7, 6, 7, 7, 7, 7] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Failed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| control 4 | [4, 4, 4, 5, 5, 6, 6, 7, 8, 9] | [4, 4, 4, 4, 4, 3, 3, 4, 4, 4] | Failed |
| control 7 | [4, 4, 5] | [3, 3, 3] | Failed |
| control 10 | [4, 5, 5, 5, 6, 7] | [3, 3, 3, 3, 3, 2] | Failed |
SHA-256 / 0a970006735a98f4a65bf031964572fd8aebc23de33bbff76158d23bda348003
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 = [[('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 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]), ('sampled regression 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 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]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('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]), ('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 6', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 2, 80], [1500, 0, 10], [1560, 4, 45], [1620, 6, 45], [2220, 5, 80], [2280, 4, 80], [2880, 0, 80], [3180, 2, 10]]}, [6, 6, 6, 6, 6, 6, 6, 5, 5]), ('boundary: 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 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])], [('sampled regression 42', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 15, 10], [120, 4, 30], [720, 2, 46], [1320, 4, 45]]}, [6, 6, 5, 4]), ('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]), ('sampled regression 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]), ('control 11', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 4, 45], [900, 15, 30], [1200, 6, 46], [1800, 6, 80], [1860, 5, 30], [2160, 4, 10], [2220, 4, 46], [2280, 0, 30]]}, [4, 4, 4, 4, 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]), ('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])], [('sampled regression 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]), ('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]), ('sampled regression 28', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 6, 10], [1200, 0, 10], [1800, 0, 30], [2100, 2, 45], [2400, 15, 80], [2460, 15, 10], [2520, 4, 46]]}, [3, 3, 2, 2, 3, 3, 3]), ('control 16', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 46], [120, 5, 80], [420, 15, 30], [1020, 6, 45], [1620, 15, 46], [1680, 0, 46], [1980, 4, 80], [2580, 4, 80]]}, [6, 6, 6, 6, 6, 6, 6, 5]), ('boundary: ten quiet minutes', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[0, 1, 10], [600, 1, 10]]}, [4, 3]), ('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]), ('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])], [('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: 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]), ('sampled regression 36', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 6, 46], [660, 0, 10], [1260, 2, 10], [1320, 2, 45], [1920, 4, 46]]}, [6, 6, 5, 5, 6]), ('control 22', {'cars': 6, 'min_active': 2, 'low_demand': 5, 'samples': [[300, 2, 10], [600, 6, 46], [660, 5, 46], [720, 15, 80], [780, 15, 80], [1080, 2, 46], [1380, 4, 80], [1440, 0, 10]]}, [6, 6, 6, 6, 6, 6, 6, 6]), ('boundary: 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 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]), ('sampled regression 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 |
|---|---|---|---|
| sampled regression 28 | [3, 3, 2, 2, 3, 3, 3] | [3, 3, 2, 2, 3, 3, 3] | Passed |
| boundary: long wait with all cars active | [3, 3, 2] | [3, 3, 2] | Passed |
| sampled regression 48 | [4, 4, 3, 3, 3, 4, 4, 4, 4, 4] | [4, 4, 3, 3, 3, 4, 4, 4, 4, 4] | Passed |
| control 1 | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Passed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | 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 |
| control 10 | [3, 3, 3, 3, 3, 2] | [3, 3, 3, 3, 3, 2] | Passed |
SHA-256 / 80c03c27bf3d97bf3343fb36379b6efc705bcc050f785da3216b8108aff9501c
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.326041+00:00.
Case digest / 06f7f22853d1ec3e7660b5281b40b060b81338eadda9bc245574138ffbf35dfa