FAILURE MAP
← Case archive

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

Act/365L denominator selection: annual periods use the end year leap status · case 01

An annual period ending in March of a leap year from March of the prior year is priced on 365 days.

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

ROOT CAUSE

The annual branch reuses the sub-annual end-year rule instead of looking for a contained 29 February.

VERIFIED REPAIR

For annual frequency test whether a 29 February lies inside the period.

Unsuccessful approach: Checking that the end is on or after 29 February of a leap end year misses leap days in the start year.

Case contract

Inputs start, end ([y,m,d]) and coupon frequency. Days are actual days. For annual frequency the denominator is 366 if any 29 February lies in (start, end], else 365. For other frequencies the denominator is 366 if the end date year is a leap year, else 365. Return days/denominator 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, freq):
    A = datetime.date(*a)
    B = datetime.date(*b)
    def leap(y):
        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
    days = (B - A).days
    if freq == 1:
        has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= B for y in range(A.year, B.year + 1))
        den = 366 if leap(B.year) else 365
    else:
        den = 366 if leap(B.year) else 365
    return round(days / den, 9)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression annual leap-day test 1', [[2095, 2, 28], [2098, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1967, 6, 7], [1970, 6, 7], 1], 2.994535519], ['partial repair probe 1', [[1995, 12, 1], [1998, 12, 1], 1], 2.994535519], ['partial repair probe 2', [[2026, 3, 31], [2029, 3, 31], 1], 2.994535519], ['boundary control 1', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['normal control 1', [[2084, 12, 5], [2086, 2, 11], 1], 1.18630137], ['normal control 2', [[2058, 8, 8], [2060, 8, 8], 1], 1.99726776]], [['regression annual leap-day test 1', [[1943, 2, 28], [1946, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[2027, 1, 28], [2028, 1, 28], 1], 1.0], ['partial repair probe 1', [[2004, 2, 1], [2005, 2, 1], 1], 1.0], ['partial repair probe 2', [[2104, 2, 28], [2105, 2, 28], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1898, 3, 30], [1899, 3, 16], 4], 0.961643836], ['normal control 2', [[2096, 1, 15], [2096, 8, 25], 2], 0.609289617]], [['regression annual leap-day test 1', [[1995, 8, 19], [1997, 8, 19], 1], 1.99726776], ['regression annual leap-day test 2', [[2050, 11, 30], [2053, 11, 30], 1], 2.994535519], ['partial repair probe 1', [[2103, 12, 1], [2105, 12, 1], 1], 1.99726776], ['partial repair probe 2', [[2028, 2, 28], [2030, 2, 28], 1], 1.99726776], ['boundary control 1', [[2024, 11, 15], [2025, 2, 15], 4], 0.252054795], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2004, 1, 28], [2004, 7, 28], 2], 0.49726776], ['normal control 2', [[1996, 2, 28], [1996, 8, 28], 4], 0.49726776]], [['regression annual leap-day test 1', [[2023, 2, 28], [2026, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1951, 1, 25], [1952, 1, 25], 1], 1.0], ['partial repair probe 1', [[1999, 12, 28], [2002, 12, 28], 1], 2.994535519], ['partial repair probe 2', [[2104, 1, 28], [2106, 1, 28], 1], 1.99726776], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2005, 3, 28], [2005, 9, 28], 2], 0.504109589], ['normal control 2', [[2038, 4, 30], [2038, 7, 30], 4], 0.249315068]], [['regression annual leap-day test 1', [[2000, 1, 29], [2002, 1, 29], 1], 1.99726776], ['regression annual leap-day test 2', [[1995, 1, 15], [1998, 1, 15], 1], 2.994535519], ['partial repair probe 1', [[2095, 6, 18], [2098, 6, 18], 1], 2.994535519], ['partial repair probe 2', [[2028, 1, 15], [2029, 1, 15], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1964, 11, 30], [1966, 3, 30], 4], 1.328767123], ['normal control 2', [[1967, 2, 28], [1967, 8, 28], 2], 0.495890411]]]
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 annual leap-day test 13.0027397262.994535519Failed
regression annual leap-day test 23.0027397262.994535519Failed
partial repair probe 13.0027397262.994535519Failed
partial repair probe 23.0027397262.994535519Failed
boundary control 11.01.0Passed
boundary control 21.01.0Passed
normal control 11.186301371.18630137Passed
normal control 21.997267761.99726776Passed

