FAILURE MAP
← Case archive

FA-67556 / Elevator dispatch scheduling / Open access

Hall call ETA with intermediate stops: direct leg stops · case 01

A direct run charges a stop at the car current floor or stops beyond the target.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The stop window is inclusive at both ends.

THE FAILURE

The stop window is inclusive at both ends.

Unsuccessful approach: Counting every stop ahead charges stops beyond the target.

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 = [[('sampled regression 41', {'floor': 11, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [8, 11, 13], 'per_floor_s': 3, 'stop_s': 12}, 27), ('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), ('control 7', {'floor': 7, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [1, 13, 9, 2], 'per_floor_s': 3, 'stop_s': 12}, 24), ('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 10', {'floor': 3, 'dir': 'up', 'target': 1, 'call_dir': 'down', 'stops': [15, 13], 'per_floor_s': 3, 'stop_s': 10}, 98)], [('sampled regression 64', {'floor': 10, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [10, 15], 'per_floor_s': 3, 'stop_s': 8}, 9), ('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: 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: 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: 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 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)], [('sampled regression 66', {'floor': 14, 'dir': 'down', 'target': 5, 'call_dir': 'down', 'stops': [14, 8, 0], 'per_floor_s': 2, 'stop_s': 10}, 28), ('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), ('control 19', {'floor': 15, 'dir': 'down', 'target': 7, 'call_dir': 'down', 'stops': [8, 13, 0], 'per_floor_s': 2, 'stop_s': 8}, 32), ('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)], [('sampled regression 41', {'floor': 11, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [8, 11, 13], 'per_floor_s': 3, 'stop_s': 12}, 27), ('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), ('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 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)], [('sampled regression 64', {'floor': 10, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [10, 15], 'per_floor_s': 3, 'stop_s': 8}, 9), ('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), ('control 30', {'floor': 7, 'dir': 'up', 'target': 9, 'call_dir': 'up', 'stops': [4, 0, 15, 2], 'per_floor_s': 3, 'stop_s': 12}, 6), ('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: 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 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 fixtureActualExpectedOutcome
sampled regression 413927Failed
boundary: stops beyond the target1818Passed
control 72424Passed
boundary: down car mirrored2222Passed
boundary: call behind a down car3030Passed
control 14848Passed
control 46262Passed
control 109898Passed

SHA-256 / e6167e0736c7a941825504e90504f27ca87f192fb044a3f0a48f45e8fbf64c7b

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 and same:
        path = t - f
        n = len([s for s in stops if s > f])
    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 = [[('sampled regression 41', {'floor': 11, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [8, 11, 13], 'per_floor_s': 3, 'stop_s': 12}, 27), ('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), ('control 7', {'floor': 7, 'dir': 'up', 'target': 11, 'call_dir': 'up', 'stops': [1, 13, 9, 2], 'per_floor_s': 3, 'stop_s': 12}, 24), ('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 10', {'floor': 3, 'dir': 'up', 'target': 1, 'call_dir': 'down', 'stops': [15, 13], 'per_floor_s': 3, 'stop_s': 10}, 98)], [('sampled regression 64', {'floor': 10, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [10, 15], 'per_floor_s': 3, 'stop_s': 8}, 9), ('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: 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: 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: 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 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)], [('sampled regression 66', {'floor': 14, 'dir': 'down', 'target': 5, 'call_dir': 'down', 'stops': [14, 8, 0], 'per_floor_s': 2, 'stop_s': 10}, 28), ('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), ('control 19', {'floor': 15, 'dir': 'down', 'target': 7, 'call_dir': 'down', 'stops': [8, 13, 0], 'per_floor_s': 2, 'stop_s': 8}, 32), ('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)], [('sampled regression 41', {'floor': 11, 'dir': 'down', 'target': 6, 'call_dir': 'down', 'stops': [8, 11, 13], 'per_floor_s': 3, 'stop_s': 12}, 27), ('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), ('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 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)], [('sampled regression 64', {'floor': 10, 'dir': 'up', 'target': 13, 'call_dir': 'up', 'stops': [10, 15], 'per_floor_s': 3, 'stop_s': 8}, 9), ('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), ('control 30', {'floor': 7, 'dir': 'up', 'target': 9, 'call_dir': 'up', 'stops': [4, 0, 15, 2], 'per_floor_s': 3, 'stop_s': 12}, 6), ('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: 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 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 fixtureActualExpectedOutcome
sampled regression 412727Passed
boundary: stops beyond the target2818Failed
control 73624Failed
boundary: down car mirrored2222Passed
boundary: call behind a down car3030Passed
control 14848Passed
control 46262Passed
control 109898Passed

SHA-256 / bd6707dde61f80672123c2aa80f0dca4d9002aafc1144a7d7c9ba7e7a8198ca5

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:53.949341+00:00.

Case digest / 1740e9c546b5f63355dcb1b8f1048c8dd73e0aa81e05e1b4e42e68c808ac19f2