FA-60881 / Bond day-count conventions / Open access
30E/360 ISDA with maturity exemption: only a start on the 31st is promoted · case 01
A period starting at the end of February accrues from day 28 or 29 instead of day 30.
ROOT CAUSE
The start-date rule was copied from 30/360 and only checks for day 31.
VERIFIED REPAIR
Promote D1 whenever the start is the last day of its month.
Unsuccessful approach: Promoting any start of 30 or later still misses February month ends.
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 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 == 31:
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 start month-end test 1', [[2100, 2, 28], [2100, 5, 31], [2101, 8, 31]], 90], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 30], [2102, 2, 28]], 90], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 31], [2106, 6, 30]], 300], ['partial repair probe 2', [[2100, 2, 28], [2100, 12, 30], [2103, 12, 31]], 300], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2076, 5, 31], [2077, 4, 22], [2077, 4, 22]], 322], ['normal control 2', [[2046, 3, 29], [2046, 8, 23], [2047, 7, 31]], 144]], [['regression start month-end test 1', [[2061, 2, 28], [2063, 7, 31], [2065, 2, 28]], 870], ['regression start month-end test 2', [[2073, 2, 28], [2080, 9, 28], [2080, 9, 28]], 2728], ['partial repair probe 1', [[2085, 2, 28], [2088, 2, 28], [2088, 2, 28]], 1078], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 30], [2104, 10, 2]], 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', [[2050, 6, 22], [2051, 4, 20], [2053, 7, 30]], 298], ['normal control 2', [[2029, 4, 1], [2032, 2, 29], [2035, 2, 28]], 1049]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 30], [2102, 11, 13]], 180], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 15], [2105, 3, 29]], 75], ['partial repair probe 1', [[2060, 2, 29], [2063, 12, 4], [2063, 12, 4]], 1354], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 15], [2102, 12, 31]], 75], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2000, 7, 30], [2004, 2, 29], [2006, 12, 31]], 1290], ['normal control 2', [[1999, 7, 31], [2001, 2, 28], [2006, 2, 28]], 570]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 12, 15], [2102, 1, 16]], 285], ['regression start month-end test 2', [[2100, 2, 28], [2100, 8, 15], [2100, 8, 20]], 165], ['partial repair probe 1', [[2005, 2, 28], [2010, 2, 28], [2013, 5, 8]], 1800], ['partial repair probe 2', [[2098, 2, 28], [2098, 8, 30], [2105, 9, 28]], 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', [[2037, 4, 10], [2040, 10, 30], [2040, 10, 30]], 1280], ['normal control 2', [[2041, 7, 30], [2046, 1, 31], [2046, 1, 31]], 1620]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 15], [2105, 8, 5]], 165], ['regression start month-end test 2', [[2047, 2, 28], [2048, 5, 30], [2048, 5, 30]], 450], ['partial repair probe 1', [[2100, 2, 28], [2100, 8, 31], [2106, 5, 21]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2106, 4, 30]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2016, 6, 30], [2019, 2, 28], [2019, 2, 28]], 958], ['normal control 2', [[2040, 10, 31], [2048, 3, 28], [2048, 3, 28]], 2668]]]
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 start month-end test 1 | 92 | 90 | Failed |
| regression start month-end test 2 | 92 | 90 | Failed |
| partial repair probe 1 | 302 | 300 | Failed |
| partial repair probe 2 | 302 | 300 | Failed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 322 | 322 | Passed |
| normal control 2 | 144 | 144 | Passed |
SHA-256 / 265b16b566eec7c3eb73e763e14dc615c9f0dbc4a9a877582f12451e873e010c
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 and y % 100 != 0) or y % 400 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
if d1 >= 30:
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 start month-end test 1', [[2100, 2, 28], [2100, 5, 31], [2101, 8, 31]], 90], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 30], [2102, 2, 28]], 90], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 31], [2106, 6, 30]], 300], ['partial repair probe 2', [[2100, 2, 28], [2100, 12, 30], [2103, 12, 31]], 300], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2076, 5, 31], [2077, 4, 22], [2077, 4, 22]], 322], ['normal control 2', [[2046, 3, 29], [2046, 8, 23], [2047, 7, 31]], 144]], [['regression start month-end test 1', [[2061, 2, 28], [2063, 7, 31], [2065, 2, 28]], 870], ['regression start month-end test 2', [[2073, 2, 28], [2080, 9, 28], [2080, 9, 28]], 2728], ['partial repair probe 1', [[2085, 2, 28], [2088, 2, 28], [2088, 2, 28]], 1078], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 30], [2104, 10, 2]], 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', [[2050, 6, 22], [2051, 4, 20], [2053, 7, 30]], 298], ['normal control 2', [[2029, 4, 1], [2032, 2, 29], [2035, 2, 28]], 1049]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 30], [2102, 11, 13]], 180], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 15], [2105, 3, 29]], 75], ['partial repair probe 1', [[2060, 2, 29], [2063, 12, 4], [2063, 12, 4]], 1354], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 15], [2102, 12, 31]], 75], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2000, 7, 30], [2004, 2, 29], [2006, 12, 31]], 1290], ['normal control 2', [[1999, 7, 31], [2001, 2, 28], [2006, 2, 28]], 570]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 12, 15], [2102, 1, 16]], 285], ['regression start month-end test 2', [[2100, 2, 28], [2100, 8, 15], [2100, 8, 20]], 165], ['partial repair probe 1', [[2005, 2, 28], [2010, 2, 28], [2013, 5, 8]], 1800], ['partial repair probe 2', [[2098, 2, 28], [2098, 8, 30], [2105, 9, 28]], 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', [[2037, 4, 10], [2040, 10, 30], [2040, 10, 30]], 1280], ['normal control 2', [[2041, 7, 30], [2046, 1, 31], [2046, 1, 31]], 1620]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 15], [2105, 8, 5]], 165], ['regression start month-end test 2', [[2047, 2, 28], [2048, 5, 30], [2048, 5, 30]], 450], ['partial repair probe 1', [[2100, 2, 28], [2100, 8, 31], [2106, 5, 21]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2106, 4, 30]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2016, 6, 30], [2019, 2, 28], [2019, 2, 28]], 958], ['normal control 2', [[2040, 10, 31], [2048, 3, 28], [2048, 3, 28]], 2668]]]
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 start month-end test 1 | 92 | 90 | Failed |
| regression start month-end test 2 | 92 | 90 | Failed |
| partial repair probe 1 | 302 | 300 | Failed |
| partial repair probe 2 | 302 | 300 | Failed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 322 | 322 | Passed |
| normal control 2 | 144 | 144 | Passed |
SHA-256 / 3d27b614ee3613cf4a8d525326981cfdcd3be201551393d43b0cb494ee007ef6
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 start month-end test 1', [[2100, 2, 28], [2100, 5, 31], [2101, 8, 31]], 90], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 30], [2102, 2, 28]], 90], ['partial repair probe 1', [[2100, 2, 28], [2100, 12, 31], [2106, 6, 30]], 300], ['partial repair probe 2', [[2100, 2, 28], [2100, 12, 30], [2103, 12, 31]], 300], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2076, 5, 31], [2077, 4, 22], [2077, 4, 22]], 322], ['normal control 2', [[2046, 3, 29], [2046, 8, 23], [2047, 7, 31]], 144]], [['regression start month-end test 1', [[2061, 2, 28], [2063, 7, 31], [2065, 2, 28]], 870], ['regression start month-end test 2', [[2073, 2, 28], [2080, 9, 28], [2080, 9, 28]], 2728], ['partial repair probe 1', [[2085, 2, 28], [2088, 2, 28], [2088, 2, 28]], 1078], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 30], [2104, 10, 2]], 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', [[2050, 6, 22], [2051, 4, 20], [2053, 7, 30]], 298], ['normal control 2', [[2029, 4, 1], [2032, 2, 29], [2035, 2, 28]], 1049]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 30], [2102, 11, 13]], 180], ['regression start month-end test 2', [[2100, 2, 28], [2100, 5, 15], [2105, 3, 29]], 75], ['partial repair probe 1', [[2060, 2, 29], [2063, 12, 4], [2063, 12, 4]], 1354], ['partial repair probe 2', [[2100, 2, 28], [2100, 5, 15], [2102, 12, 31]], 75], ['boundary control 1', [[2023, 8, 31], [2024, 2, 29], [2026, 2, 28]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2000, 7, 30], [2004, 2, 29], [2006, 12, 31]], 1290], ['normal control 2', [[1999, 7, 31], [2001, 2, 28], [2006, 2, 28]], 570]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 12, 15], [2102, 1, 16]], 285], ['regression start month-end test 2', [[2100, 2, 28], [2100, 8, 15], [2100, 8, 20]], 165], ['partial repair probe 1', [[2005, 2, 28], [2010, 2, 28], [2013, 5, 8]], 1800], ['partial repair probe 2', [[2098, 2, 28], [2098, 8, 30], [2105, 9, 28]], 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', [[2037, 4, 10], [2040, 10, 30], [2040, 10, 30]], 1280], ['normal control 2', [[2041, 7, 30], [2046, 1, 31], [2046, 1, 31]], 1620]], [['regression start month-end test 1', [[2100, 2, 28], [2100, 8, 15], [2105, 8, 5]], 165], ['regression start month-end test 2', [[2047, 2, 28], [2048, 5, 30], [2048, 5, 30]], 450], ['partial repair probe 1', [[2100, 2, 28], [2100, 8, 31], [2106, 5, 21]], 180], ['partial repair probe 2', [[2100, 2, 28], [2100, 8, 31], [2106, 4, 30]], 180], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2029, 7, 15]], 180], ['boundary control 2', [[2023, 9, 30], [2024, 3, 31], [2024, 3, 31]], 180], ['normal control 1', [[2016, 6, 30], [2019, 2, 28], [2019, 2, 28]], 958], ['normal control 2', [[2040, 10, 31], [2048, 3, 28], [2048, 3, 28]], 2668]]]
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 start month-end test 1 | 90 | 90 | Passed |
| regression start month-end test 2 | 90 | 90 | Passed |
| partial repair probe 1 | 300 | 300 | Passed |
| partial repair probe 2 | 300 | 300 | Passed |
| boundary control 1 | 180 | 180 | Passed |
| boundary control 2 | 180 | 180 | Passed |
| normal control 1 | 322 | 322 | Passed |
| normal control 2 | 144 | 144 | Passed |
SHA-256 / 33cd0e79c303b8e28f55bedec0e7222a72521b3a4dd7203ffc8adcb3517c6f72
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.849954+00:00.
Case digest / 3d6d9a7a0c4705c360e352116b4073452b71d7ab34c940db7c51a4a150470076