FAILURE MAP
← Case archive

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

Distance floored once on the trip total · case 01

Trips with many short segments bill a few more meters than the per-segment rule.

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

ROOT CAUSE

Exact segment lengths are summed and only the total is floored.

VERIFIED REPAIR

Floor each segment to whole meters before summing.

Unsuccessful approach: Rounding each segment to nearest meter still overbills fractional segments.

Case contract

Billable distance from GPS pings [t seconds, x m, y m, accuracy m, paused]. Sort by time (stable); drop pings with accuracy worse than max_acc; among remaining pings with the same timestamp keep the first. Walk the kept pings with an anchor: segment length is the floored Euclidean distance (isqrt); if it implies a speed above max_speed m/s the ping is discarded and the anchor stays; otherwise the segment is billed unless either endpoint is paused, and the anchor moves. Return total meters.

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
import math
N = 1
observations = []
def solve(pings, max_acc, max_speed):
    kept = []
    seen = set()
    for p in sorted(pings, key=lambda p: p[0]):
        if p[3] > max_acc:
            continue
        if p[0] in seen:
            continue
        seen.add(p[0])
        kept.append(p)
    total = 0
    anchor = None
    for p in kept:
        if anchor is None:
            anchor = p
            continue
        d = math.hypot(p[1] - anchor[1], p[2] - anchor[2])
        dt = p[0] - anchor[0]
        if d > max_speed * dt:
            continue
        if not (p[4] or anchor[4]):
            total += d
        anchor = p
    return int(total)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: segment floor',
   [[[20, 475, 38, 5, False], [5, 75, 53, 5, False], [30, 505, 71, 5, False], [10, 475, 53, 20, True],
     [40, 610, 76, 5, False], [35, 565, 56, 10, False], [5, 45, 20, 60, False]],
    20, 30],
   554),
  ('partial repair probe: segment floor',
   [[[5, 45, 33, 10, False], [10, 90, 66, 10, False], [10, 135, 86, 20, False], [15, 535, 71, 25, False],
     [20, 535, 104, 20, False]],
    20, 30],
   55),
  ('second regression',
   [[[20, 520, 38, 20, True], [5, 30, -15, 5, False], [30, 965, 104, 5, False], [15, 490, 38, 25, False],
     [5, 90, 18, 5, False], [0, 0, -15, 20, False], [25, 565, 71, 5, False]],
    20, 30],
   571),
  ('normal control 1',
   [[[30, 980, 83, 5, False], [25, 520, 43, 10, True], [15, 60, 38, 10, True], [5, 60, 18, 25, False],
     [25, 490, 58, 5, False], [20, 90, 38, 20, False], [5, 60, 33, 25, False], [25, 580, 63, 20, True]],
    20, 30],
   0),
  ('normal control 2',
   [[[25, 550, 43, 20, True], [5, 460, 40, 20, False], [20, 550, 58, 20, False], [35, 655, 48, 60, False],
     [10, 520, 73, 60, False], [0, 60, 20, 10, True], [25, 595, 28, 20, False], [40, 700, 68, 60, False]],
    20, 30],
   0),
  ('normal control 3',
   [[[30, 520, 53, 20, True], [20, 120, 53, 25, False], [40, 1025, 78, 25, False], [35, 625, 58, 25, False],
     [10, 45, 33, 20, False], [35, 580, 38, 20, False], [15, 75, 33, 25, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 400, 33, 25, False], [10, 445, 66, 20, False], [15, 845, 99, 10, False], [20, 875, 132, 20, True],
     [25, 875, 117, 20, False]],
    20, 30],
   433)],
 [('regression: segment floor',
   [[[10, 45, 33, 20, False], [10, 90, 18, 60, True], [15, 135, 38, 60, False], [15, 180, 38, 60, False],
     [20, 180, 23, 20, False], [25, 225, 56, 20, False], [30, 225, 41, 20, True]],
    20, 30],
   190),
  ('partial repair probe: segment floor',
   [[[5, 30, 33, 10, False], [10, 30, 33, 25, False], [15, 90, 18, 10, False]], 20, 30], 61),
  ('second regression',
   [[[40, 1365, 21, 25, False], [35, 1335, 36, 20, False], [30, 1230, 3, 25, False],
     [15, 800, -15, 60, False], [45, 1425, 54, 10, False], [20, 830, 18, 25, False], [10, 400, 0, 60, False],
     [35, 1275, 3, 20, False]],
    20, 30],
   91),
  ('normal control 1', [[[10, 400, 20, 5, False], [15, 800, 5, 60, False], [5, 0, 20, 10, True]], 20, 30], 0),
  ('normal control 2',
   [[[0, 45, -15, 10, False], [30, 1010, 177, 20, False], [0, 90, 38, 20, False], [15, 210, 111, 20, False],
     [0, 45, 5, 25, False], [10, 150, 91, 20, True], [5, 120, 71, 20, False], [25, 610, 144, 20, False]],
    20, 30],
   114),
  ('normal control 3',
   [[[30, 460, 18, 60, False], [20, 400, 18, 10, False], [10, 400, -15, 20, False], [40, 1260, 36, 25, False],
     [35, 860, 51, 60, True], [50, 1260, 36, 20, False]],
    20, 30],
   893),
  ('normal control 4', [[[0, 400, 0, 20, True], [5, 800, 33, 20, True], [5, 830, 33, 5, False]], 20, 30], 0)],
 [('regression: segment floor',
   [[[5, 75, 66, 60, True], [25, 180, 69, 20, False], [35, 285, 89, 10, False], [30, 240, 69, 25, True],
     [10, 135, 51, 60, True], [0, 45, 33, 20, False], [45, 315, 122, 60, False], [20, 135, 84, 5, False]],
    20, 30],
   256),
  ('partial repair probe: segment floor',
   [[[30, 460, 23, 20, False], [10, 30, 18, 10, False], [25, 460, 23, 25, False], [15, 60, 3, 60, False],
     [5, 0, 33, 10, False]],
    20, 30],
   463),
  ('second regression',
   [[[5, 0, 33, 20, False], [5, 30, 53, 60, True], [5, 60, 38, 20, False], [10, 105, 71, 5, False],
     [15, 105, 104, 20, False], [20, 505, 137, 20, False]],
    20, 30],
   144),
  ('normal control 1',
   [[[25, 75, 60, 25, False], [25, 75, 40, 20, False], [10, 45, 20, 10, False], [20, 45, 40, 20, True]], 20,
    30],
   0),
  ('normal control 2',
   [[[20, 30, 20, 20, True], [25, 30, 53, 20, False], [10, 30, 20, 10, False], [35, 75, 73, 25, False]], 20,
    30],
   0),
  ('normal control 3',
   [[[30, 625, 139, 10, False], [0, 0, 20, 10, False], [25, 565, 106, 5, False], [10, 105, 53, 20, False],
     [5, 45, 20, 20, False], [15, 505, 53, 10, False], [20, 565, 73, 5, False]],
    20, 30],
   640),
  ('normal control 4',
   [[[5, 400, 33, 20, True], [15, 445, 18, 60, False], [15, 445, 3, 5, False], [25, 445, 23, 25, False],
     [35, 490, 23, 20, False]],
    20, 30],
   49)],
 [('regression: segment floor',
   [[[5, 460, 38, 20, False], [20, 520, 56, 10, False], [5, 60, 53, 20, False], [10, 490, 23, 10, False],
     [5, 0, 33, 5, True], [35, 565, 89, 20, False], [25, 565, 56, 20, False]],
    20, 30],
   155),
  ('partial repair probe: segment floor',
   [[[0, 30, 20, 10, False], [5, 75, 53, 20, False], [10, 75, 38, 20, False], [15, 105, 58, 20, False]], 20,
    30],
   106),
  ('second regression', [[[10, 45, 0, 20, False], [15, 75, -15, 5, False], [15, 75, 5, 60, False]], 20, 30],
   33),
  ('normal control 1',
   [[[10, 60, -15, 60, False], [15, 105, -15, 20, False], [20, 105, 18, 20, True], [20, 105, 18, 25, False],
     [25, 505, 38, 10, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 33, 25, False], [15, 800, 53, 60, False], [20, 1200, 86, 25, False]], 20, 30], 0),
  ('normal control 3', [[[10, 430, 53, 20, True], [15, 475, 38, 25, False], [0, 30, 33, 20, False]], 20, 30],
   0),
  ('normal control 4',
   [[[5, 60, -15, 25, False], [15, 105, -30, 20, False], [15, 150, 3, 20, False], [20, 550, 23, 10, False],
     [25, 580, 23, 10, False], [35, 610, 56, 20, False]],
    20, 30],
   512)],
 [('regression: segment floor',
   [[[5, 0, 20, 20, False], [15, 45, 53, 20, False], [20, 105, 86, 10, False], [20, 135, 71, 10, False],
     [20, 180, 71, 10, False]],
    20, 30],
   123),
  ('partial repair probe: segment floor',
   [[[5, 45, 18, 25, False], [5, 0, -15, 5, False], [10, 45, 18, 5, False]], 20, 30], 55),
  ('second regression',
   [[[25, 550, 99, 10, False], [40, 995, 84, 20, False], [10, 105, 33, 10, False], [10, 45, 33, 25, False],
     [30, 950, 99, 25, False], [5, 0, 0, 10, False], [15, 150, 66, 20, False], [40, 1040, 69, 10, True]],
    20, 30],
   165),
  ('normal control 1',
   [[[35, 595, 99, 20, False], [5, 400, 0, 25, True], [40, 700, 139, 5, False], [15, 430, 33, 10, False],
     [30, 535, 99, 10, False], [25, 535, 99, 60, False], [35, 640, 119, 20, False], [20, 490, 66, 25, True]],
    20, 30],
   296),
  ('normal control 2',
   [[[20, 535, 89, 5, False], [10, 445, 23, 25, False], [30, 535, 89, 5, True], [15, 505, 56, 5, True],
     [0, 0, -15, 20, False], [5, 445, 3, 10, True], [0, 45, -30, 20, True], [35, 595, 89, 20, False]],
    20, 30],
   545),
  ('normal control 3',
   [[[30, 550, 25, 10, False], [20, 460, 20, 60, False], [25, 505, 40, 5, True], [10, 400, 0, 20, False]], 20,
    30],
   0),
  ('normal control 4',
   [[[0, 30, 33, 25, True], [10, 90, 33, 25, False], [20, 90, 18, 60, False], [25, 135, 18, 25, False],
     [30, 165, 38, 60, True], [40, 210, 38, 20, True]],
    20, 30],
   0)]]
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: segment floor555554Failed
partial repair probe: segment floor5555Passed
second regression571571Passed
normal control 100Passed
normal control 200Passed
normal control 300Passed
normal control 4433433Passed

