{"abstract":"Cushions drift by a few cents from the annual formula.","category":"Loan amortization schedules","checks":7,"contract":"x = {'disbursements': annual amounts, 'low_point': projected lowest balance, 'cushion_months', 'refund_threshold'}. total = sum; base = round_half_up(total/12); cushion = round_half_up(total*cushion_months/12); diff = low_point - cushion; shortage = max(0, -diff) is collected over 12 months rounded up; surplus = max(0, diff) is refunded when >= refund_threshold, otherwise floor(surplus/12) is credited monthly. Return {'base', 'cushion', 'shortage', 'refund', 'monthly'}.","evaluation_group":"w2-loan-amortization-schedules-escrow-analysis","failed_approach":"Dividing 12 by the cushion months with integer division is exact only for divisors of 12.","family":"w2-loan-amortization-schedules-escrow-analysis-cushion-computation","id":"FA-58671","implementations":{"attempt":{"sha256":"340e79b845bac3254c6ea295ed6644ce529057f6a1466476f56d1cad10f559ad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    total = sum(x['disbursements'])\n    base = rnd(total, 12)\n    cushion = rnd(total, 12 // x['cushion_months']) if x['cushion_months'] else 0\n    diff = x['low_point'] - cushion\n    shortage = max(0, -diff)\n    surplus = max(0, diff)\n    refund = surplus if surplus >= x['refund_threshold'] else 0\n    monthly = base + (shortage + 11) // 12 - (0 if refund else surplus // 12)\n    return {'base': base, 'cushion': cushion, 'shortage': shortage, 'refund': refund, 'monthly': monthly}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: cushion computation', {'disbursements': [120000, 36000, 99999], 'low_point': -5000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 21333, 'cushion': 42667, 'shortage': 47667, 'refund': 0, 'monthly': 25306}], ['regression: cushion computation, partial-repair probe', {'disbursements': [36000, 250000], 'low_point': -5000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 23833, 'cushion': 119167, 'shortage': 124167, 'refund': 0, 'monthly': 34181}], ['control 1', {'disbursements': [99999, 250000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 29167, 'cushion': 29167, 'shortage': 0, 'refund': 50833, 'monthly': 29167}], ['control 2', {'disbursements': [120000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 10000, 'shortage': 10000, 'refund': 0, 'monthly': 10834}], ['control 3', {'disbursements': [99999, 250000, 7], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 29167, 'cushion': 29167, 'shortage': 34167, 'refund': 0, 'monthly': 32015}], ['control 4', {'disbursements': [36000, 36000, 120000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 16000, 'cushion': 32000, 'shortage': 0, 'refund': 118000, 'monthly': 16000}], ['control 5', {'disbursements': [99999, 99999], 'low_point': 10000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 16667, 'cushion': 16667, 'shortage': 6667, 'refund': 0, 'monthly': 17223}]], [['regression: cushion computation', {'disbursements': [250000, 99999, 120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 195833, 'shortage': 45833, 'refund': 0, 'monthly': 42987}], ['control 1', {'disbursements': [120000, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 0, 'refund': 67000, 'monthly': 13000}], ['control 2', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 0, 'monthly': 2667}], ['control 3', {'disbursements': [7, 36000], 'low_point': 0, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3001, 'cushion': 0, 'shortage': 0, 'refund': 0, 'monthly': 3001}], ['control 4', {'disbursements': [120000, 120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 20000, 'cushion': 40000, 'shortage': 0, 'refund': 0, 'monthly': 20000}], ['control 5', {'disbursements': [250000, 120000, 99999], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 44167, 'refund': 0, 'monthly': 42848}], ['control 6', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 10000, 'shortage': 0, 'refund': 140000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [120000, 120000, 7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 20001, 'cushion': 100003, 'shortage': 20003, 'refund': 0, 'monthly': 21668}], ['control 1', {'disbursements': [250000, 120000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 30833, 'cushion': 30833, 'shortage': 0, 'refund': 49167, 'monthly': 30833}], ['control 2', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 15000, 'shortage': 15000, 'refund': 0, 'monthly': 4250}], ['control 3', {'disbursements': [7, 250000], 'low_point': 80000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 20834, 'cushion': 0, 'shortage': 0, 'refund': 80000, 'monthly': 20834}], ['control 4', {'disbursements': [7, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 3001, 'cushion': 3001, 'shortage': 0, 'refund': 76999, 'monthly': 3001}], ['control 5', {'disbursements': [120000, 36000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 13000, 'refund': 0, 'monthly': 14084}], ['control 6', {'disbursements': [120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 20000, 'shortage': 0, 'refund': 20000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [36000, 7], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 0}, {'base': 3001, 'cushion': 15003, 'shortage': 0, 'refund': 134997, 'monthly': 3001}], ['control 1', {'disbursements': [36000], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3000, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 3417}], ['control 2', {'disbursements': [99999, 36000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 138667, 'monthly': 11333}], ['control 3', {'disbursements': [120000, 250000, 99999], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 0, 'refund': 40833, 'monthly': 39167}], ['control 4', {'disbursements': [36000, 7, 250000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 23834, 'cushion': 47668, 'shortage': 0, 'refund': 102332, 'monthly': 23834}], ['control 5', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 4000, 'monthly': 3000}], ['control 6', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 6000, 'refund': 0, 'monthly': 3500}]], [['regression: cushion computation', {'disbursements': [7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 1, 'cushion': 3, 'shortage': 0, 'refund': 79997, 'monthly': 1}], ['control 1', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 100000, 'monthly': 10000}], ['control 2', {'disbursements': [99999], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 20000}, {'base': 8333, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 8750}], ['control 3', {'disbursements': [7, 99999, 36000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 11334, 'cushion': 22668, 'shortage': 0, 'refund': 127332, 'monthly': 11334}], ['control 4', {'disbursements': [120000], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 30000, 'monthly': 10000}], ['control 5', {'disbursements': [120000, 36000, 99999], 'low_point': 40000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 21333, 'cushion': 0, 'shortage': 0, 'refund': 40000, 'monthly': 21333}], ['control 6', {'disbursements': [36000, 99999], 'low_point': 40000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 28667, 'monthly': 11333}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"deea01d39ab91ac710751361be65dbcbbc60ff876d9e4caaf736b9642b9a550f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    total = sum(x['disbursements'])\n    base = rnd(total, 12)\n    cushion = base * x['cushion_months']\n    diff = x['low_point'] - cushion\n    shortage = max(0, -diff)\n    surplus = max(0, diff)\n    refund = surplus if surplus >= x['refund_threshold'] else 0\n    monthly = base + (shortage + 11) // 12 - (0 if refund else surplus // 12)\n    return {'base': base, 'cushion': cushion, 'shortage': shortage, 'refund': refund, 'monthly': monthly}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: cushion computation', {'disbursements': [120000, 36000, 99999], 'low_point': -5000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 21333, 'cushion': 42667, 'shortage': 47667, 'refund': 0, 'monthly': 25306}], ['regression: cushion computation, partial-repair probe', {'disbursements': [36000, 250000], 'low_point': -5000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 23833, 'cushion': 119167, 'shortage': 124167, 'refund': 0, 'monthly': 34181}], ['control 1', {'disbursements': [99999, 250000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 29167, 'cushion': 29167, 'shortage': 0, 'refund': 50833, 'monthly': 29167}], ['control 2', {'disbursements': [120000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 10000, 'shortage': 10000, 'refund': 0, 'monthly': 10834}], ['control 3', {'disbursements': [99999, 250000, 7], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 29167, 'cushion': 29167, 'shortage': 34167, 'refund': 0, 'monthly': 32015}], ['control 4', {'disbursements': [36000, 36000, 120000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 16000, 'cushion': 32000, 'shortage': 0, 'refund': 118000, 'monthly': 16000}], ['control 5', {'disbursements': [99999, 99999], 'low_point': 10000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 16667, 'cushion': 16667, 'shortage': 6667, 'refund': 0, 'monthly': 17223}]], [['regression: cushion computation', {'disbursements': [250000, 99999, 120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 195833, 'shortage': 45833, 'refund': 0, 'monthly': 42987}], ['control 1', {'disbursements': [120000, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 0, 'refund': 67000, 'monthly': 13000}], ['control 2', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 0, 'monthly': 2667}], ['control 3', {'disbursements': [7, 36000], 'low_point': 0, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3001, 'cushion': 0, 'shortage': 0, 'refund': 0, 'monthly': 3001}], ['control 4', {'disbursements': [120000, 120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 20000, 'cushion': 40000, 'shortage': 0, 'refund': 0, 'monthly': 20000}], ['control 5', {'disbursements': [250000, 120000, 99999], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 44167, 'refund': 0, 'monthly': 42848}], ['control 6', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 10000, 'shortage': 0, 'refund': 140000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [120000, 120000, 7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 20001, 'cushion': 100003, 'shortage': 20003, 'refund': 0, 'monthly': 21668}], ['control 1', {'disbursements': [250000, 120000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 30833, 'cushion': 30833, 'shortage': 0, 'refund': 49167, 'monthly': 30833}], ['control 2', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 15000, 'shortage': 15000, 'refund': 0, 'monthly': 4250}], ['control 3', {'disbursements': [7, 250000], 'low_point': 80000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 20834, 'cushion': 0, 'shortage': 0, 'refund': 80000, 'monthly': 20834}], ['control 4', {'disbursements': [7, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 3001, 'cushion': 3001, 'shortage': 0, 'refund': 76999, 'monthly': 3001}], ['control 5', {'disbursements': [120000, 36000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 13000, 'refund': 0, 'monthly': 14084}], ['control 6', {'disbursements': [120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 20000, 'shortage': 0, 'refund': 20000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [36000, 7], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 0}, {'base': 3001, 'cushion': 15003, 'shortage': 0, 'refund': 134997, 'monthly': 3001}], ['control 1', {'disbursements': [36000], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3000, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 3417}], ['control 2', {'disbursements': [99999, 36000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 138667, 'monthly': 11333}], ['control 3', {'disbursements': [120000, 250000, 99999], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 0, 'refund': 40833, 'monthly': 39167}], ['control 4', {'disbursements': [36000, 7, 250000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 23834, 'cushion': 47668, 'shortage': 0, 'refund': 102332, 'monthly': 23834}], ['control 5', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 4000, 'monthly': 3000}], ['control 6', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 6000, 'refund': 0, 'monthly': 3500}]], [['regression: cushion computation', {'disbursements': [7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 1, 'cushion': 3, 'shortage': 0, 'refund': 79997, 'monthly': 1}], ['control 1', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 100000, 'monthly': 10000}], ['control 2', {'disbursements': [99999], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 20000}, {'base': 8333, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 8750}], ['control 3', {'disbursements': [7, 99999, 36000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 11334, 'cushion': 22668, 'shortage': 0, 'refund': 127332, 'monthly': 11334}], ['control 4', {'disbursements': [120000], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 30000, 'monthly': 10000}], ['control 5', {'disbursements': [120000, 36000, 99999], 'low_point': 40000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 21333, 'cushion': 0, 'shortage': 0, 'refund': 40000, 'monthly': 21333}], ['control 6', {'disbursements': [36000, 99999], 'low_point': 40000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 28667, 'monthly': 11333}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"5de4941c82680b41c4710f75b2facb44bc42499a944b6579f145b39f3fb8413e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    total = sum(x['disbursements'])\n    base = rnd(total, 12)\n    cushion = rnd(total * x['cushion_months'], 12)\n    diff = x['low_point'] - cushion\n    shortage = max(0, -diff)\n    surplus = max(0, diff)\n    refund = surplus if surplus >= x['refund_threshold'] else 0\n    monthly = base + (shortage + 11) // 12 - (0 if refund else surplus // 12)\n    return {'base': base, 'cushion': cushion, 'shortage': shortage, 'refund': refund, 'monthly': monthly}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: cushion computation', {'disbursements': [120000, 36000, 99999], 'low_point': -5000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 21333, 'cushion': 42667, 'shortage': 47667, 'refund': 0, 'monthly': 25306}], ['regression: cushion computation, partial-repair probe', {'disbursements': [36000, 250000], 'low_point': -5000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 23833, 'cushion': 119167, 'shortage': 124167, 'refund': 0, 'monthly': 34181}], ['control 1', {'disbursements': [99999, 250000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 29167, 'cushion': 29167, 'shortage': 0, 'refund': 50833, 'monthly': 29167}], ['control 2', {'disbursements': [120000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 10000, 'shortage': 10000, 'refund': 0, 'monthly': 10834}], ['control 3', {'disbursements': [99999, 250000, 7], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 29167, 'cushion': 29167, 'shortage': 34167, 'refund': 0, 'monthly': 32015}], ['control 4', {'disbursements': [36000, 36000, 120000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 16000, 'cushion': 32000, 'shortage': 0, 'refund': 118000, 'monthly': 16000}], ['control 5', {'disbursements': [99999, 99999], 'low_point': 10000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 16667, 'cushion': 16667, 'shortage': 6667, 'refund': 0, 'monthly': 17223}]], [['regression: cushion computation', {'disbursements': [250000, 99999, 120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 195833, 'shortage': 45833, 'refund': 0, 'monthly': 42987}], ['control 1', {'disbursements': [120000, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 0, 'refund': 67000, 'monthly': 13000}], ['control 2', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 0, 'monthly': 2667}], ['control 3', {'disbursements': [7, 36000], 'low_point': 0, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3001, 'cushion': 0, 'shortage': 0, 'refund': 0, 'monthly': 3001}], ['control 4', {'disbursements': [120000, 120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 20000, 'cushion': 40000, 'shortage': 0, 'refund': 0, 'monthly': 20000}], ['control 5', {'disbursements': [250000, 120000, 99999], 'low_point': -5000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 44167, 'refund': 0, 'monthly': 42848}], ['control 6', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 10000, 'shortage': 0, 'refund': 140000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [120000, 120000, 7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 20001, 'cushion': 100003, 'shortage': 20003, 'refund': 0, 'monthly': 21668}], ['control 1', {'disbursements': [250000, 120000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 30833, 'cushion': 30833, 'shortage': 0, 'refund': 49167, 'monthly': 30833}], ['control 2', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 5, 'refund_threshold': 5000}, {'base': 3000, 'cushion': 15000, 'shortage': 15000, 'refund': 0, 'monthly': 4250}], ['control 3', {'disbursements': [7, 250000], 'low_point': 80000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 20834, 'cushion': 0, 'shortage': 0, 'refund': 80000, 'monthly': 20834}], ['control 4', {'disbursements': [7, 36000], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 3001, 'cushion': 3001, 'shortage': 0, 'refund': 76999, 'monthly': 3001}], ['control 5', {'disbursements': [120000, 36000], 'low_point': 0, 'cushion_months': 1, 'refund_threshold': 0}, {'base': 13000, 'cushion': 13000, 'shortage': 13000, 'refund': 0, 'monthly': 14084}], ['control 6', {'disbursements': [120000], 'low_point': 40000, 'cushion_months': 2, 'refund_threshold': 5000}, {'base': 10000, 'cushion': 20000, 'shortage': 0, 'refund': 20000, 'monthly': 10000}]], [['regression: cushion computation', {'disbursements': [36000, 7], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 0}, {'base': 3001, 'cushion': 15003, 'shortage': 0, 'refund': 134997, 'monthly': 3001}], ['control 1', {'disbursements': [36000], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 0}, {'base': 3000, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 3417}], ['control 2', {'disbursements': [99999, 36000], 'low_point': 150000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 138667, 'monthly': 11333}], ['control 3', {'disbursements': [120000, 250000, 99999], 'low_point': 80000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 39167, 'cushion': 39167, 'shortage': 0, 'refund': 40833, 'monthly': 39167}], ['control 4', {'disbursements': [36000, 7, 250000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 23834, 'cushion': 47668, 'shortage': 0, 'refund': 102332, 'monthly': 23834}], ['control 5', {'disbursements': [36000], 'low_point': 10000, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 0, 'refund': 4000, 'monthly': 3000}], ['control 6', {'disbursements': [36000], 'low_point': 0, 'cushion_months': 2, 'refund_threshold': 0}, {'base': 3000, 'cushion': 6000, 'shortage': 6000, 'refund': 0, 'monthly': 3500}]], [['regression: cushion computation', {'disbursements': [7], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 1, 'cushion': 3, 'shortage': 0, 'refund': 79997, 'monthly': 1}], ['control 1', {'disbursements': [120000], 'low_point': 150000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 100000, 'monthly': 10000}], ['control 2', {'disbursements': [99999], 'low_point': -5000, 'cushion_months': 0, 'refund_threshold': 20000}, {'base': 8333, 'cushion': 0, 'shortage': 5000, 'refund': 0, 'monthly': 8750}], ['control 3', {'disbursements': [7, 99999, 36000], 'low_point': 150000, 'cushion_months': 2, 'refund_threshold': 20000}, {'base': 11334, 'cushion': 22668, 'shortage': 0, 'refund': 127332, 'monthly': 11334}], ['control 4', {'disbursements': [120000], 'low_point': 80000, 'cushion_months': 5, 'refund_threshold': 20000}, {'base': 10000, 'cushion': 50000, 'shortage': 0, 'refund': 30000, 'monthly': 10000}], ['control 5', {'disbursements': [120000, 36000, 99999], 'low_point': 40000, 'cushion_months': 0, 'refund_threshold': 5000}, {'base': 21333, 'cushion': 0, 'shortage': 0, 'refund': 40000, 'monthly': 21333}], ['control 6', {'disbursements': [36000, 99999], 'low_point': 40000, 'cushion_months': 1, 'refund_threshold': 20000}, {'base': 11333, 'cushion': 11333, 'shortage': 0, 'refund': 28667, 'monthly': 11333}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-loan-amortization-schedules-escrow-analysis-cushion-computation","generated_at":"2026-09-29T14:46:28.872906+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.","repair":"Compute the cushion from the annual total and round once.","root_cause":"The cushion multiplies the already-rounded monthly base.","sha256":"b1dfde8c1355fb5ee06f69c9ae78a0380e55a109b06a1b35241781b4243e3e50","title":"Annual escrow analysis: cushion computation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.331,"exit_code":1,"observations":[{"actual":{"base":21333,"cushion":42667,"monthly":25306,"refund":0,"shortage":47667},"check":"regression: cushion computation","expected":{"base":21333,"cushion":42667,"monthly":25306,"refund":0,"shortage":47667},"passed":true},{"actual":{"base":23833,"cushion":143000,"monthly":36167,"refund":0,"shortage":148000},"check":"regression: cushion computation, partial-repair probe","expected":{"base":23833,"cushion":119167,"monthly":34181,"refund":0,"shortage":124167},"passed":false},{"actual":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"check":"control 1","expected":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"passed":true},{"actual":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"check":"control 2","expected":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"passed":true},{"actual":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"check":"control 3","expected":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"passed":true},{"actual":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"check":"control 4","expected":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"passed":true},{"actual":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"check":"control 5","expected":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cushion computation\", \"actual\": {\"base\": 21333, \"cushion\": 42667, \"shortage\": 47667, \"refund\": 0, \"monthly\": 25306}, \"expected\": {\"base\": 21333, \"cushion\": 42667, \"shortage\": 47667, \"refund\": 0, \"monthly\": 25306}, \"passed\": true}, {\"check\": \"regression: cushion computation, partial-repair probe\", \"actual\": {\"base\": 23833, \"cushion\": 143000, \"shortage\": 148000, \"refund\": 0, \"monthly\": 36167}, \"expected\": {\"base\": 23833, \"cushion\": 119167, \"shortage\": 124167, \"refund\": 0, \"monthly\": 34181}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"expected\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"expected\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"expected\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.044,"exit_code":1,"observations":[{"actual":{"base":21333,"cushion":42666,"monthly":25306,"refund":0,"shortage":47666},"check":"regression: cushion computation","expected":{"base":21333,"cushion":42667,"monthly":25306,"refund":0,"shortage":47667},"passed":false},{"actual":{"base":23833,"cushion":119165,"monthly":34181,"refund":0,"shortage":124165},"check":"regression: cushion computation, partial-repair probe","expected":{"base":23833,"cushion":119167,"monthly":34181,"refund":0,"shortage":124167},"passed":false},{"actual":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"check":"control 1","expected":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"passed":true},{"actual":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"check":"control 2","expected":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"passed":true},{"actual":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"check":"control 3","expected":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"passed":true},{"actual":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"check":"control 4","expected":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"passed":true},{"actual":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"check":"control 5","expected":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cushion computation\", \"actual\": {\"base\": 21333, \"cushion\": 42666, \"shortage\": 47666, \"refund\": 0, \"monthly\": 25306}, \"expected\": {\"base\": 21333, \"cushion\": 42667, \"shortage\": 47667, \"refund\": 0, \"monthly\": 25306}, \"passed\": false}, {\"check\": \"regression: cushion computation, partial-repair probe\", \"actual\": {\"base\": 23833, \"cushion\": 119165, \"shortage\": 124165, \"refund\": 0, \"monthly\": 34181}, \"expected\": {\"base\": 23833, \"cushion\": 119167, \"shortage\": 124167, \"refund\": 0, \"monthly\": 34181}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"expected\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"expected\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"expected\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.516,"exit_code":0,"observations":[{"actual":{"base":21333,"cushion":42667,"monthly":25306,"refund":0,"shortage":47667},"check":"regression: cushion computation","expected":{"base":21333,"cushion":42667,"monthly":25306,"refund":0,"shortage":47667},"passed":true},{"actual":{"base":23833,"cushion":119167,"monthly":34181,"refund":0,"shortage":124167},"check":"regression: cushion computation, partial-repair probe","expected":{"base":23833,"cushion":119167,"monthly":34181,"refund":0,"shortage":124167},"passed":true},{"actual":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"check":"control 1","expected":{"base":29167,"cushion":29167,"monthly":29167,"refund":50833,"shortage":0},"passed":true},{"actual":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"check":"control 2","expected":{"base":10000,"cushion":10000,"monthly":10834,"refund":0,"shortage":10000},"passed":true},{"actual":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"check":"control 3","expected":{"base":29167,"cushion":29167,"monthly":32015,"refund":0,"shortage":34167},"passed":true},{"actual":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"check":"control 4","expected":{"base":16000,"cushion":32000,"monthly":16000,"refund":118000,"shortage":0},"passed":true},{"actual":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"check":"control 5","expected":{"base":16667,"cushion":16667,"monthly":17223,"refund":0,"shortage":6667},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: cushion computation\", \"actual\": {\"base\": 21333, \"cushion\": 42667, \"shortage\": 47667, \"refund\": 0, \"monthly\": 25306}, \"expected\": {\"base\": 21333, \"cushion\": 42667, \"shortage\": 47667, \"refund\": 0, \"monthly\": 25306}, \"passed\": true}, {\"check\": \"regression: cushion computation, partial-repair probe\", \"actual\": {\"base\": 23833, \"cushion\": 119167, \"shortage\": 124167, \"refund\": 0, \"monthly\": 34181}, \"expected\": {\"base\": 23833, \"cushion\": 119167, \"shortage\": 124167, \"refund\": 0, \"monthly\": 34181}, \"passed\": true}, {\"check\": \"control 1\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 0, \"refund\": 50833, \"monthly\": 29167}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"expected\": {\"base\": 10000, \"cushion\": 10000, \"shortage\": 10000, \"refund\": 0, \"monthly\": 10834}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"expected\": {\"base\": 29167, \"cushion\": 29167, \"shortage\": 34167, \"refund\": 0, \"monthly\": 32015}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"expected\": {\"base\": 16000, \"cushion\": 32000, \"shortage\": 0, \"refund\": 118000, \"monthly\": 16000}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"expected\": {\"base\": 16667, \"cushion\": 16667, \"shortage\": 6667, \"refund\": 0, \"monthly\": 17223}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}