FAILURE MAP
← Case archive

FA-60926 / Bond day-count conventions / Open access

Act/Act ISDA year fraction: days are divided by an average 365.25-day year · case 01

Year fractions are close but not equal to the ISDA value for nearly every span.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The per-year split was replaced with a single division by 365.25.

VERIFIED REPAIR

Split by calendar years and divide each piece by its own year length.

Unsuccessful approach: Dividing by 366 only when a 29 February occurs in the span is a different convention.

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 and y % 100 != 0) or y % 400 == 0
    total = Fraction(0)
    cur = A
    total = Fraction((B - A).days * 4, 1461)
    return round(float(total), 9)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression average year basis 1', [[2033, 2, 27], [2036, 11, 26]], 3.745474961], ['regression average year basis 2', [[1897, 9, 30], [1898, 3, 28]], 0.490410959], ['partial repair probe 1', [[2079, 11, 3], [2083, 11, 3]], 4.0], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2059, 8, 30], [2059, 7, 23]], 'end before start'], ['normal control 2', [[2099, 12, 16], [2099, 11, 17]], 'end before start'], ['normal control 3', [[2103, 6, 16], [2103, 5, 8]], 'end before start'], ['normal control 4', [[1990, 7, 22], [1990, 7, 4]], 'end before start']], [['regression average year basis 1', [[2041, 1, 23], [2041, 8, 10]], 0.545205479], ['regression average year basis 2', [[1989, 1, 11], [1992, 10, 16]], 3.762220226], ['partial repair probe 1', [[2086, 2, 28], [2090, 1, 22]], 3.898630137], ['partial repair probe 2', [[2028, 12, 24], [2029, 10, 5]], 0.780762033], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2041, 6, 30], [2041, 5, 29]], 'end before start'], ['normal control 2', [[1944, 6, 15], [1944, 5, 27]], 'end before start'], ['normal control 3', [[2087, 4, 19], [2087, 4, 4]], 'end before start']], [['regression average year basis 1', [[2045, 7, 24], [2046, 1, 10]], 0.465753425], ['regression average year basis 2', [[2104, 1, 17], [2104, 7, 25]], 0.519125683], ['partial repair probe 1', [[2096, 12, 31], [2099, 2, 8]], 2.106841829], ['partial repair probe 2', [[1936, 4, 23], [1937, 4, 22]], 0.99536642], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2039, 3, 17], [2039, 2, 26]], 'end before start'], ['normal control 2', [[2031, 11, 17], [2031, 11, 9]], 'end before start'], ['normal control 3', [[2009, 8, 3], [2009, 6, 30]], 'end before start']], [['regression average year basis 1', [[2018, 9, 1], [2019, 9, 29]], 1.076712329], ['regression average year basis 2', [[2094, 2, 28], [2094, 6, 7]], 0.271232877], ['partial repair probe 1', [[1935, 10, 31], [1936, 4, 13]], 0.451283779], ['partial repair probe 2', [[2083, 5, 15], [2084, 6, 1]], 1.048177259], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1908, 12, 13], [1908, 12, 12]], 'end before start'], ['normal control 2', [[1900, 4, 24], [1900, 4, 13]], 'end before start'], ['normal control 3', [[1994, 7, 29], [1994, 7, 14]], 'end before start']], [['regression average year basis 1', [[2058, 8, 14], [2064, 8, 8]], 5.98465454], ['regression average year basis 2', [[1980, 7, 11], [1983, 5, 22]], 2.861711206], ['partial repair probe 1', [[2088, 5, 30], [2088, 6, 2]], 0.008196721], ['partial repair probe 2', [[2027, 1, 9], [2032, 10, 24]], 5.789557602], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2043, 5, 31], [2043, 4, 25]], 'end before start'], ['normal control 2', [[1960, 8, 1], [1960, 6, 27]], 'end before start'], ['normal control 3', [[2078, 1, 31], [2078, 1, 7]], 'end before start']]]
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 fixtureActualExpectedOutcome
regression average year basis 13.7453798773.745474961Failed
regression average year basis 20.4900752910.490410959Failed
partial repair probe 14.04.0Passed
boundary control 10.00.0Passed
normal control 1end before startend before startPassed
normal control 2end before startend before startPassed
normal control 3end before startend before startPassed
normal control 4end before startend before startPassed

