FA-68746 / Toll and parking fee computation / Open access
Open-road gantry trip building: the cap is applied to the whole statement · case 01
Open-road gantry trip building returns a wrong result when the cap is applied to the whole statement.
ROOT CAUSE
All trips share one cap, undercharging multi-trip statements.
THE FAILURE
All trips share one cap, undercharging multi-trip statements.
Unsuccessful approach: Deduplicating gantries within a trip forgives legitimate repeat passages.
Case contract
Input {reads: [[minute, gantry, direction]] unordered, dedupe, max_gap, price per gantry, trip_cap}. Reads are sorted; a read of the same gantry within dedupe minutes (inclusive) of the last kept read of that gantry is dropped. Kept reads join the current trip when the direction matches and the gap from the trip's latest read is <= max_gap, else start a new trip. Each trip pays min(trip_cap, sum of its gantry prices). Return [trips, total].
Why this case matters
Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
reads = sorted(x['reads'])
kept = []
lastg = {}
for t, g, d in reads:
if g in lastg and t - lastg[g] <= x['dedupe']:
continue
lastg[g] = t
kept.append((t, g, d))
trips = []
for t, g, d in kept:
if trips and trips[-1]['d'] == d and t - trips[-1]['t'] <= x['max_gap']:
trips[-1]['g'].append(g)
trips[-1]['t'] = t
else:
trips.append({'d': d, 't': t, 'g': [g]})
total = min(x['trip_cap'], sum(x['price'][g] for tr in trips for g in tr['g']))
return [len(trips), total]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'reads': [[85, 0, 'N'], [59, 3, 'S'], [64, 0, 'S'], [67, 0, 'S'], [65, 3, 'N'], [28, 0, 'S'], [29, 0, 'S']], 'dedupe': 2, 'max_gap': 30, 'price': [75, 200, 110, 200, 150, 150], 'trip_cap': 600}, [5, 700]), ({'reads': [[109, 2, 'N'], [15, 1, 'N'], [60, 2, 'N'], [12, 3, 'S'], [65, 3, 'N'], [108, 2, 'N'], [18, 1, 'N'], [139, 5, 'N'], [63, 3, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 75, 75, 110, 75, 110], 'trip_cap': 900}, [5, 630]), ({'reads': [[23, 3, 'N'], [25, 3, 'N'], [68, 0, 'N'], [71, 2, 'S'], [72, 3, 'S'], [75, 3, 'S'], [92, 0, 'S'], [112, 5, 'N'], [115, 5, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [200, 110, 75, 75, 75, 200], 'trip_cap': 900}, [4, 825]), ({'reads': [[2, 3, 'N'], [47, 0, 'N'], [48, 0, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [75, 110, 75, 200, 75, 75], 'trip_cap': 400}, [2, 275]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[123, 4, 'S'], [103, 4, 'S'], [70, 2, 'S'], [73, 5, 'S'], [103, 4, 'S'], [12, 3, 'N'], [22, 4, 'S'], [83, 5, 'S'], [25, 2, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 110, 150, 150, 150, 150], 'trip_cap': 400}, [3, 850]), ({'reads': [[7, 2, 'S'], [7, 2, 'S'], [8, 2, 'S'], [39, 4, 'S'], [49, 2, 'S'], [50, 2, 'S'], [79, 0, 'S'], [124, 1, 'S'], [154, 1, 'S'], [155, 1, 'S'], [159, 5, 'S'], [159, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 150, 150, 150, 150, 200], 'trip_cap': 900}, [5, 1100]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350])], [({'reads': [[28, 0, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [200, 200, 150, 110, 75, 75], 'trip_cap': 900}, [1, 200]), ({'reads': [[32, 5, 'S'], [33, 5, 'N'], [34, 5, 'N'], [38, 3, 'N'], [39, 1, 'N'], [59, 0, 'N'], [79, 1, 'N'], [80, 1, 'N'], [89, 2, 'S'], [119, 0, 'S'], [120, 5, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 110, 200, 150, 150, 110], 'trip_cap': 900}, [3, 940]), ({'reads': [[28, 0, 'S'], [73, 2, 'N'], [75, 2, 'N'], [83, 1, 'N'], [84, 1, 'N'], [84, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [110, 200, 75, 150, 200, 110], 'trip_cap': 600}, [3, 495]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[34, 4, 'N'], [54, 0, 'N'], [57, 2, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [110, 110, 110, 75, 150, 200], 'trip_cap': 400}, [1, 370]), ({'reads': [[8, 4, 'N'], [38, 2, 'N'], [38, 2, 'N'], [58, 2, 'S'], [58, 2, 'S'], [68, 1, 'S'], [98, 1, 'S'], [98, 1, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 110, 150, 200, 200, 110], 'trip_cap': 400}, [4, 720]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[15, 0, 'N'], [18, 5, 'N'], [21, 0, 'N'], [52, 3, 'N'], [55, 5, 'N'], [86, 4, 'S'], [91, 3, 'N'], [93, 3, 'N'], [92, 1, 'N'], [92, 1, 'N'], [123, 1, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 150, 75, 110, 110, 150], 'trip_cap': 600}, [5, 1080])], [({'reads': [[42, 4, 'S'], [62, 1, 'S'], [92, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 150, 110, 200, 75, 200], 'trip_cap': 600}, [2, 300]), ({'reads': [[1, 1, 'N'], [32, 3, 'N'], [63, 5, 'N'], [108, 1, 'S'], [111, 1, 'S'], [111, 3, 'S'], [112, 3, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [110, 75, 110, 75, 75, 150], 'trip_cap': 400}, [4, 525]), ({'reads': [[28, 2, 'S'], [13, 4, 'S'], [18, 1, 'S'], [59, 5, 'S'], [59, 5, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [150, 75, 200, 150, 150, 110], 'trip_cap': 400}, [2, 510]), ({'reads': [[32, 4, 'N'], [33, 4, 'N'], [78, 3, 'S'], [29, 1, 'N'], [24, 3, 'N'], [68, 1, 'S'], [63, 3, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [150, 75, 150, 200, 200, 150], 'trip_cap': 900}, [3, 950]), ({'reads': [[44, 1, 'S'], [64, 5, 'S'], [109, 1, 'N'], [154, 4, 'N'], [185, 2, 'S']], 'dedupe': 2, 'max_gap': 30, 'price': [150, 75, 200, 110, 200, 110], 'trip_cap': 900}, [4, 660]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[1, 4, 'N'], [31, 4, 'N'], [61, 3, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 150, 75, 75, 110, 110], 'trip_cap': 600}, [3, 295])], [({'reads': [[45, 5, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 200, 75, 200, 150, 150], 'trip_cap': 400}, [1, 150]), ({'reads': [[49, 3, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [200, 110, 200, 110, 110, 150], 'trip_cap': 600}, [1, 110]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[31, 4, 'S'], [34, 4, 'S'], [51, 2, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [110, 150, 110, 200, 150, 75], 'trip_cap': 600}, [1, 260]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[47, 0, 'N'], [50, 0, 'S'], [52, 0, 'S'], [51, 2, 'S'], [61, 5, 'S'], [81, 0, 'S'], [91, 0, 'S'], [92, 5, 'S'], [112, 4, 'N'], [113, 4, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 200, 150, 110, 75, 150], 'trip_cap': 600}, [3, 825]), ({'reads': [[37, 4, 'S'], [68, 2, 'S'], [88, 2, 'S'], [93, 5, 'S'], [113, 2, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 75, 150, 200, 75, 75], 'trip_cap': 400}, [2, 475]), ({'reads': [[50, 4, 'S'], [70, 3, 'S'], [73, 0, 'N'], [74, 0, 'N'], [103, 4, 'N'], [113, 1, 'S'], [113, 1, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 200, 75, 110, 150, 200], 'trip_cap': 400}, [4, 685])], [({'reads': [[25, 1, 'S'], [56, 1, 'S'], [56, 1, 'S'], [66, 3, 'S'], [35, 4, 'S'], [5, 3, 'S'], [36, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 110, 75, 200, 75, 200], 'trip_cap': 400}, [1, 400]), ({'reads': [[18, 0, 'N'], [18, 0, 'N'], [19, 4, 'N'], [29, 2, 'N'], [59, 1, 'N'], [79, 0, 'N'], [79, 0, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 75, 110, 110, 110, 75], 'trip_cap': 400}, [2, 445]), ({'reads': [[39, 0, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 75, 110, 110, 110, 110], 'trip_cap': 600}, [1, 75]), ({'reads': [[2, 1, 'N'], [33, 0, 'N'], [33, 0, 'N'], [78, 3, 'N'], [88, 2, 'N'], [89, 2, 'N'], [91, 0, 'N'], [94, 5, 'N'], [99, 3, 'N'], [144, 1, 'S'], [189, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 200, 110, 110, 75, 200], 'trip_cap': 600}, [5, 1275]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[12, 1, 'S'], [43, 4, 'S'], [74, 1, 'S'], [119, 2, 'N'], [150, 0, 'N'], [151, 0, 'N'], [181, 3, 'S'], [182, 3, 'S'], [182, 1, 'S'], [185, 1, 'S'], [202, 1, 'S'], [232, 4, 'S'], [235, 4, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [150, 75, 110, 150, 150, 75], 'trip_cap': 400}, [7, 1010]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[39, 2, 'S'], [84, 3, 'S'], [85, 3, 'S'], [87, 3, 'S'], [116, 2, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [200, 150, 75, 150, 75, 75], 'trip_cap': 900}, [3, 300])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check('fee oracle' + ' %d' % i, 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 |
|---|---|---|---|
| fee oracle 0 | [5, 600] | [5, 700] | Failed |
| fee oracle 1 | [5, 630] | [5, 630] | Passed |
| fee oracle 2 | [4, 825] | [4, 825] | Passed |
| fee oracle 3 | [2, 275] | [2, 275] | Passed |
| fee oracle 4 | [1, 750] | [1, 750] | Passed |
| fee oracle 5 | [3, 400] | [3, 850] | Failed |
| fee oracle 6 | [5, 900] | [5, 1100] | Failed |
| fee oracle 7 | [2, 350] | [2, 350] | Passed |
SHA-256 / a7a99c7dfb5c4a14b7a0e5485f9559784efbd8e1901230d89e97eb4875a57dde
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
reads = sorted(x['reads'])
kept = []
lastg = {}
for t, g, d in reads:
if g in lastg and t - lastg[g] <= x['dedupe']:
continue
lastg[g] = t
kept.append((t, g, d))
trips = []
for t, g, d in kept:
if trips and trips[-1]['d'] == d and t - trips[-1]['t'] <= x['max_gap']:
trips[-1]['g'].append(g)
trips[-1]['t'] = t
else:
trips.append({'d': d, 't': t, 'g': [g]})
total = sum(min(x['trip_cap'], sum(x['price'][g] for g in set(tr['g']))) for tr in trips)
return [len(trips), total]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'reads': [[85, 0, 'N'], [59, 3, 'S'], [64, 0, 'S'], [67, 0, 'S'], [65, 3, 'N'], [28, 0, 'S'], [29, 0, 'S']], 'dedupe': 2, 'max_gap': 30, 'price': [75, 200, 110, 200, 150, 150], 'trip_cap': 600}, [5, 700]), ({'reads': [[109, 2, 'N'], [15, 1, 'N'], [60, 2, 'N'], [12, 3, 'S'], [65, 3, 'N'], [108, 2, 'N'], [18, 1, 'N'], [139, 5, 'N'], [63, 3, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 75, 75, 110, 75, 110], 'trip_cap': 900}, [5, 630]), ({'reads': [[23, 3, 'N'], [25, 3, 'N'], [68, 0, 'N'], [71, 2, 'S'], [72, 3, 'S'], [75, 3, 'S'], [92, 0, 'S'], [112, 5, 'N'], [115, 5, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [200, 110, 75, 75, 75, 200], 'trip_cap': 900}, [4, 825]), ({'reads': [[2, 3, 'N'], [47, 0, 'N'], [48, 0, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [75, 110, 75, 200, 75, 75], 'trip_cap': 400}, [2, 275]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[123, 4, 'S'], [103, 4, 'S'], [70, 2, 'S'], [73, 5, 'S'], [103, 4, 'S'], [12, 3, 'N'], [22, 4, 'S'], [83, 5, 'S'], [25, 2, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 110, 150, 150, 150, 150], 'trip_cap': 400}, [3, 850]), ({'reads': [[7, 2, 'S'], [7, 2, 'S'], [8, 2, 'S'], [39, 4, 'S'], [49, 2, 'S'], [50, 2, 'S'], [79, 0, 'S'], [124, 1, 'S'], [154, 1, 'S'], [155, 1, 'S'], [159, 5, 'S'], [159, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 150, 150, 150, 150, 200], 'trip_cap': 900}, [5, 1100]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350])], [({'reads': [[28, 0, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [200, 200, 150, 110, 75, 75], 'trip_cap': 900}, [1, 200]), ({'reads': [[32, 5, 'S'], [33, 5, 'N'], [34, 5, 'N'], [38, 3, 'N'], [39, 1, 'N'], [59, 0, 'N'], [79, 1, 'N'], [80, 1, 'N'], [89, 2, 'S'], [119, 0, 'S'], [120, 5, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 110, 200, 150, 150, 110], 'trip_cap': 900}, [3, 940]), ({'reads': [[28, 0, 'S'], [73, 2, 'N'], [75, 2, 'N'], [83, 1, 'N'], [84, 1, 'N'], [84, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [110, 200, 75, 150, 200, 110], 'trip_cap': 600}, [3, 495]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[34, 4, 'N'], [54, 0, 'N'], [57, 2, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [110, 110, 110, 75, 150, 200], 'trip_cap': 400}, [1, 370]), ({'reads': [[8, 4, 'N'], [38, 2, 'N'], [38, 2, 'N'], [58, 2, 'S'], [58, 2, 'S'], [68, 1, 'S'], [98, 1, 'S'], [98, 1, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 110, 150, 200, 200, 110], 'trip_cap': 400}, [4, 720]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[15, 0, 'N'], [18, 5, 'N'], [21, 0, 'N'], [52, 3, 'N'], [55, 5, 'N'], [86, 4, 'S'], [91, 3, 'N'], [93, 3, 'N'], [92, 1, 'N'], [92, 1, 'N'], [123, 1, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [75, 150, 75, 110, 110, 150], 'trip_cap': 600}, [5, 1080])], [({'reads': [[42, 4, 'S'], [62, 1, 'S'], [92, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 150, 110, 200, 75, 200], 'trip_cap': 600}, [2, 300]), ({'reads': [[1, 1, 'N'], [32, 3, 'N'], [63, 5, 'N'], [108, 1, 'S'], [111, 1, 'S'], [111, 3, 'S'], [112, 3, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [110, 75, 110, 75, 75, 150], 'trip_cap': 400}, [4, 525]), ({'reads': [[28, 2, 'S'], [13, 4, 'S'], [18, 1, 'S'], [59, 5, 'S'], [59, 5, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [150, 75, 200, 150, 150, 110], 'trip_cap': 400}, [2, 510]), ({'reads': [[32, 4, 'N'], [33, 4, 'N'], [78, 3, 'S'], [29, 1, 'N'], [24, 3, 'N'], [68, 1, 'S'], [63, 3, 'N']], 'dedupe': 3, 'max_gap': 30, 'price': [150, 75, 150, 200, 200, 150], 'trip_cap': 900}, [3, 950]), ({'reads': [[44, 1, 'S'], [64, 5, 'S'], [109, 1, 'N'], [154, 4, 'N'], [185, 2, 'S']], 'dedupe': 2, 'max_gap': 30, 'price': [150, 75, 200, 110, 200, 110], 'trip_cap': 900}, [4, 660]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[1, 4, 'N'], [31, 4, 'N'], [61, 3, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 150, 75, 75, 110, 110], 'trip_cap': 600}, [3, 295])], [({'reads': [[45, 5, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 200, 75, 200, 150, 150], 'trip_cap': 400}, [1, 150]), ({'reads': [[49, 3, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [200, 110, 200, 110, 110, 150], 'trip_cap': 600}, [1, 110]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[31, 4, 'S'], [34, 4, 'S'], [51, 2, 'S']], 'dedupe': 3, 'max_gap': 30, 'price': [110, 150, 110, 200, 150, 75], 'trip_cap': 600}, [1, 260]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[47, 0, 'N'], [50, 0, 'S'], [52, 0, 'S'], [51, 2, 'S'], [61, 5, 'S'], [81, 0, 'S'], [91, 0, 'S'], [92, 5, 'S'], [112, 4, 'N'], [113, 4, 'N']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 200, 150, 110, 75, 150], 'trip_cap': 600}, [3, 825]), ({'reads': [[37, 4, 'S'], [68, 2, 'S'], [88, 2, 'S'], [93, 5, 'S'], [113, 2, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [110, 75, 150, 200, 75, 75], 'trip_cap': 400}, [2, 475]), ({'reads': [[50, 4, 'S'], [70, 3, 'S'], [73, 0, 'N'], [74, 0, 'N'], [103, 4, 'N'], [113, 1, 'S'], [113, 1, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 200, 75, 110, 150, 200], 'trip_cap': 400}, [4, 685])], [({'reads': [[25, 1, 'S'], [56, 1, 'S'], [56, 1, 'S'], [66, 3, 'S'], [35, 4, 'S'], [5, 3, 'S'], [36, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [150, 110, 75, 200, 75, 200], 'trip_cap': 400}, [1, 400]), ({'reads': [[18, 0, 'N'], [18, 0, 'N'], [19, 4, 'N'], [29, 2, 'N'], [59, 1, 'N'], [79, 0, 'N'], [79, 0, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 75, 110, 110, 110, 75], 'trip_cap': 400}, [2, 445]), ({'reads': [[39, 0, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [75, 75, 110, 110, 110, 110], 'trip_cap': 600}, [1, 75]), ({'reads': [[2, 1, 'N'], [33, 0, 'N'], [33, 0, 'N'], [78, 3, 'N'], [88, 2, 'N'], [89, 2, 'N'], [91, 0, 'N'], [94, 5, 'N'], [99, 3, 'N'], [144, 1, 'S'], [189, 5, 'S']], 'dedupe': 2, 'max_gap': 20, 'price': [75, 200, 110, 110, 75, 200], 'trip_cap': 600}, [5, 1275]), ({'reads': [[10, 0, 'S'], [5, 4, 'N'], [12, 1, 'S'], [11, 0, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 400}, [2, 350]), ({'reads': [[12, 1, 'S'], [43, 4, 'S'], [74, 1, 'S'], [119, 2, 'N'], [150, 0, 'N'], [151, 0, 'N'], [181, 3, 'S'], [182, 3, 'S'], [182, 1, 'S'], [185, 1, 'S'], [202, 1, 'S'], [232, 4, 'S'], [235, 4, 'S']], 'dedupe': 3, 'max_gap': 20, 'price': [150, 75, 110, 150, 150, 75], 'trip_cap': 400}, [7, 1010]), ({'reads': [[0, 1, 'N'], [2, 1, 'N'], [4, 1, 'N'], [30, 2, 'N'], [55, 3, 'N']], 'dedupe': 2, 'max_gap': 30, 'price': [100, 150, 200, 250, 100, 100], 'trip_cap': 900}, [1, 750]), ({'reads': [[39, 2, 'S'], [84, 3, 'S'], [85, 3, 'S'], [87, 3, 'S'], [116, 2, 'N']], 'dedupe': 3, 'max_gap': 20, 'price': [200, 150, 75, 150, 75, 75], 'trip_cap': 900}, [3, 300])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check('fee oracle' + ' %d' % i, 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 |
|---|---|---|---|
| fee oracle 0 | [5, 700] | [5, 700] | Passed |
| fee oracle 1 | [5, 555] | [5, 630] | Failed |
| fee oracle 2 | [4, 825] | [4, 825] | Passed |
| fee oracle 3 | [2, 275] | [2, 275] | Passed |
| fee oracle 4 | [1, 600] | [1, 750] | Failed |
| fee oracle 5 | [3, 850] | [3, 850] | Passed |
| fee oracle 6 | [5, 1100] | [5, 1100] | Passed |
| fee oracle 7 | [2, 350] | [2, 350] | Passed |
SHA-256 / 4d58cbaf72357fe97bd5d2e0fe20e5d4af621ba9d34ce95dbfa37ae9072342dc
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic, bounded toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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:48:05.101892+00:00.
Case digest / c43333fb93587fb19fbdda32bf8e8d75030dce846d48d206d6e521b6cf713a95