FA-67816 / Elevator dispatch scheduling / Open access
Energy saving car shutdown: timer clearing on demand · case 01
A brief quiet spell after busy traffic triggers a shutdown.
ROOT CAUSE
Normal demand never clears the low-demand timer.
VERIFIED REPAIR
Clear the timer on any sample with normal demand.
Unsuccessful approach: Clearing only on double the threshold keeps the timer through moderate traffic.
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:
pass
out.append(active)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: 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]), ('sampled regression 5', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 4, 30], [660, 0, 30], [960, 5, 46], [1020, 6, 46], [1320, 4, 30], [1920, 15, 46], [2520, 5, 80]]}, [4, 4, 4, 4, 4, 4, 4]), ('sampled regression 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]), ('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 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 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]), ('sampled regression 9', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 80], [900, 5, 46], [1200, 6, 80], [1500, 2, 80], [2100, 0, 45], [2400, 2, 80], [2460, 6, 46], [2520, 0, 80], [2820, 15, 46], [2880, 0, 46]]}, [4, 4, 4, 4, 3, 4, 4, 4, 4, 4]), ('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]), ('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 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]), ('sampled regression 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: 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]), ('sampled regression 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]), ('sampled regression 27', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 80], [660, 15, 45], [1260, 0, 80], [1860, 6, 45], [1920, 4, 10], [2220, 15, 10]]}, [3, 3, 3, 3, 3, 3]), ('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]), ('sampled regression 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]), ('sampled regression 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6]), ('control 32', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 5, 80], [900, 0, 10], [960, 0, 80], [1260, 15, 46]]}, [3, 3, 3, 3])], [('regression: 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]), ('sampled regression 38', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 45], [360, 5, 80], [420, 6, 80], [480, 6, 46], [780, 4, 80], [1380, 2, 45], [1680, 5, 30], [2280, 15, 30], [2880, 4, 30]]}, [3, 3, 3, 3, 3, 2, 2, 2, 2]), ('sampled regression 55', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 45], [360, 5, 46], [420, 5, 46], [1020, 0, 80], [1080, 15, 45], [1380, 15, 80]]}, [6, 6, 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]), ('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]), ('sampled regression 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]), ('sampled regression 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 50', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 45], [900, 0, 30], [1500, 15, 10]]}, [6, 6, 6, 6]), ('sampled regression 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: 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]), ('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]), ('sampled regression 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: demand returns | [4, 4, 3, 3] | [4, 4, 4, 4] | Failed |
| sampled regression 5 | [4, 4, 4, 4, 3, 4, 4] | [4, 4, 4, 4, 4, 4, 4] | Failed |
| sampled regression 1 | [6, 6, 6, 5, 5, 4, 5, 5, 5, 5] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Failed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | 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 |
| sampled regression 10 | [3, 3, 2, 2, 3, 3] | [3, 3, 3, 3, 3, 2] | Failed |
SHA-256 / 8bad7dd792fc53087f9edccb4c1c14ff324c327f3c6975792c2fa6013254e0d0
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']:
active -= 1
low_since = t
elif demand >= 2 * x['low_demand']:
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: 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]), ('sampled regression 5', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 4, 30], [660, 0, 30], [960, 5, 46], [1020, 6, 46], [1320, 4, 30], [1920, 15, 46], [2520, 5, 80]]}, [4, 4, 4, 4, 4, 4, 4]), ('sampled regression 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]), ('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 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 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]), ('sampled regression 9', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 80], [900, 5, 46], [1200, 6, 80], [1500, 2, 80], [2100, 0, 45], [2400, 2, 80], [2460, 6, 46], [2520, 0, 80], [2820, 15, 46], [2880, 0, 46]]}, [4, 4, 4, 4, 3, 4, 4, 4, 4, 4]), ('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]), ('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 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]), ('sampled regression 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: 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]), ('sampled regression 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]), ('sampled regression 27', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 80], [660, 15, 45], [1260, 0, 80], [1860, 6, 45], [1920, 4, 10], [2220, 15, 10]]}, [3, 3, 3, 3, 3, 3]), ('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]), ('sampled regression 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]), ('sampled regression 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6]), ('control 32', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 5, 80], [900, 0, 10], [960, 0, 80], [1260, 15, 46]]}, [3, 3, 3, 3])], [('regression: 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]), ('sampled regression 38', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 45], [360, 5, 80], [420, 6, 80], [480, 6, 46], [780, 4, 80], [1380, 2, 45], [1680, 5, 30], [2280, 15, 30], [2880, 4, 30]]}, [3, 3, 3, 3, 3, 2, 2, 2, 2]), ('sampled regression 55', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 45], [360, 5, 46], [420, 5, 46], [1020, 0, 80], [1080, 15, 45], [1380, 15, 80]]}, [6, 6, 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]), ('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]), ('sampled regression 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]), ('sampled regression 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 50', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 45], [900, 0, 30], [1500, 15, 10]]}, [6, 6, 6, 6]), ('sampled regression 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: 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]), ('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]), ('sampled regression 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: demand returns | [4, 4, 3, 3] | [4, 4, 4, 4] | Failed |
| sampled regression 5 | [4, 4, 4, 4, 3, 4, 4] | [4, 4, 4, 4, 4, 4, 4] | Failed |
| sampled regression 1 | [6, 6, 6, 5, 5, 4, 5, 5, 5, 5] | [6, 6, 6, 6, 6, 5, 6, 6, 6, 6] | Failed |
| boundary: ten quiet minutes | [4, 3] | [4, 3] | Passed |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | 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 |
| sampled regression 10 | [3, 3, 2, 2, 3, 3] | [3, 3, 3, 3, 3, 2] | Failed |
SHA-256 / 7188d83dd047cf4a97defbd5ec4b99d6157cd2d5503ba5ade79308ea2f2d2e2a
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: 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]), ('sampled regression 5', {'cars': 4, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 4, 30], [660, 0, 30], [960, 5, 46], [1020, 6, 46], [1320, 4, 30], [1920, 15, 46], [2520, 5, 80]]}, [4, 4, 4, 4, 4, 4, 4]), ('sampled regression 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]), ('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 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 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]), ('sampled regression 9', {'cars': 4, 'min_active': 2, 'low_demand': 5, 'samples': [[600, 4, 80], [900, 5, 46], [1200, 6, 80], [1500, 2, 80], [2100, 0, 45], [2400, 2, 80], [2460, 6, 46], [2520, 0, 80], [2820, 15, 46], [2880, 0, 46]]}, [4, 4, 4, 4, 3, 4, 4, 4, 4, 4]), ('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]), ('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 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]), ('sampled regression 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: 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]), ('sampled regression 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]), ('sampled regression 27', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 80], [660, 15, 45], [1260, 0, 80], [1860, 6, 45], [1920, 4, 10], [2220, 15, 10]]}, [3, 3, 3, 3, 3, 3]), ('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]), ('sampled regression 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]), ('sampled regression 29', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 10], [900, 2, 10]]}, [6, 6, 6]), ('control 32', {'cars': 3, 'min_active': 1, 'low_demand': 5, 'samples': [[600, 5, 80], [900, 0, 10], [960, 0, 80], [1260, 15, 46]]}, [3, 3, 3, 3])], [('regression: 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]), ('sampled regression 38', {'cars': 3, 'min_active': 2, 'low_demand': 5, 'samples': [[60, 0, 45], [360, 5, 80], [420, 6, 80], [480, 6, 46], [780, 4, 80], [1380, 2, 45], [1680, 5, 30], [2280, 15, 30], [2880, 4, 30]]}, [3, 3, 3, 3, 3, 2, 2, 2, 2]), ('sampled regression 55', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[60, 2, 45], [360, 5, 46], [420, 5, 46], [1020, 0, 80], [1080, 15, 45], [1380, 15, 80]]}, [6, 6, 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]), ('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]), ('sampled regression 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]), ('sampled regression 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]), ('sampled regression 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])], [('regression: 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]), ('sampled regression 50', {'cars': 6, 'min_active': 1, 'low_demand': 5, 'samples': [[300, 0, 45], [600, 5, 45], [900, 0, 30], [1500, 15, 10]]}, [6, 6, 6, 6]), ('sampled regression 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: 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]), ('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]), ('sampled regression 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: demand returns | [4, 4, 4, 4] | [4, 4, 4, 4] | Passed |
| sampled regression 5 | [4, 4, 4, 4, 4, 4, 4] | [4, 4, 4, 4, 4, 4, 4] | Passed |
| sampled regression 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 |
| boundary: successive shutdowns | [4, 3, 3, 2] | [4, 3, 3, 2] | 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 |
| sampled regression 10 | [3, 3, 3, 3, 3, 2] | [3, 3, 3, 3, 3, 2] | Passed |
SHA-256 / a9ea2d07fc2f4dc81cb93bcd559bad76ff3d4f383a84965fe49d522293ace5f4
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.395071+00:00.
Case digest / 71e65d9272f3fc1cbb4c0f24380f79b5f427143e18241460aa3c5c26590d3938