{"abstract":"Actual/360 loans accrue interest on a 365-day year.","category":"Loan amortization schedules","checks":7,"contract":"x = {'principal', 'rate_bp', 'convention': '30/360'|'act/365'|'act/360', 'start': [y,m,d], 'first_due': [y,m,d]}. 30/360: a start day of 31 becomes 30; then a due day of 31 becomes 30 when the (adjusted) start day is 30; days = 360*dy + 30*dm + dd. Actual conventions count calendar days, basis 365 or 360 (365 even in leap years). If days <= 0 return {'error': 'due_not_after_start'}. Interest = round_half_up(P*bp*days/(10000*basis)). Return {'days', 'basis', 'interest'}.","evaluation_group":"w2-loan-amortization-schedules-odd-first-period-day-count","failed_approach":"Switching act/365 to 366 in leap years contradicts the fixed 365 basis.","family":"w2-loan-amortization-schedules-odd-first-period-day-count-actual-basis","id":"FA-58461","implementations":{"attempt":{"sha256":"18909df3603e96b969547a702caa5dece8a0ffb22d83bcbed7249abf4abdc0dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\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    y1, m1, d1 = x['start']\n    y2, m2, d2 = x['first_due']\n    conv = x['convention']\n    if conv == '30/360':\n        if d1 == 31:\n            d1 = 30\n        if d2 == 31 and d1 == 30:\n            d2 = 30\n        days = 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)\n        basis = 360\n    else:\n        days = (datetime.date(y2, m2, d2) - datetime.date(y1, m1, d1)).days\n        basis = (366 if y1 % 4 == 0 else 365) if conv == 'act/365' else 360\n    if days <= 0:\n        return {'error': 'due_not_after_start'}\n    interest = rnd(x['principal'] * x['rate_bp'] * days, 10000 * basis)\n    return {'days': days, 'basis': basis, 'interest': interest}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 3, 1]}, {'days': 352, 'basis': 360, 'interest': 441}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 12, 28], 'first_due': [2025, 2, 15]}, {'days': 49, 'basis': 365, 'interest': 179}], ['control 1', {'principal': 12345, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 7, 15], 'first_due': [2024, 9, 30]}, {'days': 75, 'basis': 360, 'interest': 309}], ['control 2', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 1, 15], 'first_due': [2023, 1, 30]}, {'days': 15, 'basis': 360, 'interest': 250}], ['control 3', {'principal': 36500, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 8, 1], 'first_due': [2024, 9, 1]}, {'days': 30, 'basis': 360, 'interest': 152}], ['control 4', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 8, 15], 'first_due': [2024, 9, 15]}, {'days': 30, 'basis': 360, 'interest': 365}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 3, 29], 'first_due': [2023, 3, 31]}, {'days': 2, 'basis': 360, 'interest': 24}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 2, 1]}, {'days': 323, 'basis': 360, 'interest': 554}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 7, 30], 'first_due': [2024, 8, 28]}, {'days': 29, 'basis': 365, 'interest': 49}], ['control 1', {'principal': 12345, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2023, 8, 28]}, {'days': 30, 'basis': 360, 'interest': 62}], ['control 2', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2024, 4, 30]}, {'days': 366, 'basis': 365, 'interest': 60164}], ['control 3', {'principal': 36500, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 6, 30], 'first_due': [2023, 8, 30]}, {'days': 60, 'basis': 360, 'interest': 365}], ['control 4', {'principal': 1000000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2024, 6, 15]}, {'days': 317, 'basis': 360, 'interest': 52833}], ['control 5', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 10, 29], 'first_due': [2025, 10, 15]}, {'days': 346, 'basis': 360, 'interest': 11533}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 11, 28], 'first_due': [2024, 10, 31]}, {'days': 338, 'basis': 360, 'interest': 580}], ['regression: actual basis, partial-repair probe', {'principal': 100000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2025, 2, 15]}, {'days': 352, 'basis': 365, 'interest': 11573}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 1, 31], 'first_due': [2024, 1, 28]}, {'error': 'due_not_after_start'}], ['control 2', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2023, 4, 30], 'first_due': [2023, 5, 28]}, {'days': 28, 'basis': 360, 'interest': 48}], ['control 3', {'principal': 1000000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2023, 12, 1], 'first_due': [2023, 12, 15]}, {'days': 14, 'basis': 365, 'interest': 1400}], ['control 4', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2024, 7, 29], 'first_due': [2024, 9, 1]}, {'days': 32, 'basis': 360, 'interest': 533}], ['control 5', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 2, 28], 'first_due': [2024, 1, 1]}, {'days': 303, 'basis': 360, 'interest': 5050}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 4, 30], 'first_due': [2024, 5, 1]}, {'days': 1, 'basis': 360, 'interest': 1}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 4, 29]}, {'days': 60, 'basis': 365, 'interest': 244}], ['control 1', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 4, 1], 'first_due': [2024, 3, 1]}, {'days': 330, 'basis': 360, 'interest': 11000}], ['control 2', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2023, 4, 28], 'first_due': [2023, 6, 28]}, {'days': 61, 'basis': 365, 'interest': 305}], ['control 3', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2023, 4, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 36500, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 12, 31], 'first_due': [2024, 1, 28]}, {'days': 28, 'basis': 365, 'interest': 168}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 11, 1], 'first_due': [2025, 11, 1]}, {'days': 365, 'basis': 365, 'interest': 4380}]], [['regression: actual basis', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/360', 'start': [2024, 6, 28], 'first_due': [2024, 7, 30]}, {'days': 32, 'basis': 360, 'interest': 5333}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 3, 29]}, {'days': 29, 'basis': 365, 'interest': 145}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 7, 28], 'first_due': [2025, 6, 30]}, {'days': 332, 'basis': 360, 'interest': 569}], ['control 2', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 6, 28], 'first_due': [2025, 5, 15]}, {'days': 321, 'basis': 365, 'interest': 3210}], ['control 3', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 7, 30], 'first_due': [2024, 7, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 1000000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 6, 30], 'first_due': [2025, 6, 1]}, {'days': 336, 'basis': 365, 'interest': 110466}], ['control 5', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 9, 28], 'first_due': [2025, 9, 30]}, {'days': 367, 'basis': 365, 'interest': 3670}]]]\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":"f161c2fbb83baf338ac3e53bc322cb5c712b0eadc0ac5f6b5ce64726bdde4511","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\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    y1, m1, d1 = x['start']\n    y2, m2, d2 = x['first_due']\n    conv = x['convention']\n    if conv == '30/360':\n        if d1 == 31:\n            d1 = 30\n        if d2 == 31 and d1 == 30:\n            d2 = 30\n        days = 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)\n        basis = 360\n    else:\n        days = (datetime.date(y2, m2, d2) - datetime.date(y1, m1, d1)).days\n        basis = 365 if conv != '30/360' else 360\n    if days <= 0:\n        return {'error': 'due_not_after_start'}\n    interest = rnd(x['principal'] * x['rate_bp'] * days, 10000 * basis)\n    return {'days': days, 'basis': basis, 'interest': interest}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 3, 1]}, {'days': 352, 'basis': 360, 'interest': 441}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 12, 28], 'first_due': [2025, 2, 15]}, {'days': 49, 'basis': 365, 'interest': 179}], ['control 1', {'principal': 12345, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 7, 15], 'first_due': [2024, 9, 30]}, {'days': 75, 'basis': 360, 'interest': 309}], ['control 2', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 1, 15], 'first_due': [2023, 1, 30]}, {'days': 15, 'basis': 360, 'interest': 250}], ['control 3', {'principal': 36500, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 8, 1], 'first_due': [2024, 9, 1]}, {'days': 30, 'basis': 360, 'interest': 152}], ['control 4', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 8, 15], 'first_due': [2024, 9, 15]}, {'days': 30, 'basis': 360, 'interest': 365}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 3, 29], 'first_due': [2023, 3, 31]}, {'days': 2, 'basis': 360, 'interest': 24}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 2, 1]}, {'days': 323, 'basis': 360, 'interest': 554}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 7, 30], 'first_due': [2024, 8, 28]}, {'days': 29, 'basis': 365, 'interest': 49}], ['control 1', {'principal': 12345, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2023, 8, 28]}, {'days': 30, 'basis': 360, 'interest': 62}], ['control 2', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2024, 4, 30]}, {'days': 366, 'basis': 365, 'interest': 60164}], ['control 3', {'principal': 36500, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 6, 30], 'first_due': [2023, 8, 30]}, {'days': 60, 'basis': 360, 'interest': 365}], ['control 4', {'principal': 1000000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2024, 6, 15]}, {'days': 317, 'basis': 360, 'interest': 52833}], ['control 5', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 10, 29], 'first_due': [2025, 10, 15]}, {'days': 346, 'basis': 360, 'interest': 11533}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 11, 28], 'first_due': [2024, 10, 31]}, {'days': 338, 'basis': 360, 'interest': 580}], ['regression: actual basis, partial-repair probe', {'principal': 100000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2025, 2, 15]}, {'days': 352, 'basis': 365, 'interest': 11573}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 1, 31], 'first_due': [2024, 1, 28]}, {'error': 'due_not_after_start'}], ['control 2', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2023, 4, 30], 'first_due': [2023, 5, 28]}, {'days': 28, 'basis': 360, 'interest': 48}], ['control 3', {'principal': 1000000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2023, 12, 1], 'first_due': [2023, 12, 15]}, {'days': 14, 'basis': 365, 'interest': 1400}], ['control 4', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2024, 7, 29], 'first_due': [2024, 9, 1]}, {'days': 32, 'basis': 360, 'interest': 533}], ['control 5', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 2, 28], 'first_due': [2024, 1, 1]}, {'days': 303, 'basis': 360, 'interest': 5050}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 4, 30], 'first_due': [2024, 5, 1]}, {'days': 1, 'basis': 360, 'interest': 1}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 4, 29]}, {'days': 60, 'basis': 365, 'interest': 244}], ['control 1', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 4, 1], 'first_due': [2024, 3, 1]}, {'days': 330, 'basis': 360, 'interest': 11000}], ['control 2', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2023, 4, 28], 'first_due': [2023, 6, 28]}, {'days': 61, 'basis': 365, 'interest': 305}], ['control 3', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2023, 4, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 36500, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 12, 31], 'first_due': [2024, 1, 28]}, {'days': 28, 'basis': 365, 'interest': 168}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 11, 1], 'first_due': [2025, 11, 1]}, {'days': 365, 'basis': 365, 'interest': 4380}]], [['regression: actual basis', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/360', 'start': [2024, 6, 28], 'first_due': [2024, 7, 30]}, {'days': 32, 'basis': 360, 'interest': 5333}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 3, 29]}, {'days': 29, 'basis': 365, 'interest': 145}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 7, 28], 'first_due': [2025, 6, 30]}, {'days': 332, 'basis': 360, 'interest': 569}], ['control 2', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 6, 28], 'first_due': [2025, 5, 15]}, {'days': 321, 'basis': 365, 'interest': 3210}], ['control 3', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 7, 30], 'first_due': [2024, 7, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 1000000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 6, 30], 'first_due': [2025, 6, 1]}, {'days': 336, 'basis': 365, 'interest': 110466}], ['control 5', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 9, 28], 'first_due': [2025, 9, 30]}, {'days': 367, 'basis': 365, 'interest': 3670}]]]\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":"f7e0f4763b4ddb883486e9709d20ee7dd3b8cb583a6fdd0600682840b824e9c3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\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    y1, m1, d1 = x['start']\n    y2, m2, d2 = x['first_due']\n    conv = x['convention']\n    if conv == '30/360':\n        if d1 == 31:\n            d1 = 30\n        if d2 == 31 and d1 == 30:\n            d2 = 30\n        days = 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)\n        basis = 360\n    else:\n        days = (datetime.date(y2, m2, d2) - datetime.date(y1, m1, d1)).days\n        basis = 365 if conv == 'act/365' else 360\n    if days <= 0:\n        return {'error': 'due_not_after_start'}\n    interest = rnd(x['principal'] * x['rate_bp'] * days, 10000 * basis)\n    return {'days': days, 'basis': basis, 'interest': interest}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 3, 1]}, {'days': 352, 'basis': 360, 'interest': 441}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 12, 28], 'first_due': [2025, 2, 15]}, {'days': 49, 'basis': 365, 'interest': 179}], ['control 1', {'principal': 12345, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 7, 15], 'first_due': [2024, 9, 30]}, {'days': 75, 'basis': 360, 'interest': 309}], ['control 2', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 1, 15], 'first_due': [2023, 1, 30]}, {'days': 15, 'basis': 360, 'interest': 250}], ['control 3', {'principal': 36500, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 8, 1], 'first_due': [2024, 9, 1]}, {'days': 30, 'basis': 360, 'interest': 152}], ['control 4', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 8, 15], 'first_due': [2024, 9, 15]}, {'days': 30, 'basis': 360, 'interest': 365}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 3, 29], 'first_due': [2023, 3, 31]}, {'days': 2, 'basis': 360, 'interest': 24}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 3, 15], 'first_due': [2024, 2, 1]}, {'days': 323, 'basis': 360, 'interest': 554}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 7, 30], 'first_due': [2024, 8, 28]}, {'days': 29, 'basis': 365, 'interest': 49}], ['control 1', {'principal': 12345, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2023, 8, 28]}, {'days': 30, 'basis': 360, 'interest': 62}], ['control 2', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2024, 4, 30]}, {'days': 366, 'basis': 365, 'interest': 60164}], ['control 3', {'principal': 36500, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 6, 30], 'first_due': [2023, 8, 30]}, {'days': 60, 'basis': 360, 'interest': 365}], ['control 4', {'principal': 1000000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 7, 28], 'first_due': [2024, 6, 15]}, {'days': 317, 'basis': 360, 'interest': 52833}], ['control 5', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2024, 10, 29], 'first_due': [2025, 10, 15]}, {'days': 346, 'basis': 360, 'interest': 11533}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 500, 'convention': 'act/360', 'start': [2023, 11, 28], 'first_due': [2024, 10, 31]}, {'days': 338, 'basis': 360, 'interest': 580}], ['regression: actual basis, partial-repair probe', {'principal': 100000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2025, 2, 15]}, {'days': 352, 'basis': 365, 'interest': 11573}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 1, 31], 'first_due': [2024, 1, 28]}, {'error': 'due_not_after_start'}], ['control 2', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2023, 4, 30], 'first_due': [2023, 5, 28]}, {'days': 28, 'basis': 360, 'interest': 48}], ['control 3', {'principal': 1000000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2023, 12, 1], 'first_due': [2023, 12, 15]}, {'days': 14, 'basis': 365, 'interest': 1400}], ['control 4', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2024, 7, 29], 'first_due': [2024, 9, 1]}, {'days': 32, 'basis': 360, 'interest': 533}], ['control 5', {'principal': 100000, 'rate_bp': 600, 'convention': '30/360', 'start': [2023, 2, 28], 'first_due': [2024, 1, 1]}, {'days': 303, 'basis': 360, 'interest': 5050}]], [['regression: actual basis', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 4, 30], 'first_due': [2024, 5, 1]}, {'days': 1, 'basis': 360, 'interest': 1}], ['regression: actual basis, partial-repair probe', {'principal': 12345, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 4, 29]}, {'days': 60, 'basis': 365, 'interest': 244}], ['control 1', {'principal': 100000, 'rate_bp': 1200, 'convention': '30/360', 'start': [2023, 4, 1], 'first_due': [2024, 3, 1]}, {'days': 330, 'basis': 360, 'interest': 11000}], ['control 2', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2023, 4, 28], 'first_due': [2023, 6, 28]}, {'days': 61, 'basis': 365, 'interest': 305}], ['control 3', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2023, 4, 30], 'first_due': [2023, 4, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 36500, 'rate_bp': 600, 'convention': 'act/365', 'start': [2023, 12, 31], 'first_due': [2024, 1, 28]}, {'days': 28, 'basis': 365, 'interest': 168}], ['control 5', {'principal': 36500, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 11, 1], 'first_due': [2025, 11, 1]}, {'days': 365, 'basis': 365, 'interest': 4380}]], [['regression: actual basis', {'principal': 1000000, 'rate_bp': 600, 'convention': 'act/360', 'start': [2024, 6, 28], 'first_due': [2024, 7, 30]}, {'days': 32, 'basis': 360, 'interest': 5333}], ['regression: actual basis, partial-repair probe', {'principal': 36500, 'rate_bp': 500, 'convention': 'act/365', 'start': [2024, 2, 29], 'first_due': [2024, 3, 29]}, {'days': 29, 'basis': 365, 'interest': 145}], ['control 1', {'principal': 12345, 'rate_bp': 500, 'convention': '30/360', 'start': [2024, 7, 28], 'first_due': [2025, 6, 30]}, {'days': 332, 'basis': 360, 'interest': 569}], ['control 2', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 6, 28], 'first_due': [2025, 5, 15]}, {'days': 321, 'basis': 365, 'interest': 3210}], ['control 3', {'principal': 12345, 'rate_bp': 365, 'convention': 'act/360', 'start': [2024, 7, 30], 'first_due': [2024, 7, 30]}, {'error': 'due_not_after_start'}], ['control 4', {'principal': 1000000, 'rate_bp': 1200, 'convention': 'act/365', 'start': [2024, 6, 30], 'first_due': [2025, 6, 1]}, {'days': 336, 'basis': 365, 'interest': 110466}], ['control 5', {'principal': 100000, 'rate_bp': 365, 'convention': 'act/365', 'start': [2024, 9, 28], 'first_due': [2025, 9, 30]}, {'days': 367, 'basis': 365, 'interest': 3670}]]]\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-odd-first-period-day-count-actual-basis","generated_at":"2026-09-29T14:46:26.890433+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":"Use 365 only for act/365 and 360 for act/360.","root_cause":"Every actual convention uses a 365 basis.","sha256":"0533027b1c12eabd46dbab8907ad228b6d905b5bd81dc58ac4e712bd8642a211","title":"Odd first period day count: actual basis · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.0,"exit_code":1,"observations":[{"actual":{"basis":360,"days":352,"interest":441},"check":"regression: actual basis","expected":{"basis":360,"days":352,"interest":441},"passed":true},{"actual":{"basis":366,"days":49,"interest":178},"check":"regression: actual basis, partial-repair probe","expected":{"basis":365,"days":49,"interest":179},"passed":false},{"actual":{"basis":360,"days":75,"interest":309},"check":"control 1","expected":{"basis":360,"days":75,"interest":309},"passed":true},{"actual":{"basis":360,"days":15,"interest":250},"check":"control 2","expected":{"basis":360,"days":15,"interest":250},"passed":true},{"actual":{"basis":360,"days":30,"interest":152},"check":"control 3","expected":{"basis":360,"days":30,"interest":152},"passed":true},{"actual":{"basis":360,"days":30,"interest":365},"check":"control 4","expected":{"basis":360,"days":30,"interest":365},"passed":true},{"actual":{"basis":360,"days":2,"interest":24},"check":"control 5","expected":{"basis":360,"days":2,"interest":24},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: actual basis\", \"actual\": {\"days\": 352, \"basis\": 360, \"interest\": 441}, \"expected\": {\"days\": 352, \"basis\": 360, \"interest\": 441}, \"passed\": true}, {\"check\": \"regression: actual basis, partial-repair probe\", \"actual\": {\"days\": 49, \"basis\": 366, \"interest\": 178}, \"expected\": {\"days\": 49, \"basis\": 365, \"interest\": 179}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"expected\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"expected\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"expected\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.766,"exit_code":1,"observations":[{"actual":{"basis":365,"days":352,"interest":435},"check":"regression: actual basis","expected":{"basis":360,"days":352,"interest":441},"passed":false},{"actual":{"basis":365,"days":49,"interest":179},"check":"regression: actual basis, partial-repair probe","expected":{"basis":365,"days":49,"interest":179},"passed":true},{"actual":{"basis":360,"days":75,"interest":309},"check":"control 1","expected":{"basis":360,"days":75,"interest":309},"passed":true},{"actual":{"basis":360,"days":15,"interest":250},"check":"control 2","expected":{"basis":360,"days":15,"interest":250},"passed":true},{"actual":{"basis":360,"days":30,"interest":152},"check":"control 3","expected":{"basis":360,"days":30,"interest":152},"passed":true},{"actual":{"basis":360,"days":30,"interest":365},"check":"control 4","expected":{"basis":360,"days":30,"interest":365},"passed":true},{"actual":{"basis":360,"days":2,"interest":24},"check":"control 5","expected":{"basis":360,"days":2,"interest":24},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: actual basis\", \"actual\": {\"days\": 352, \"basis\": 365, \"interest\": 435}, \"expected\": {\"days\": 352, \"basis\": 360, \"interest\": 441}, \"passed\": false}, {\"check\": \"regression: actual basis, partial-repair probe\", \"actual\": {\"days\": 49, \"basis\": 365, \"interest\": 179}, \"expected\": {\"days\": 49, \"basis\": 365, \"interest\": 179}, \"passed\": true}, {\"check\": \"control 1\", \"actual\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"expected\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"expected\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"expected\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.886,"exit_code":0,"observations":[{"actual":{"basis":360,"days":352,"interest":441},"check":"regression: actual basis","expected":{"basis":360,"days":352,"interest":441},"passed":true},{"actual":{"basis":365,"days":49,"interest":179},"check":"regression: actual basis, partial-repair probe","expected":{"basis":365,"days":49,"interest":179},"passed":true},{"actual":{"basis":360,"days":75,"interest":309},"check":"control 1","expected":{"basis":360,"days":75,"interest":309},"passed":true},{"actual":{"basis":360,"days":15,"interest":250},"check":"control 2","expected":{"basis":360,"days":15,"interest":250},"passed":true},{"actual":{"basis":360,"days":30,"interest":152},"check":"control 3","expected":{"basis":360,"days":30,"interest":152},"passed":true},{"actual":{"basis":360,"days":30,"interest":365},"check":"control 4","expected":{"basis":360,"days":30,"interest":365},"passed":true},{"actual":{"basis":360,"days":2,"interest":24},"check":"control 5","expected":{"basis":360,"days":2,"interest":24},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: actual basis\", \"actual\": {\"days\": 352, \"basis\": 360, \"interest\": 441}, \"expected\": {\"days\": 352, \"basis\": 360, \"interest\": 441}, \"passed\": true}, {\"check\": \"regression: actual basis, partial-repair probe\", \"actual\": {\"days\": 49, \"basis\": 365, \"interest\": 179}, \"expected\": {\"days\": 49, \"basis\": 365, \"interest\": 179}, \"passed\": true}, {\"check\": \"control 1\", \"actual\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"expected\": {\"days\": 75, \"basis\": 360, \"interest\": 309}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"expected\": {\"days\": 15, \"basis\": 360, \"interest\": 250}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 152}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"expected\": {\"days\": 30, \"basis\": 360, \"interest\": 365}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"expected\": {\"days\": 2, \"basis\": 360, \"interest\": 24}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}