FA-60876 / Bond day-count conventions / Open access
30E/360 ISDA with maturity exemption: February is always treated as 28 days long · case 01
Accruals starting or ending on 29 February are not recognized as month end.
ROOT CAUSE
The month-length helper hard-codes 28 days for February.
VERIFIED REPAIR
Return 29 for February in Gregorian leap years.
Unsuccessful approach: A plain divisible-by-four test misclassifies century years such as 2100.
Case contract
Inputs: start, end and maturity dates as [y,m,d]. D1 becomes 30 if the start is the last day of its month. D2 becomes 30 if the end is the last day of its month, unless the end date equals the maturity date and falls in February. Return 360*(Y2-Y1)+30*(M2-M1)+(D2-D1).
Why this case matters
Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b, mat):
y1, m1, d1 = a
y2, m2, d2 = b
def last(y, m):
if m == 2:
return 28
return 30 if m in (4, 6, 9, 11) else 31
if d1 == last(y1, m1):
d1 = 30
if d2 == last(y2, m2) and not (list(b) == list(mat) and m2 == 2):
d2 = 30
return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression february month length 1', [[2060, 2, 29], [2062, 2, 27], [2063, 8, 25]], 717], ['regression february month length 2', [[2080, 2, 29], [2081, 2, 28], [2081, 2, 28]], 358], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2105, 3, 31]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 30], [2104, 2, 27]], 90], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['normal control 2', [[2045, 6, 30], [2046, 2, 28], [2046, 2, 28]], 238]], [['regression february month length 1', [[2032, 2, 28], [2035, 12, 20], [2035, 12, 20]], 1372], ['regression february month length 2', [[2081, 9, 30], [2084, 2, 28], [2086, 2, 28]], 868], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2106, 9, 30]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2100, 11, 11]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2067, 3, 31], [2070, 2, 28], [2070, 2, 28]], 1048], ['normal control 2', [[2049, 5, 31], [2057, 2, 28], [2057, 12, 1]], 2790]], [['regression february month length 1', [[2077, 2, 28], [2080, 2, 29], [2082, 4, 29]], 1080], ['regression february month length 2', [[2055, 1, 28], [2056, 2, 29], [2056, 5, 16]], 392], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 30], [2105, 2, 25]], 300], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2106, 11, 30]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2066, 7, 31], [2069, 2, 28], [2069, 2, 28]], 928], ['normal control 2', [[2095, 12, 31], [2098, 2, 28], [2098, 2, 28]], 778]], [['regression february month length 1', [[2088, 2, 29], [2095, 2, 28], [2095, 12, 27]], 2520], ['regression february month length 2', [[2036, 2, 29], [2039, 8, 31], [2044, 8, 31]], 1260], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2103, 1, 31]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2103, 8, 31]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2041, 2, 28], [2043, 1, 31], [2043, 1, 31]], 690], ['normal control 2', [[2016, 4, 30], [2018, 7, 31], [2022, 1, 31]], 810]], [['regression february month length 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['regression february month length 2', [[2079, 5, 3], [2080, 2, 28], [2081, 11, 20]], 295], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2104, 5, 12]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2100, 11, 30]], 180], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2002, 8, 31], [2005, 2, 28], [2005, 2, 28]], 898], ['normal control 2', [[2045, 5, 31], [2049, 2, 28], [2049, 9, 9]], 1350]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression february month length 1 | 718 | 717 | Failed |
| regression february month length 2 | 359 | 358 | Failed |
| partial repair probe 1 | 180 | 180 | Passed |
| partial repair probe 2 | 90 | 90 | Passed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 180 | 180 | Passed |
| normal control 2 | 238 | 238 | Passed |
SHA-256 / ecd97e4aded1a014bd40408a9cc72071b0ab4e5717dda4f0904468a4cae82514
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b, mat):
y1, m1, d1 = a
y2, m2, d2 = b
def last(y, m):
if m == 2:
return 29 if y % 4 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
if d1 == last(y1, m1):
d1 = 30
if d2 == last(y2, m2) and not (list(b) == list(mat) and m2 == 2):
d2 = 30
return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression february month length 1', [[2060, 2, 29], [2062, 2, 27], [2063, 8, 25]], 717], ['regression february month length 2', [[2080, 2, 29], [2081, 2, 28], [2081, 2, 28]], 358], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2105, 3, 31]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 30], [2104, 2, 27]], 90], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['normal control 2', [[2045, 6, 30], [2046, 2, 28], [2046, 2, 28]], 238]], [['regression february month length 1', [[2032, 2, 28], [2035, 12, 20], [2035, 12, 20]], 1372], ['regression february month length 2', [[2081, 9, 30], [2084, 2, 28], [2086, 2, 28]], 868], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2106, 9, 30]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2100, 11, 11]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2067, 3, 31], [2070, 2, 28], [2070, 2, 28]], 1048], ['normal control 2', [[2049, 5, 31], [2057, 2, 28], [2057, 12, 1]], 2790]], [['regression february month length 1', [[2077, 2, 28], [2080, 2, 29], [2082, 4, 29]], 1080], ['regression february month length 2', [[2055, 1, 28], [2056, 2, 29], [2056, 5, 16]], 392], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 30], [2105, 2, 25]], 300], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2106, 11, 30]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2066, 7, 31], [2069, 2, 28], [2069, 2, 28]], 928], ['normal control 2', [[2095, 12, 31], [2098, 2, 28], [2098, 2, 28]], 778]], [['regression february month length 1', [[2088, 2, 29], [2095, 2, 28], [2095, 12, 27]], 2520], ['regression february month length 2', [[2036, 2, 29], [2039, 8, 31], [2044, 8, 31]], 1260], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2103, 1, 31]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2103, 8, 31]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2041, 2, 28], [2043, 1, 31], [2043, 1, 31]], 690], ['normal control 2', [[2016, 4, 30], [2018, 7, 31], [2022, 1, 31]], 810]], [['regression february month length 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['regression february month length 2', [[2079, 5, 3], [2080, 2, 28], [2081, 11, 20]], 295], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2104, 5, 12]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2100, 11, 30]], 180], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2002, 8, 31], [2005, 2, 28], [2005, 2, 28]], 898], ['normal control 2', [[2045, 5, 31], [2049, 2, 28], [2049, 9, 9]], 1350]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression february month length 1 | 717 | 717 | Passed |
| regression february month length 2 | 358 | 358 | Passed |
| partial repair probe 1 | 178 | 180 | Failed |
| partial repair probe 2 | 92 | 90 | Failed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 180 | 180 | Passed |
| normal control 2 | 238 | 238 | Passed |
SHA-256 / 8e29f38b0e21c5e6d3a3385d5e33c32988b18c94914088bf1e166731ea4475fd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b, mat):
y1, m1, d1 = a
y2, m2, d2 = b
def last(y, m):
if m == 2:
return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
if d1 == last(y1, m1):
d1 = 30
if d2 == last(y2, m2) and not (list(b) == list(mat) and m2 == 2):
d2 = 30
return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression february month length 1', [[2060, 2, 29], [2062, 2, 27], [2063, 8, 25]], 717], ['regression february month length 2', [[2080, 2, 29], [2081, 2, 28], [2081, 2, 28]], 358], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2105, 3, 31]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 30], [2104, 2, 27]], 90], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['normal control 2', [[2045, 6, 30], [2046, 2, 28], [2046, 2, 28]], 238]], [['regression february month length 1', [[2032, 2, 28], [2035, 12, 20], [2035, 12, 20]], 1372], ['regression february month length 2', [[2081, 9, 30], [2084, 2, 28], [2086, 2, 28]], 868], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2106, 9, 30]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2100, 11, 11]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2067, 3, 31], [2070, 2, 28], [2070, 2, 28]], 1048], ['normal control 2', [[2049, 5, 31], [2057, 2, 28], [2057, 12, 1]], 2790]], [['regression february month length 1', [[2077, 2, 28], [2080, 2, 29], [2082, 4, 29]], 1080], ['regression february month length 2', [[2055, 1, 28], [2056, 2, 29], [2056, 5, 16]], 392], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 30], [2105, 2, 25]], 300], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2106, 11, 30]], 180], ['boundary control 1', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2066, 7, 31], [2069, 2, 28], [2069, 2, 28]], 928], ['normal control 2', [[2095, 12, 31], [2098, 2, 28], [2098, 2, 28]], 778]], [['regression february month length 1', [[2088, 2, 29], [2095, 2, 28], [2095, 12, 27]], 2520], ['regression february month length 2', [[2036, 2, 29], [2039, 8, 31], [2044, 8, 31]], 1260], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2103, 1, 31]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2103, 8, 31]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['normal control 1', [[2041, 2, 28], [2043, 1, 31], [2043, 1, 31]], 690], ['normal control 2', [[2016, 4, 30], [2018, 7, 31], [2022, 1, 31]], 810]], [['regression february month length 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['regression february month length 2', [[2079, 5, 3], [2080, 2, 28], [2081, 11, 20]], 295], ['partial repair probe 1', [[2099, 8, 31], [2100, 2, 28], [2104, 5, 12]], 180], ['partial repair probe 2', [[2099, 8, 31], [2100, 2, 28], [2100, 11, 30]], 180], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2024, 2, 29]], 179], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31], [2030, 5, 31]], 180], ['normal control 1', [[2002, 8, 31], [2005, 2, 28], [2005, 2, 28]], 898], ['normal control 2', [[2045, 5, 31], [2049, 2, 28], [2049, 9, 9]], 1350]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression february month length 1 | 717 | 717 | Passed |
| regression february month length 2 | 358 | 358 | Passed |
| partial repair probe 1 | 180 | 180 | Passed |
| partial repair probe 2 | 90 | 90 | Passed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 180 | 180 | Passed |
| normal control 2 | 238 | 238 | Passed |
SHA-256 / c18f15f521343ddaa7235e39cef66de64e90d909004ad0c50e277f21b09e914e
Verification & scope
A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any published convention text. 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:49.738626+00:00.
Case digest / 5bee623c85bfb8f36ec2ab33d9fe74e2fe2e6286d7f7ae66036b78b2e9185f51