SHA-256 / 0b45a0098e0f6503645534ab7a38d48ca873144c4fe554df758a7579322b4c49

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) or y % 400 == 0
    total = Fraction(0)
    cur = A
    has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= B for y in range(A.year, B.year + 1))
    total = Fraction((B - A).days, 366 if has29 else 365)
    return round(float(total), 9)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression average year basis 1', [[2033, 2, 27], [2036, 11, 26]], 3.745474961], ['regression average year basis 2', [[1897, 9, 30], [1898, 3, 28]], 0.490410959], ['partial repair probe 1', [[2079, 11, 3], [2083, 11, 3]], 4.0], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2059, 8, 30], [2059, 7, 23]], 'end before start'], ['normal control 2', [[2099, 12, 16], [2099, 11, 17]], 'end before start'], ['normal control 3', [[2103, 6, 16], [2103, 5, 8]], 'end before start'], ['normal control 4', [[1990, 7, 22], [1990, 7, 4]], 'end before start']], [['regression average year basis 1', [[2041, 1, 23], [2041, 8, 10]], 0.545205479], ['regression average year basis 2', [[1989, 1, 11], [1992, 10, 16]], 3.762220226], ['partial repair probe 1', [[2086, 2, 28], [2090, 1, 22]], 3.898630137], ['partial repair probe 2', [[2028, 12, 24], [2029, 10, 5]], 0.780762033], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2041, 6, 30], [2041, 5, 29]], 'end before start'], ['normal control 2', [[1944, 6, 15], [1944, 5, 27]], 'end before start'], ['normal control 3', [[2087, 4, 19], [2087, 4, 4]], 'end before start']], [['regression average year basis 1', [[2045, 7, 24], [2046, 1, 10]], 0.465753425], ['regression average year basis 2', [[2104, 1, 17], [2104, 7, 25]], 0.519125683], ['partial repair probe 1', [[2096, 12, 31], [2099, 2, 8]], 2.106841829], ['partial repair probe 2', [[1936, 4, 23], [1937, 4, 22]], 0.99536642], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2039, 3, 17], [2039, 2, 26]], 'end before start'], ['normal control 2', [[2031, 11, 17], [2031, 11, 9]], 'end before start'], ['normal control 3', [[2009, 8, 3], [2009, 6, 30]], 'end before start']], [['regression average year basis 1', [[2018, 9, 1], [2019, 9, 29]], 1.076712329], ['regression average year basis 2', [[2094, 2, 28], [2094, 6, 7]], 0.271232877], ['partial repair probe 1', [[1935, 10, 31], [1936, 4, 13]], 0.451283779], ['partial repair probe 2', [[2083, 5, 15], [2084, 6, 1]], 1.048177259], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1908, 12, 13], [1908, 12, 12]], 'end before start'], ['normal control 2', [[1900, 4, 24], [1900, 4, 13]], 'end before start'], ['normal control 3', [[1994, 7, 29], [1994, 7, 14]], 'end before start']], [['regression average year basis 1', [[2058, 8, 14], [2064, 8, 8]], 5.98465454], ['regression average year basis 2', [[1980, 7, 11], [1983, 5, 22]], 2.861711206], ['partial repair probe 1', [[2088, 5, 30], [2088, 6, 2]], 0.008196721], ['partial repair probe 2', [[2027, 1, 9], [2032, 10, 24]], 5.789557602], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2043, 5, 31], [2043, 4, 25]], 'end before start'], ['normal control 2', [[1960, 8, 1], [1960, 6, 27]], 'end before start'], ['normal control 3', [[2078, 1, 31], [2078, 1, 7]], 'end before start']]]
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 fixtureActualExpectedOutcome
regression average year basis 13.7377049183.745474961Failed
regression average year basis 20.4904109590.490410959Passed
partial repair probe 13.9918032794.0Failed
boundary control 10.00.0Passed
normal control 1end before startend before startPassed
normal control 2end before startend before startPassed
normal control 3end before startend before startPassed
normal control 4end before startend before startPassed

