FAILURE MAP
← Case archive

FA-85361 / Ride-hailing fare and surge pricing / Open access

Surge damping applied to increases instead of decreases · case 01

Surge creeps up slowly during a demand spike and collapses instantly afterwards.

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

ROOT CAUSE

The rate limiter caps rises and lets drops through unchanged.

VERIFIED REPAIR

Rise immediately and limit only the per-interval decrease.

Unsuccessful approach: Limiting both directions still delays the required immediate rise.

Case contract

Each interval gives [open requests, idle drivers]. The raw multiplier (tenths) is 30 when the exact ratio requests/drivers >= 3, 20 when >= 2, 15 when >= 1.5, 12 when >= 1.2, else 10; with zero drivers it is 30 if any request is open, else 10. The published multiplier rises immediately to the raw value but falls by at most 2 tenths per interval, starting from prev. Return the published multiplier per interval.

Why this case matters

Ride-hailing prices are computed per trip at scale; ordering, unit and boundary slips become systematic over- or under-charging.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(obs, prev):
    tiers = [(30, 30), (20, 20), (15, 15), (12, 12)]
    cur = prev
    out = []
    for req, drv in obs:
        raw = 10
        if drv == 0:
            raw = 30 if req > 0 else 10
        else:
            for th, mult in tiers:
                if req * 10 >= th * drv:
                    raw = mult
                    break
        cur = min(raw, cur + 2) if raw >= cur else raw
        out.append(cur)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hysteresis direction', [[[2, 10], [1, 10], [22, 7]], 12], [10, 10, 30]),
  ('partial repair probe: hysteresis direction',
   [[[23, 7], [5, 5], [14, 5], [19, 7], [30, 10], [20, 10]], 30], [30, 28, 26, 24, 30, 28]),
  ('second regression', [[[6, 7], [4, 5], [6, 7], [0, 0], [4, 5], [19, 10]], 30], [28, 26, 24, 22, 20, 18]),
  ('normal control 1', [[[0, 0], [4, 10], [8, 10], [6, 7], [25, 20], [2, 5]], 10], [10, 10, 10, 10, 12, 10]),
  ('normal control 2', [[[0, 0], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[10, 10], [-1, 0]], 10], [10, 10]),
  ('normal control 4', [[[-1, 0], [7, 7]], 10], [10, 10])],
 [('regression: hysteresis direction', [[[11, 10], [-1, 0], [20, 20], [19, 10], [12, 10], [18, 10]], 10],
   [10, 10, 10, 15, 13, 15]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [0, 0], [21, 7], [11, 10], [0, 0], [31, 10]], 10],
   [10, 10, 30, 28, 26, 30]),
  ('second regression', [[[4, 5], [8, 20], [38, 20]], 20], [18, 16, 15]),
  ('normal control 1', [[[9, 10], [7, 5]], 12], [10, 12]),
  ('normal control 2', [[[10, 20], [6, 7]], 10], [10, 10]),
  ('normal control 3', [[[10, 10], [3, 7]], 10], [10, 10]),
  ('normal control 4', [[[5, 10], [6, 5]], 12], [10, 12])],
 [('regression: hysteresis direction', [[[19, 20], [9, 5], [20, 20]], 15], [13, 15, 13]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [4, 10], [30, 7], [9, 10], [5, 5], [14, 10]], 15],
   [13, 11, 30, 28, 26, 24]),
  ('second regression', [[[10, 5], [11, 10], [16, 20], [3, 7], [1, 5]], 20], [20, 18, 16, 14, 12]),
  ('normal control 1', [[[7, 10], [2, 5]], 12], [10, 10]),
  ('normal control 2', [[[6, 5], [4, 20], [0, 0]], 12], [12, 10, 10]),
  ('normal control 3', [[[7, 5], [6, 10]], 12], [12, 10]),
  ('normal control 4', [[[0, 0], [9, 10]], 12], [10, 10])],
 [('regression: hysteresis direction', [[[0, 0], [24, 0], [1, 10], [6, 20], [5, 10]], 15],
   [13, 30, 28, 26, 24]),
  ('partial repair probe: hysteresis direction', [[[31, 7], [27, 0], [9, 20]], 12], [30, 30, 28]),
  ('second regression', [[[10, 20], [26, 0], [5, 10]], 30], [28, 30, 28]),
  ('normal control 1', [[[10, 10], [12, 10]], 10], [10, 12]),
  ('normal control 2', [[[15, 20], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[5, 5], [11, 10], [0, 0]], 10], [10, 10, 10]),
  ('normal control 4', [[[38, 20], [16, 10]], 15], [15, 15])],
 [('regression: hysteresis direction', [[[32, 0], [16, 20]], 15], [30, 28]),
  ('partial repair probe: hysteresis direction', [[[30, 10], [4, 5]], 12], [30, 28]),
  ('second regression', [[[20, 5], [14, 7], [15, 10], [1, 7], [24, 20]], 15], [30, 28, 26, 24, 22]),
  ('normal control 1', [[[2, 5], [0, 0], [24, 20], [10, 10]], 12], [10, 10, 12, 10]),
  ('normal control 2', [[[5, 5], [10, 10]], 12], [10, 10]),
  ('normal control 3', [[[24, 20], [10, 7], [8, 10], [5, 10], [0, 0]], 12], [12, 12, 10, 10, 10]),
  ('normal control 4', [[[5, 10], [-1, 0]], 10], [10, 10])]]
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
regression: hysteresis direction[10, 10, 12][10, 10, 30]Failed
partial repair probe: hysteresis direction[30, 10, 12, 14, 16, 18][30, 28, 26, 24, 30, 28]Failed
second regression[10, 10, 10, 10, 10, 12][28, 26, 24, 22, 20, 18]Failed
normal control 1[10, 10, 10, 10, 12, 10][10, 10, 10, 10, 12, 10]Passed
normal control 2[10, 10][10, 10]Passed
normal control 3[10, 10][10, 10]Passed
normal control 4[10, 10][10, 10]Passed

