FA-58431 / Loan amortization schedules / Open access
Interest-only period with funding stub: amortization term · case 01
The amortizing payment is too small and a large final payment remains.
ROOT CAUSE
The payment is leveled over the whole loan term including the interest-only months.
THE FAILURE
The payment is leveled over the whole loan term including the interest-only months.
Unsuccessful approach: Reducing principal by interest-only payments treats interest as if it repaid principal.
Case contract
x = {'principal', 'rate_bp', 'io_months' >= 1, 'amort_months' >= 1, 'fund_day' 1..30}. IO month m pays interest round_half_up(P*bp*days/(120000*30)) with days = 31 - fund_day for the first IO month and 30 otherwise. Then the level payment on the full principal over amort_months (exact annuity, half-up) amortizes with monthly interest round_half_up(balance*bp/120000); the last month pays balance + interest. Return {'io_bills': list of IO payments, 'payment', 'final_payment', 'total_interest'}.
Why this case matters
Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
def rnd(n, d):
q, r = divmod(n, d)
return q + (1 if 2 * r >= d else 0)
def level(P, n):
if n <= 0 or P <= 0:
return 0
if bp == 0:
exact = Fraction(P, n)
else:
r = Fraction(bp, 120000)
exact = P * r / (1 - (1 + r) ** -n)
return math.floor(exact + Fraction(1, 2))
bp = x['rate_bp']
P = x['principal']
io_bills = []
total_int = 0
for m in range(x['io_months']):
days = 31 - x['fund_day'] if m == 0 else 30
interest = rnd(P * bp * days, 120000 * 30)
io_bills.append(interest)
total_int += interest
pay = level(P, x['io_months'] + x['amort_months'])
bal = P
final = 0
for k in range(1, x['amort_months'] + 1):
interest = rnd(bal * bp, 120000)
total_int += interest
if k == x['amort_months']:
final = bal + interest
else:
bal -= pay - interest
return {'io_bills': io_bills, 'payment': pay, 'final_payment': final, 'total_interest': total_int}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: amortization term', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 60, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 56614, 'final_payment': 56596, 'total_interest': 434322}], ['sample 1', {'principal': 12345, 'rate_bp': 725, 'io_months': 12, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 1070, 'final_payment': 1065, 'total_interest': 1355}], ['sample 2', {'principal': 250000, 'rate_bp': 725, 'io_months': 3, 'amort_months': 12, 'fund_day': 29}, {'io_bills': [101, 1510, 1510], 'payment': 21661, 'final_payment': 21655, 'total_interest': 13047}], ['sample 3', {'principal': 250000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [167, 2500, 2500], 'payment': 11768, 'final_payment': 11778, 'total_interest': 37609}], ['sample 4', {'principal': 3000000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 1, 'fund_day': 2}, {'io_bills': [29000, 30000, 30000], 'payment': 3030000, 'final_payment': 3030000, 'total_interest': 119000}], ['sample 5', {'principal': 12345, 'rate_bp': 0, 'io_months': 1, 'amort_months': 24, 'fund_day': 2}, {'io_bills': [0], 'payment': 514, 'final_payment': 523, 'total_interest': 0}], ['sample 6', {'principal': 12345, 'rate_bp': 500, 'io_months': 3, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [27, 51, 51], 'payment': 1057, 'final_payment': 1054, 'total_interest': 465}]], [['regression: amortization term', {'principal': 12345, 'rate_bp': 0, 'io_months': 3, 'amort_months': 12, 'fund_day': 1}, {'io_bills': [0, 0, 0], 'payment': 1029, 'final_payment': 1026, 'total_interest': 0}], ['regression: amortization term, partial-repair probe', {'principal': 100000, 'rate_bp': 725, 'io_months': 2, 'amort_months': 60, 'fund_day': 1}, {'io_bills': [604, 604], 'payment': 1992, 'final_payment': 1987, 'total_interest': 20723}], ['sample 1', {'principal': 250000, 'rate_bp': 500, 'io_months': 2, 'amort_months': 60, 'fund_day': 30}, {'io_bills': [35, 1042], 'payment': 4718, 'final_payment': 4703, 'total_interest': 34142}], ['sample 2', {'principal': 3000000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 60, 'fund_day': 2}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 50000, 'final_payment': 50000, 'total_interest': 0}], ['sample 3', {'principal': 100000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [33, 1000, 1000], 'payment': 4707, 'final_payment': 4718, 'total_interest': 15012}], ['sample 4', {'principal': 12345, 'rate_bp': 725, 'io_months': 3, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [40, 75, 75], 'payment': 246, 'final_payment': 239, 'total_interest': 2598}], ['sample 5', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 12, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 256822, 'final_payment': 256827, 'total_interest': 119369}]], [['regression: amortization term', {'principal': 3000000, 'rate_bp': 500, 'io_months': 2, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [833, 12500], 'payment': 131614, 'final_payment': 131618, 'total_interest': 172073}], ['sample 1', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 24, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 131614, 'final_payment': 131618, 'total_interest': 196240}], ['sample 2', {'principal': 12345, 'rate_bp': 500, 'io_months': 2, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [27, 51], 'payment': 1057, 'final_payment': 1054, 'total_interest': 414}], ['sample 3', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 4167, 'final_payment': 4159, 'total_interest': 0}], ['sample 4', {'principal': 100000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [222, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417], 'payment': 4387, 'final_payment': 4389, 'total_interest': 10099}], ['sample 5', {'principal': 100000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 12, 'fund_day': 29}, {'io_bills': [28, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417], 'payment': 8561, 'final_payment': 8559, 'total_interest': 7345}], ['sample 6', {'principal': 12345, 'rate_bp': 0, 'io_months': 2, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [0, 0], 'payment': 514, 'final_payment': 523, 'total_interest': 0}]], [['regression: amortization term', {'principal': 250000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [556, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042], 'payment': 4718, 'final_payment': 4703, 'total_interest': 45083}], ['sample 1', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 60, 'fund_day': 29}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 1667, 'final_payment': 1647, 'total_interest': 0}], ['sample 2', {'principal': 250000, 'rate_bp': 0, 'io_months': 3, 'amort_months': 1, 'fund_day': 2}, {'io_bills': [0, 0, 0], 'payment': 250000, 'final_payment': 250000, 'total_interest': 0}], ['sample 3', {'principal': 250000, 'rate_bp': 1200, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [1333, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500], 'payment': 11768, 'final_payment': 11778, 'total_interest': 61275}], ['sample 4', {'principal': 100000, 'rate_bp': 725, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [322, 604, 604, 604, 604, 604, 604, 604, 604, 604, 604, 604], 'payment': 4489, 'final_payment': 4477, 'total_interest': 14690}], ['sample 5', {'principal': 12345, 'rate_bp': 1200, 'io_months': 2, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [4, 123], 'payment': 581, 'final_payment': 584, 'total_interest': 1729}], ['sample 6', {'principal': 100000, 'rate_bp': 500, 'io_months': 1, 'amort_months': 12, 'fund_day': 30}, {'io_bills': [14], 'payment': 8561, 'final_payment': 8559, 'total_interest': 2744}]], [['regression: amortization term', {'principal': 12345, 'rate_bp': 725, 'io_months': 1, 'amort_months': 12, 'fund_day': 2}, {'io_bills': [72], 'payment': 1070, 'final_payment': 1065, 'total_interest': 562}], ['sample 1', {'principal': 3000000, 'rate_bp': 725, 'io_months': 1, 'amort_months': 60, 'fund_day': 29}, {'io_bills': [1208], 'payment': 59758, 'final_payment': 59764, 'total_interest': 586694}], ['sample 2', {'principal': 100000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 60, 'fund_day': 2}, {'io_bills': [403, 417, 417], 'payment': 1887, 'final_payment': 1894, 'total_interest': 14464}], ['sample 3', {'principal': 250000, 'rate_bp': 725, 'io_months': 1, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [806], 'payment': 4980, 'final_payment': 4967, 'total_interest': 49593}], ['sample 4', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 4167, 'final_payment': 4159, 'total_interest': 0}], ['sample 5', {'principal': 12345, 'rate_bp': 725, 'io_months': 2, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [40, 75], 'payment': 554, 'final_payment': 559, 'total_interest': 1071}], ['sample 6', {'principal': 3000000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 125000, 'final_payment': 125000, 'total_interest': 0}]]]
for label, args, expected in fixtures[N-1]:
try:
actual = solve(args)
except Exception as exc:
actual = 'raised ' + type(exc).__name__
check(label, actual, 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: amortization term | {'final_payment': 215601, 'io_bills': [12500, 12500, 12500], 'payment': 54241, 'total_interest': 453320} | {'final_payment': 56596, 'io_bills': [12500, 12500, 12500], 'payment': 56614, 'total_interest': 434322} | Failed |
| sample 1 | {'final_payment': 6953, 'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 554, 'total_interest': 1567} | {'final_payment': 1065, 'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 1070, 'total_interest': 1355} | Failed |
| sample 2 | {'final_payment': 69303, 'io_bills': [101, 1510, 1510], 'payment': 17484, 'total_interest': 14748} | {'final_payment': 21655, 'io_bills': [101, 1510, 1510], 'payment': 21661, 'total_interest': 13047} | Failed |
| sample 3 | {'final_payment': 41828, 'io_bills': [167, 2500, 2500], 'payment': 10611, 'total_interest': 41048} | {'final_payment': 11778, 'io_bills': [167, 2500, 2500], 'payment': 11768, 'total_interest': 37609} | Failed |
| sample 4 | {'final_payment': 3030000, 'io_bills': [29000, 30000, 30000], 'payment': 768843, 'total_interest': 119000} | {'final_payment': 3030000, 'io_bills': [29000, 30000, 30000], 'payment': 3030000, 'total_interest': 119000} | Failed |
| sample 5 | {'final_payment': 983, 'io_bills': [0], 'payment': 494, 'total_interest': 0} | {'final_payment': 523, 'io_bills': [0], 'payment': 514, 'total_interest': 0} | Failed |
| sample 6 | {'final_payment': 3377, 'io_bills': [27, 51, 51], 'payment': 851, 'total_interest': 522} | {'final_payment': 1054, 'io_bills': [27, 51, 51], 'payment': 1057, 'total_interest': 465} | Failed |
SHA-256 / 8185ecd6c7c76f0a0395ecb4d1c8e4d721516e53f7baaaa487f630d2332c9808
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
def rnd(n, d):
q, r = divmod(n, d)
return q + (1 if 2 * r >= d else 0)
def level(P, n):
if n <= 0 or P <= 0:
return 0
if bp == 0:
exact = Fraction(P, n)
else:
r = Fraction(bp, 120000)
exact = P * r / (1 - (1 + r) ** -n)
return math.floor(exact + Fraction(1, 2))
bp = x['rate_bp']
P = x['principal']
io_bills = []
total_int = 0
for m in range(x['io_months']):
days = 31 - x['fund_day'] if m == 0 else 30
interest = rnd(P * bp * days, 120000 * 30)
io_bills.append(interest)
total_int += interest
pay = level(P - sum(io_bills), x['amort_months'])
bal = P
final = 0
for k in range(1, x['amort_months'] + 1):
interest = rnd(bal * bp, 120000)
total_int += interest
if k == x['amort_months']:
final = bal + interest
else:
bal -= pay - interest
return {'io_bills': io_bills, 'payment': pay, 'final_payment': final, 'total_interest': total_int}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: amortization term', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 60, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 56614, 'final_payment': 56596, 'total_interest': 434322}], ['sample 1', {'principal': 12345, 'rate_bp': 725, 'io_months': 12, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 1070, 'final_payment': 1065, 'total_interest': 1355}], ['sample 2', {'principal': 250000, 'rate_bp': 725, 'io_months': 3, 'amort_months': 12, 'fund_day': 29}, {'io_bills': [101, 1510, 1510], 'payment': 21661, 'final_payment': 21655, 'total_interest': 13047}], ['sample 3', {'principal': 250000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [167, 2500, 2500], 'payment': 11768, 'final_payment': 11778, 'total_interest': 37609}], ['sample 4', {'principal': 3000000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 1, 'fund_day': 2}, {'io_bills': [29000, 30000, 30000], 'payment': 3030000, 'final_payment': 3030000, 'total_interest': 119000}], ['sample 5', {'principal': 12345, 'rate_bp': 0, 'io_months': 1, 'amort_months': 24, 'fund_day': 2}, {'io_bills': [0], 'payment': 514, 'final_payment': 523, 'total_interest': 0}], ['sample 6', {'principal': 12345, 'rate_bp': 500, 'io_months': 3, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [27, 51, 51], 'payment': 1057, 'final_payment': 1054, 'total_interest': 465}]], [['regression: amortization term', {'principal': 12345, 'rate_bp': 0, 'io_months': 3, 'amort_months': 12, 'fund_day': 1}, {'io_bills': [0, 0, 0], 'payment': 1029, 'final_payment': 1026, 'total_interest': 0}], ['regression: amortization term, partial-repair probe', {'principal': 100000, 'rate_bp': 725, 'io_months': 2, 'amort_months': 60, 'fund_day': 1}, {'io_bills': [604, 604], 'payment': 1992, 'final_payment': 1987, 'total_interest': 20723}], ['sample 1', {'principal': 250000, 'rate_bp': 500, 'io_months': 2, 'amort_months': 60, 'fund_day': 30}, {'io_bills': [35, 1042], 'payment': 4718, 'final_payment': 4703, 'total_interest': 34142}], ['sample 2', {'principal': 3000000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 60, 'fund_day': 2}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 50000, 'final_payment': 50000, 'total_interest': 0}], ['sample 3', {'principal': 100000, 'rate_bp': 1200, 'io_months': 3, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [33, 1000, 1000], 'payment': 4707, 'final_payment': 4718, 'total_interest': 15012}], ['sample 4', {'principal': 12345, 'rate_bp': 725, 'io_months': 3, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [40, 75, 75], 'payment': 246, 'final_payment': 239, 'total_interest': 2598}], ['sample 5', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 12, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 256822, 'final_payment': 256827, 'total_interest': 119369}]], [['regression: amortization term', {'principal': 3000000, 'rate_bp': 500, 'io_months': 2, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [833, 12500], 'payment': 131614, 'final_payment': 131618, 'total_interest': 172073}], ['sample 1', {'principal': 3000000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 24, 'fund_day': 1}, {'io_bills': [12500, 12500, 12500], 'payment': 131614, 'final_payment': 131618, 'total_interest': 196240}], ['sample 2', {'principal': 12345, 'rate_bp': 500, 'io_months': 2, 'amort_months': 12, 'fund_day': 15}, {'io_bills': [27, 51], 'payment': 1057, 'final_payment': 1054, 'total_interest': 414}], ['sample 3', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 29}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 4167, 'final_payment': 4159, 'total_interest': 0}], ['sample 4', {'principal': 100000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [222, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417], 'payment': 4387, 'final_payment': 4389, 'total_interest': 10099}], ['sample 5', {'principal': 100000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 12, 'fund_day': 29}, {'io_bills': [28, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, 417], 'payment': 8561, 'final_payment': 8559, 'total_interest': 7345}], ['sample 6', {'principal': 12345, 'rate_bp': 0, 'io_months': 2, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [0, 0], 'payment': 514, 'final_payment': 523, 'total_interest': 0}]], [['regression: amortization term', {'principal': 250000, 'rate_bp': 500, 'io_months': 12, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [556, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042], 'payment': 4718, 'final_payment': 4703, 'total_interest': 45083}], ['sample 1', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 60, 'fund_day': 29}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 1667, 'final_payment': 1647, 'total_interest': 0}], ['sample 2', {'principal': 250000, 'rate_bp': 0, 'io_months': 3, 'amort_months': 1, 'fund_day': 2}, {'io_bills': [0, 0, 0], 'payment': 250000, 'final_payment': 250000, 'total_interest': 0}], ['sample 3', {'principal': 250000, 'rate_bp': 1200, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [1333, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500, 2500], 'payment': 11768, 'final_payment': 11778, 'total_interest': 61275}], ['sample 4', {'principal': 100000, 'rate_bp': 725, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [322, 604, 604, 604, 604, 604, 604, 604, 604, 604, 604, 604], 'payment': 4489, 'final_payment': 4477, 'total_interest': 14690}], ['sample 5', {'principal': 12345, 'rate_bp': 1200, 'io_months': 2, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [4, 123], 'payment': 581, 'final_payment': 584, 'total_interest': 1729}], ['sample 6', {'principal': 100000, 'rate_bp': 500, 'io_months': 1, 'amort_months': 12, 'fund_day': 30}, {'io_bills': [14], 'payment': 8561, 'final_payment': 8559, 'total_interest': 2744}]], [['regression: amortization term', {'principal': 12345, 'rate_bp': 725, 'io_months': 1, 'amort_months': 12, 'fund_day': 2}, {'io_bills': [72], 'payment': 1070, 'final_payment': 1065, 'total_interest': 562}], ['sample 1', {'principal': 3000000, 'rate_bp': 725, 'io_months': 1, 'amort_months': 60, 'fund_day': 29}, {'io_bills': [1208], 'payment': 59758, 'final_payment': 59764, 'total_interest': 586694}], ['sample 2', {'principal': 100000, 'rate_bp': 500, 'io_months': 3, 'amort_months': 60, 'fund_day': 2}, {'io_bills': [403, 417, 417], 'payment': 1887, 'final_payment': 1894, 'total_interest': 14464}], ['sample 3', {'principal': 250000, 'rate_bp': 725, 'io_months': 1, 'amort_months': 60, 'fund_day': 15}, {'io_bills': [806], 'payment': 4980, 'final_payment': 4967, 'total_interest': 49593}], ['sample 4', {'principal': 100000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 30}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 4167, 'final_payment': 4159, 'total_interest': 0}], ['sample 5', {'principal': 12345, 'rate_bp': 725, 'io_months': 2, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [40, 75], 'payment': 554, 'final_payment': 559, 'total_interest': 1071}], ['sample 6', {'principal': 3000000, 'rate_bp': 0, 'io_months': 12, 'amort_months': 24, 'fund_day': 15}, {'io_bills': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'payment': 125000, 'final_payment': 125000, 'total_interest': 0}]]]
for label, args, expected in fixtures[N-1]:
try:
actual = solve(args)
except Exception as exc:
actual = 'raised ' + type(exc).__name__
check(label, actual, 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: amortization term | {'final_payment': 104035, 'io_bills': [12500, 12500, 12500], 'payment': 55906, 'total_interest': 439989} | {'final_payment': 56596, 'io_bills': [12500, 12500, 12500], 'payment': 56614, 'total_interest': 434322} | Failed |
| sample 1 | {'final_payment': 1920, 'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 995, 'total_interest': 1385} | {'final_payment': 1065, 'io_bills': [40, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75], 'payment': 1070, 'total_interest': 1355} | Failed |
| sample 2 | {'final_payment': 24746, 'io_bills': [101, 1510, 1510], 'payment': 21390, 'total_interest': 13157} | {'final_payment': 21655, 'io_bills': [101, 1510, 1510], 'payment': 21661, 'total_interest': 13047} | Failed |
| sample 3 | {'final_payment': 18093, 'io_bills': [167, 2500, 2500], 'payment': 11525, 'total_interest': 38335} | {'final_payment': 11778, 'io_bills': [167, 2500, 2500], 'payment': 11768, 'total_interest': 37609} | Failed |
| sample 4 | {'final_payment': 3030000, 'io_bills': [29000, 30000, 30000], 'payment': 2940110, 'total_interest': 119000} | {'final_payment': 3030000, 'io_bills': [29000, 30000, 30000], 'payment': 3030000, 'total_interest': 119000} | Failed |
| sample 5 | {'final_payment': 523, 'io_bills': [0], 'payment': 514, 'total_interest': 0} | {'final_payment': 523, 'io_bills': [0], 'payment': 514, 'total_interest': 0} | Passed |
| sample 6 | {'final_payment': 1179, 'io_bills': [27, 51, 51], 'payment': 1046, 'total_interest': 469} | {'final_payment': 1054, 'io_bills': [27, 51, 51], 'payment': 1057, 'total_interest': 465} | Failed |
SHA-256 / 6735f3a0ef9eb60733396d62f8be8231aa7ce051a7c5e3654f7dd853038423aa
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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 teaching model with stipulated toy lending rules stated in the contract; money is integer cents and rates are basis points; it makes no claim of conformance to any regulation, servicing standard or product. 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:46:26.711159+00:00.
Case digest / 72005aed447f98b7243dfbeba5ce5bd5e6bfaa4dce4051f1913bc6b587d9238b