SHA-256 / 05c0d7c16e524828f70ea88927da1ce9f9eb82cdf3ba9cf0117adf4b45c886df

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(pings, max_acc, max_speed):
    kept = []
    seen = set()
    for p in sorted(pings, key=lambda p: p[0]):
        if p[3] > max_acc:
            continue
        if p[0] in seen:
            continue
        seen.add(p[0])
        kept.append(p)
    total = 0
    anchor = None
    for p in kept:
        if anchor is None:
            anchor = p
            continue
        d = round(math.hypot(p[1] - anchor[1], p[2] - anchor[2]))
        dt = p[0] - anchor[0]
        if d > max_speed * dt:
            continue
        if not (p[4] or anchor[4]):
            total += d
        anchor = p
    return total
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: segment floor',
   [[[20, 475, 38, 5, False], [5, 75, 53, 5, False], [30, 505, 71, 5, False], [10, 475, 53, 20, True],
     [40, 610, 76, 5, False], [35, 565, 56, 10, False], [5, 45, 20, 60, False]],
    20, 30],
   554),
  ('partial repair probe: segment floor',
   [[[5, 45, 33, 10, False], [10, 90, 66, 10, False], [10, 135, 86, 20, False], [15, 535, 71, 25, False],
     [20, 535, 104, 20, False]],
    20, 30],
   55),
  ('second regression',
   [[[20, 520, 38, 20, True], [5, 30, -15, 5, False], [30, 965, 104, 5, False], [15, 490, 38, 25, False],
     [5, 90, 18, 5, False], [0, 0, -15, 20, False], [25, 565, 71, 5, False]],
    20, 30],
   571),
  ('normal control 1',
   [[[30, 980, 83, 5, False], [25, 520, 43, 10, True], [15, 60, 38, 10, True], [5, 60, 18, 25, False],
     [25, 490, 58, 5, False], [20, 90, 38, 20, False], [5, 60, 33, 25, False], [25, 580, 63, 20, True]],
    20, 30],
   0),
  ('normal control 2',
   [[[25, 550, 43, 20, True], [5, 460, 40, 20, False], [20, 550, 58, 20, False], [35, 655, 48, 60, False],
     [10, 520, 73, 60, False], [0, 60, 20, 10, True], [25, 595, 28, 20, False], [40, 700, 68, 60, False]],
    20, 30],
   0),
  ('normal control 3',
   [[[30, 520, 53, 20, True], [20, 120, 53, 25, False], [40, 1025, 78, 25, False], [35, 625, 58, 25, False],
     [10, 45, 33, 20, False], [35, 580, 38, 20, False], [15, 75, 33, 25, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 400, 33, 25, False], [10, 445, 66, 20, False], [15, 845, 99, 10, False], [20, 875, 132, 20, True],
     [25, 875, 117, 20, False]],
    20, 30],
   433)],
 [('regression: segment floor',
   [[[10, 45, 33, 20, False], [10, 90, 18, 60, True], [15, 135, 38, 60, False], [15, 180, 38, 60, False],
     [20, 180, 23, 20, False], [25, 225, 56, 20, False], [30, 225, 41, 20, True]],
    20, 30],
   190),
  ('partial repair probe: segment floor',
   [[[5, 30, 33, 10, False], [10, 30, 33, 25, False], [15, 90, 18, 10, False]], 20, 30], 61),
  ('second regression',
   [[[40, 1365, 21, 25, False], [35, 1335, 36, 20, False], [30, 1230, 3, 25, False],
     [15, 800, -15, 60, False], [45, 1425, 54, 10, False], [20, 830, 18, 25, False], [10, 400, 0, 60, False],
     [35, 1275, 3, 20, False]],
    20, 30],
   91),
  ('normal control 1', [[[10, 400, 20, 5, False], [15, 800, 5, 60, False], [5, 0, 20, 10, True]], 20, 30], 0),
  ('normal control 2',
   [[[0, 45, -15, 10, False], [30, 1010, 177, 20, False], [0, 90, 38, 20, False], [15, 210, 111, 20, False],
     [0, 45, 5, 25, False], [10, 150, 91, 20, True], [5, 120, 71, 20, False], [25, 610, 144, 20, False]],
    20, 30],
   114),
  ('normal control 3',
   [[[30, 460, 18, 60, False], [20, 400, 18, 10, False], [10, 400, -15, 20, False], [40, 1260, 36, 25, False],
     [35, 860, 51, 60, True], [50, 1260, 36, 20, False]],
    20, 30],
   893),
  ('normal control 4', [[[0, 400, 0, 20, True], [5, 800, 33, 20, True], [5, 830, 33, 5, False]], 20, 30], 0)],
 [('regression: segment floor',
   [[[5, 75, 66, 60, True], [25, 180, 69, 20, False], [35, 285, 89, 10, False], [30, 240, 69, 25, True],
     [10, 135, 51, 60, True], [0, 45, 33, 20, False], [45, 315, 122, 60, False], [20, 135, 84, 5, False]],
    20, 30],
   256),
  ('partial repair probe: segment floor',
   [[[30, 460, 23, 20, False], [10, 30, 18, 10, False], [25, 460, 23, 25, False], [15, 60, 3, 60, False],
     [5, 0, 33, 10, False]],
    20, 30],
   463),
  ('second regression',
   [[[5, 0, 33, 20, False], [5, 30, 53, 60, True], [5, 60, 38, 20, False], [10, 105, 71, 5, False],
     [15, 105, 104, 20, False], [20, 505, 137, 20, False]],
    20, 30],
   144),
  ('normal control 1',
   [[[25, 75, 60, 25, False], [25, 75, 40, 20, False], [10, 45, 20, 10, False], [20, 45, 40, 20, True]], 20,
    30],
   0),
  ('normal control 2',
   [[[20, 30, 20, 20, True], [25, 30, 53, 20, False], [10, 30, 20, 10, False], [35, 75, 73, 25, False]], 20,
    30],
   0),
  ('normal control 3',
   [[[30, 625, 139, 10, False], [0, 0, 20, 10, False], [25, 565, 106, 5, False], [10, 105, 53, 20, False],
     [5, 45, 20, 20, False], [15, 505, 53, 10, False], [20, 565, 73, 5, False]],
    20, 30],
   640),
  ('normal control 4',
   [[[5, 400, 33, 20, True], [15, 445, 18, 60, False], [15, 445, 3, 5, False], [25, 445, 23, 25, False],
     [35, 490, 23, 20, False]],
    20, 30],
   49)],
 [('regression: segment floor',
   [[[5, 460, 38, 20, False], [20, 520, 56, 10, False], [5, 60, 53, 20, False], [10, 490, 23, 10, False],
     [5, 0, 33, 5, True], [35, 565, 89, 20, False], [25, 565, 56, 20, False]],
    20, 30],
   155),
  ('partial repair probe: segment floor',
   [[[0, 30, 20, 10, False], [5, 75, 53, 20, False], [10, 75, 38, 20, False], [15, 105, 58, 20, False]], 20,
    30],
   106),
  ('second regression', [[[10, 45, 0, 20, False], [15, 75, -15, 5, False], [15, 75, 5, 60, False]], 20, 30],
   33),
  ('normal control 1',
   [[[10, 60, -15, 60, False], [15, 105, -15, 20, False], [20, 105, 18, 20, True], [20, 105, 18, 25, False],
     [25, 505, 38, 10, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 33, 25, False], [15, 800, 53, 60, False], [20, 1200, 86, 25, False]], 20, 30], 0),
  ('normal control 3', [[[10, 430, 53, 20, True], [15, 475, 38, 25, False], [0, 30, 33, 20, False]], 20, 30],
   0),
  ('normal control 4',
   [[[5, 60, -15, 25, False], [15, 105, -30, 20, False], [15, 150, 3, 20, False], [20, 550, 23, 10, False],
     [25, 580, 23, 10, False], [35, 610, 56, 20, False]],
    20, 30],
   512)],
 [('regression: segment floor',
   [[[5, 0, 20, 20, False], [15, 45, 53, 20, False], [20, 105, 86, 10, False], [20, 135, 71, 10, False],
     [20, 180, 71, 10, False]],
    20, 30],
   123),
  ('partial repair probe: segment floor',
   [[[5, 45, 18, 25, False], [5, 0, -15, 5, False], [10, 45, 18, 5, False]], 20, 30], 55),
  ('second regression',
   [[[25, 550, 99, 10, False], [40, 995, 84, 20, False], [10, 105, 33, 10, False], [10, 45, 33, 25, False],
     [30, 950, 99, 25, False], [5, 0, 0, 10, False], [15, 150, 66, 20, False], [40, 1040, 69, 10, True]],
    20, 30],
   165),
  ('normal control 1',
   [[[35, 595, 99, 20, False], [5, 400, 0, 25, True], [40, 700, 139, 5, False], [15, 430, 33, 10, False],
     [30, 535, 99, 10, False], [25, 535, 99, 60, False], [35, 640, 119, 20, False], [20, 490, 66, 25, True]],
    20, 30],
   296),
  ('normal control 2',
   [[[20, 535, 89, 5, False], [10, 445, 23, 25, False], [30, 535, 89, 5, True], [15, 505, 56, 5, True],
     [0, 0, -15, 20, False], [5, 445, 3, 10, True], [0, 45, -30, 20, True], [35, 595, 89, 20, False]],
    20, 30],
   545),
  ('normal control 3',
   [[[30, 550, 25, 10, False], [20, 460, 20, 60, False], [25, 505, 40, 5, True], [10, 400, 0, 20, False]], 20,
    30],
   0),
  ('normal control 4',
   [[[0, 30, 33, 25, True], [10, 90, 33, 25, False], [20, 90, 18, 60, False], [25, 135, 18, 25, False],
     [30, 165, 38, 60, True], [40, 210, 38, 20, True]],
    20, 30],
   0)]]
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: segment floor556554Failed
partial repair probe: segment floor5655Failed
second regression572571Failed
normal control 100Passed
normal control 200Passed
normal control 300Passed
normal control 4433433Passed