SHA-256 / f5649bdda66d2de2ec21a4645dcd28283ebeef977dc806c4fa2bea8c2be9e425

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(obs, prev):
    tiers = [(30, 30), (20, 20), (15, 15), (12, 12)]
    cur = prev
    out = []
    for req, drv in obs:
        raw = 10
        if drv == 0:
            raw = 30 if req > 0 else 10
        else:
            for th, mult in tiers:
                if req * 10 >= th * drv:
                    raw = mult
                    break
        cur = min(raw, cur + 2) if raw >= cur else max(raw, cur - 2)
        out.append(cur)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hysteresis direction', [[[2, 10], [1, 10], [22, 7]], 12], [10, 10, 30]),
  ('partial repair probe: hysteresis direction',
   [[[23, 7], [5, 5], [14, 5], [19, 7], [30, 10], [20, 10]], 30], [30, 28, 26, 24, 30, 28]),
  ('second regression', [[[6, 7], [4, 5], [6, 7], [0, 0], [4, 5], [19, 10]], 30], [28, 26, 24, 22, 20, 18]),
  ('normal control 1', [[[0, 0], [4, 10], [8, 10], [6, 7], [25, 20], [2, 5]], 10], [10, 10, 10, 10, 12, 10]),
  ('normal control 2', [[[0, 0], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[10, 10], [-1, 0]], 10], [10, 10]),
  ('normal control 4', [[[-1, 0], [7, 7]], 10], [10, 10])],
 [('regression: hysteresis direction', [[[11, 10], [-1, 0], [20, 20], [19, 10], [12, 10], [18, 10]], 10],
   [10, 10, 10, 15, 13, 15]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [0, 0], [21, 7], [11, 10], [0, 0], [31, 10]], 10],
   [10, 10, 30, 28, 26, 30]),
  ('second regression', [[[4, 5], [8, 20], [38, 20]], 20], [18, 16, 15]),
  ('normal control 1', [[[9, 10], [7, 5]], 12], [10, 12]),
  ('normal control 2', [[[10, 20], [6, 7]], 10], [10, 10]),
  ('normal control 3', [[[10, 10], [3, 7]], 10], [10, 10]),
  ('normal control 4', [[[5, 10], [6, 5]], 12], [10, 12])],
 [('regression: hysteresis direction', [[[19, 20], [9, 5], [20, 20]], 15], [13, 15, 13]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [4, 10], [30, 7], [9, 10], [5, 5], [14, 10]], 15],
   [13, 11, 30, 28, 26, 24]),
  ('second regression', [[[10, 5], [11, 10], [16, 20], [3, 7], [1, 5]], 20], [20, 18, 16, 14, 12]),
  ('normal control 1', [[[7, 10], [2, 5]], 12], [10, 10]),
  ('normal control 2', [[[6, 5], [4, 20], [0, 0]], 12], [12, 10, 10]),
  ('normal control 3', [[[7, 5], [6, 10]], 12], [12, 10]),
  ('normal control 4', [[[0, 0], [9, 10]], 12], [10, 10])],
 [('regression: hysteresis direction', [[[0, 0], [24, 0], [1, 10], [6, 20], [5, 10]], 15],
   [13, 30, 28, 26, 24]),
  ('partial repair probe: hysteresis direction', [[[31, 7], [27, 0], [9, 20]], 12], [30, 30, 28]),
  ('second regression', [[[10, 20], [26, 0], [5, 10]], 30], [28, 30, 28]),
  ('normal control 1', [[[10, 10], [12, 10]], 10], [10, 12]),
  ('normal control 2', [[[15, 20], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[5, 5], [11, 10], [0, 0]], 10], [10, 10, 10]),
  ('normal control 4', [[[38, 20], [16, 10]], 15], [15, 15])],
 [('regression: hysteresis direction', [[[32, 0], [16, 20]], 15], [30, 28]),
  ('partial repair probe: hysteresis direction', [[[30, 10], [4, 5]], 12], [30, 28]),
  ('second regression', [[[20, 5], [14, 7], [15, 10], [1, 7], [24, 20]], 15], [30, 28, 26, 24, 22]),
  ('normal control 1', [[[2, 5], [0, 0], [24, 20], [10, 10]], 12], [10, 10, 12, 10]),
  ('normal control 2', [[[5, 5], [10, 10]], 12], [10, 10]),
  ('normal control 3', [[[24, 20], [10, 7], [8, 10], [5, 10], [0, 0]], 12], [12, 12, 10, 10, 10]),
  ('normal control 4', [[[5, 10], [-1, 0]], 10], [10, 10])]]
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
regression: hysteresis direction[10, 10, 12][10, 10, 30]Failed
partial repair probe: hysteresis direction[30, 28, 26, 24, 26, 24][30, 28, 26, 24, 30, 28]Failed
second regression[28, 26, 24, 22, 20, 18][28, 26, 24, 22, 20, 18]Passed
normal control 1[10, 10, 10, 10, 12, 10][10, 10, 10, 10, 12, 10]Passed
normal control 2[10, 10][10, 10]Passed
normal control 3[10, 10][10, 10]Passed
normal control 4[10, 10][10, 10]Passed

