FA-60916 / Bond day-count conventions / Open access
Act/Act ISDA year fraction: century years are all treated as leap years · case 01
Pieces in 1900 or 2100 are divided by 366.
ROOT CAUSE
The leap test only checks divisibility by four.
VERIFIED REPAIR
Apply the full Gregorian rule including the 100 and 400 exceptions.
Unsuccessful approach: Excluding all century years breaks the year 2000, which is a leap year.
Case contract
Inputs start and end [y,m,d]. If end < start return "end before start". Split the interval at each 1 January; each piece contributes its actual days divided by 366 if the piece lies in a Gregorian leap year, else 365. Sum exactly and return the float rounded to 9 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(a, b):
A = datetime.date(*a)
B = datetime.date(*b)
if B < A:
return 'end before start'
def leap(y):
return y % 4 == 0
total = Fraction(0)
cur = A
while cur < B:
nxt = min(B, datetime.date(cur.year + 1, 1, 1))
total += Fraction((nxt - cur).days, 366 if leap(cur.year) else 365)
cur = nxt
return round(float(total), 9)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression gregorian century rule 1', [[1900, 12, 12], [1902, 9, 11]], 1.747945205], ['regression gregorian century rule 2', [[2100, 8, 7], [2101, 12, 23]], 1.378082192], ['partial repair probe 1', [[1998, 2, 12], [2003, 1, 12]], 4.915068493], ['partial repair probe 2', [[1997, 7, 29], [2000, 4, 3]], 2.681495621], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2061, 4, 23], [2062, 11, 8]], 1.545205479], ['normal control 2', [[1965, 4, 28], [1968, 2, 22]], 2.821528558]], [['regression gregorian century rule 1', [[1897, 6, 13], [1901, 8, 19]], 4.183561644], ['regression gregorian century rule 2', [[1900, 4, 25], [1901, 1, 27]], 0.75890411], ['partial repair probe 1', [[2000, 2, 29], [2002, 8, 10]], 2.444277266], ['partial repair probe 2', [[1997, 3, 20], [2001, 12, 29]], 4.778082192], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[1982, 10, 1], [1983, 8, 2]], 0.835616438], ['normal control 2', [[1918, 6, 30], [1919, 7, 5]], 1.01369863]], [['regression gregorian century rule 1', [[1899, 7, 30], [1900, 6, 17]], 0.882191781], ['regression gregorian century rule 2', [[2100, 12, 19], [2101, 2, 1]], 0.120547945], ['partial repair probe 1', [[1997, 9, 30], [2002, 8, 23]], 4.895890411], ['partial repair probe 2', [[1997, 5, 12], [2000, 7, 5]], 3.149292612], ['boundary control 1', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[2013, 5, 17], [2013, 4, 26]], 'end before start'], ['normal control 2', [[2054, 4, 24], [2054, 11, 1]], 0.523287671]], [['regression gregorian century rule 1', [[1899, 12, 30], [1900, 12, 25]], 0.98630137], ['regression gregorian century rule 2', [[1896, 10, 28], [1900, 5, 19]], 3.55567782], ['partial repair probe 1', [[1997, 4, 13], [2000, 11, 7]], 3.570274721], ['partial repair probe 2', [[2000, 8, 26], [2003, 12, 27]], 3.336028146], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1970, 8, 5], [1974, 7, 27]], 3.975342466], ['normal control 2', [[1903, 8, 26], [1909, 7, 28]], 5.920547945]], [['regression gregorian century rule 1', [[1898, 8, 12], [1900, 12, 29]], 2.380821918], ['regression gregorian century rule 2', [[2100, 9, 30], [2106, 3, 21]], 5.471232877], ['partial repair probe 1', [[1998, 2, 27], [2002, 8, 30]], 4.504109589], ['partial repair probe 2', [[1999, 1, 19], [2004, 3, 23]], 5.174728647], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[1940, 8, 16], [1943, 2, 14]], 2.497597126], ['normal control 2', [[1986, 3, 5], [1986, 11, 19]], 0.709589041]]]
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 gregorian century rule 1 | 1.747795494 | 1.747945205 | Failed |
| regression gregorian century rule 2 | 1.37698181 | 1.378082192 | Failed |
| partial repair probe 1 | 4.915068493 | 4.915068493 | Passed |
| partial repair probe 2 | 2.681495621 | 2.681495621 | Passed |
| boundary control 1 | 1.0 | 1.0 | Passed |
| boundary control 2 | 0.0 | 0.0 | Passed |
| normal control 1 | 1.545205479 | 1.545205479 | Passed |
| normal control 2 | 2.821528558 | 2.821528558 | Passed |
SHA-256 / 44fe59aa40a6ce1d306282d528c46e932988c7ffb3d31b2a297ce14d951020b9
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(a, b):
A = datetime.date(*a)
B = datetime.date(*b)
if B < A:
return 'end before start'
def leap(y):
return y % 4 == 0 and y % 100 != 0
total = Fraction(0)
cur = A
while cur < B:
nxt = min(B, datetime.date(cur.year + 1, 1, 1))
total += Fraction((nxt - cur).days, 366 if leap(cur.year) else 365)
cur = nxt
return round(float(total), 9)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression gregorian century rule 1', [[1900, 12, 12], [1902, 9, 11]], 1.747945205], ['regression gregorian century rule 2', [[2100, 8, 7], [2101, 12, 23]], 1.378082192], ['partial repair probe 1', [[1998, 2, 12], [2003, 1, 12]], 4.915068493], ['partial repair probe 2', [[1997, 7, 29], [2000, 4, 3]], 2.681495621], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2061, 4, 23], [2062, 11, 8]], 1.545205479], ['normal control 2', [[1965, 4, 28], [1968, 2, 22]], 2.821528558]], [['regression gregorian century rule 1', [[1897, 6, 13], [1901, 8, 19]], 4.183561644], ['regression gregorian century rule 2', [[1900, 4, 25], [1901, 1, 27]], 0.75890411], ['partial repair probe 1', [[2000, 2, 29], [2002, 8, 10]], 2.444277266], ['partial repair probe 2', [[1997, 3, 20], [2001, 12, 29]], 4.778082192], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[1982, 10, 1], [1983, 8, 2]], 0.835616438], ['normal control 2', [[1918, 6, 30], [1919, 7, 5]], 1.01369863]], [['regression gregorian century rule 1', [[1899, 7, 30], [1900, 6, 17]], 0.882191781], ['regression gregorian century rule 2', [[2100, 12, 19], [2101, 2, 1]], 0.120547945], ['partial repair probe 1', [[1997, 9, 30], [2002, 8, 23]], 4.895890411], ['partial repair probe 2', [[1997, 5, 12], [2000, 7, 5]], 3.149292612], ['boundary control 1', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[2013, 5, 17], [2013, 4, 26]], 'end before start'], ['normal control 2', [[2054, 4, 24], [2054, 11, 1]], 0.523287671]], [['regression gregorian century rule 1', [[1899, 12, 30], [1900, 12, 25]], 0.98630137], ['regression gregorian century rule 2', [[1896, 10, 28], [1900, 5, 19]], 3.55567782], ['partial repair probe 1', [[1997, 4, 13], [2000, 11, 7]], 3.570274721], ['partial repair probe 2', [[2000, 8, 26], [2003, 12, 27]], 3.336028146], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1970, 8, 5], [1974, 7, 27]], 3.975342466], ['normal control 2', [[1903, 8, 26], [1909, 7, 28]], 5.920547945]], [['regression gregorian century rule 1', [[1898, 8, 12], [1900, 12, 29]], 2.380821918], ['regression gregorian century rule 2', [[2100, 9, 30], [2106, 3, 21]], 5.471232877], ['partial repair probe 1', [[1998, 2, 27], [2002, 8, 30]], 4.504109589], ['partial repair probe 2', [[1999, 1, 19], [2004, 3, 23]], 5.174728647], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[1940, 8, 16], [1943, 2, 14]], 2.497597126], ['normal control 2', [[1986, 3, 5], [1986, 11, 19]], 0.709589041]]]
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 gregorian century rule 1 | 1.747945205 | 1.747945205 | Passed |
| regression gregorian century rule 2 | 1.378082192 | 1.378082192 | Passed |
| partial repair probe 1 | 4.917808219 | 4.915068493 | Failed |
| partial repair probe 2 | 2.682191781 | 2.681495621 | Failed |
| boundary control 1 | 1.0 | 1.0 | Passed |
| boundary control 2 | 0.0 | 0.0 | Passed |
| normal control 1 | 1.545205479 | 1.545205479 | Passed |
| normal control 2 | 2.821528558 | 2.821528558 | Passed |
SHA-256 / f7c6c2d814d04cc79ac8ab8ec3cc8747a0e86974c907ae842987975abc7fac36
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
from fractions import Fraction
N = 1
observations = []
def solve(a, b):
A = datetime.date(*a)
B = datetime.date(*b)
if B < A:
return 'end before start'
def leap(y):
return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
total = Fraction(0)
cur = A
while cur < B:
nxt = min(B, datetime.date(cur.year + 1, 1, 1))
total += Fraction((nxt - cur).days, 366 if leap(cur.year) else 365)
cur = nxt
return round(float(total), 9)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression gregorian century rule 1', [[1900, 12, 12], [1902, 9, 11]], 1.747945205], ['regression gregorian century rule 2', [[2100, 8, 7], [2101, 12, 23]], 1.378082192], ['partial repair probe 1', [[1998, 2, 12], [2003, 1, 12]], 4.915068493], ['partial repair probe 2', [[1997, 7, 29], [2000, 4, 3]], 2.681495621], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2061, 4, 23], [2062, 11, 8]], 1.545205479], ['normal control 2', [[1965, 4, 28], [1968, 2, 22]], 2.821528558]], [['regression gregorian century rule 1', [[1897, 6, 13], [1901, 8, 19]], 4.183561644], ['regression gregorian century rule 2', [[1900, 4, 25], [1901, 1, 27]], 0.75890411], ['partial repair probe 1', [[2000, 2, 29], [2002, 8, 10]], 2.444277266], ['partial repair probe 2', [[1997, 3, 20], [2001, 12, 29]], 4.778082192], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[1982, 10, 1], [1983, 8, 2]], 0.835616438], ['normal control 2', [[1918, 6, 30], [1919, 7, 5]], 1.01369863]], [['regression gregorian century rule 1', [[1899, 7, 30], [1900, 6, 17]], 0.882191781], ['regression gregorian century rule 2', [[2100, 12, 19], [2101, 2, 1]], 0.120547945], ['partial repair probe 1', [[1997, 9, 30], [2002, 8, 23]], 4.895890411], ['partial repair probe 2', [[1997, 5, 12], [2000, 7, 5]], 3.149292612], ['boundary control 1', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[2013, 5, 17], [2013, 4, 26]], 'end before start'], ['normal control 2', [[2054, 4, 24], [2054, 11, 1]], 0.523287671]], [['regression gregorian century rule 1', [[1899, 12, 30], [1900, 12, 25]], 0.98630137], ['regression gregorian century rule 2', [[1896, 10, 28], [1900, 5, 19]], 3.55567782], ['partial repair probe 1', [[1997, 4, 13], [2000, 11, 7]], 3.570274721], ['partial repair probe 2', [[2000, 8, 26], [2003, 12, 27]], 3.336028146], ['boundary control 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1970, 8, 5], [1974, 7, 27]], 3.975342466], ['normal control 2', [[1903, 8, 26], [1909, 7, 28]], 5.920547945]], [['regression gregorian century rule 1', [[1898, 8, 12], [1900, 12, 29]], 2.380821918], ['regression gregorian century rule 2', [[2100, 9, 30], [2106, 3, 21]], 5.471232877], ['partial repair probe 1', [[1998, 2, 27], [2002, 8, 30]], 4.504109589], ['partial repair probe 2', [[1999, 1, 19], [2004, 3, 23]], 5.174728647], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[1940, 8, 16], [1943, 2, 14]], 2.497597126], ['normal control 2', [[1986, 3, 5], [1986, 11, 19]], 0.709589041]]]
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 gregorian century rule 1 | 1.747945205 | 1.747945205 | Passed |
| regression gregorian century rule 2 | 1.378082192 | 1.378082192 | Passed |
| partial repair probe 1 | 4.915068493 | 4.915068493 | Passed |
| partial repair probe 2 | 2.681495621 | 2.681495621 | Passed |
| boundary control 1 | 1.0 | 1.0 | Passed |
| boundary control 2 | 0.0 | 0.0 | Passed |
| normal control 1 | 1.545205479 | 1.545205479 | Passed |
| normal control 2 | 2.821528558 | 2.821528558 | Passed |
SHA-256 / a055fa60a2be860bec4e38b2cff2f35d3ba2c6cffac5d7e3a52c6e0d52242f08
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:50.030303+00:00.
Case digest / b10e58b7a6dfba41afee3f10c9aaec25531878180ac468c691614dbf625c9e76