FAILURE MAP
← Case archive

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

Act/Act ISDA year fraction: only the first year is split out and the remainder uses the end year basis · case 01

Multi-year spans ignore the leap status of middle years.

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

ROOT CAUSE

The loop was simplified to a first-year piece plus one remainder piece.

THE FAILURE

The loop was simplified to a first-year piece plus one remainder piece.

Unsuccessful approach: Splitting off the last year too still lumps the middle years together.

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
    if cur < B:
        nxt = min(B, datetime.date(cur.year + 1, 1, 1))
        total += Fraction((nxt - cur).days, 366 if leap(cur.year) else 365)
        total += Fraction((B - nxt).days, 366 if leap(B.year) 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 two piece split 1', [[1900, 11, 16], [1906, 7, 12]], 5.652054795], ['regression two piece split 2', [[2067, 10, 30], [2073, 10, 12]], 5.950684932], ['partial repair probe 1', [[2006, 1, 20], [2009, 12, 4]], 3.871232877], ['partial repair probe 2', [[2026, 5, 1], [2030, 9, 4]], 4.345205479], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['normal control 1', [[2032, 9, 29], [2032, 11, 13]], 0.12295082], ['normal control 2', [[1958, 3, 20], [1958, 9, 16]], 0.493150685]], [['regression two piece split 1', [[2064, 2, 20], [2069, 2, 24]], 5.011333184], ['regression two piece split 2', [[1903, 8, 31], [1909, 7, 11]], 5.860273973], ['partial repair probe 1', [[1961, 6, 22], [1965, 4, 25]], 3.84109589], ['partial repair probe 2', [[2083, 8, 31], [2085, 1, 31]], 1.419178082], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[2072, 5, 2], [2072, 6, 27]], 0.153005464], ['normal control 2', [[1900, 6, 5], [1901, 5, 18]], 0.950684932]], [['regression two piece split 1', [[2033, 11, 30], [2038, 6, 7]], 4.517808219], ['regression two piece split 2', [[2086, 8, 22], [2091, 12, 28]], 5.350684932], ['partial repair probe 1', [[2089, 6, 8], [2093, 7, 27]], 4.134246575], ['partial repair probe 2', [[1927, 12, 5], [1932, 3, 1]], 4.237907029], ['boundary control 1', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1927, 8, 31], [1927, 10, 12]], 0.115068493], ['normal control 2', [[2019, 3, 6], [2020, 1, 4]], 0.832854256]], [['regression two piece split 1', [[1991, 1, 7], [1994, 7, 16]], 3.520547945], ['regression two piece split 2', [[2027, 10, 26], [2032, 3, 4]], 4.355692791], ['partial repair probe 1', [[1901, 12, 13], [1907, 11, 6]], 5.898630137], ['partial repair probe 2', [[1941, 4, 30], [1945, 5, 25]], 4.068493151], ['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', [[2043, 3, 4], [2043, 12, 25]], 0.810958904], ['normal control 2', [[2073, 9, 14], [2074, 2, 11]], 0.410958904]], [['regression two piece split 1', [[1912, 10, 16], [1917, 2, 2]], 4.298053747], ['regression two piece split 2', [[2077, 3, 22], [2081, 7, 11]], 4.304109589], ['partial repair probe 1', [[1982, 10, 31], [1985, 12, 16]], 3.126027397], ['partial repair probe 2', [[2101, 5, 31], [2106, 10, 18]], 5.383561644], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['normal control 1', [[1955, 11, 18], [1955, 10, 22]], 'end before start'], ['normal control 2', [[2068, 3, 1], [2070, 1, 8]], 1.855243656]]]
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 two piece split 15.6547945215.652054795Failed
regression two piece split 25.9561643845.950684932Failed
partial repair probe 13.8739726033.871232877Failed
partial repair probe 24.3479452054.345205479Failed
boundary control 11.01.0Passed
boundary control 21.0013773491.001377349Passed
normal control 10.122950820.12295082Passed
normal control 20.4931506850.493150685Passed

SHA-256 / ade506f7b4206e5a36cb089fa0650bf700f56f23559d9ea1dbab409aed3505bd

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
    if cur < B:
        nxt = min(B, datetime.date(cur.year + 1, 1, 1))
        last = max(nxt, datetime.date(B.year, 1, 1))
        total += Fraction((nxt - cur).days, 366 if leap(cur.year) else 365)
        total += Fraction((last - nxt).days, 365)
        total += Fraction((B - last).days, 366 if leap(B.year) 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 two piece split 1', [[1900, 11, 16], [1906, 7, 12]], 5.652054795], ['regression two piece split 2', [[2067, 10, 30], [2073, 10, 12]], 5.950684932], ['partial repair probe 1', [[2006, 1, 20], [2009, 12, 4]], 3.871232877], ['partial repair probe 2', [[2026, 5, 1], [2030, 9, 4]], 4.345205479], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['normal control 1', [[2032, 9, 29], [2032, 11, 13]], 0.12295082], ['normal control 2', [[1958, 3, 20], [1958, 9, 16]], 0.493150685]], [['regression two piece split 1', [[2064, 2, 20], [2069, 2, 24]], 5.011333184], ['regression two piece split 2', [[1903, 8, 31], [1909, 7, 11]], 5.860273973], ['partial repair probe 1', [[1961, 6, 22], [1965, 4, 25]], 3.84109589], ['partial repair probe 2', [[2083, 8, 31], [2085, 1, 31]], 1.419178082], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['normal control 1', [[2072, 5, 2], [2072, 6, 27]], 0.153005464], ['normal control 2', [[1900, 6, 5], [1901, 5, 18]], 0.950684932]], [['regression two piece split 1', [[2033, 11, 30], [2038, 6, 7]], 4.517808219], ['regression two piece split 2', [[2086, 8, 22], [2091, 12, 28]], 5.350684932], ['partial repair probe 1', [[2089, 6, 8], [2093, 7, 27]], 4.134246575], ['partial repair probe 2', [[1927, 12, 5], [1932, 3, 1]], 4.237907029], ['boundary control 1', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['boundary control 2', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['normal control 1', [[1927, 8, 31], [1927, 10, 12]], 0.115068493], ['normal control 2', [[2019, 3, 6], [2020, 1, 4]], 0.832854256]], [['regression two piece split 1', [[1991, 1, 7], [1994, 7, 16]], 3.520547945], ['regression two piece split 2', [[2027, 10, 26], [2032, 3, 4]], 4.355692791], ['partial repair probe 1', [[1901, 12, 13], [1907, 11, 6]], 5.898630137], ['partial repair probe 2', [[1941, 4, 30], [1945, 5, 25]], 4.068493151], ['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', [[2043, 3, 4], [2043, 12, 25]], 0.810958904], ['normal control 2', [[2073, 9, 14], [2074, 2, 11]], 0.410958904]], [['regression two piece split 1', [[1912, 10, 16], [1917, 2, 2]], 4.298053747], ['regression two piece split 2', [[2077, 3, 22], [2081, 7, 11]], 4.304109589], ['partial repair probe 1', [[1982, 10, 31], [1985, 12, 16]], 3.126027397], ['partial repair probe 2', [[2101, 5, 31], [2106, 10, 18]], 5.383561644], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2023, 7, 1], [2024, 7, 1]], 1.001377349], ['normal control 1', [[1955, 11, 18], [1955, 10, 22]], 'end before start'], ['normal control 2', [[2068, 3, 1], [2070, 1, 8]], 1.855243656]]]
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 two piece split 15.6547945215.652054795Failed
regression two piece split 25.9561643845.950684932Failed
partial repair probe 13.8739726033.871232877Failed
partial repair probe 24.3479452054.345205479Failed
boundary control 11.01.0Passed
boundary control 21.0013773491.001377349Passed
normal control 10.122950820.12295082Passed
normal control 20.4931506850.493150685Passed

SHA-256 / f4dc5e612ac815c554e2af07743adc869e8852dccc903cc20bb9feb2ac16931b

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

Case digest / 715366ee0de04cd1dfbfd16bf3dae3de0b7754e4d3248965ed2e7a8755a15ed3