FA-85536 / Ride-hailing fare and surge pricing / Open access
Segment leaving a paused point billed · case 01
The first segment after resuming a paused trip is charged.
ROOT CAUSE
Only the segment end ping's pause flag is checked.
VERIFIED REPAIR
Skip billing when either endpoint is paused.
Unsuccessful approach: Checking only the anchor bills segments that end in a pause.
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.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]:
total += d
anchor = p
return total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: paused endpoints',
[[[0, 30, -15, 20, True], [0, 30, -30, 60, False], [0, 30, -45, 25, False], [0, 90, -45, 20, False],
[5, 120, -60, 10, False], [15, 520, -40, 20, False], [20, 550, -40, 20, True],
[30, 610, -55, 20, False]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[20, 505, 3, 5, False], [40, 550, 76, 20, True], [30, 550, 23, 25, False], [35, 550, 43, 5, False],
[35, 550, 23, 20, False], [10, 45, -15, 20, False], [15, 105, -30, 20, False]],
20, 30],
511),
('second regression',
[[[10, 60, 20, 10, False], [10, 90, 53, 20, False], [15, 135, 53, 25, False], [15, 135, 53, 5, False],
[25, 165, 53, 20, True]],
20, 30],
81),
('normal control 1',
[[[5, 120, 60, 20, False], [5, 520, 80, 5, False], [15, 565, 80, 25, False], [5, 120, 40, 20, False],
[5, 60, 20, 20, False]],
20, 30],
0),
('normal control 2',
[[[15, 860, 36, 10, False], [5, 800, 3, 5, False], [5, 800, -30, 25, False], [0, 400, -15, 60, False]], 20,
30],
68),
('normal control 3', [[[10, 45, 33, 20, False], [15, 90, 33, 5, False], [15, 120, 66, 5, False]], 20, 30],
45),
('normal control 4',
[[[5, 60, 33, 60, False], [15, 460, 33, 60, False], [15, 860, 66, 25, False], [20, 905, 66, 25, False],
[20, 1305, 86, 10, True]],
20, 30],
0)],
[('regression: paused endpoints',
[[[10, 45, 20, 20, True], [15, 90, 20, 60, False], [15, 120, 53, 5, False], [20, 520, 38, 5, False]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[0, 60, -15, 5, False], [0, 105, 18, 10, False], [5, 505, 38, 20, False], [15, 505, 38, 20, False],
[25, 505, 58, 20, True]],
20, 30],
448),
('second regression',
[[[10, 30, 0, 60, True], [10, 75, 20, 10, False], [5, 30, 0, 25, False], [15, 135, 53, 20, True]], 20, 30],
0),
('normal control 1',
[[[5, 430, -30, 10, False], [5, 460, -30, 5, False], [10, 505, 3, 5, False], [5, 30, -15, 25, False]], 20,
30],
81),
('normal control 2',
[[[0, 45, 0, 25, False], [0, 75, 20, 60, False], [0, 475, 40, 5, False], [0, 875, 73, 20, False],
[10, 935, 58, 5, False], [15, 965, 91, 60, True], [20, 995, 76, 10, False], [30, 1040, 76, 5, False]],
20, 30],
566),
('normal control 3',
[[[5, 30, 0, 25, True], [10, 90, -15, 20, True], [15, 490, -30, 5, True], [25, 490, -30, 20, True]], 20,
30],
0),
('normal control 4',
[[[5, 30, -15, 10, False], [10, 90, 5, 25, False], [15, 490, -10, 20, False], [20, 490, -25, 20, False],
[25, 550, -5, 25, False], [30, 595, 15, 60, False], [40, 655, 15, 5, False], [45, 685, 48, 20, False]],
20, 30],
669)],
[('regression: paused endpoints',
[[[10, 520, 33, 20, True], [25, 580, 33, 20, False], [15, 550, 33, 60, False], [30, 640, 66, 10, True],
[30, 685, 86, 5, False], [10, 120, 33, 25, False], [5, 60, 33, 5, True]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[5, 150, 38, 10, False], [5, 60, 20, 10, False], [5, 90, 5, 20, False], [10, 195, 23, 20, False],
[20, 625, 28, 25, False], [15, 225, 8, 20, True]],
20, 30],
47),
('second regression',
[[[35, 135, 71, 20, False], [10, 30, 33, 25, False], [15, 30, 66, 5, True], [35, 165, 91, 20, True],
[25, 90, 51, 25, False], [40, 195, 111, 10, False]],
20, 30],
72),
('normal control 1',
[[[0, 60, -15, 25, False], [0, 460, 5, 20, False], [5, 860, -10, 60, False], [15, 1260, 23, 20, False],
[20, 1305, 43, 25, True], [25, 1350, 43, 60, False], [25, 1380, 63, 60, False],
[30, 1780, 48, 5, False]],
20, 30],
0),
('normal control 2', [[[10, 45, 33, 10, False], [10, 105, 33, 60, True], [15, 150, 66, 20, False]], 20, 30],
110),
('normal control 3', [[[5, 0, -15, 20, False], [15, 60, -30, 5, False], [25, 105, -30, 25, False]], 20, 30],
61),
('normal control 4',
[[[0, 30, 33, 20, False], [25, 610, 119, 20, False], [20, 550, 119, 20, False], [30, 640, 139, 20, False],
[10, 90, 66, 10, False], [20, 490, 86, 5, True]],
20, 30],
622)],
[('regression: paused endpoints',
[[[0, 45, -15, 20, True], [5, 90, -15, 60, True], [15, 150, 18, 20, False], [25, 180, 18, 5, True]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[5, 45, 0, 25, False], [10, 90, 20, 60, True], [20, 135, 5, 10, False], [20, 135, 25, 25, False],
[25, 135, 45, 60, False], [30, 180, 45, 20, True], [35, 225, 45, 5, False]],
20, 30],
0),
('second regression',
[[[10, 400, 3, 20, True], [25, 505, 8, 20, False], [20, 460, 23, 20, False], [35, 565, 28, 5, False],
[0, 400, 33, 20, False], [5, 400, 18, 25, True], [40, 965, 48, 20, False], [45, 1365, 68, 60, False]],
20, 30],
110),
('normal control 1', [[[5, 30, 20, 60, False], [5, 430, 53, 25, False], [10, 830, 38, 5, True]], 20, 30],
0),
('normal control 2', [[[10, 0, 0, 60, False], [10, 45, 0, 20, False], [10, 90, 33, 20, True]], 20, 30], 0),
('normal control 3',
[[[10, 45, 33, 60, False], [15, 445, 33, 60, False], [25, 490, 18, 20, False], [30, 520, 18, 60, True],
[40, 565, 3, 25, True], [45, 595, 36, 10, False], [50, 595, 21, 20, False], [55, 655, 54, 20, False]],
20, 30],
189),
('normal control 4',
[[[10, 90, 53, 60, True], [5, 60, 20, 20, False], [35, 950, 113, 20, True], [30, 890, 73, 60, False],
[35, 920, 93, 5, False], [20, 490, 53, 20, False]],
20, 30],
431)],
[('regression: paused endpoints',
[[[45, 965, 139, 5, False], [5, 400, 0, 10, True], [15, 430, 33, 10, True], [60, 1040, 172, 5, False],
[45, 920, 106, 5, False], [50, 995, 172, 20, False], [25, 490, 53, 5, False], [35, 890, 73, 5, False]],
20, 30],
571),
('partial repair probe: paused endpoints',
[[[20, 105, 33, 20, True], [10, 75, 0, 20, False], [5, 45, 0, 10, False], [25, 150, 53, 10, False]], 20,
30],
30),
('second regression',
[[[25, 475, 73, 60, False], [5, 0, 0, 5, False], [15, 400, 33, 10, False], [35, 520, 93, 60, False],
[20, 445, 53, 10, True]],
20, 30],
0),
('normal control 1',
[[[20, 830, 53, 60, False], [15, 800, 53, 5, False], [10, 400, 20, 10, False], [30, 890, 119, 5, False],
[25, 860, 86, 60, False], [15, 400, 53, 20, True]],
20, 30],
499),
('normal control 2',
[[[20, 90, 86, 5, False], [10, 30, 33, 25, False], [30, 890, 71, 10, False], [15, 60, 66, 20, False],
[30, 490, 71, 60, False]],
20, 30],
36),
('normal control 3',
[[[5, 30, -15, 25, False], [10, 90, -15, 25, False], [15, 120, 18, 25, True], [25, 520, 3, 20, True],
[30, 580, 36, 60, False], [35, 980, 69, 5, False], [35, 1040, 102, 60, False]],
20, 30],
0),
('normal control 4', [[[5, 45, 33, 20, False], [20, 165, 33, 60, False], [10, 105, 33, 20, False]], 20, 30],
60)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: paused endpoints | 161 | 0 | Failed |
| partial repair probe: paused endpoints | 511 | 511 | Passed |
| second regression | 81 | 81 | Passed |
| normal control 1 | 0 | 0 | Passed |
| normal control 2 | 68 | 68 | Passed |
| normal control 3 | 45 | 45 | Passed |
| normal control 4 | 0 | 0 | Passed |
SHA-256 / f3d85b1e52e1cda73070a2b4b0ad7b92f3ab0fee8e67d67a8aa1271bd8887ce2
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 = 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 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: paused endpoints',
[[[0, 30, -15, 20, True], [0, 30, -30, 60, False], [0, 30, -45, 25, False], [0, 90, -45, 20, False],
[5, 120, -60, 10, False], [15, 520, -40, 20, False], [20, 550, -40, 20, True],
[30, 610, -55, 20, False]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[20, 505, 3, 5, False], [40, 550, 76, 20, True], [30, 550, 23, 25, False], [35, 550, 43, 5, False],
[35, 550, 23, 20, False], [10, 45, -15, 20, False], [15, 105, -30, 20, False]],
20, 30],
511),
('second regression',
[[[10, 60, 20, 10, False], [10, 90, 53, 20, False], [15, 135, 53, 25, False], [15, 135, 53, 5, False],
[25, 165, 53, 20, True]],
20, 30],
81),
('normal control 1',
[[[5, 120, 60, 20, False], [5, 520, 80, 5, False], [15, 565, 80, 25, False], [5, 120, 40, 20, False],
[5, 60, 20, 20, False]],
20, 30],
0),
('normal control 2',
[[[15, 860, 36, 10, False], [5, 800, 3, 5, False], [5, 800, -30, 25, False], [0, 400, -15, 60, False]], 20,
30],
68),
('normal control 3', [[[10, 45, 33, 20, False], [15, 90, 33, 5, False], [15, 120, 66, 5, False]], 20, 30],
45),
('normal control 4',
[[[5, 60, 33, 60, False], [15, 460, 33, 60, False], [15, 860, 66, 25, False], [20, 905, 66, 25, False],
[20, 1305, 86, 10, True]],
20, 30],
0)],
[('regression: paused endpoints',
[[[10, 45, 20, 20, True], [15, 90, 20, 60, False], [15, 120, 53, 5, False], [20, 520, 38, 5, False]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[0, 60, -15, 5, False], [0, 105, 18, 10, False], [5, 505, 38, 20, False], [15, 505, 38, 20, False],
[25, 505, 58, 20, True]],
20, 30],
448),
('second regression',
[[[10, 30, 0, 60, True], [10, 75, 20, 10, False], [5, 30, 0, 25, False], [15, 135, 53, 20, True]], 20, 30],
0),
('normal control 1',
[[[5, 430, -30, 10, False], [5, 460, -30, 5, False], [10, 505, 3, 5, False], [5, 30, -15, 25, False]], 20,
30],
81),
('normal control 2',
[[[0, 45, 0, 25, False], [0, 75, 20, 60, False], [0, 475, 40, 5, False], [0, 875, 73, 20, False],
[10, 935, 58, 5, False], [15, 965, 91, 60, True], [20, 995, 76, 10, False], [30, 1040, 76, 5, False]],
20, 30],
566),
('normal control 3',
[[[5, 30, 0, 25, True], [10, 90, -15, 20, True], [15, 490, -30, 5, True], [25, 490, -30, 20, True]], 20,
30],
0),
('normal control 4',
[[[5, 30, -15, 10, False], [10, 90, 5, 25, False], [15, 490, -10, 20, False], [20, 490, -25, 20, False],
[25, 550, -5, 25, False], [30, 595, 15, 60, False], [40, 655, 15, 5, False], [45, 685, 48, 20, False]],
20, 30],
669)],
[('regression: paused endpoints',
[[[10, 520, 33, 20, True], [25, 580, 33, 20, False], [15, 550, 33, 60, False], [30, 640, 66, 10, True],
[30, 685, 86, 5, False], [10, 120, 33, 25, False], [5, 60, 33, 5, True]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[5, 150, 38, 10, False], [5, 60, 20, 10, False], [5, 90, 5, 20, False], [10, 195, 23, 20, False],
[20, 625, 28, 25, False], [15, 225, 8, 20, True]],
20, 30],
47),
('second regression',
[[[35, 135, 71, 20, False], [10, 30, 33, 25, False], [15, 30, 66, 5, True], [35, 165, 91, 20, True],
[25, 90, 51, 25, False], [40, 195, 111, 10, False]],
20, 30],
72),
('normal control 1',
[[[0, 60, -15, 25, False], [0, 460, 5, 20, False], [5, 860, -10, 60, False], [15, 1260, 23, 20, False],
[20, 1305, 43, 25, True], [25, 1350, 43, 60, False], [25, 1380, 63, 60, False],
[30, 1780, 48, 5, False]],
20, 30],
0),
('normal control 2', [[[10, 45, 33, 10, False], [10, 105, 33, 60, True], [15, 150, 66, 20, False]], 20, 30],
110),
('normal control 3', [[[5, 0, -15, 20, False], [15, 60, -30, 5, False], [25, 105, -30, 25, False]], 20, 30],
61),
('normal control 4',
[[[0, 30, 33, 20, False], [25, 610, 119, 20, False], [20, 550, 119, 20, False], [30, 640, 139, 20, False],
[10, 90, 66, 10, False], [20, 490, 86, 5, True]],
20, 30],
622)],
[('regression: paused endpoints',
[[[0, 45, -15, 20, True], [5, 90, -15, 60, True], [15, 150, 18, 20, False], [25, 180, 18, 5, True]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[5, 45, 0, 25, False], [10, 90, 20, 60, True], [20, 135, 5, 10, False], [20, 135, 25, 25, False],
[25, 135, 45, 60, False], [30, 180, 45, 20, True], [35, 225, 45, 5, False]],
20, 30],
0),
('second regression',
[[[10, 400, 3, 20, True], [25, 505, 8, 20, False], [20, 460, 23, 20, False], [35, 565, 28, 5, False],
[0, 400, 33, 20, False], [5, 400, 18, 25, True], [40, 965, 48, 20, False], [45, 1365, 68, 60, False]],
20, 30],
110),
('normal control 1', [[[5, 30, 20, 60, False], [5, 430, 53, 25, False], [10, 830, 38, 5, True]], 20, 30],
0),
('normal control 2', [[[10, 0, 0, 60, False], [10, 45, 0, 20, False], [10, 90, 33, 20, True]], 20, 30], 0),
('normal control 3',
[[[10, 45, 33, 60, False], [15, 445, 33, 60, False], [25, 490, 18, 20, False], [30, 520, 18, 60, True],
[40, 565, 3, 25, True], [45, 595, 36, 10, False], [50, 595, 21, 20, False], [55, 655, 54, 20, False]],
20, 30],
189),
('normal control 4',
[[[10, 90, 53, 60, True], [5, 60, 20, 20, False], [35, 950, 113, 20, True], [30, 890, 73, 60, False],
[35, 920, 93, 5, False], [20, 490, 53, 20, False]],
20, 30],
431)],
[('regression: paused endpoints',
[[[45, 965, 139, 5, False], [5, 400, 0, 10, True], [15, 430, 33, 10, True], [60, 1040, 172, 5, False],
[45, 920, 106, 5, False], [50, 995, 172, 20, False], [25, 490, 53, 5, False], [35, 890, 73, 5, False]],
20, 30],
571),
('partial repair probe: paused endpoints',
[[[20, 105, 33, 20, True], [10, 75, 0, 20, False], [5, 45, 0, 10, False], [25, 150, 53, 10, False]], 20,
30],
30),
('second regression',
[[[25, 475, 73, 60, False], [5, 0, 0, 5, False], [15, 400, 33, 10, False], [35, 520, 93, 60, False],
[20, 445, 53, 10, True]],
20, 30],
0),
('normal control 1',
[[[20, 830, 53, 60, False], [15, 800, 53, 5, False], [10, 400, 20, 10, False], [30, 890, 119, 5, False],
[25, 860, 86, 60, False], [15, 400, 53, 20, True]],
20, 30],
499),
('normal control 2',
[[[20, 90, 86, 5, False], [10, 30, 33, 25, False], [30, 890, 71, 10, False], [15, 60, 66, 20, False],
[30, 490, 71, 60, False]],
20, 30],
36),
('normal control 3',
[[[5, 30, -15, 25, False], [10, 90, -15, 25, False], [15, 120, 18, 25, True], [25, 520, 3, 20, True],
[30, 580, 36, 60, False], [35, 980, 69, 5, False], [35, 1040, 102, 60, False]],
20, 30],
0),
('normal control 4', [[[5, 45, 33, 20, False], [20, 165, 33, 60, False], [10, 105, 33, 20, False]], 20, 30],
60)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: paused endpoints | 430 | 0 | Failed |
| partial repair probe: paused endpoints | 544 | 511 | Failed |
| second regression | 111 | 81 | Failed |
| normal control 1 | 0 | 0 | Passed |
| normal control 2 | 68 | 68 | Passed |
| normal control 3 | 45 | 45 | Passed |
| normal control 4 | 0 | 0 | Passed |
SHA-256 / ff7796c1b48731ef2057eed0629f5af869301c191ecae77ca1b762eb525a341a
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: paused endpoints',
[[[0, 30, -15, 20, True], [0, 30, -30, 60, False], [0, 30, -45, 25, False], [0, 90, -45, 20, False],
[5, 120, -60, 10, False], [15, 520, -40, 20, False], [20, 550, -40, 20, True],
[30, 610, -55, 20, False]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[20, 505, 3, 5, False], [40, 550, 76, 20, True], [30, 550, 23, 25, False], [35, 550, 43, 5, False],
[35, 550, 23, 20, False], [10, 45, -15, 20, False], [15, 105, -30, 20, False]],
20, 30],
511),
('second regression',
[[[10, 60, 20, 10, False], [10, 90, 53, 20, False], [15, 135, 53, 25, False], [15, 135, 53, 5, False],
[25, 165, 53, 20, True]],
20, 30],
81),
('normal control 1',
[[[5, 120, 60, 20, False], [5, 520, 80, 5, False], [15, 565, 80, 25, False], [5, 120, 40, 20, False],
[5, 60, 20, 20, False]],
20, 30],
0),
('normal control 2',
[[[15, 860, 36, 10, False], [5, 800, 3, 5, False], [5, 800, -30, 25, False], [0, 400, -15, 60, False]], 20,
30],
68),
('normal control 3', [[[10, 45, 33, 20, False], [15, 90, 33, 5, False], [15, 120, 66, 5, False]], 20, 30],
45),
('normal control 4',
[[[5, 60, 33, 60, False], [15, 460, 33, 60, False], [15, 860, 66, 25, False], [20, 905, 66, 25, False],
[20, 1305, 86, 10, True]],
20, 30],
0)],
[('regression: paused endpoints',
[[[10, 45, 20, 20, True], [15, 90, 20, 60, False], [15, 120, 53, 5, False], [20, 520, 38, 5, False]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[0, 60, -15, 5, False], [0, 105, 18, 10, False], [5, 505, 38, 20, False], [15, 505, 38, 20, False],
[25, 505, 58, 20, True]],
20, 30],
448),
('second regression',
[[[10, 30, 0, 60, True], [10, 75, 20, 10, False], [5, 30, 0, 25, False], [15, 135, 53, 20, True]], 20, 30],
0),
('normal control 1',
[[[5, 430, -30, 10, False], [5, 460, -30, 5, False], [10, 505, 3, 5, False], [5, 30, -15, 25, False]], 20,
30],
81),
('normal control 2',
[[[0, 45, 0, 25, False], [0, 75, 20, 60, False], [0, 475, 40, 5, False], [0, 875, 73, 20, False],
[10, 935, 58, 5, False], [15, 965, 91, 60, True], [20, 995, 76, 10, False], [30, 1040, 76, 5, False]],
20, 30],
566),
('normal control 3',
[[[5, 30, 0, 25, True], [10, 90, -15, 20, True], [15, 490, -30, 5, True], [25, 490, -30, 20, True]], 20,
30],
0),
('normal control 4',
[[[5, 30, -15, 10, False], [10, 90, 5, 25, False], [15, 490, -10, 20, False], [20, 490, -25, 20, False],
[25, 550, -5, 25, False], [30, 595, 15, 60, False], [40, 655, 15, 5, False], [45, 685, 48, 20, False]],
20, 30],
669)],
[('regression: paused endpoints',
[[[10, 520, 33, 20, True], [25, 580, 33, 20, False], [15, 550, 33, 60, False], [30, 640, 66, 10, True],
[30, 685, 86, 5, False], [10, 120, 33, 25, False], [5, 60, 33, 5, True]],
20, 30],
0),
('partial repair probe: paused endpoints',
[[[5, 150, 38, 10, False], [5, 60, 20, 10, False], [5, 90, 5, 20, False], [10, 195, 23, 20, False],
[20, 625, 28, 25, False], [15, 225, 8, 20, True]],
20, 30],
47),
('second regression',
[[[35, 135, 71, 20, False], [10, 30, 33, 25, False], [15, 30, 66, 5, True], [35, 165, 91, 20, True],
[25, 90, 51, 25, False], [40, 195, 111, 10, False]],
20, 30],
72),
('normal control 1',
[[[0, 60, -15, 25, False], [0, 460, 5, 20, False], [5, 860, -10, 60, False], [15, 1260, 23, 20, False],
[20, 1305, 43, 25, True], [25, 1350, 43, 60, False], [25, 1380, 63, 60, False],
[30, 1780, 48, 5, False]],
20, 30],
0),
('normal control 2', [[[10, 45, 33, 10, False], [10, 105, 33, 60, True], [15, 150, 66, 20, False]], 20, 30],
110),
('normal control 3', [[[5, 0, -15, 20, False], [15, 60, -30, 5, False], [25, 105, -30, 25, False]], 20, 30],
61),
('normal control 4',
[[[0, 30, 33, 20, False], [25, 610, 119, 20, False], [20, 550, 119, 20, False], [30, 640, 139, 20, False],
[10, 90, 66, 10, False], [20, 490, 86, 5, True]],
20, 30],
622)],
[('regression: paused endpoints',
[[[0, 45, -15, 20, True], [5, 90, -15, 60, True], [15, 150, 18, 20, False], [25, 180, 18, 5, True]], 20,
30],
0),
('partial repair probe: paused endpoints',
[[[5, 45, 0, 25, False], [10, 90, 20, 60, True], [20, 135, 5, 10, False], [20, 135, 25, 25, False],
[25, 135, 45, 60, False], [30, 180, 45, 20, True], [35, 225, 45, 5, False]],
20, 30],
0),
('second regression',
[[[10, 400, 3, 20, True], [25, 505, 8, 20, False], [20, 460, 23, 20, False], [35, 565, 28, 5, False],
[0, 400, 33, 20, False], [5, 400, 18, 25, True], [40, 965, 48, 20, False], [45, 1365, 68, 60, False]],
20, 30],
110),
('normal control 1', [[[5, 30, 20, 60, False], [5, 430, 53, 25, False], [10, 830, 38, 5, True]], 20, 30],
0),
('normal control 2', [[[10, 0, 0, 60, False], [10, 45, 0, 20, False], [10, 90, 33, 20, True]], 20, 30], 0),
('normal control 3',
[[[10, 45, 33, 60, False], [15, 445, 33, 60, False], [25, 490, 18, 20, False], [30, 520, 18, 60, True],
[40, 565, 3, 25, True], [45, 595, 36, 10, False], [50, 595, 21, 20, False], [55, 655, 54, 20, False]],
20, 30],
189),
('normal control 4',
[[[10, 90, 53, 60, True], [5, 60, 20, 20, False], [35, 950, 113, 20, True], [30, 890, 73, 60, False],
[35, 920, 93, 5, False], [20, 490, 53, 20, False]],
20, 30],
431)],
[('regression: paused endpoints',
[[[45, 965, 139, 5, False], [5, 400, 0, 10, True], [15, 430, 33, 10, True], [60, 1040, 172, 5, False],
[45, 920, 106, 5, False], [50, 995, 172, 20, False], [25, 490, 53, 5, False], [35, 890, 73, 5, False]],
20, 30],
571),
('partial repair probe: paused endpoints',
[[[20, 105, 33, 20, True], [10, 75, 0, 20, False], [5, 45, 0, 10, False], [25, 150, 53, 10, False]], 20,
30],
30),
('second regression',
[[[25, 475, 73, 60, False], [5, 0, 0, 5, False], [15, 400, 33, 10, False], [35, 520, 93, 60, False],
[20, 445, 53, 10, True]],
20, 30],
0),
('normal control 1',
[[[20, 830, 53, 60, False], [15, 800, 53, 5, False], [10, 400, 20, 10, False], [30, 890, 119, 5, False],
[25, 860, 86, 60, False], [15, 400, 53, 20, True]],
20, 30],
499),
('normal control 2',
[[[20, 90, 86, 5, False], [10, 30, 33, 25, False], [30, 890, 71, 10, False], [15, 60, 66, 20, False],
[30, 490, 71, 60, False]],
20, 30],
36),
('normal control 3',
[[[5, 30, -15, 25, False], [10, 90, -15, 25, False], [15, 120, 18, 25, True], [25, 520, 3, 20, True],
[30, 580, 36, 60, False], [35, 980, 69, 5, False], [35, 1040, 102, 60, False]],
20, 30],
0),
('normal control 4', [[[5, 45, 33, 20, False], [20, 165, 33, 60, False], [10, 105, 33, 20, False]], 20, 30],
60)]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: paused endpoints | 0 | 0 | Passed |
| partial repair probe: paused endpoints | 511 | 511 | Passed |
| second regression | 81 | 81 | Passed |
| normal control 1 | 0 | 0 | Passed |
| normal control 2 | 68 | 68 | Passed |
| normal control 3 | 45 | 45 | Passed |
| normal control 4 | 0 | 0 | Passed |
SHA-256 / 371b31c64466b09d1a488bb8a0c2ed6d72357a8a414fffe0edb06d2a5906f66f
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.232444+00:00.
Case digest / 9402cde79990e3357190c830a6ab56843279ea5097c58da433a1c60ba45d9927