FA-67346 / Elevator dispatch scheduling / Open access
Directional collective next stop: reversal call choice · case 01
The car reverses at the nearest down call and leaves higher down calls waiting.
ROOT CAUSE
The reversal target uses the lowest instead of the highest down call above.
THE FAILURE
The reversal target uses the lowest instead of the highest down call above.
Unsuccessful approach: Reporting the travel direction as down misstates the run up to the reversal floor.
Case contract
A car stopped at floor with direction up, down or idle chooses its next stop. Travelling up it stops at the nearest car call or up hall call above; failing that it runs to the highest down hall call above; failing that it reverses and applies the mirrored rule downwards (nearest car call or down call below, else lowest up call below). An idle car heads towards the nearest call other than its own floor (ties to the lower floor). Returns [floor, travel direction] or [None, idle].
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):
f = x['floor']
cc = set(x['car_calls'])
up = set(x['hall_up'])
dn = set(x['hall_down'])
def ahead(sd):
if sd == 'up':
same = [c for c in cc | up if c > f]
if same:
return [min(same), 'up']
opp = [c for c in dn if c > f]
if opp:
return [min(opp), 'up']
else:
same = [c for c in cc | dn if c < f]
if same:
return [max(same), 'down']
opp = [c for c in up if c < f]
if opp:
return [min(opp), 'down']
return None
d = x['dir']
if d == 'idle':
allc = [c for c in sorted(cc | up | dn, key=lambda c: (abs(c - f), c)) if c != f]
if not allc:
return [None, 'idle']
d = 'up' if allc[0] > f else 'down'
r = ahead(d)
if r is None:
r = ahead('down' if d == 'up' else 'up')
return r if r is not None else [None, 'idle']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('boundary: car call ahead of an up call', {'floor': 2, 'dir': 'up', 'car_calls': [6], 'hall_up': [4], 'hall_down': []}, [4, 'up']), ('control 1', {'floor': 1, 'dir': 'down', 'car_calls': [7, 4, 8], 'hall_up': [], 'hall_down': [10, 5, 3]}, [4, 'up']), ('control 4', {'floor': 4, 'dir': 'down', 'car_calls': [10], 'hall_up': [6, 0], 'hall_down': [10]}, [0, 'down']), ('control 7', {'floor': 3, 'dir': 'down', 'car_calls': [7, 3], 'hall_up': [10], 'hall_down': [2, 4, 7]}, [2, 'down'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('boundary: idle car equidistant calls', {'floor': 5, 'dir': 'idle', 'car_calls': [3, 7], 'hall_up': [], 'hall_down': []}, [3, 'down']), ('boundary: idle car nearest call above', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [6], 'hall_down': [1]}, [6, 'up']), ('boundary: down car with nothing below', {'floor': 6, 'dir': 'down', 'car_calls': [], 'hall_up': [9], 'hall_down': []}, [9, 'up']), ('control 12', {'floor': 5, 'dir': 'idle', 'car_calls': [6, 9], 'hall_up': [6, 10], 'hall_down': [6, 2, 7]}, [6, 'up']), ('control 15', {'floor': 3, 'dir': 'down', 'car_calls': [], 'hall_up': [2, 4, 10], 'hall_down': [6, 5, 8]}, [2, 'down']), ('control 18', {'floor': 1, 'dir': 'idle', 'car_calls': [1], 'hall_up': [10, 1, 2], 'hall_down': [5]}, [2, 'up'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('control 58', {'floor': 0, 'dir': 'idle', 'car_calls': [], 'hall_up': [0], 'hall_down': [6]}, [6, 'up']), ('boundary: idle car nearest call above', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [6], 'hall_down': [1]}, [6, 'up']), ('boundary: down car with nothing below', {'floor': 6, 'dir': 'down', 'car_calls': [], 'hall_up': [9], 'hall_down': []}, [9, 'up']), ('control 23', {'floor': 1, 'dir': 'idle', 'car_calls': [], 'hall_up': [5], 'hall_down': []}, [5, 'up']), ('control 26', {'floor': 7, 'dir': 'idle', 'car_calls': [9], 'hall_up': [3], 'hall_down': [10, 5, 9]}, [5, 'down']), ('control 29', {'floor': 4, 'dir': 'down', 'car_calls': [2], 'hall_up': [5], 'hall_down': []}, [2, 'down'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('control 42', {'floor': 10, 'dir': 'up', 'car_calls': [], 'hall_up': [4, 6, 1], 'hall_down': [7, 11]}, [11, 'up']), ('boundary: up car with nothing above', {'floor': 6, 'dir': 'up', 'car_calls': [2], 'hall_up': [1], 'hall_down': []}, [2, 'down']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('control 34', {'floor': 11, 'dir': 'down', 'car_calls': [10], 'hall_up': [4, 5], 'hall_down': []}, [10, 'down']), ('control 37', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [0, 1], 'hall_down': [1, 7]}, [7, 'up']), ('control 40', {'floor': 9, 'dir': 'up', 'car_calls': [1, 9], 'hall_up': [8, 10, 5], 'hall_down': []}, [10, 'up'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('control 37', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [0, 1], 'hall_down': [1, 7]}, [7, 'up']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('boundary: car call ahead of an up call', {'floor': 2, 'dir': 'up', 'car_calls': [6], 'hall_up': [4], 'hall_down': []}, [4, 'up']), ('control 45', {'floor': 9, 'dir': 'idle', 'car_calls': [9, 0], 'hall_up': [7], 'hall_down': [2, 6, 1]}, [6, 'down']), ('control 48', {'floor': 4, 'dir': 'down', 'car_calls': [9], 'hall_up': [4, 2, 1], 'hall_down': []}, [1, 'down']), ('control 51', {'floor': 6, 'dir': 'idle', 'car_calls': [6], 'hall_up': [9], 'hall_down': []}, [9, 'up'])]]
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: highest down call is the reversal | [4, 'up'] | [9, 'up'] | Failed |
| sampled regression 17 | [10, 'up'] | [11, 'up'] | Failed |
| boundary: idle car with a call at its own floor | [8, 'up'] | [8, 'up'] | Passed |
| boundary: down call passed on the way up | [8, 'up'] | [8, 'up'] | Passed |
| boundary: car call ahead of an up call | [4, 'up'] | [4, 'up'] | Passed |
| control 1 | [4, 'up'] | [4, 'up'] | Passed |
| control 4 | [0, 'down'] | [0, 'down'] | Passed |
| control 7 | [2, 'down'] | [2, 'down'] | Passed |
SHA-256 / 373f612c7de6e820681361008bccdaf3a9a25fb4405acbd530161445f99de835
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
f = x['floor']
cc = set(x['car_calls'])
up = set(x['hall_up'])
dn = set(x['hall_down'])
def ahead(sd):
if sd == 'up':
same = [c for c in cc | up if c > f]
if same:
return [min(same), 'up']
opp = [c for c in dn if c > f]
if opp:
return [max(opp), 'down']
else:
same = [c for c in cc | dn if c < f]
if same:
return [max(same), 'down']
opp = [c for c in up if c < f]
if opp:
return [min(opp), 'down']
return None
d = x['dir']
if d == 'idle':
allc = [c for c in sorted(cc | up | dn, key=lambda c: (abs(c - f), c)) if c != f]
if not allc:
return [None, 'idle']
d = 'up' if allc[0] > f else 'down'
r = ahead(d)
if r is None:
r = ahead('down' if d == 'up' else 'up')
return r if r is not None else [None, 'idle']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('boundary: car call ahead of an up call', {'floor': 2, 'dir': 'up', 'car_calls': [6], 'hall_up': [4], 'hall_down': []}, [4, 'up']), ('control 1', {'floor': 1, 'dir': 'down', 'car_calls': [7, 4, 8], 'hall_up': [], 'hall_down': [10, 5, 3]}, [4, 'up']), ('control 4', {'floor': 4, 'dir': 'down', 'car_calls': [10], 'hall_up': [6, 0], 'hall_down': [10]}, [0, 'down']), ('control 7', {'floor': 3, 'dir': 'down', 'car_calls': [7, 3], 'hall_up': [10], 'hall_down': [2, 4, 7]}, [2, 'down'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('boundary: idle car equidistant calls', {'floor': 5, 'dir': 'idle', 'car_calls': [3, 7], 'hall_up': [], 'hall_down': []}, [3, 'down']), ('boundary: idle car nearest call above', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [6], 'hall_down': [1]}, [6, 'up']), ('boundary: down car with nothing below', {'floor': 6, 'dir': 'down', 'car_calls': [], 'hall_up': [9], 'hall_down': []}, [9, 'up']), ('control 12', {'floor': 5, 'dir': 'idle', 'car_calls': [6, 9], 'hall_up': [6, 10], 'hall_down': [6, 2, 7]}, [6, 'up']), ('control 15', {'floor': 3, 'dir': 'down', 'car_calls': [], 'hall_up': [2, 4, 10], 'hall_down': [6, 5, 8]}, [2, 'down']), ('control 18', {'floor': 1, 'dir': 'idle', 'car_calls': [1], 'hall_up': [10, 1, 2], 'hall_down': [5]}, [2, 'up'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('control 58', {'floor': 0, 'dir': 'idle', 'car_calls': [], 'hall_up': [0], 'hall_down': [6]}, [6, 'up']), ('boundary: idle car nearest call above', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [6], 'hall_down': [1]}, [6, 'up']), ('boundary: down car with nothing below', {'floor': 6, 'dir': 'down', 'car_calls': [], 'hall_up': [9], 'hall_down': []}, [9, 'up']), ('control 23', {'floor': 1, 'dir': 'idle', 'car_calls': [], 'hall_up': [5], 'hall_down': []}, [5, 'up']), ('control 26', {'floor': 7, 'dir': 'idle', 'car_calls': [9], 'hall_up': [3], 'hall_down': [10, 5, 9]}, [5, 'down']), ('control 29', {'floor': 4, 'dir': 'down', 'car_calls': [2], 'hall_up': [5], 'hall_down': []}, [2, 'down'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('boundary: idle car with a call at its own floor', {'floor': 4, 'dir': 'idle', 'car_calls': [], 'hall_up': [4], 'hall_down': [8]}, [8, 'up']), ('control 42', {'floor': 10, 'dir': 'up', 'car_calls': [], 'hall_up': [4, 6, 1], 'hall_down': [7, 11]}, [11, 'up']), ('boundary: up car with nothing above', {'floor': 6, 'dir': 'up', 'car_calls': [2], 'hall_up': [1], 'hall_down': []}, [2, 'down']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('control 34', {'floor': 11, 'dir': 'down', 'car_calls': [10], 'hall_up': [4, 5], 'hall_down': []}, [10, 'down']), ('control 37', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [0, 1], 'hall_down': [1, 7]}, [7, 'up']), ('control 40', {'floor': 9, 'dir': 'up', 'car_calls': [1, 9], 'hall_up': [8, 10, 5], 'hall_down': []}, [10, 'up'])], [('regression: highest down call is the reversal', {'floor': 1, 'dir': 'up', 'car_calls': [], 'hall_up': [], 'hall_down': [4, 9]}, [9, 'up']), ('sampled regression 17', {'floor': 9, 'dir': 'up', 'car_calls': [], 'hall_up': [9, 6, 1], 'hall_down': [10, 9, 11]}, [11, 'up']), ('control 37', {'floor': 5, 'dir': 'idle', 'car_calls': [], 'hall_up': [0, 1], 'hall_down': [1, 7]}, [7, 'up']), ('boundary: down call passed on the way up', {'floor': 3, 'dir': 'up', 'car_calls': [8], 'hall_up': [], 'hall_down': [5]}, [8, 'up']), ('boundary: car call ahead of an up call', {'floor': 2, 'dir': 'up', 'car_calls': [6], 'hall_up': [4], 'hall_down': []}, [4, 'up']), ('control 45', {'floor': 9, 'dir': 'idle', 'car_calls': [9, 0], 'hall_up': [7], 'hall_down': [2, 6, 1]}, [6, 'down']), ('control 48', {'floor': 4, 'dir': 'down', 'car_calls': [9], 'hall_up': [4, 2, 1], 'hall_down': []}, [1, 'down']), ('control 51', {'floor': 6, 'dir': 'idle', 'car_calls': [6], 'hall_up': [9], 'hall_down': []}, [9, 'up'])]]
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: highest down call is the reversal | [9, 'down'] | [9, 'up'] | Failed |
| sampled regression 17 | [11, 'down'] | [11, 'up'] | Failed |
| boundary: idle car with a call at its own floor | [8, 'down'] | [8, 'up'] | Failed |
| boundary: down call passed on the way up | [8, 'up'] | [8, 'up'] | Passed |
| boundary: car call ahead of an up call | [4, 'up'] | [4, 'up'] | Passed |
| control 1 | [4, 'up'] | [4, 'up'] | Passed |
| control 4 | [0, 'down'] | [0, 'down'] | Passed |
| control 7 | [2, 'down'] | [2, 'down'] | Passed |
SHA-256 / 6f1d77dff4bd862c70a1a643ed5eb555b5a31da2a4b3c2dac9d4e0a63dd7e7a3
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:51.994392+00:00.
Case digest / 2bfe9a23ac03f63b24a920b60b1f09671b6b6b0446fba030beaed289c94b3945