FA-67541 / Elevator dispatch scheduling / Open access
Hall call ETA with intermediate stops: direct service condition · case 01
A call at the floor the car has just left, or a call wanting the other direction, is treated as directly on the way.
ROOT CAUSE
The direct-service test accepts the current floor.
VERIFIED REPAIR
Serve directly only calls strictly ahead in the car direction.
Unsuccessful approach: Ignoring the call direction sends the car straight to a passenger who wants to travel the other way.
Case contract
A moving car at floor with direction and car stops estimates its arrival at a hall call (target, call direction). Work in the car direction (mirror floors for down). If the target is strictly ahead and the call is in the car direction, the car goes straight there, stopping at stops strictly between. Otherwise it runs to the farthest of its stops ahead and the target, reverses and returns to the target, stopping at every stop ahead plus stops strictly between target and floor behind. A stop at the target floor is not extra. ETA = floors travelled * per_floor_s + stops * stop_s.
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):
sg = 1 if x['dir'] == 'up' else -1
f = x['floor'] * sg
t = x['target'] * sg
stops = [s * sg for s in x['stops'] if s * sg != t]
same = x['call_dir'] == x['dir']
if t >= f and same:
path = t - f
n = len([s for s in stops if f < s < t])
else:
ahead = [s for s in stops if s > f]
far = max(ahead + [t, f])
path = (far - f) + (far - t)
n = len(ahead) + len([s for s in stops if t < s < f])
return path * x['per_floor_s'] + n * x['stop_s']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 1', {'floor': 6, 'dir': 'down', 'target': 12, 'call_dir': 'down', 'stops': [3, 4], 'per_floor_s': 2, 'stop_s': 12}, 48), ('control 4', {'floor': 1, 'dir': 'down', 'target': 14, 'call_dir': 'down', 'stops': [3, 10, 5], 'per_floor_s': 2, 'stop_s': 12}, 62), ('control 7', {'floor': 7, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [1, 13, 9, 2], 'per_floor_s': 3, 'stop_s': 12}, 24)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 74', {'floor': 6, 'dir': 'down', 'target': 5, 'call_dir': 'up', 'stops': [1, 14], 'per_floor_s': 3, 'stop_s': 8}, 35), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 12', {'floor': 12, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 8, 7, 15], 'per_floor_s': 3, 'stop_s': 10}, 3), ('control 15', {'floor': 15, 'dir': 'up', 'target': 11, 'call_dir': 'down', 'stops': [3], 'per_floor_s': 3, 'stop_s': 12}, 12), ('control 18', {'floor': 1, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [8, 2, 11, 1], 'per_floor_s': 2, 'stop_s': 10}, 16)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 77', {'floor': 12, 'dir': 'down', 'target': 8, 'call_dir': 'up', 'stops': [14, 10, 3], 'per_floor_s': 3, 'stop_s': 12}, 66), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 23', {'floor': 4, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [], 'per_floor_s': 2, 'stop_s': 12}, 18), ('control 26', {'floor': 14, 'dir': 'up', 'target': 15, 'call_dir': 'down', 'stops': [1, 14], 'per_floor_s': 2, 'stop_s': 8}, 2), ('control 29', {'floor': 8, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [14, 15, 3], 'per_floor_s': 3, 'stop_s': 10}, 6)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('boundary: stops beyond the target', {'floor': 2, 'dir': 'up', 'target': 6, 'call_dir': 'up', 'stops': [4, 10], 'per_floor_s': 2, 'stop_s': 10}, 18), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 34', {'floor': 7, 'dir': 'down', 'target': 7, 'call_dir': 'up', 'stops': [10, 7], 'per_floor_s': 2, 'stop_s': 8}, 0), ('control 37', {'floor': 14, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [7, 4, 13, 1], 'per_floor_s': 2, 'stop_s': 10}, 16), ('control 40', {'floor': 10, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 10, 12, 5], 'per_floor_s': 3, 'stop_s': 10}, 59)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('control 45', {'floor': 2, 'dir': 'down', 'target': 0, 'call_dir': 'down', 'stops': [3, 12, 7, 11], 'per_floor_s': 2, 'stop_s': 8}, 4), ('control 48', {'floor': 8, 'dir': 'down', 'target': 2, 'call_dir': 'up', 'stops': [8, 7, 4, 6], 'per_floor_s': 3, 'stop_s': 8}, 42), ('control 51', {'floor': 11, 'dir': 'up', 'target': 4, 'call_dir': 'down', 'stops': [], 'per_floor_s': 3, 'stop_s': 12}, 21)]]
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: call at the current floor | 0 | 26 | Failed |
| boundary: call ahead but opposite direction | 44 | 44 | Passed |
| control 6 | 22 | 22 | Passed |
| boundary: down car mirrored | 22 | 22 | Passed |
| boundary: call behind a down car | 30 | 30 | Passed |
| control 1 | 48 | 48 | Passed |
| control 4 | 62 | 62 | Passed |
| control 7 | 24 | 24 | Passed |
SHA-256 / 4e388a54e2476267c54eae141e60b2a42940940f2a15c95829d24d66854ada28
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
sg = 1 if x['dir'] == 'up' else -1
f = x['floor'] * sg
t = x['target'] * sg
stops = [s * sg for s in x['stops'] if s * sg != t]
same = x['call_dir'] == x['dir']
if t > f:
path = t - f
n = len([s for s in stops if f < s < t])
else:
ahead = [s for s in stops if s > f]
far = max(ahead + [t, f])
path = (far - f) + (far - t)
n = len(ahead) + len([s for s in stops if t < s < f])
return path * x['per_floor_s'] + n * x['stop_s']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 1', {'floor': 6, 'dir': 'down', 'target': 12, 'call_dir': 'down', 'stops': [3, 4], 'per_floor_s': 2, 'stop_s': 12}, 48), ('control 4', {'floor': 1, 'dir': 'down', 'target': 14, 'call_dir': 'down', 'stops': [3, 10, 5], 'per_floor_s': 2, 'stop_s': 12}, 62), ('control 7', {'floor': 7, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [1, 13, 9, 2], 'per_floor_s': 3, 'stop_s': 12}, 24)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 74', {'floor': 6, 'dir': 'down', 'target': 5, 'call_dir': 'up', 'stops': [1, 14], 'per_floor_s': 3, 'stop_s': 8}, 35), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 12', {'floor': 12, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 8, 7, 15], 'per_floor_s': 3, 'stop_s': 10}, 3), ('control 15', {'floor': 15, 'dir': 'up', 'target': 11, 'call_dir': 'down', 'stops': [3], 'per_floor_s': 3, 'stop_s': 12}, 12), ('control 18', {'floor': 1, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [8, 2, 11, 1], 'per_floor_s': 2, 'stop_s': 10}, 16)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 77', {'floor': 12, 'dir': 'down', 'target': 8, 'call_dir': 'up', 'stops': [14, 10, 3], 'per_floor_s': 3, 'stop_s': 12}, 66), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 23', {'floor': 4, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [], 'per_floor_s': 2, 'stop_s': 12}, 18), ('control 26', {'floor': 14, 'dir': 'up', 'target': 15, 'call_dir': 'down', 'stops': [1, 14], 'per_floor_s': 2, 'stop_s': 8}, 2), ('control 29', {'floor': 8, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [14, 15, 3], 'per_floor_s': 3, 'stop_s': 10}, 6)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('boundary: stops beyond the target', {'floor': 2, 'dir': 'up', 'target': 6, 'call_dir': 'up', 'stops': [4, 10], 'per_floor_s': 2, 'stop_s': 10}, 18), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 34', {'floor': 7, 'dir': 'down', 'target': 7, 'call_dir': 'up', 'stops': [10, 7], 'per_floor_s': 2, 'stop_s': 8}, 0), ('control 37', {'floor': 14, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [7, 4, 13, 1], 'per_floor_s': 2, 'stop_s': 10}, 16), ('control 40', {'floor': 10, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 10, 12, 5], 'per_floor_s': 3, 'stop_s': 10}, 59)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('control 45', {'floor': 2, 'dir': 'down', 'target': 0, 'call_dir': 'down', 'stops': [3, 12, 7, 11], 'per_floor_s': 2, 'stop_s': 8}, 4), ('control 48', {'floor': 8, 'dir': 'down', 'target': 2, 'call_dir': 'up', 'stops': [8, 7, 4, 6], 'per_floor_s': 3, 'stop_s': 8}, 42), ('control 51', {'floor': 11, 'dir': 'up', 'target': 4, 'call_dir': 'down', 'stops': [], 'per_floor_s': 3, 'stop_s': 12}, 21)]]
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: call at the current floor | 26 | 26 | Passed |
| boundary: call ahead but opposite direction | 22 | 44 | Failed |
| control 6 | 6 | 22 | Failed |
| boundary: down car mirrored | 22 | 22 | Passed |
| boundary: call behind a down car | 30 | 30 | Passed |
| control 1 | 48 | 48 | Passed |
| control 4 | 62 | 62 | Passed |
| control 7 | 24 | 24 | Passed |
SHA-256 / 31e66f8ec14651c6024c5a41f00c8d0f8f808175b7cc3141c0d13540bff0b270
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
sg = 1 if x['dir'] == 'up' else -1
f = x['floor'] * sg
t = x['target'] * sg
stops = [s * sg for s in x['stops'] if s * sg != t]
same = x['call_dir'] == x['dir']
if t > f and same:
path = t - f
n = len([s for s in stops if f < s < t])
else:
ahead = [s for s in stops if s > f]
far = max(ahead + [t, f])
path = (far - f) + (far - t)
n = len(ahead) + len([s for s in stops if t < s < f])
return path * x['per_floor_s'] + n * x['stop_s']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 1', {'floor': 6, 'dir': 'down', 'target': 12, 'call_dir': 'down', 'stops': [3, 4], 'per_floor_s': 2, 'stop_s': 12}, 48), ('control 4', {'floor': 1, 'dir': 'down', 'target': 14, 'call_dir': 'down', 'stops': [3, 10, 5], 'per_floor_s': 2, 'stop_s': 12}, 62), ('control 7', {'floor': 7, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [1, 13, 9, 2], 'per_floor_s': 3, 'stop_s': 12}, 24)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 74', {'floor': 6, 'dir': 'down', 'target': 5, 'call_dir': 'up', 'stops': [1, 14], 'per_floor_s': 3, 'stop_s': 8}, 35), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 12', {'floor': 12, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 8, 7, 15], 'per_floor_s': 3, 'stop_s': 10}, 3), ('control 15', {'floor': 15, 'dir': 'up', 'target': 11, 'call_dir': 'down', 'stops': [3], 'per_floor_s': 3, 'stop_s': 12}, 12), ('control 18', {'floor': 1, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [8, 2, 11, 1], 'per_floor_s': 2, 'stop_s': 10}, 16)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 77', {'floor': 12, 'dir': 'down', 'target': 8, 'call_dir': 'up', 'stops': [14, 10, 3], 'per_floor_s': 3, 'stop_s': 12}, 66), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('boundary: stop at the target floor', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'up', 'stops': [8, 5], 'per_floor_s': 2, 'stop_s': 10}, 22), ('control 23', {'floor': 4, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [], 'per_floor_s': 2, 'stop_s': 12}, 18), ('control 26', {'floor': 14, 'dir': 'up', 'target': 15, 'call_dir': 'down', 'stops': [1, 14], 'per_floor_s': 2, 'stop_s': 8}, 2), ('control 29', {'floor': 8, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [14, 15, 3], 'per_floor_s': 3, 'stop_s': 10}, 6)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('boundary: stops beyond the target', {'floor': 2, 'dir': 'up', 'target': 6, 'call_dir': 'up', 'stops': [4, 10], 'per_floor_s': 2, 'stop_s': 10}, 18), ('boundary: down car mirrored', {'floor': 10, 'dir': 'down', 'target': 4, 'call_dir': 'down', 'stops': [7], 'per_floor_s': 2, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('control 34', {'floor': 7, 'dir': 'down', 'target': 7, 'call_dir': 'up', 'stops': [10, 7], 'per_floor_s': 2, 'stop_s': 8}, 0), ('control 37', {'floor': 14, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [7, 4, 13, 1], 'per_floor_s': 2, 'stop_s': 10}, 16), ('control 40', {'floor': 10, 'dir': 'down', 'target': 11, 'call_dir': 'down', 'stops': [4, 10, 12, 5], 'per_floor_s': 3, 'stop_s': 10}, 59)], [('regression: call at the current floor', {'floor': 5, 'dir': 'up', 'target': 5, 'call_dir': 'up', 'stops': [9], 'per_floor_s': 2, 'stop_s': 10}, 26), ('boundary: call ahead but opposite direction', {'floor': 2, 'dir': 'up', 'target': 8, 'call_dir': 'down', 'stops': [5, 11], 'per_floor_s': 2, 'stop_s': 10}, 44), ('control 6', {'floor': 5, 'dir': 'down', 'target': 3, 'call_dir': 'up', 'stops': [2], 'per_floor_s': 3, 'stop_s': 10}, 22), ('boundary: call behind a down car', {'floor': 10, 'dir': 'down', 'target': 12, 'call_dir': 'up', 'stops': [6], 'per_floor_s': 2, 'stop_s': 10}, 30), ('boundary: stops behind served on return', {'floor': 6, 'dir': 'up', 'target': 1, 'call_dir': 'up', 'stops': [9, 3], 'per_floor_s': 2, 'stop_s': 10}, 42), ('control 45', {'floor': 2, 'dir': 'down', 'target': 0, 'call_dir': 'down', 'stops': [3, 12, 7, 11], 'per_floor_s': 2, 'stop_s': 8}, 4), ('control 48', {'floor': 8, 'dir': 'down', 'target': 2, 'call_dir': 'up', 'stops': [8, 7, 4, 6], 'per_floor_s': 3, 'stop_s': 8}, 42), ('control 51', {'floor': 11, 'dir': 'up', 'target': 4, 'call_dir': 'down', 'stops': [], 'per_floor_s': 3, 'stop_s': 12}, 21)]]
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: call at the current floor | 26 | 26 | Passed |
| boundary: call ahead but opposite direction | 44 | 44 | Passed |
| control 6 | 22 | 22 | Passed |
| boundary: down car mirrored | 22 | 22 | Passed |
| boundary: call behind a down car | 30 | 30 | Passed |
| control 1 | 48 | 48 | Passed |
| control 4 | 62 | 62 | Passed |
| control 7 | 24 | 24 | Passed |
SHA-256 / b578bc8cb3dbd574939ba1e67706363e103979a6968f96c967e08311e8e22544
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:53.902132+00:00.
Case digest / bd41fc01be4334f2cb85deacaa3281a50e4a39fe67bb2ffffe2f606d36742c1f