SHA-256 / 1cc73a9e86ed4c802f8df146f16d7bfcc6f69fd70dd884bf778e2cd7bf08909b

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, freq):
    A = datetime.date(*a)
    B = datetime.date(*b)
    def leap(y):
        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
    days = (B - A).days
    if freq == 1:
        has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= B for y in range(A.year, B.year + 1))
        den = 366 if leap(B.year) and B >= datetime.date(B.year, 2, 29) else 365
    else:
        den = 366 if leap(B.year) else 365
    return round(days / den, 9)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression annual leap-day test 1', [[2095, 2, 28], [2098, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1967, 6, 7], [1970, 6, 7], 1], 2.994535519], ['partial repair probe 1', [[1995, 12, 1], [1998, 12, 1], 1], 2.994535519], ['partial repair probe 2', [[2026, 3, 31], [2029, 3, 31], 1], 2.994535519], ['boundary control 1', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['normal control 1', [[2084, 12, 5], [2086, 2, 11], 1], 1.18630137], ['normal control 2', [[2058, 8, 8], [2060, 8, 8], 1], 1.99726776]], [['regression annual leap-day test 1', [[1943, 2, 28], [1946, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[2027, 1, 28], [2028, 1, 28], 1], 1.0], ['partial repair probe 1', [[2004, 2, 1], [2005, 2, 1], 1], 1.0], ['partial repair probe 2', [[2104, 2, 28], [2105, 2, 28], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1898, 3, 30], [1899, 3, 16], 4], 0.961643836], ['normal control 2', [[2096, 1, 15], [2096, 8, 25], 2], 0.609289617]], [['regression annual leap-day test 1', [[1995, 8, 19], [1997, 8, 19], 1], 1.99726776], ['regression annual leap-day test 2', [[2050, 11, 30], [2053, 11, 30], 1], 2.994535519], ['partial repair probe 1', [[2103, 12, 1], [2105, 12, 1], 1], 1.99726776], ['partial repair probe 2', [[2028, 2, 28], [2030, 2, 28], 1], 1.99726776], ['boundary control 1', [[2024, 11, 15], [2025, 2, 15], 4], 0.252054795], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2004, 1, 28], [2004, 7, 28], 2], 0.49726776], ['normal control 2', [[1996, 2, 28], [1996, 8, 28], 4], 0.49726776]], [['regression annual leap-day test 1', [[2023, 2, 28], [2026, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1951, 1, 25], [1952, 1, 25], 1], 1.0], ['partial repair probe 1', [[1999, 12, 28], [2002, 12, 28], 1], 2.994535519], ['partial repair probe 2', [[2104, 1, 28], [2106, 1, 28], 1], 1.99726776], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2005, 3, 28], [2005, 9, 28], 2], 0.504109589], ['normal control 2', [[2038, 4, 30], [2038, 7, 30], 4], 0.249315068]], [['regression annual leap-day test 1', [[2000, 1, 29], [2002, 1, 29], 1], 1.99726776], ['regression annual leap-day test 2', [[1995, 1, 15], [1998, 1, 15], 1], 2.994535519], ['partial repair probe 1', [[2095, 6, 18], [2098, 6, 18], 1], 2.994535519], ['partial repair probe 2', [[2028, 1, 15], [2029, 1, 15], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1964, 11, 30], [1966, 3, 30], 4], 1.328767123], ['normal control 2', [[1967, 2, 28], [1967, 8, 28], 2], 0.495890411]]]
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 annual leap-day test 13.0027397262.994535519Failed
regression annual leap-day test 23.0027397262.994535519Failed
partial repair probe 13.0027397262.994535519Failed
partial repair probe 23.0027397262.994535519Failed
boundary control 11.01.0Passed
boundary control 21.01.0Passed
normal control 11.186301371.18630137Passed
normal control 21.997267761.99726776Passed

