FA-60891 / Bond day-count conventions / Open access
ICMA regular-period accrued with ex-coupon: the settlement day is counted as an accrued day · case 01
Every positive accrual is one day of coupon too high.
ROOT CAUSE
The accrued day count adds one to include both endpoints.
THE FAILURE
The accrued day count adds one to include both endpoints.
Unsuccessful approach: Skipping the extra day only when settling on the coupon date keeps the error elsewhere.
Case contract
Inputs prev, nxt, settle ([y,m,d]), annual rate, frequency and ex-coupon days. Settlement outside [prev, nxt] returns "settlement outside period"; settlement on nxt returns 0.0. If the settlement is within ex-coupon days of nxt (days to nxt <= exdays), accrued is negative: -coupon*days(settle,nxt)/days(prev,nxt). Otherwise accrued = coupon*days(prev,settle)/days(prev,nxt). coupon=100*rate/freq; round the final value to 6 decimals.
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
import datetime
from fractions import Fraction
N = 1
observations = []
def solve(prev, nxt, settle, rate, freq, exdays):
P = datetime.date(*prev)
Q = datetime.date(*nxt)
S = datetime.date(*settle)
if not (P <= S <= Q):
return 'settlement outside period'
if S == Q:
return 0.0
period = (Q - P).days
coupon = 100 * rate / freq
if (Q - S).days <= exdays:
return round(-coupon * (Q - S).days / period, 6)
days = (S - P).days + 1
return round(coupon * days / period, 6)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression accrual day inclusivity 1', [[2007, 5, 30], [2007, 8, 30], [2007, 8, 24], 0.05, 4, 3], 1.168478], ['regression accrual day inclusivity 2', [[2025, 3, 18], [2025, 9, 18], [2025, 7, 23], 0.04125, 2, 7], 1.423573], ['partial repair probe 1', [[2046, 7, 29], [2047, 1, 29], [2046, 8, 11], 0.04125, 2, 5], 0.14572], ['partial repair probe 2', [[2028, 5, 28], [2028, 8, 28], [2028, 8, 20], 0.07, 4, 7], 1.597826], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['normal control 1', [[2005, 4, 30], [2005, 10, 30], [2005, 10, 22], 0.04125, 2, 10], -0.090164], ['normal control 2', [[2017, 8, 15], [2018, 8, 15], [2018, 8, 8], 0.02, 1, 10], -0.038356]], [['regression accrual day inclusivity 1', [[2019, 11, 18], [2020, 5, 18], [2020, 1, 26], 0.0625, 2, 10], 1.184753], ['regression accrual day inclusivity 2', [[2042, 9, 26], [2043, 3, 26], [2043, 3, 21], 0.035, 2, 0], 1.701657], ['partial repair probe 1', [[2000, 1, 1], [2001, 1, 1], [2000, 5, 26], 0.035, 1, 0], 1.396175], ['partial repair probe 2', [[2004, 6, 27], [2005, 6, 27], [2004, 11, 1], 0.035, 1, 0], 1.217808], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['normal control 1', [[2026, 12, 31], [2027, 1, 31], [2027, 1, 27], 0.0275, 12, 7], -0.02957], ['normal control 2', [[2038, 11, 1], [2039, 11, 1], [2039, 11, 1], 0.035, 1, 3], 0.0]], [['regression accrual day inclusivity 1', [[2016, 4, 30], [2016, 10, 30], [2016, 8, 20], 0.02, 2, 0], 0.612022], ['regression accrual day inclusivity 2', [[2056, 11, 30], [2057, 5, 30], [2056, 12, 3], 0.0625, 2, 5], 0.051796], ['partial repair probe 1', [[2005, 11, 16], [2006, 11, 16], [2006, 5, 30], 0.02, 1, 0], 1.068493], ['partial repair probe 2', [[2056, 4, 28], [2056, 10, 28], [2056, 9, 28], 0.0125, 2, 0], 0.522541], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['normal control 1', [[2006, 3, 1], [2007, 3, 1], [2007, 3, 1], 0.02, 1, 5], 0.0], ['normal control 2', [[2000, 11, 25], [2001, 2, 25], [2001, 2, 19], 0.0275, 4, 7], -0.044837]], [['regression accrual day inclusivity 1', [[2019, 8, 11], [2019, 9, 11], [2019, 8, 14], 0.0625, 12, 0], 0.050403], ['regression accrual day inclusivity 2', [[2003, 4, 28], [2003, 7, 28], [2003, 7, 21], 0.035, 4, 0], 0.807692], ['partial repair probe 1', [[2056, 5, 30], [2056, 6, 30], [2056, 6, 18], 0.05, 12, 10], 0.255376], ['partial repair probe 2', [[2017, 11, 30], [2018, 5, 30], [2018, 4, 27], 0.02, 2, 7], 0.81768], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['normal control 1', [[2004, 8, 24], [2004, 9, 24], [2004, 9, 24], 0.07, 12, 3], 0.0], ['normal control 2', [[2006, 2, 28], [2006, 3, 28], [2006, 3, 22], 0.0275, 12, 10], -0.049107]], [['regression accrual day inclusivity 1', [[2049, 12, 4], [2050, 3, 4], [2049, 12, 4], 0.02, 4, 7], 0.0], ['regression accrual day inclusivity 2', [[2039, 1, 26], [2039, 4, 26], [2039, 3, 14], 0.0275, 4, 0], 0.359028], ['partial repair probe 1', [[2045, 3, 26], [2046, 3, 26], [2045, 9, 3], 0.0125, 1, 0], 0.55137], ['partial repair probe 2', [[2032, 10, 24], [2033, 1, 24], [2032, 12, 25], 0.02, 4, 5], 0.336957], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['normal control 1', [[2033, 11, 1], [2034, 2, 1], [2034, 1, 29], 0.035, 4, 10], -0.028533], ['normal control 2', [[2054, 6, 1], [2054, 7, 1], [2054, 6, 24], 0.0125, 12, 10], -0.024306]]]
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 accrual day inclusivity 1 | 1.182065 | 1.168478 | Failed |
| regression accrual day inclusivity 2 | 1.434783 | 1.423573 | Failed |
| partial repair probe 1 | 0.156929 | 0.14572 | Failed |
| partial repair probe 2 | 1.616848 | 1.597826 | Failed |
| boundary control 1 | 0.0 | 0.0 | Passed |
| boundary control 2 | settlement outside period | settlement outside period | Passed |
| normal control 1 | -0.090164 | -0.090164 | Passed |
| normal control 2 | -0.038356 | -0.038356 | Passed |
SHA-256 / 899b4216076258bbe0f6c3f3bd76d6a987910b08df0aaf73e0601f3a857c3522
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
from fractions import Fraction
N = 1
observations = []
def solve(prev, nxt, settle, rate, freq, exdays):
P = datetime.date(*prev)
Q = datetime.date(*nxt)
S = datetime.date(*settle)
if not (P <= S <= Q):
return 'settlement outside period'
if S == Q:
return 0.0
period = (Q - P).days
coupon = 100 * rate / freq
if (Q - S).days <= exdays:
return round(-coupon * (Q - S).days / period, 6)
days = (S - P).days + (1 if S > P else 0)
return round(coupon * days / period, 6)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression accrual day inclusivity 1', [[2007, 5, 30], [2007, 8, 30], [2007, 8, 24], 0.05, 4, 3], 1.168478], ['regression accrual day inclusivity 2', [[2025, 3, 18], [2025, 9, 18], [2025, 7, 23], 0.04125, 2, 7], 1.423573], ['partial repair probe 1', [[2046, 7, 29], [2047, 1, 29], [2046, 8, 11], 0.04125, 2, 5], 0.14572], ['partial repair probe 2', [[2028, 5, 28], [2028, 8, 28], [2028, 8, 20], 0.07, 4, 7], 1.597826], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['normal control 1', [[2005, 4, 30], [2005, 10, 30], [2005, 10, 22], 0.04125, 2, 10], -0.090164], ['normal control 2', [[2017, 8, 15], [2018, 8, 15], [2018, 8, 8], 0.02, 1, 10], -0.038356]], [['regression accrual day inclusivity 1', [[2019, 11, 18], [2020, 5, 18], [2020, 1, 26], 0.0625, 2, 10], 1.184753], ['regression accrual day inclusivity 2', [[2042, 9, 26], [2043, 3, 26], [2043, 3, 21], 0.035, 2, 0], 1.701657], ['partial repair probe 1', [[2000, 1, 1], [2001, 1, 1], [2000, 5, 26], 0.035, 1, 0], 1.396175], ['partial repair probe 2', [[2004, 6, 27], [2005, 6, 27], [2004, 11, 1], 0.035, 1, 0], 1.217808], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['normal control 1', [[2026, 12, 31], [2027, 1, 31], [2027, 1, 27], 0.0275, 12, 7], -0.02957], ['normal control 2', [[2038, 11, 1], [2039, 11, 1], [2039, 11, 1], 0.035, 1, 3], 0.0]], [['regression accrual day inclusivity 1', [[2016, 4, 30], [2016, 10, 30], [2016, 8, 20], 0.02, 2, 0], 0.612022], ['regression accrual day inclusivity 2', [[2056, 11, 30], [2057, 5, 30], [2056, 12, 3], 0.0625, 2, 5], 0.051796], ['partial repair probe 1', [[2005, 11, 16], [2006, 11, 16], [2006, 5, 30], 0.02, 1, 0], 1.068493], ['partial repair probe 2', [[2056, 4, 28], [2056, 10, 28], [2056, 9, 28], 0.0125, 2, 0], 0.522541], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['normal control 1', [[2006, 3, 1], [2007, 3, 1], [2007, 3, 1], 0.02, 1, 5], 0.0], ['normal control 2', [[2000, 11, 25], [2001, 2, 25], [2001, 2, 19], 0.0275, 4, 7], -0.044837]], [['regression accrual day inclusivity 1', [[2019, 8, 11], [2019, 9, 11], [2019, 8, 14], 0.0625, 12, 0], 0.050403], ['regression accrual day inclusivity 2', [[2003, 4, 28], [2003, 7, 28], [2003, 7, 21], 0.035, 4, 0], 0.807692], ['partial repair probe 1', [[2056, 5, 30], [2056, 6, 30], [2056, 6, 18], 0.05, 12, 10], 0.255376], ['partial repair probe 2', [[2017, 11, 30], [2018, 5, 30], [2018, 4, 27], 0.02, 2, 7], 0.81768], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 8], 0.05, 2, 7], -0.096154], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['normal control 1', [[2004, 8, 24], [2004, 9, 24], [2004, 9, 24], 0.07, 12, 3], 0.0], ['normal control 2', [[2006, 2, 28], [2006, 3, 28], [2006, 3, 22], 0.0275, 12, 10], -0.049107]], [['regression accrual day inclusivity 1', [[2049, 12, 4], [2050, 3, 4], [2049, 12, 4], 0.02, 4, 7], 0.0], ['regression accrual day inclusivity 2', [[2039, 1, 26], [2039, 4, 26], [2039, 3, 14], 0.0275, 4, 0], 0.359028], ['partial repair probe 1', [[2045, 3, 26], [2046, 3, 26], [2045, 9, 3], 0.0125, 1, 0], 0.55137], ['partial repair probe 2', [[2032, 10, 24], [2033, 1, 24], [2032, 12, 25], 0.02, 4, 5], 0.336957], ['boundary control 1', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 15], 0.05, 2, 7], 0.0], ['boundary control 2', [[2024, 1, 15], [2024, 7, 15], [2024, 7, 16], 0.05, 2, 7], 'settlement outside period'], ['normal control 1', [[2033, 11, 1], [2034, 2, 1], [2034, 1, 29], 0.035, 4, 10], -0.028533], ['normal control 2', [[2054, 6, 1], [2054, 7, 1], [2054, 6, 24], 0.0125, 12, 10], -0.024306]]]
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 accrual day inclusivity 1 | 1.182065 | 1.168478 | Failed |
| regression accrual day inclusivity 2 | 1.434783 | 1.423573 | Failed |
| partial repair probe 1 | 0.156929 | 0.14572 | Failed |
| partial repair probe 2 | 1.616848 | 1.597826 | Failed |
| boundary control 1 | 0.0 | 0.0 | Passed |
| boundary control 2 | settlement outside period | settlement outside period | Passed |
| normal control 1 | -0.090164 | -0.090164 | Passed |
| normal control 2 | -0.038356 | -0.038356 | Passed |
SHA-256 / cd38560581ae82ef0c3d00ac659a18bb791848bd32d0e94051a6d457ac455630
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic 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.918239+00:00.
Case digest / d89ddc4ae129622c57ab529af821e1cf1061f516dc1b52e08e1b8e0e26b65e29