FAILURE MAP
← Case archive

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

Inaccurate duplicate hides a good ping · case 01

A bad fix sharing a timestamp with a good fix causes both to be dropped.

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

ROOT CAUSE

Timestamp deduplication runs before the accuracy filter.

VERIFIED REPAIR

Filter by accuracy first, then keep the first surviving ping per timestamp.

Unsuccessful approach: Removing deduplication keeps zero-duration segments that trip the speed filter.

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[0] in seen:
            continue
        seen.add(p[0])
        if p[3] > max_acc:
            continue
        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: accuracy before dedupe',
   [[[10, 60, -15, 20, False], [20, 120, -30, 5, False], [20, 165, -45, 20, False], [30, 565, -12, 10, False],
     [40, 610, 8, 25, False], [40, 655, 41, 20, False]],
    20, 30],
   600),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 135, 18, 20, False], [10, 60, -15, 60, False], [15, 105, 18, 5, False], [30, 640, 69, 20, False],
     [45, 640, 109, 20, False], [25, 580, 36, 5, False], [40, 640, 89, 10, False], [25, 180, 51, 10, False]],
    20, 30],
   559),
  ('second regression',
   [[[5, 60, 0, 20, False], [10, 120, 20, 25, True], [15, 520, 20, 20, True], [20, 580, 5, 25, False],
     [30, 580, -10, 60, False], [30, 640, -25, 10, False], [40, 670, -5, 60, False]],
    20, 30],
   580),
  ('normal control 1', [[[0, 60, 0, 10, False], [10, 90, -15, 20, True], [10, 490, -15, 10, False]], 20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 10, False], [10, 800, 20, 20, False], [20, 845, 5, 20, False], [30, 1245, 5, 10, False],
     [40, 1305, 5, 5, True], [45, 1350, 25, 60, False], [50, 1380, 25, 20, False]],
    20, 30],
   445),
  ('normal control 3', [[[10, 105, 5, 5, False], [15, 505, 25, 20, False], [5, 45, -15, 20, False]], 20, 30],
   63),
  ('normal control 4',
   [[[20, 60, 40, 20, False], [10, 30, 0, 25, False], [20, 60, 20, 5, False], [25, 460, 40, 60, True],
     [0, 30, 0, 60, False]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[45, 195, 152, 60, True], [10, 75, 53, 60, True], [35, 195, 119, 25, False], [25, 165, 119, 20, False],
     [25, 195, 119, 25, False], [20, 135, 86, 10, False], [10, 45, 33, 20, False]],
    20, 30],
   148),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 610, -25, 10, False], [30, 1040, -40, 10, False], [10, 45, -15, 25, False],
     [25, 120, -30, 60, False], [25, 210, -25, 20, False], [25, 165, -10, 25, False],
     [20, 75, -30, 10, False], [25, 640, -25, 10, True]],
    20, 30],
   0),
  ('second regression',
   [[[40, 150, -9, 5, False], [25, 120, -12, 60, False], [5, 30, -15, 25, True], [35, 150, 6, 20, False],
     [20, 120, -45, 60, False], [30, 120, 21, 10, False], [5, 75, -30, 20, False],
     [15, 120, -45, 10, False]],
    20, 30],
   161),
  ('normal control 1',
   [[[15, 520, 33, 60, False], [25, 550, 33, 60, False], [10, 460, 0, 25, True], [15, 490, 0, 20, True],
     [5, 400, 0, 25, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 20, False], [5, 400, 0, 10, False], [10, 800, -15, 5, True], [15, 845, 5, 10, True]], 20,
    30],
   0),
  ('normal control 3',
   [[[0, 430, 40, 20, False], [15, 860, 80, 10, True], [20, 860, 100, 5, False], [5, 830, 40, 10, True],
     [10, 830, 60, 25, False], [20, 1260, 100, 20, False], [0, 30, 20, 60, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 30, 20, 5, False], [5, 75, 53, 10, False], [15, 135, 53, 20, True], [20, 165, 73, 25, False],
     [30, 210, 93, 60, False]],
    20, 30],
   55)],
 [('regression: accuracy before dedupe',
   [[[10, 430, 53, 25, False], [10, 460, 86, 20, False], [5, 400, 20, 20, False], [10, 460, 53, 25, False]],
    20, 30],
   89),
  ('partial repair probe: accuracy before dedupe',
   [[[5, 445, 20, 5, True], [20, 565, 91, 20, False], [20, 520, 58, 20, False], [10, 475, 38, 20, False],
     [0, 400, 0, 20, False], [5, 475, 5, 60, False], [30, 995, 124, 5, True], [30, 595, 91, 10, False]],
    20, 30],
   104),
  ('second regression',
   [[[10, 400, -15, 5, False], [15, 400, -30, 25, False], [15, 460, 3, 20, False]], 20, 30], 62),
  ('normal control 1',
   [[[15, 135, 33, 20, False], [15, 105, 0, 60, False], [20, 535, 53, 20, False], [25, 980, 38, 5, False],
     [10, 45, 0, 25, False], [20, 580, 38, 20, True]],
    20, 30],
   0),
  ('normal control 2', [[[5, 0, 33, 5, False], [10, 400, 33, 20, False], [15, 430, 66, 60, False]], 20, 30],
   0),
  ('normal control 3', [[[5, 60, 20, 60, False], [15, 105, 53, 20, False], [20, 165, 53, 5, False]], 20, 30],
   60),
  ('normal control 4',
   [[[5, 60, 33, 10, False], [15, 120, 18, 20, False], [25, 120, 3, 60, False], [30, 180, 23, 10, False],
     [40, 180, 43, 60, False], [45, 180, 63, 60, False]],
    20, 30],
   121)],
 [('regression: accuracy before dedupe',
   [[[5, 0, 20, 25, False], [5, 60, 40, 5, False], [10, 120, 25, 5, False]], 20, 30], 61),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 475, -30, 5, False], [45, 1040, 36, 60, False], [15, 445, -30, 25, False], [30, 875, 3, 60, False],
     [45, 1100, 56, 10, True], [45, 980, 36, 20, False], [35, 920, 3, 10, False], [5, 45, -15, 20, False]],
    20, 30],
   430),
  ('second regression',
   [[[15, 490, 23, 20, False], [10, 430, 38, 25, False], [10, 430, 5, 5, False], [5, 400, -15, 20, False],
     [15, 520, 56, 5, False]],
    20, 30],
   98),
  ('normal control 1',
   [[[15, 135, 5, 10, False], [20, 195, 25, 25, False], [10, 105, -15, 60, False], [5, 45, -15, 20, False],
     [0, 45, -15, 25, True]],
    20, 30],
   92),
  ('normal control 2',
   [[[10, 60, 18, 5, False], [5, 60, 33, 60, False], [30, 120, 23, 20, False], [20, 120, 3, 60, False],
     [25, 120, 23, 20, True]],
    20, 30],
   0),
  ('normal control 3',
   [[[0, 30, 0, 20, False], [10, 90, -15, 20, False], [20, 90, -15, 60, False], [25, 135, 18, 20, False],
     [25, 165, 3, 20, False], [25, 195, 36, 25, False], [30, 225, 56, 60, False]],
    20, 30],
   116),
  ('normal control 4',
   [[[0, 30, 20, 25, False], [0, 430, 5, 25, False], [0, 475, -10, 60, True], [0, 475, -25, 5, False],
     [10, 475, -5, 25, True], [15, 505, 15, 60, True], [15, 550, 35, 20, True], [20, 610, 20, 10, True]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[5, 60, 33, 20, False], [10, 90, 99, 25, False], [10, 60, 66, 10, False]], 20, 30], 33),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 800, 40, 5, False], [35, 1290, 93, 20, False], [10, 400, 20, 20, False], [40, 1290, 126, 20, False],
     [20, 845, 40, 10, True], [30, 890, 73, 5, True], [20, 400, 40, 5, False], [5, 400, 20, 5, False]],
    20, 30],
   0),
  ('second regression', [[[10, 0, 20, 5, False], [15, 60, 38, 25, False], [15, 60, 53, 20, False]], 20, 30],
   68),
  ('normal control 1',
   [[[15, 505, -30, 10, True], [20, 905, -45, 60, True], [5, 30, -15, 20, False], [5, 60, -30, 25, False],
     [10, 105, -30, 20, False]],
    20, 30],
   76),
  ('normal control 2',
   [[[10, 45, 20, 25, False], [15, 45, 20, 10, False], [20, 75, 53, 60, False], [25, 75, 86, 10, False],
     [30, 105, 71, 25, False]],
    20, 30],
   72),
  ('normal control 3',
   [[[10, 0, 0, 20, False], [20, 30, -15, 20, False], [25, 430, -30, 25, False], [35, 475, -30, 5, False],
     [35, 875, -10, 10, False]],
    20, 30],
   478),
  ('normal control 4',
   [[[45, 640, 124, 20, False], [30, 550, 71, 60, False], [5, 45, 66, 20, True], [25, 505, 86, 25, False],
     [15, 105, 66, 60, False], [5, 0, 33, 10, False], [40, 580, 91, 20, False], [55, 700, 109, 25, True]],
    20, 30],
   68)]]
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: accuracy before dedupe61600Failed
partial repair probe: accuracy before dedupe559559Passed
second regression0580Failed
normal control 100Passed
normal control 2445445Passed
normal control 36363Passed
normal control 400Passed

