FA-60911 / Bond day-count conventions / Open access
Act/Act ISDA year fraction: every calendar piece uses the start year basis · case 01
Spans crossing from a non-leap year into a leap year divide leap-year days by 365.
ROOT CAUSE
The denominator is chosen from the start year instead of the year of each piece.
VERIFIED REPAIR
Choose 366 or 365 separately for each calendar-year piece.
Unsuccessful approach: Using the end year basis for all pieces moves the error to the first piece.
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
while cur < B:
nxt = min(B, datetime.date(cur.year + 1, 1, 1))
total += Fraction((nxt - cur).days, 366 if leap(A.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 segment denominator year 1', [[1920, 8, 29], [1921, 12, 9]], 1.278516356], ['regression segment denominator year 2', [[2088, 10, 21], [2093, 8, 9]], 4.799461038], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[2098, 9, 14], [2099, 8, 15]], 0.917808219], ['normal control 2', [[2096, 2, 29], [2096, 6, 22]], 0.31147541]], [['regression segment denominator year 1', [[2049, 10, 8], [2054, 9, 16]], 4.939726027], ['regression segment denominator year 2', [[2091, 8, 29], [2093, 12, 24]], 2.320547945], ['partial repair probe 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[1898, 2, 10], [1899, 1, 16]], 0.931506849], ['normal control 2', [[1983, 9, 20], [1983, 10, 2]], 0.032876712]], [['regression segment denominator year 1', [[2104, 1, 11], [2109, 3, 18]], 5.180896774], ['regression segment denominator year 2', [[2023, 11, 30], [2026, 10, 31]], 2.917808219], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[1909, 5, 31], [1910, 7, 3]], 1.090410959], ['normal control 2', [[2054, 6, 11], [2054, 5, 11]], 'end before start']], [['regression segment denominator year 1', [[1913, 2, 14], [1916, 9, 4]], 3.554315443], ['regression segment denominator year 2', [[1911, 1, 28], [1916, 3, 20]], 5.141874392], ['partial repair probe 1', [[2023, 12, 30], [2024, 1, 1]], 0.005479452], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[2078, 8, 31], [2078, 7, 25]], 'end before start'], ['normal control 2', [[1941, 8, 21], [1942, 1, 26]], 0.432876712]], [['regression segment denominator year 1', [[2056, 7, 19], [2057, 5, 22]], 0.839853282], ['regression segment denominator year 2', [[1938, 2, 28], [1943, 7, 22]], 5.394520548], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2056, 2, 10], [2057, 1, 1]], 0.890710383], ['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', [[2090, 12, 9], [2091, 10, 25]], 0.876712329], ['normal control 2', [[2031, 7, 31], [2031, 10, 31]], 0.252054795]]]
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 segment denominator year 1 | 1.275956284 | 1.278516356 | Failed |
| regression segment denominator year 2 | 4.789617486 | 4.799461038 | Failed |
| partial repair probe 1 | 1.0 | 1.0 | Passed |
| partial repair probe 2 | 0.002739726 | 0.002739726 | Passed |
| boundary control 1 | 0.0 | 0.0 | Passed |
| boundary control 2 | 0.246575342 | 0.246575342 | Passed |
| normal control 1 | 0.917808219 | 0.917808219 | Passed |
| normal control 2 | 0.31147541 | 0.31147541 | Passed |
SHA-256 / ca666869288183eda84c957f24ef661ea674f936f74624b135113f1de93ef851
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
while cur < B:
nxt = min(B, datetime.date(cur.year + 1, 1, 1))
total += Fraction((nxt - cur).days, 366 if leap(B.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 segment denominator year 1', [[1920, 8, 29], [1921, 12, 9]], 1.278516356], ['regression segment denominator year 2', [[2088, 10, 21], [2093, 8, 9]], 4.799461038], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[2098, 9, 14], [2099, 8, 15]], 0.917808219], ['normal control 2', [[2096, 2, 29], [2096, 6, 22]], 0.31147541]], [['regression segment denominator year 1', [[2049, 10, 8], [2054, 9, 16]], 4.939726027], ['regression segment denominator year 2', [[2091, 8, 29], [2093, 12, 24]], 2.320547945], ['partial repair probe 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[1898, 2, 10], [1899, 1, 16]], 0.931506849], ['normal control 2', [[1983, 9, 20], [1983, 10, 2]], 0.032876712]], [['regression segment denominator year 1', [[2104, 1, 11], [2109, 3, 18]], 5.180896774], ['regression segment denominator year 2', [[2023, 11, 30], [2026, 10, 31]], 2.917808219], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[1909, 5, 31], [1910, 7, 3]], 1.090410959], ['normal control 2', [[2054, 6, 11], [2054, 5, 11]], 'end before start']], [['regression segment denominator year 1', [[1913, 2, 14], [1916, 9, 4]], 3.554315443], ['regression segment denominator year 2', [[1911, 1, 28], [1916, 3, 20]], 5.141874392], ['partial repair probe 1', [[2023, 12, 30], [2024, 1, 1]], 0.005479452], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[2078, 8, 31], [2078, 7, 25]], 'end before start'], ['normal control 2', [[1941, 8, 21], [1942, 1, 26]], 0.432876712]], [['regression segment denominator year 1', [[2056, 7, 19], [2057, 5, 22]], 0.839853282], ['regression segment denominator year 2', [[1938, 2, 28], [1943, 7, 22]], 5.394520548], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2056, 2, 10], [2057, 1, 1]], 0.890710383], ['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', [[2090, 12, 9], [2091, 10, 25]], 0.876712329], ['normal control 2', [[2031, 7, 31], [2031, 10, 31]], 0.252054795]]]
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 segment denominator year 1 | 1.279452055 | 1.278516356 | Failed |
| regression segment denominator year 2 | 4.802739726 | 4.799461038 | Failed |
| partial repair probe 1 | 1.002739726 | 1.0 | Failed |
| partial repair probe 2 | 0.00273224 | 0.002739726 | Failed |
| boundary control 1 | 0.0 | 0.0 | Passed |
| boundary control 2 | 0.246575342 | 0.246575342 | Passed |
| normal control 1 | 0.917808219 | 0.917808219 | Passed |
| normal control 2 | 0.31147541 | 0.31147541 | Passed |
SHA-256 / b27f0915d9598f0c9b61f4bdc8f6fb4c2b4473ce25c532921679809612ab4249
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 segment denominator year 1', [[1920, 8, 29], [1921, 12, 9]], 1.278516356], ['regression segment denominator year 2', [[2088, 10, 21], [2093, 8, 9]], 4.799461038], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[2098, 9, 14], [2099, 8, 15]], 0.917808219], ['normal control 2', [[2096, 2, 29], [2096, 6, 22]], 0.31147541]], [['regression segment denominator year 1', [[2049, 10, 8], [2054, 9, 16]], 4.939726027], ['regression segment denominator year 2', [[2091, 8, 29], [2093, 12, 24]], 2.320547945], ['partial repair probe 1', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[1898, 2, 10], [1899, 1, 16]], 0.931506849], ['normal control 2', [[1983, 9, 20], [1983, 10, 2]], 0.032876712]], [['regression segment denominator year 1', [[2104, 1, 11], [2109, 3, 18]], 5.180896774], ['regression segment denominator year 2', [[2023, 11, 30], [2026, 10, 31]], 2.917808219], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2023, 12, 31], [2024, 1, 1]], 0.002739726], ['boundary control 1', [[2024, 3, 1], [2024, 3, 1]], 0.0], ['boundary control 2', [[2099, 12, 1], [2100, 3, 1]], 0.246575342], ['normal control 1', [[1909, 5, 31], [1910, 7, 3]], 1.090410959], ['normal control 2', [[2054, 6, 11], [2054, 5, 11]], 'end before start']], [['regression segment denominator year 1', [[1913, 2, 14], [1916, 9, 4]], 3.554315443], ['regression segment denominator year 2', [[1911, 1, 28], [1916, 3, 20]], 5.141874392], ['partial repair probe 1', [[2023, 12, 30], [2024, 1, 1]], 0.005479452], ['partial repair probe 2', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['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', [[2078, 8, 31], [2078, 7, 25]], 'end before start'], ['normal control 2', [[1941, 8, 21], [1942, 1, 26]], 0.432876712]], [['regression segment denominator year 1', [[2056, 7, 19], [2057, 5, 22]], 0.839853282], ['regression segment denominator year 2', [[1938, 2, 28], [1943, 7, 22]], 5.394520548], ['partial repair probe 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['partial repair probe 2', [[2056, 2, 10], [2057, 1, 1]], 0.890710383], ['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', [[2090, 12, 9], [2091, 10, 25]], 0.876712329], ['normal control 2', [[2031, 7, 31], [2031, 10, 31]], 0.252054795]]]
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 segment denominator year 1 | 1.278516356 | 1.278516356 | Passed |
| regression segment denominator year 2 | 4.799461038 | 4.799461038 | Passed |
| partial repair probe 1 | 1.0 | 1.0 | Passed |
| partial repair probe 2 | 0.002739726 | 0.002739726 | Passed |
| boundary control 1 | 0.0 | 0.0 | Passed |
| boundary control 2 | 0.246575342 | 0.246575342 | Passed |
| normal control 1 | 0.917808219 | 0.917808219 | Passed |
| normal control 2 | 0.31147541 | 0.31147541 | Passed |
SHA-256 / 21bfed50aa3c60f14596cfbe34cc6b57be3519c985582b5004f318ed705875eb
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.990421+00:00.
Case digest / 9978245080d81978b5b844f66b97bf1fb92633f877e335b509daf99b2fbe3740