SHA-256 / eb5d456b920d376fa1ac5c8c73c5b04c602b2caec119b2d94904bb5ed4f40296

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 average year basis 1', [[2033, 2, 27], [2036, 11, 26]], 3.745474961], ['regression average year basis 2', [[1897, 9, 30], [1898, 3, 28]], 0.490410959], ['partial repair probe 1', [[2079, 11, 3], [2083, 11, 3]], 4.0], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2059, 8, 30], [2059, 7, 23]], 'end before start'], ['normal control 2', [[2099, 12, 16], [2099, 11, 17]], 'end before start'], ['normal control 3', [[2103, 6, 16], [2103, 5, 8]], 'end before start'], ['normal control 4', [[1990, 7, 22], [1990, 7, 4]], 'end before start']], [['regression average year basis 1', [[2041, 1, 23], [2041, 8, 10]], 0.545205479], ['regression average year basis 2', [[1989, 1, 11], [1992, 10, 16]], 3.762220226], ['partial repair probe 1', [[2086, 2, 28], [2090, 1, 22]], 3.898630137], ['partial repair probe 2', [[2028, 12, 24], [2029, 10, 5]], 0.780762033], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2041, 6, 30], [2041, 5, 29]], 'end before start'], ['normal control 2', [[1944, 6, 15], [1944, 5, 27]], 'end before start'], ['normal control 3', [[2087, 4, 19], [2087, 4, 4]], 'end before start']], [['regression average year basis 1', [[2045, 7, 24], [2046, 1, 10]], 0.465753425], ['regression average year basis 2', [[2104, 1, 17], [2104, 7, 25]], 0.519125683], ['partial repair probe 1', [[2096, 12, 31], [2099, 2, 8]], 2.106841829], ['partial repair probe 2', [[1936, 4, 23], [1937, 4, 22]], 0.99536642], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2039, 3, 17], [2039, 2, 26]], 'end before start'], ['normal control 2', [[2031, 11, 17], [2031, 11, 9]], 'end before start'], ['normal control 3', [[2009, 8, 3], [2009, 6, 30]], 'end before start']], [['regression average year basis 1', [[2018, 9, 1], [2019, 9, 29]], 1.076712329], ['regression average year basis 2', [[2094, 2, 28], [2094, 6, 7]], 0.271232877], ['partial repair probe 1', [[1935, 10, 31], [1936, 4, 13]], 0.451283779], ['partial repair probe 2', [[2083, 5, 15], [2084, 6, 1]], 1.048177259], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1908, 12, 13], [1908, 12, 12]], 'end before start'], ['normal control 2', [[1900, 4, 24], [1900, 4, 13]], 'end before start'], ['normal control 3', [[1994, 7, 29], [1994, 7, 14]], 'end before start']], [['regression average year basis 1', [[2058, 8, 14], [2064, 8, 8]], 5.98465454], ['regression average year basis 2', [[1980, 7, 11], [1983, 5, 22]], 2.861711206], ['partial repair probe 1', [[2088, 5, 30], [2088, 6, 2]], 0.008196721], ['partial repair probe 2', [[2027, 1, 9], [2032, 10, 24]], 5.789557602], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[2043, 5, 31], [2043, 4, 25]], 'end before start'], ['normal control 2', [[1960, 8, 1], [1960, 6, 27]], 'end before start'], ['normal control 3', [[2078, 1, 31], [2078, 1, 7]], 'end before start']]]
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 fixtureActualExpectedOutcome
regression average year basis 13.7454749613.745474961Passed
regression average year basis 20.4904109590.490410959Passed
partial repair probe 14.04.0Passed
boundary control 10.00.0Passed
normal control 1end before startend before startPassed
normal control 2end before startend before startPassed
normal control 3end before startend before startPassed
normal control 4end before startend before startPassed

SHA-256 / 782187da114c36bf64d2140adcf1cd6a6f6bb9dd856eff91293a9f75f45ba976

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.250039+00:00.

Case digest / 860770f6cb88f955db6f13f1e04c93012369c446ac4da59eb78bc8edc0d4ed80