SHA-256 / 826d302cf7c2f94b699ef24a1b8e96026b05637da630f13d1ec028f189cc2497

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
        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: accuracy before dedupe',
   [[[10, 60, -15, 20, False], [20, 120, -30, 5, False], [20, 165, -45, 20, False], [30, 565, -12, 10, False],
     [40, 610, 8, 25, False], [40, 655, 41, 20, False]],
    20, 30],
   600),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 135, 18, 20, False], [10, 60, -15, 60, False], [15, 105, 18, 5, False], [30, 640, 69, 20, False],
     [45, 640, 109, 20, False], [25, 580, 36, 5, False], [40, 640, 89, 10, False], [25, 180, 51, 10, False]],
    20, 30],
   559),
  ('second regression',
   [[[5, 60, 0, 20, False], [10, 120, 20, 25, True], [15, 520, 20, 20, True], [20, 580, 5, 25, False],
     [30, 580, -10, 60, False], [30, 640, -25, 10, False], [40, 670, -5, 60, False]],
    20, 30],
   580),
  ('normal control 1', [[[0, 60, 0, 10, False], [10, 90, -15, 20, True], [10, 490, -15, 10, False]], 20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 10, False], [10, 800, 20, 20, False], [20, 845, 5, 20, False], [30, 1245, 5, 10, False],
     [40, 1305, 5, 5, True], [45, 1350, 25, 60, False], [50, 1380, 25, 20, False]],
    20, 30],
   445),
  ('normal control 3', [[[10, 105, 5, 5, False], [15, 505, 25, 20, False], [5, 45, -15, 20, False]], 20, 30],
   63),
  ('normal control 4',
   [[[20, 60, 40, 20, False], [10, 30, 0, 25, False], [20, 60, 20, 5, False], [25, 460, 40, 60, True],
     [0, 30, 0, 60, False]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[45, 195, 152, 60, True], [10, 75, 53, 60, True], [35, 195, 119, 25, False], [25, 165, 119, 20, False],
     [25, 195, 119, 25, False], [20, 135, 86, 10, False], [10, 45, 33, 20, False]],
    20, 30],
   148),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 610, -25, 10, False], [30, 1040, -40, 10, False], [10, 45, -15, 25, False],
     [25, 120, -30, 60, False], [25, 210, -25, 20, False], [25, 165, -10, 25, False],
     [20, 75, -30, 10, False], [25, 640, -25, 10, True]],
    20, 30],
   0),
  ('second regression',
   [[[40, 150, -9, 5, False], [25, 120, -12, 60, False], [5, 30, -15, 25, True], [35, 150, 6, 20, False],
     [20, 120, -45, 60, False], [30, 120, 21, 10, False], [5, 75, -30, 20, False],
     [15, 120, -45, 10, False]],
    20, 30],
   161),
  ('normal control 1',
   [[[15, 520, 33, 60, False], [25, 550, 33, 60, False], [10, 460, 0, 25, True], [15, 490, 0, 20, True],
     [5, 400, 0, 25, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 20, False], [5, 400, 0, 10, False], [10, 800, -15, 5, True], [15, 845, 5, 10, True]], 20,
    30],
   0),
  ('normal control 3',
   [[[0, 430, 40, 20, False], [15, 860, 80, 10, True], [20, 860, 100, 5, False], [5, 830, 40, 10, True],
     [10, 830, 60, 25, False], [20, 1260, 100, 20, False], [0, 30, 20, 60, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 30, 20, 5, False], [5, 75, 53, 10, False], [15, 135, 53, 20, True], [20, 165, 73, 25, False],
     [30, 210, 93, 60, False]],
    20, 30],
   55)],
 [('regression: accuracy before dedupe',
   [[[10, 430, 53, 25, False], [10, 460, 86, 20, False], [5, 400, 20, 20, False], [10, 460, 53, 25, False]],
    20, 30],
   89),
  ('partial repair probe: accuracy before dedupe',
   [[[5, 445, 20, 5, True], [20, 565, 91, 20, False], [20, 520, 58, 20, False], [10, 475, 38, 20, False],
     [0, 400, 0, 20, False], [5, 475, 5, 60, False], [30, 995, 124, 5, True], [30, 595, 91, 10, False]],
    20, 30],
   104),
  ('second regression',
   [[[10, 400, -15, 5, False], [15, 400, -30, 25, False], [15, 460, 3, 20, False]], 20, 30], 62),
  ('normal control 1',
   [[[15, 135, 33, 20, False], [15, 105, 0, 60, False], [20, 535, 53, 20, False], [25, 980, 38, 5, False],
     [10, 45, 0, 25, False], [20, 580, 38, 20, True]],
    20, 30],
   0),
  ('normal control 2', [[[5, 0, 33, 5, False], [10, 400, 33, 20, False], [15, 430, 66, 60, False]], 20, 30],
   0),
  ('normal control 3', [[[5, 60, 20, 60, False], [15, 105, 53, 20, False], [20, 165, 53, 5, False]], 20, 30],
   60),
  ('normal control 4',
   [[[5, 60, 33, 10, False], [15, 120, 18, 20, False], [25, 120, 3, 60, False], [30, 180, 23, 10, False],
     [40, 180, 43, 60, False], [45, 180, 63, 60, False]],
    20, 30],
   121)],
 [('regression: accuracy before dedupe',
   [[[5, 0, 20, 25, False], [5, 60, 40, 5, False], [10, 120, 25, 5, False]], 20, 30], 61),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 475, -30, 5, False], [45, 1040, 36, 60, False], [15, 445, -30, 25, False], [30, 875, 3, 60, False],
     [45, 1100, 56, 10, True], [45, 980, 36, 20, False], [35, 920, 3, 10, False], [5, 45, -15, 20, False]],
    20, 30],
   430),
  ('second regression',
   [[[15, 490, 23, 20, False], [10, 430, 38, 25, False], [10, 430, 5, 5, False], [5, 400, -15, 20, False],
     [15, 520, 56, 5, False]],
    20, 30],
   98),
  ('normal control 1',
   [[[15, 135, 5, 10, False], [20, 195, 25, 25, False], [10, 105, -15, 60, False], [5, 45, -15, 20, False],
     [0, 45, -15, 25, True]],
    20, 30],
   92),
  ('normal control 2',
   [[[10, 60, 18, 5, False], [5, 60, 33, 60, False], [30, 120, 23, 20, False], [20, 120, 3, 60, False],
     [25, 120, 23, 20, True]],
    20, 30],
   0),
  ('normal control 3',
   [[[0, 30, 0, 20, False], [10, 90, -15, 20, False], [20, 90, -15, 60, False], [25, 135, 18, 20, False],
     [25, 165, 3, 20, False], [25, 195, 36, 25, False], [30, 225, 56, 60, False]],
    20, 30],
   116),
  ('normal control 4',
   [[[0, 30, 20, 25, False], [0, 430, 5, 25, False], [0, 475, -10, 60, True], [0, 475, -25, 5, False],
     [10, 475, -5, 25, True], [15, 505, 15, 60, True], [15, 550, 35, 20, True], [20, 610, 20, 10, True]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[5, 60, 33, 20, False], [10, 90, 99, 25, False], [10, 60, 66, 10, False]], 20, 30], 33),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 800, 40, 5, False], [35, 1290, 93, 20, False], [10, 400, 20, 20, False], [40, 1290, 126, 20, False],
     [20, 845, 40, 10, True], [30, 890, 73, 5, True], [20, 400, 40, 5, False], [5, 400, 20, 5, False]],
    20, 30],
   0),
  ('second regression', [[[10, 0, 20, 5, False], [15, 60, 38, 25, False], [15, 60, 53, 20, False]], 20, 30],
   68),
  ('normal control 1',
   [[[15, 505, -30, 10, True], [20, 905, -45, 60, True], [5, 30, -15, 20, False], [5, 60, -30, 25, False],
     [10, 105, -30, 20, False]],
    20, 30],
   76),
  ('normal control 2',
   [[[10, 45, 20, 25, False], [15, 45, 20, 10, False], [20, 75, 53, 60, False], [25, 75, 86, 10, False],
     [30, 105, 71, 25, False]],
    20, 30],
   72),
  ('normal control 3',
   [[[10, 0, 0, 20, False], [20, 30, -15, 20, False], [25, 430, -30, 25, False], [35, 475, -30, 5, False],
     [35, 875, -10, 10, False]],
    20, 30],
   478),
  ('normal control 4',
   [[[45, 640, 124, 20, False], [30, 550, 71, 60, False], [5, 45, 66, 20, True], [25, 505, 86, 25, False],
     [15, 105, 66, 60, False], [5, 0, 33, 10, False], [40, 580, 91, 20, False], [55, 700, 109, 25, True]],
    20, 30],
   68)]]
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: accuracy before dedupe600600Passed
partial repair probe: accuracy before dedupe548559Failed
second regression580580Passed
normal control 100Passed
normal control 2445445Passed
normal control 36363Passed
normal control 400Passed

