FAILURE MAP
← Case archive

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

Low estimate rounded to the nearest dollar · case 01

The low end of the range can exceed 90% of the estimate.

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

ROOT CAUSE

The low bound rounds half up instead of flooring to a dollar.

VERIFIED REPAIR

Floor the low bound to whole dollars.

Unsuccessful approach: Nearest-dollar rounding with round() still rounds some low ends upward.

Case contract

Show a fare range from a point estimate in cents: low = 90% of the estimate floored to whole dollars, but never below the minimum fare; high = 110% of the estimate rounded up to whole dollars; if the range is narrower than 2.00 the high end becomes low + 2.00. Return [low, high] cents.

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(est, minimum):
    low = max((est * 9 // 10 + 50) // 100 * 100, minimum)
    high = -(-(est * 11) // 1000) * 100
    if high - low < 200:
        high = low + 200
    return [low, high]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [2082, 800], [1800, 2300]),
  ('second regression', [1111, 800], [900, 1300]), ('normal control 1', [1000, 1000], [1000, 1200]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [2050, 1000], [1800, 2300]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [700, 500], [600, 800]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [4383, 1000], [3900, 4900]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [2500, 800], [2200, 2800]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 500], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [2050, 500], [1800, 2300]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [1999, 1000], [1700, 2200]),
  ('partial repair probe: low end rounding', [1111, 500], [900, 1300]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 800], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [1000, 1000], [1000, 1200]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [4887, 500], [4300, 5400]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 800], [2200, 2800]), ('normal control 1', [2050, 500], [1800, 2300]),
  ('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [700, 800], [800, 1000]),
  ('normal control 4', [2904, 500], [2600, 3200])]]
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: low end rounding[1800, 2200][1700, 2200]Failed
partial repair probe: low end rounding[1900, 2300][1800, 2300]Failed
second regression[1000, 1300][900, 1300]Failed
normal control 1[1000, 1200][1000, 1200]Passed
normal control 2[1100, 1400][1100, 1400]Passed
normal control 3[1800, 2300][1800, 2300]Passed
normal control 4[1100, 1400][1100, 1400]Passed

SHA-256 / ffd3aee1329d3c1acd6dff9cfb530a6c70188957dc935bae6df67a630e60a00d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(est, minimum):
    low = max(round(est * 0.9 / 100) * 100, minimum)
    high = -(-(est * 11) // 1000) * 100
    if high - low < 200:
        high = low + 200
    return [low, high]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [2082, 800], [1800, 2300]),
  ('second regression', [1111, 800], [900, 1300]), ('normal control 1', [1000, 1000], [1000, 1200]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [2050, 1000], [1800, 2300]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [700, 500], [600, 800]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [4383, 1000], [3900, 4900]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [2500, 800], [2200, 2800]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 500], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [2050, 500], [1800, 2300]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [1999, 1000], [1700, 2200]),
  ('partial repair probe: low end rounding', [1111, 500], [900, 1300]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 800], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [1000, 1000], [1000, 1200]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [4887, 500], [4300, 5400]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 800], [2200, 2800]), ('normal control 1', [2050, 500], [1800, 2300]),
  ('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [700, 800], [800, 1000]),
  ('normal control 4', [2904, 500], [2600, 3200])]]
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: low end rounding[1800, 2200][1700, 2200]Failed
partial repair probe: low end rounding[1900, 2300][1800, 2300]Failed
second regression[1000, 1300][900, 1300]Failed
normal control 1[1000, 1200][1000, 1200]Passed
normal control 2[1100, 1400][1100, 1400]Passed
normal control 3[1800, 2300][1800, 2300]Passed
normal control 4[1100, 1400][1100, 1400]Passed

SHA-256 / fc213a8510320d86183453a3842f6479b1372f8a9cadd34c4d754c114d984863

3 / The verified repair

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

N = 1
observations = []
def solve(est, minimum):
    low = max(est * 9 // 10 // 100 * 100, minimum)
    high = -(-(est * 11) // 1000) * 100
    if high - low < 200:
        high = low + 200
    return [low, high]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [2082, 800], [1800, 2300]),
  ('second regression', [1111, 800], [900, 1300]), ('normal control 1', [1000, 1000], [1000, 1200]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [2050, 1000], [1800, 2300]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [1999, 800], [1700, 2200]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [700, 500], [600, 800]),
  ('normal control 2', [1234, 500], [1100, 1400]), ('normal control 3', [4383, 1000], [3900, 4900]),
  ('normal control 4', [1234, 800], [1100, 1400])],
 [('regression: low end rounding', [2500, 800], [2200, 2800]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 500], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [2050, 500], [1800, 2300]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [1999, 1000], [1700, 2200]),
  ('partial repair probe: low end rounding', [1111, 500], [900, 1300]),
  ('second regression', [2500, 500], [2200, 2800]), ('normal control 1', [1000, 800], [900, 1100]),
  ('normal control 2', [1234, 800], [1100, 1400]), ('normal control 3', [1000, 1000], [1000, 1200]),
  ('normal control 4', [700, 500], [600, 800])],
 [('regression: low end rounding', [4887, 500], [4300, 5400]),
  ('partial repair probe: low end rounding', [1999, 500], [1700, 2200]),
  ('second regression', [2500, 800], [2200, 2800]), ('normal control 1', [2050, 500], [1800, 2300]),
  ('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [700, 800], [800, 1000]),
  ('normal control 4', [2904, 500], [2600, 3200])]]
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: low end rounding[1700, 2200][1700, 2200]Passed
partial repair probe: low end rounding[1800, 2300][1800, 2300]Passed
second regression[900, 1300][900, 1300]Passed
normal control 1[1000, 1200][1000, 1200]Passed
normal control 2[1100, 1400][1100, 1400]Passed
normal control 3[1800, 2300][1800, 2300]Passed
normal control 4[1100, 1400][1100, 1400]Passed

SHA-256 / 9efc5514f6d87c7ec4c71fe144c97e137238b0ac078c4d5f2634bbed59ac29da

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

Case digest / db38432185f0ecc78130bce7e3b6ff6427f1432a47615c461dbf76f03780d47d