SHA-256 / 8cf6dd026d7014060f042293adfc97b5d114603fcafb5d941e62d66c3d17b29b

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(pings, max_acc, max_speed):
    kept = []
    seen = set()
    for p in sorted(pings, key=lambda p: p[0]):
        if p[3] > max_acc:
            continue
        if p[0] in seen:
            continue
        seen.add(p[0])
        kept.append(p)
    total = 0
    anchor = None
    for p in kept:
        if anchor is None:
            anchor = p
            continue
        d = math.isqrt((p[1] - anchor[1]) ** 2 + (p[2] - anchor[2]) ** 2)
        dt = p[0] - anchor[0]
        if d > max_speed * dt:
            continue
        if not (p[4] or anchor[4]):
            total += d
        anchor = p
    return total
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: segment floor',
   [[[20, 475, 38, 5, False], [5, 75, 53, 5, False], [30, 505, 71, 5, False], [10, 475, 53, 20, True],
     [40, 610, 76, 5, False], [35, 565, 56, 10, False], [5, 45, 20, 60, False]],
    20, 30],
   554),
  ('partial repair probe: segment floor',
   [[[5, 45, 33, 10, False], [10, 90, 66, 10, False], [10, 135, 86, 20, False], [15, 535, 71, 25, False],
     [20, 535, 104, 20, False]],
    20, 30],
   55),
  ('second regression',
   [[[20, 520, 38, 20, True], [5, 30, -15, 5, False], [30, 965, 104, 5, False], [15, 490, 38, 25, False],
     [5, 90, 18, 5, False], [0, 0, -15, 20, False], [25, 565, 71, 5, False]],
    20, 30],
   571),
  ('normal control 1',
   [[[30, 980, 83, 5, False], [25, 520, 43, 10, True], [15, 60, 38, 10, True], [5, 60, 18, 25, False],
     [25, 490, 58, 5, False], [20, 90, 38, 20, False], [5, 60, 33, 25, False], [25, 580, 63, 20, True]],
    20, 30],
   0),
  ('normal control 2',
   [[[25, 550, 43, 20, True], [5, 460, 40, 20, False], [20, 550, 58, 20, False], [35, 655, 48, 60, False],
     [10, 520, 73, 60, False], [0, 60, 20, 10, True], [25, 595, 28, 20, False], [40, 700, 68, 60, False]],
    20, 30],
   0),
  ('normal control 3',
   [[[30, 520, 53, 20, True], [20, 120, 53, 25, False], [40, 1025, 78, 25, False], [35, 625, 58, 25, False],
     [10, 45, 33, 20, False], [35, 580, 38, 20, False], [15, 75, 33, 25, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 400, 33, 25, False], [10, 445, 66, 20, False], [15, 845, 99, 10, False], [20, 875, 132, 20, True],
     [25, 875, 117, 20, False]],
    20, 30],
   433)],
 [('regression: segment floor',
   [[[10, 45, 33, 20, False], [10, 90, 18, 60, True], [15, 135, 38, 60, False], [15, 180, 38, 60, False],
     [20, 180, 23, 20, False], [25, 225, 56, 20, False], [30, 225, 41, 20, True]],
    20, 30],
   190),
  ('partial repair probe: segment floor',
   [[[5, 30, 33, 10, False], [10, 30, 33, 25, False], [15, 90, 18, 10, False]], 20, 30], 61),
  ('second regression',
   [[[40, 1365, 21, 25, False], [35, 1335, 36, 20, False], [30, 1230, 3, 25, False],
     [15, 800, -15, 60, False], [45, 1425, 54, 10, False], [20, 830, 18, 25, False], [10, 400, 0, 60, False],
     [35, 1275, 3, 20, False]],
    20, 30],
   91),
  ('normal control 1', [[[10, 400, 20, 5, False], [15, 800, 5, 60, False], [5, 0, 20, 10, True]], 20, 30], 0),
  ('normal control 2',
   [[[0, 45, -15, 10, False], [30, 1010, 177, 20, False], [0, 90, 38, 20, False], [15, 210, 111, 20, False],
     [0, 45, 5, 25, False], [10, 150, 91, 20, True], [5, 120, 71, 20, False], [25, 610, 144, 20, False]],
    20, 30],
   114),
  ('normal control 3',
   [[[30, 460, 18, 60, False], [20, 400, 18, 10, False], [10, 400, -15, 20, False], [40, 1260, 36, 25, False],
     [35, 860, 51, 60, True], [50, 1260, 36, 20, False]],
    20, 30],
   893),
  ('normal control 4', [[[0, 400, 0, 20, True], [5, 800, 33, 20, True], [5, 830, 33, 5, False]], 20, 30], 0)],
 [('regression: segment floor',
   [[[5, 75, 66, 60, True], [25, 180, 69, 20, False], [35, 285, 89, 10, False], [30, 240, 69, 25, True],
     [10, 135, 51, 60, True], [0, 45, 33, 20, False], [45, 315, 122, 60, False], [20, 135, 84, 5, False]],
    20, 30],
   256),
  ('partial repair probe: segment floor',
   [[[30, 460, 23, 20, False], [10, 30, 18, 10, False], [25, 460, 23, 25, False], [15, 60, 3, 60, False],
     [5, 0, 33, 10, False]],
    20, 30],
   463),
  ('second regression',
   [[[5, 0, 33, 20, False], [5, 30, 53, 60, True], [5, 60, 38, 20, False], [10, 105, 71, 5, False],
     [15, 105, 104, 20, False], [20, 505, 137, 20, False]],
    20, 30],
   144),
  ('normal control 1',
   [[[25, 75, 60, 25, False], [25, 75, 40, 20, False], [10, 45, 20, 10, False], [20, 45, 40, 20, True]], 20,
    30],
   0),
  ('normal control 2',
   [[[20, 30, 20, 20, True], [25, 30, 53, 20, False], [10, 30, 20, 10, False], [35, 75, 73, 25, False]], 20,
    30],
   0),
  ('normal control 3',
   [[[30, 625, 139, 10, False], [0, 0, 20, 10, False], [25, 565, 106, 5, False], [10, 105, 53, 20, False],
     [5, 45, 20, 20, False], [15, 505, 53, 10, False], [20, 565, 73, 5, False]],
    20, 30],
   640),
  ('normal control 4',
   [[[5, 400, 33, 20, True], [15, 445, 18, 60, False], [15, 445, 3, 5, False], [25, 445, 23, 25, False],
     [35, 490, 23, 20, False]],
    20, 30],
   49)],
 [('regression: segment floor',
   [[[5, 460, 38, 20, False], [20, 520, 56, 10, False], [5, 60, 53, 20, False], [10, 490, 23, 10, False],
     [5, 0, 33, 5, True], [35, 565, 89, 20, False], [25, 565, 56, 20, False]],
    20, 30],
   155),
  ('partial repair probe: segment floor',
   [[[0, 30, 20, 10, False], [5, 75, 53, 20, False], [10, 75, 38, 20, False], [15, 105, 58, 20, False]], 20,
    30],
   106),
  ('second regression', [[[10, 45, 0, 20, False], [15, 75, -15, 5, False], [15, 75, 5, 60, False]], 20, 30],
   33),
  ('normal control 1',
   [[[10, 60, -15, 60, False], [15, 105, -15, 20, False], [20, 105, 18, 20, True], [20, 105, 18, 25, False],
     [25, 505, 38, 10, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 33, 25, False], [15, 800, 53, 60, False], [20, 1200, 86, 25, False]], 20, 30], 0),
  ('normal control 3', [[[10, 430, 53, 20, True], [15, 475, 38, 25, False], [0, 30, 33, 20, False]], 20, 30],
   0),
  ('normal control 4',
   [[[5, 60, -15, 25, False], [15, 105, -30, 20, False], [15, 150, 3, 20, False], [20, 550, 23, 10, False],
     [25, 580, 23, 10, False], [35, 610, 56, 20, False]],
    20, 30],
   512)],
 [('regression: segment floor',
   [[[5, 0, 20, 20, False], [15, 45, 53, 20, False], [20, 105, 86, 10, False], [20, 135, 71, 10, False],
     [20, 180, 71, 10, False]],
    20, 30],
   123),
  ('partial repair probe: segment floor',
   [[[5, 45, 18, 25, False], [5, 0, -15, 5, False], [10, 45, 18, 5, False]], 20, 30], 55),
  ('second regression',
   [[[25, 550, 99, 10, False], [40, 995, 84, 20, False], [10, 105, 33, 10, False], [10, 45, 33, 25, False],
     [30, 950, 99, 25, False], [5, 0, 0, 10, False], [15, 150, 66, 20, False], [40, 1040, 69, 10, True]],
    20, 30],
   165),
  ('normal control 1',
   [[[35, 595, 99, 20, False], [5, 400, 0, 25, True], [40, 700, 139, 5, False], [15, 430, 33, 10, False],
     [30, 535, 99, 10, False], [25, 535, 99, 60, False], [35, 640, 119, 20, False], [20, 490, 66, 25, True]],
    20, 30],
   296),
  ('normal control 2',
   [[[20, 535, 89, 5, False], [10, 445, 23, 25, False], [30, 535, 89, 5, True], [15, 505, 56, 5, True],
     [0, 0, -15, 20, False], [5, 445, 3, 10, True], [0, 45, -30, 20, True], [35, 595, 89, 20, False]],
    20, 30],
   545),
  ('normal control 3',
   [[[30, 550, 25, 10, False], [20, 460, 20, 60, False], [25, 505, 40, 5, True], [10, 400, 0, 20, False]], 20,
    30],
   0),
  ('normal control 4',
   [[[0, 30, 33, 25, True], [10, 90, 33, 25, False], [20, 90, 18, 60, False], [25, 135, 18, 25, False],
     [30, 165, 38, 60, True], [40, 210, 38, 20, True]],
    20, 30],
   0)]]
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: segment floor554554Passed
partial repair probe: segment floor5555Passed
second regression571571Passed
normal control 100Passed
normal control 200Passed
normal control 300Passed
normal control 4433433Passed

SHA-256 / ad1246ff94e444316cbfaeed043cc8c40e29434884c6e6900e1e10d3fe31e172

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

Case digest / 587a44ef4085aeb7a441aa6db291576370817f04324091df008f8e4c6d17f677