SHA-256 / 8a67bc5a644612db473a4d0d1e3e1da06875c930946d557a7cee6edab5e9d23e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(obs, prev):
    tiers = [(30, 30), (20, 20), (15, 15), (12, 12)]
    cur = prev
    out = []
    for req, drv in obs:
        raw = 10
        if drv == 0:
            raw = 30 if req > 0 else 10
        else:
            for th, mult in tiers:
                if req * 10 >= th * drv:
                    raw = mult
                    break
        cur = raw if raw >= cur else max(raw, cur - 2)
        out.append(cur)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: hysteresis direction', [[[2, 10], [1, 10], [22, 7]], 12], [10, 10, 30]),
  ('partial repair probe: hysteresis direction',
   [[[23, 7], [5, 5], [14, 5], [19, 7], [30, 10], [20, 10]], 30], [30, 28, 26, 24, 30, 28]),
  ('second regression', [[[6, 7], [4, 5], [6, 7], [0, 0], [4, 5], [19, 10]], 30], [28, 26, 24, 22, 20, 18]),
  ('normal control 1', [[[0, 0], [4, 10], [8, 10], [6, 7], [25, 20], [2, 5]], 10], [10, 10, 10, 10, 12, 10]),
  ('normal control 2', [[[0, 0], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[10, 10], [-1, 0]], 10], [10, 10]),
  ('normal control 4', [[[-1, 0], [7, 7]], 10], [10, 10])],
 [('regression: hysteresis direction', [[[11, 10], [-1, 0], [20, 20], [19, 10], [12, 10], [18, 10]], 10],
   [10, 10, 10, 15, 13, 15]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [0, 0], [21, 7], [11, 10], [0, 0], [31, 10]], 10],
   [10, 10, 30, 28, 26, 30]),
  ('second regression', [[[4, 5], [8, 20], [38, 20]], 20], [18, 16, 15]),
  ('normal control 1', [[[9, 10], [7, 5]], 12], [10, 12]),
  ('normal control 2', [[[10, 20], [6, 7]], 10], [10, 10]),
  ('normal control 3', [[[10, 10], [3, 7]], 10], [10, 10]),
  ('normal control 4', [[[5, 10], [6, 5]], 12], [10, 12])],
 [('regression: hysteresis direction', [[[19, 20], [9, 5], [20, 20]], 15], [13, 15, 13]),
  ('partial repair probe: hysteresis direction', [[[0, 0], [4, 10], [30, 7], [9, 10], [5, 5], [14, 10]], 15],
   [13, 11, 30, 28, 26, 24]),
  ('second regression', [[[10, 5], [11, 10], [16, 20], [3, 7], [1, 5]], 20], [20, 18, 16, 14, 12]),
  ('normal control 1', [[[7, 10], [2, 5]], 12], [10, 10]),
  ('normal control 2', [[[6, 5], [4, 20], [0, 0]], 12], [12, 10, 10]),
  ('normal control 3', [[[7, 5], [6, 10]], 12], [12, 10]),
  ('normal control 4', [[[0, 0], [9, 10]], 12], [10, 10])],
 [('regression: hysteresis direction', [[[0, 0], [24, 0], [1, 10], [6, 20], [5, 10]], 15],
   [13, 30, 28, 26, 24]),
  ('partial repair probe: hysteresis direction', [[[31, 7], [27, 0], [9, 20]], 12], [30, 30, 28]),
  ('second regression', [[[10, 20], [26, 0], [5, 10]], 30], [28, 30, 28]),
  ('normal control 1', [[[10, 10], [12, 10]], 10], [10, 12]),
  ('normal control 2', [[[15, 20], [11, 10]], 12], [10, 10]),
  ('normal control 3', [[[5, 5], [11, 10], [0, 0]], 10], [10, 10, 10]),
  ('normal control 4', [[[38, 20], [16, 10]], 15], [15, 15])],
 [('regression: hysteresis direction', [[[32, 0], [16, 20]], 15], [30, 28]),
  ('partial repair probe: hysteresis direction', [[[30, 10], [4, 5]], 12], [30, 28]),
  ('second regression', [[[20, 5], [14, 7], [15, 10], [1, 7], [24, 20]], 15], [30, 28, 26, 24, 22]),
  ('normal control 1', [[[2, 5], [0, 0], [24, 20], [10, 10]], 12], [10, 10, 12, 10]),
  ('normal control 2', [[[5, 5], [10, 10]], 12], [10, 10]),
  ('normal control 3', [[[24, 20], [10, 7], [8, 10], [5, 10], [0, 0]], 12], [12, 12, 10, 10, 10]),
  ('normal control 4', [[[5, 10], [-1, 0]], 10], [10, 10])]]
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
regression: hysteresis direction[10, 10, 30][10, 10, 30]Passed
partial repair probe: hysteresis direction[30, 28, 26, 24, 30, 28][30, 28, 26, 24, 30, 28]Passed
second regression[28, 26, 24, 22, 20, 18][28, 26, 24, 22, 20, 18]Passed
normal control 1[10, 10, 10, 10, 12, 10][10, 10, 10, 10, 12, 10]Passed
normal control 2[10, 10][10, 10]Passed
normal control 3[10, 10][10, 10]Passed
normal control 4[10, 10][10, 10]Passed

SHA-256 / 83c747fc9eee22d357bafac95e45f6958416cf2991f54ab6e99e8279489c4aa0

Verification & scope

A deterministic toy pricing contract stipulated for this example; it does not reproduce the pricing of any real ride-hailing operator or regulator. 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:50:39.715888+00:00.

Case digest / dfd50cb029db81103484482cb821ab52b8527b25909519e24c4672eec3d707a9