FA-66511 / Airline fare rule evaluation / Open access
Mileage ratio rounded before band selection · case 01
A routing 5.1% over MPM is charged only the 5M surcharge.
ROOT CAUSE
The ratio is rounded to two decimals, pulling slightly-over routings into the lower band.
VERIFIED REPAIR
Compare exact integer products instead of a rounded ratio.
Unsuccessful approach: Rounding to three decimals narrows but does not remove the misclassification.
Case contract
Input {'tpm':[segment miles],'tpd':deduction miles,'mpm'}. Total = sum(TPM) - TPD. Total <= MPM -> ['M',0]; else the smallest band b in 5,10,15,20,25 with total <= MPM*(1+b/100) -> ['bM', b]; beyond 25% -> 'ERR_EXCEEDS'. Comparisons are exact integer arithmetic.
Why this case matters
The mileage system surcharges fares in 5% bands when the ticketed routing exceeds the maximum permitted mileage.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
total = sum(x['tpm']) - x['tpd']
mpm = x['mpm']
if total * 100 <= mpm * 100: return ['M', 0]
for pct in (5, 10, 15, 20, 25):
if round(total / mpm, 2) <= 1 + pct / 100:
return ['%dM' % pct, pct]
return 'ERR_EXCEEDS'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['within MPM', {'tpm': [1200, 801], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1107], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 251, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1210], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5256], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2492, 2156], 'tpd': 0, 'mpm': 4150}, ['15M', 15]], ['sampled case 2', {'tpm': [3592, 2721], 'tpd': 0, 'mpm': 5598}, ['15M', 15]], ['sampled case 3', {'tpm': [402, 360], 'tpd': 73, 'mpm': 652}, ['10M', 10]], ['regression: band comparison arithmetic', {'tpm': [3022, 3383], 'tpd': 0, 'mpm': 5821}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 802], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1108], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 252, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1220], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5257], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [4525, 5148], 'tpd': 0, 'mpm': 7940}, ['25M', 25]], ['sampled case 2', {'tpm': [3880, 3908], 'tpd': 293, 'mpm': 7743}, ['M', 0]], ['sampled case 3', {'tpm': [3404, 3171], 'tpd': 0, 'mpm': 5451}, ['25M', 25]], ['regression: band comparison arithmetic', {'tpm': [1397, 1474], 'tpd': 0, 'mpm': 2496}, ['20M', 20]]], [['within MPM', {'tpm': [1200, 803], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1109], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 253, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1230], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5258], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2696, 2449], 'tpd': 42, 'mpm': 4715}, ['10M', 10]], ['sampled case 2', {'tpm': [193], 'tpd': 0, 'mpm': 8525}, ['M', 0]], ['sampled case 3', {'tpm': [1557, 1285], 'tpd': 0, 'mpm': 2456}, ['20M', 20]], ['regression: band comparison arithmetic', {'tpm': [2364, 3414, 1783], 'tpd': 214, 'mpm': 5876}, 'ERR_EXCEEDS']], [['within MPM', {'tpm': [1200, 804], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1110], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 254, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1240], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5259], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1579, 2622], 'tpd': 0, 'mpm': 1172}, 'ERR_EXCEEDS'], ['sampled case 2', {'tpm': [3163, 3734], 'tpd': 278, 'mpm': 3722}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [607], 'tpd': 0, 'mpm': 5975}, ['M', 0]], ['regression: band comparison arithmetic', {'tpm': [821, 856], 'tpd': 0, 'mpm': 1524}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 805], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1111], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 255, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1250], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5260], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1024], 'tpd': 298, 'mpm': 6290}, ['M', 0]], ['sampled case 2', {'tpm': [1754, 1180], 'tpd': 0, 'mpm': 872}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [3753, 4785], 'tpd': 130, 'mpm': 7546}, ['15M', 15]], ['regression: band comparison arithmetic', {'tpm': [604, 589], 'tpd': 0, 'mpm': 994}, ['25M', 25]]]]
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 |
|---|---|---|---|
| within MPM | ['M', 0] | ['M', 0] | Passed |
| exactly MPM | ['M', 0] | ['M', 0] | Passed |
| exactly 5 percent over | ['5M', 5] | ['5M', 5] | Passed |
| just over 5 percent | ['5M', 5] | ['10M', 10] | Failed |
| deduction brings within | ['M', 0] | ['M', 0] | Passed |
| beyond 25 percent | ERR_EXCEEDS | ERR_EXCEEDS | Passed |
| ratio rounds down to band | ['5M', 5] | ['10M', 10] | Failed |
| sampled case 1 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 2 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 3 | ['10M', 10] | ['10M', 10] | Passed |
| regression: band comparison arithmetic | ['10M', 10] | ['15M', 15] | Failed |
SHA-256 / 62a8d23ee1065c3fa1e085c82ec16db577dbf0a6ad90777d7d875e27f948af37
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
total = sum(x['tpm']) - x['tpd']
mpm = x['mpm']
if total * 100 <= mpm * 100: return ['M', 0]
for pct in (5, 10, 15, 20, 25):
if round(total / mpm, 3) <= 1 + pct / 100:
return ['%dM' % pct, pct]
return 'ERR_EXCEEDS'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['within MPM', {'tpm': [1200, 801], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1107], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 251, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1210], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5256], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2492, 2156], 'tpd': 0, 'mpm': 4150}, ['15M', 15]], ['sampled case 2', {'tpm': [3592, 2721], 'tpd': 0, 'mpm': 5598}, ['15M', 15]], ['sampled case 3', {'tpm': [402, 360], 'tpd': 73, 'mpm': 652}, ['10M', 10]], ['regression: band comparison arithmetic', {'tpm': [3022, 3383], 'tpd': 0, 'mpm': 5821}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 802], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1108], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 252, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1220], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5257], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [4525, 5148], 'tpd': 0, 'mpm': 7940}, ['25M', 25]], ['sampled case 2', {'tpm': [3880, 3908], 'tpd': 293, 'mpm': 7743}, ['M', 0]], ['sampled case 3', {'tpm': [3404, 3171], 'tpd': 0, 'mpm': 5451}, ['25M', 25]], ['regression: band comparison arithmetic', {'tpm': [1397, 1474], 'tpd': 0, 'mpm': 2496}, ['20M', 20]]], [['within MPM', {'tpm': [1200, 803], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1109], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 253, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1230], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5258], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2696, 2449], 'tpd': 42, 'mpm': 4715}, ['10M', 10]], ['sampled case 2', {'tpm': [193], 'tpd': 0, 'mpm': 8525}, ['M', 0]], ['sampled case 3', {'tpm': [1557, 1285], 'tpd': 0, 'mpm': 2456}, ['20M', 20]], ['regression: band comparison arithmetic', {'tpm': [2364, 3414, 1783], 'tpd': 214, 'mpm': 5876}, 'ERR_EXCEEDS']], [['within MPM', {'tpm': [1200, 804], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1110], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 254, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1240], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5259], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1579, 2622], 'tpd': 0, 'mpm': 1172}, 'ERR_EXCEEDS'], ['sampled case 2', {'tpm': [3163, 3734], 'tpd': 278, 'mpm': 3722}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [607], 'tpd': 0, 'mpm': 5975}, ['M', 0]], ['regression: band comparison arithmetic', {'tpm': [821, 856], 'tpd': 0, 'mpm': 1524}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 805], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1111], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 255, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1250], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5260], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1024], 'tpd': 298, 'mpm': 6290}, ['M', 0]], ['sampled case 2', {'tpm': [1754, 1180], 'tpd': 0, 'mpm': 872}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [3753, 4785], 'tpd': 130, 'mpm': 7546}, ['15M', 15]], ['regression: band comparison arithmetic', {'tpm': [604, 589], 'tpd': 0, 'mpm': 994}, ['25M', 25]]]]
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 |
|---|---|---|---|
| within MPM | ['M', 0] | ['M', 0] | Passed |
| exactly MPM | ['M', 0] | ['M', 0] | Passed |
| exactly 5 percent over | ['5M', 5] | ['5M', 5] | Passed |
| just over 5 percent | ['10M', 10] | ['10M', 10] | Passed |
| deduction brings within | ['M', 0] | ['M', 0] | Passed |
| beyond 25 percent | ERR_EXCEEDS | ERR_EXCEEDS | Passed |
| ratio rounds down to band | ['10M', 10] | ['10M', 10] | Passed |
| sampled case 1 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 2 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 3 | ['10M', 10] | ['10M', 10] | Passed |
| regression: band comparison arithmetic | ['10M', 10] | ['15M', 15] | Failed |
SHA-256 / 7f2e60682f54522efc0c6c7bb364ac8fb0131fe122a9b45aada9fd7aaf48fe0b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
total = sum(x['tpm']) - x['tpd']
mpm = x['mpm']
if total * 100 <= mpm * 100: return ['M', 0]
for pct in (5, 10, 15, 20, 25):
if total * 100 <= mpm * (100 + pct):
return ['%dM' % pct, pct]
return 'ERR_EXCEEDS'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['within MPM', {'tpm': [1200, 801], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1107], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 251, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1210], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5256], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2492, 2156], 'tpd': 0, 'mpm': 4150}, ['15M', 15]], ['sampled case 2', {'tpm': [3592, 2721], 'tpd': 0, 'mpm': 5598}, ['15M', 15]], ['sampled case 3', {'tpm': [402, 360], 'tpd': 73, 'mpm': 652}, ['10M', 10]], ['regression: band comparison arithmetic', {'tpm': [3022, 3383], 'tpd': 0, 'mpm': 5821}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 802], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1108], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 252, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1220], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5257], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [4525, 5148], 'tpd': 0, 'mpm': 7940}, ['25M', 25]], ['sampled case 2', {'tpm': [3880, 3908], 'tpd': 293, 'mpm': 7743}, ['M', 0]], ['sampled case 3', {'tpm': [3404, 3171], 'tpd': 0, 'mpm': 5451}, ['25M', 25]], ['regression: band comparison arithmetic', {'tpm': [1397, 1474], 'tpd': 0, 'mpm': 2496}, ['20M', 20]]], [['within MPM', {'tpm': [1200, 803], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1109], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 253, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1230], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5258], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [2696, 2449], 'tpd': 42, 'mpm': 4715}, ['10M', 10]], ['sampled case 2', {'tpm': [193], 'tpd': 0, 'mpm': 8525}, ['M', 0]], ['sampled case 3', {'tpm': [1557, 1285], 'tpd': 0, 'mpm': 2456}, ['20M', 20]], ['regression: band comparison arithmetic', {'tpm': [2364, 3414, 1783], 'tpd': 214, 'mpm': 5876}, 'ERR_EXCEEDS']], [['within MPM', {'tpm': [1200, 804], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1110], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 254, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1240], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5259], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1579, 2622], 'tpd': 0, 'mpm': 1172}, 'ERR_EXCEEDS'], ['sampled case 2', {'tpm': [3163, 3734], 'tpd': 278, 'mpm': 3722}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [607], 'tpd': 0, 'mpm': 5975}, ['M', 0]], ['regression: band comparison arithmetic', {'tpm': [821, 856], 'tpd': 0, 'mpm': 1524}, ['15M', 15]]], [['within MPM', {'tpm': [1200, 805], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly MPM', {'tpm': [1000, 1100], 'tpd': 0, 'mpm': 2100}, ['M', 0]], ['exactly 5 percent over', {'tpm': [1100, 1105], 'tpd': 0, 'mpm': 2100}, ['5M', 5]], ['just over 5 percent', {'tpm': [1100, 1111], 'tpd': 0, 'mpm': 2100}, ['10M', 10]], ['deduction brings within', {'tpm': [1500, 900], 'tpd': 255, 'mpm': 2200}, ['M', 0]], ['beyond 25 percent', {'tpm': [2000, 1250], 'tpd': 0, 'mpm': 2500}, 'ERR_EXCEEDS'], ['ratio rounds down to band', {'tpm': [5260], 'tpd': 0, 'mpm': 5000}, ['10M', 10]], ['sampled case 1', {'tpm': [1024], 'tpd': 298, 'mpm': 6290}, ['M', 0]], ['sampled case 2', {'tpm': [1754, 1180], 'tpd': 0, 'mpm': 872}, 'ERR_EXCEEDS'], ['sampled case 3', {'tpm': [3753, 4785], 'tpd': 130, 'mpm': 7546}, ['15M', 15]], ['regression: band comparison arithmetic', {'tpm': [604, 589], 'tpd': 0, 'mpm': 994}, ['25M', 25]]]]
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 |
|---|---|---|---|
| within MPM | ['M', 0] | ['M', 0] | Passed |
| exactly MPM | ['M', 0] | ['M', 0] | Passed |
| exactly 5 percent over | ['5M', 5] | ['5M', 5] | Passed |
| just over 5 percent | ['10M', 10] | ['10M', 10] | Passed |
| deduction brings within | ['M', 0] | ['M', 0] | Passed |
| beyond 25 percent | ERR_EXCEEDS | ERR_EXCEEDS | Passed |
| ratio rounds down to band | ['10M', 10] | ['10M', 10] | Passed |
| sampled case 1 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 2 | ['15M', 15] | ['15M', 15] | Passed |
| sampled case 3 | ['10M', 10] | ['10M', 10] | Passed |
| regression: band comparison arithmetic | ['15M', 15] | ['15M', 15] | Passed |
SHA-256 / 5bc663f877aa5e07a5dda45709c6e75dcb353764a9486209f49df40e9095ebe6
Verification & scope
A stipulated toy fare-rule contract with invented constants; it is not an ATPCO or carrier tariff implementation and makes no claim of industry-standard conformance. 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:47:44.332985+00:00.
Case digest / 9e1126dffb6e79dc6513c2e436c53027462be0a56a6037fd31ceb580b0c360d0