SHA-256 / 123fcc41cc82526d89a9d2eaaf809d75ebd05b907f2a52869e9c05ce1eb10730

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, freq):
    A = datetime.date(*a)
    B = datetime.date(*b)
    def leap(y):
        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
    days = (B - A).days
    if freq == 1:
        has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= B for y in range(A.year, B.year + 1))
        den = 366 if has29 else 365
    else:
        den = 366 if leap(B.year) else 365
    return round(days / den, 9)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression annual leap-day test 1', [[2095, 2, 28], [2098, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1967, 6, 7], [1970, 6, 7], 1], 2.994535519], ['partial repair probe 1', [[1995, 12, 1], [1998, 12, 1], 1], 2.994535519], ['partial repair probe 2', [[2026, 3, 31], [2029, 3, 31], 1], 2.994535519], ['boundary control 1', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['normal control 1', [[2084, 12, 5], [2086, 2, 11], 1], 1.18630137], ['normal control 2', [[2058, 8, 8], [2060, 8, 8], 1], 1.99726776]], [['regression annual leap-day test 1', [[1943, 2, 28], [1946, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[2027, 1, 28], [2028, 1, 28], 1], 1.0], ['partial repair probe 1', [[2004, 2, 1], [2005, 2, 1], 1], 1.0], ['partial repair probe 2', [[2104, 2, 28], [2105, 2, 28], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1898, 3, 30], [1899, 3, 16], 4], 0.961643836], ['normal control 2', [[2096, 1, 15], [2096, 8, 25], 2], 0.609289617]], [['regression annual leap-day test 1', [[1995, 8, 19], [1997, 8, 19], 1], 1.99726776], ['regression annual leap-day test 2', [[2050, 11, 30], [2053, 11, 30], 1], 2.994535519], ['partial repair probe 1', [[2103, 12, 1], [2105, 12, 1], 1], 1.99726776], ['partial repair probe 2', [[2028, 2, 28], [2030, 2, 28], 1], 1.99726776], ['boundary control 1', [[2024, 11, 15], [2025, 2, 15], 4], 0.252054795], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2004, 1, 28], [2004, 7, 28], 2], 0.49726776], ['normal control 2', [[1996, 2, 28], [1996, 8, 28], 4], 0.49726776]], [['regression annual leap-day test 1', [[2023, 2, 28], [2026, 2, 28], 1], 2.994535519], ['regression annual leap-day test 2', [[1951, 1, 25], [1952, 1, 25], 1], 1.0], ['partial repair probe 1', [[1999, 12, 28], [2002, 12, 28], 1], 2.994535519], ['partial repair probe 2', [[2104, 1, 28], [2106, 1, 28], 1], 1.99726776], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 3, 1], [2024, 3, 1], 1], 1.0], ['normal control 1', [[2005, 3, 28], [2005, 9, 28], 2], 0.504109589], ['normal control 2', [[2038, 4, 30], [2038, 7, 30], 4], 0.249315068]], [['regression annual leap-day test 1', [[2000, 1, 29], [2002, 1, 29], 1], 1.99726776], ['regression annual leap-day test 2', [[1995, 1, 15], [1998, 1, 15], 1], 2.994535519], ['partial repair probe 1', [[2095, 6, 18], [2098, 6, 18], 1], 2.994535519], ['partial repair probe 2', [[2028, 1, 15], [2029, 1, 15], 1], 1.0], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28], 1], 1.0], ['boundary control 2', [[2023, 12, 15], [2024, 3, 15], 4], 0.24863388], ['normal control 1', [[1964, 11, 30], [1966, 3, 30], 4], 1.328767123], ['normal control 2', [[1967, 2, 28], [1967, 8, 28], 2], 0.495890411]]]
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 annual leap-day test 12.9945355192.994535519Passed
regression annual leap-day test 22.9945355192.994535519Passed
partial repair probe 12.9945355192.994535519Passed
partial repair probe 22.9945355192.994535519Passed
boundary control 11.01.0Passed
boundary control 21.01.0Passed
normal control 11.186301371.18630137Passed
normal control 21.997267761.99726776Passed

SHA-256 / 8af02bd3e5add6180dc8a32dfa903bfa222464d6ca9f705dd7d7918fb2068341

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

Case digest / 4aff758bc155c86b716c469c7bd85239b388d384114f155fe0f0c497d5ea3e6a