SHA-256 / 493d03e7404d5fe8ffce858d5e8090e2ba4d13a1da2b82767ac66dca2b6d0a0d

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: accuracy before dedupe',
   [[[10, 60, -15, 20, False], [20, 120, -30, 5, False], [20, 165, -45, 20, False], [30, 565, -12, 10, False],
     [40, 610, 8, 25, False], [40, 655, 41, 20, False]],
    20, 30],
   600),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 135, 18, 20, False], [10, 60, -15, 60, False], [15, 105, 18, 5, False], [30, 640, 69, 20, False],
     [45, 640, 109, 20, False], [25, 580, 36, 5, False], [40, 640, 89, 10, False], [25, 180, 51, 10, False]],
    20, 30],
   559),
  ('second regression',
   [[[5, 60, 0, 20, False], [10, 120, 20, 25, True], [15, 520, 20, 20, True], [20, 580, 5, 25, False],
     [30, 580, -10, 60, False], [30, 640, -25, 10, False], [40, 670, -5, 60, False]],
    20, 30],
   580),
  ('normal control 1', [[[0, 60, 0, 10, False], [10, 90, -15, 20, True], [10, 490, -15, 10, False]], 20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 10, False], [10, 800, 20, 20, False], [20, 845, 5, 20, False], [30, 1245, 5, 10, False],
     [40, 1305, 5, 5, True], [45, 1350, 25, 60, False], [50, 1380, 25, 20, False]],
    20, 30],
   445),
  ('normal control 3', [[[10, 105, 5, 5, False], [15, 505, 25, 20, False], [5, 45, -15, 20, False]], 20, 30],
   63),
  ('normal control 4',
   [[[20, 60, 40, 20, False], [10, 30, 0, 25, False], [20, 60, 20, 5, False], [25, 460, 40, 60, True],
     [0, 30, 0, 60, False]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[45, 195, 152, 60, True], [10, 75, 53, 60, True], [35, 195, 119, 25, False], [25, 165, 119, 20, False],
     [25, 195, 119, 25, False], [20, 135, 86, 10, False], [10, 45, 33, 20, False]],
    20, 30],
   148),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 610, -25, 10, False], [30, 1040, -40, 10, False], [10, 45, -15, 25, False],
     [25, 120, -30, 60, False], [25, 210, -25, 20, False], [25, 165, -10, 25, False],
     [20, 75, -30, 10, False], [25, 640, -25, 10, True]],
    20, 30],
   0),
  ('second regression',
   [[[40, 150, -9, 5, False], [25, 120, -12, 60, False], [5, 30, -15, 25, True], [35, 150, 6, 20, False],
     [20, 120, -45, 60, False], [30, 120, 21, 10, False], [5, 75, -30, 20, False],
     [15, 120, -45, 10, False]],
    20, 30],
   161),
  ('normal control 1',
   [[[15, 520, 33, 60, False], [25, 550, 33, 60, False], [10, 460, 0, 25, True], [15, 490, 0, 20, True],
     [5, 400, 0, 25, False]],
    20, 30],
   0),
  ('normal control 2',
   [[[5, 400, 0, 20, False], [5, 400, 0, 10, False], [10, 800, -15, 5, True], [15, 845, 5, 10, True]], 20,
    30],
   0),
  ('normal control 3',
   [[[0, 430, 40, 20, False], [15, 860, 80, 10, True], [20, 860, 100, 5, False], [5, 830, 40, 10, True],
     [10, 830, 60, 25, False], [20, 1260, 100, 20, False], [0, 30, 20, 60, False]],
    20, 30],
   0),
  ('normal control 4',
   [[[0, 30, 20, 5, False], [5, 75, 53, 10, False], [15, 135, 53, 20, True], [20, 165, 73, 25, False],
     [30, 210, 93, 60, False]],
    20, 30],
   55)],
 [('regression: accuracy before dedupe',
   [[[10, 430, 53, 25, False], [10, 460, 86, 20, False], [5, 400, 20, 20, False], [10, 460, 53, 25, False]],
    20, 30],
   89),
  ('partial repair probe: accuracy before dedupe',
   [[[5, 445, 20, 5, True], [20, 565, 91, 20, False], [20, 520, 58, 20, False], [10, 475, 38, 20, False],
     [0, 400, 0, 20, False], [5, 475, 5, 60, False], [30, 995, 124, 5, True], [30, 595, 91, 10, False]],
    20, 30],
   104),
  ('second regression',
   [[[10, 400, -15, 5, False], [15, 400, -30, 25, False], [15, 460, 3, 20, False]], 20, 30], 62),
  ('normal control 1',
   [[[15, 135, 33, 20, False], [15, 105, 0, 60, False], [20, 535, 53, 20, False], [25, 980, 38, 5, False],
     [10, 45, 0, 25, False], [20, 580, 38, 20, True]],
    20, 30],
   0),
  ('normal control 2', [[[5, 0, 33, 5, False], [10, 400, 33, 20, False], [15, 430, 66, 60, False]], 20, 30],
   0),
  ('normal control 3', [[[5, 60, 20, 60, False], [15, 105, 53, 20, False], [20, 165, 53, 5, False]], 20, 30],
   60),
  ('normal control 4',
   [[[5, 60, 33, 10, False], [15, 120, 18, 20, False], [25, 120, 3, 60, False], [30, 180, 23, 10, False],
     [40, 180, 43, 60, False], [45, 180, 63, 60, False]],
    20, 30],
   121)],
 [('regression: accuracy before dedupe',
   [[[5, 0, 20, 25, False], [5, 60, 40, 5, False], [10, 120, 25, 5, False]], 20, 30], 61),
  ('partial repair probe: accuracy before dedupe',
   [[[25, 475, -30, 5, False], [45, 1040, 36, 60, False], [15, 445, -30, 25, False], [30, 875, 3, 60, False],
     [45, 1100, 56, 10, True], [45, 980, 36, 20, False], [35, 920, 3, 10, False], [5, 45, -15, 20, False]],
    20, 30],
   430),
  ('second regression',
   [[[15, 490, 23, 20, False], [10, 430, 38, 25, False], [10, 430, 5, 5, False], [5, 400, -15, 20, False],
     [15, 520, 56, 5, False]],
    20, 30],
   98),
  ('normal control 1',
   [[[15, 135, 5, 10, False], [20, 195, 25, 25, False], [10, 105, -15, 60, False], [5, 45, -15, 20, False],
     [0, 45, -15, 25, True]],
    20, 30],
   92),
  ('normal control 2',
   [[[10, 60, 18, 5, False], [5, 60, 33, 60, False], [30, 120, 23, 20, False], [20, 120, 3, 60, False],
     [25, 120, 23, 20, True]],
    20, 30],
   0),
  ('normal control 3',
   [[[0, 30, 0, 20, False], [10, 90, -15, 20, False], [20, 90, -15, 60, False], [25, 135, 18, 20, False],
     [25, 165, 3, 20, False], [25, 195, 36, 25, False], [30, 225, 56, 60, False]],
    20, 30],
   116),
  ('normal control 4',
   [[[0, 30, 20, 25, False], [0, 430, 5, 25, False], [0, 475, -10, 60, True], [0, 475, -25, 5, False],
     [10, 475, -5, 25, True], [15, 505, 15, 60, True], [15, 550, 35, 20, True], [20, 610, 20, 10, True]],
    20, 30],
   0)],
 [('regression: accuracy before dedupe',
   [[[5, 60, 33, 20, False], [10, 90, 99, 25, False], [10, 60, 66, 10, False]], 20, 30], 33),
  ('partial repair probe: accuracy before dedupe',
   [[[20, 800, 40, 5, False], [35, 1290, 93, 20, False], [10, 400, 20, 20, False], [40, 1290, 126, 20, False],
     [20, 845, 40, 10, True], [30, 890, 73, 5, True], [20, 400, 40, 5, False], [5, 400, 20, 5, False]],
    20, 30],
   0),
  ('second regression', [[[10, 0, 20, 5, False], [15, 60, 38, 25, False], [15, 60, 53, 20, False]], 20, 30],
   68),
  ('normal control 1',
   [[[15, 505, -30, 10, True], [20, 905, -45, 60, True], [5, 30, -15, 20, False], [5, 60, -30, 25, False],
     [10, 105, -30, 20, False]],
    20, 30],
   76),
  ('normal control 2',
   [[[10, 45, 20, 25, False], [15, 45, 20, 10, False], [20, 75, 53, 60, False], [25, 75, 86, 10, False],
     [30, 105, 71, 25, False]],
    20, 30],
   72),
  ('normal control 3',
   [[[10, 0, 0, 20, False], [20, 30, -15, 20, False], [25, 430, -30, 25, False], [35, 475, -30, 5, False],
     [35, 875, -10, 10, False]],
    20, 30],
   478),
  ('normal control 4',
   [[[45, 640, 124, 20, False], [30, 550, 71, 60, False], [5, 45, 66, 20, True], [25, 505, 86, 25, False],
     [15, 105, 66, 60, False], [5, 0, 33, 10, False], [40, 580, 91, 20, False], [55, 700, 109, 25, True]],
    20, 30],
   68)]]
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: accuracy before dedupe600600Passed
partial repair probe: accuracy before dedupe559559Passed
second regression580580Passed
normal control 100Passed
normal control 2445445Passed
normal control 36363Passed
normal control 400Passed

SHA-256 / 0ad5b9cf12b6339bd1708f9cdf9a2b4625b447bced792468460a167d5b7dab04

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

Case digest / d334c74fc55e77bd59c1c97178c2a014d83d2955547668396ea91672bfbc94b4