FA-61036 / Bond day-count conventions / Open access
NL/365 no-leap day count: at most one leap day is removed · case 01
Spans of more than four years are overstated by the extra leap days.
ROOT CAUSE
The leap-day adjustment is a yes/no flag instead of a count.
THE FAILURE
The leap-day adjustment is a yes/no flag instead of a count.
Unsuccessful approach: Counting only the start and end years ignores leap years in between.
Case contract
Inputs start and end [y,m,d]. If end < start return "end before start". Days are actual days minus the number of 29 February dates lying in (start, end]. Return [days, days/365 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
leapdays = 1 if any(leap(y) and A < datetime.date(y, 2, 29) <= B for y in range(A.year, B.year + 1)) else 0
days = (B - A).days - leapdays
return [days, round(days / 365, 9)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression multi-year leap count 1', [[2028, 1, 1], [2035, 3, 19]], [2632, 7.210958904]], ['regression multi-year leap count 2', [[2096, 2, 28], [2106, 10, 17]], [3881, 10.632876712]], ['partial repair probe 1', [[1999, 5, 21], [2003, 3, 20]], [1398, 3.830136986]], ['partial repair probe 2', [[2056, 10, 31], [2062, 8, 14]], [2112, 5.78630137]], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['boundary control 2', [[2024, 3, 1], [2024, 12, 31]], [305, 0.835616438]], ['normal control 1', [[2093, 5, 29], [2093, 9, 30]], [124, 0.339726027]], ['normal control 2', [[1904, 10, 23], [1905, 7, 21]], [271, 0.742465753]]], [['regression multi-year leap count 1', [[2053, 6, 28], [2064, 6, 5]], [3992, 10.936986301]], ['regression multi-year leap count 2', [[1959, 12, 30], [1964, 9, 16]], [1720, 4.712328767]], ['partial repair probe 1', [[1938, 2, 2], [1942, 6, 17]], [1595, 4.369863014]], ['partial repair probe 2', [[2102, 3, 21], [2106, 4, 21]], [1491, 4.084931507]], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['boundary control 2', [[2099, 1, 1], [2101, 1, 1]], [730, 2.0]], ['normal control 1', [[2095, 4, 29], [2095, 9, 2]], [126, 0.345205479]], ['normal control 2', [[2096, 1, 1], [2097, 12, 27]], [725, 1.98630137]]], [['regression multi-year leap count 1', [[2031, 4, 30], [2042, 4, 8]], [3993, 10.939726027]], ['regression multi-year leap count 2', [[2086, 8, 20], [2094, 3, 26]], [2773, 7.597260274]], ['partial repair probe 1', [[1978, 3, 20], [1983, 7, 7]], [1934, 5.298630137]], ['partial repair probe 2', [[2021, 1, 20], [2026, 2, 28]], [1864, 5.106849315]], ['boundary control 1', [[2024, 3, 1], [2024, 12, 31]], [305, 0.835616438]], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['normal control 1', [[2004, 1, 1], [2006, 5, 6]], [855, 2.342465753]], ['normal control 2', [[2061, 4, 26], [2061, 9, 24]], [151, 0.41369863]]], [['regression multi-year leap count 1', [[2016, 6, 29], [2024, 8, 6]], [2958, 8.104109589]], ['regression multi-year leap count 2', [[1995, 1, 29], [2001, 6, 8]], [2320, 6.356164384]], ['partial repair probe 1', [[2094, 10, 26], [2097, 2, 28]], [855, 2.342465753]], ['partial repair probe 2', [[2089, 3, 24], [2095, 12, 22]], [2463, 6.747945205]], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['boundary control 2', [[2020, 1, 1], [2020, 1, 1]], [0, 0.0]], ['normal control 1', [[2074, 2, 4], [2075, 2, 4]], [365, 1.0]], ['normal control 2', [[2076, 5, 16], [2076, 7, 27]], [72, 0.197260274]]], [['regression multi-year leap count 1', [[2011, 9, 13], [2020, 2, 16]], [3076, 8.42739726]], ['regression multi-year leap count 2', [[2037, 2, 6], [2047, 6, 19]], [3783, 10.364383562]], ['partial repair probe 1', [[2036, 10, 17], [2042, 2, 13]], [1944, 5.326027397]], ['partial repair probe 2', [[2013, 11, 1], [2019, 12, 24]], [2243, 6.145205479]], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['normal control 1', [[2000, 3, 15], [2004, 6, 27]], [1564, 4.284931507]], ['normal control 2', [[2024, 1, 1], [2024, 9, 26]], [268, 0.734246575]]]]
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 multi-year leap count 1 | [2633, 7.21369863] | [2632, 7.210958904] | Failed |
| regression multi-year leap count 2 | [3882, 10.635616438] | [3881, 10.632876712] | Failed |
| partial repair probe 1 | [1398, 3.830136986] | [1398, 3.830136986] | Passed |
| partial repair probe 2 | [2112, 5.78630137] | [2112, 5.78630137] | Passed |
| boundary control 1 | [365, 1.0] | [365, 1.0] | Passed |
| boundary control 2 | [305, 0.835616438] | [305, 0.835616438] | Passed |
| normal control 1 | [124, 0.339726027] | [124, 0.339726027] | Passed |
| normal control 2 | [271, 0.742465753] | [271, 0.742465753] | Passed |
SHA-256 / 543c1c8e90663e5530d9b106ad92bfc19f9968d5d5ae35a67e552c91efb94582
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
leapdays = sum(1 for y in {A.year, B.year} if leap(y) and A < datetime.date(y, 2, 29) <= B)
days = (B - A).days - leapdays
return [days, round(days / 365, 9)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression multi-year leap count 1', [[2028, 1, 1], [2035, 3, 19]], [2632, 7.210958904]], ['regression multi-year leap count 2', [[2096, 2, 28], [2106, 10, 17]], [3881, 10.632876712]], ['partial repair probe 1', [[1999, 5, 21], [2003, 3, 20]], [1398, 3.830136986]], ['partial repair probe 2', [[2056, 10, 31], [2062, 8, 14]], [2112, 5.78630137]], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['boundary control 2', [[2024, 3, 1], [2024, 12, 31]], [305, 0.835616438]], ['normal control 1', [[2093, 5, 29], [2093, 9, 30]], [124, 0.339726027]], ['normal control 2', [[1904, 10, 23], [1905, 7, 21]], [271, 0.742465753]]], [['regression multi-year leap count 1', [[2053, 6, 28], [2064, 6, 5]], [3992, 10.936986301]], ['regression multi-year leap count 2', [[1959, 12, 30], [1964, 9, 16]], [1720, 4.712328767]], ['partial repair probe 1', [[1938, 2, 2], [1942, 6, 17]], [1595, 4.369863014]], ['partial repair probe 2', [[2102, 3, 21], [2106, 4, 21]], [1491, 4.084931507]], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['boundary control 2', [[2099, 1, 1], [2101, 1, 1]], [730, 2.0]], ['normal control 1', [[2095, 4, 29], [2095, 9, 2]], [126, 0.345205479]], ['normal control 2', [[2096, 1, 1], [2097, 12, 27]], [725, 1.98630137]]], [['regression multi-year leap count 1', [[2031, 4, 30], [2042, 4, 8]], [3993, 10.939726027]], ['regression multi-year leap count 2', [[2086, 8, 20], [2094, 3, 26]], [2773, 7.597260274]], ['partial repair probe 1', [[1978, 3, 20], [1983, 7, 7]], [1934, 5.298630137]], ['partial repair probe 2', [[2021, 1, 20], [2026, 2, 28]], [1864, 5.106849315]], ['boundary control 1', [[2024, 3, 1], [2024, 12, 31]], [305, 0.835616438]], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['normal control 1', [[2004, 1, 1], [2006, 5, 6]], [855, 2.342465753]], ['normal control 2', [[2061, 4, 26], [2061, 9, 24]], [151, 0.41369863]]], [['regression multi-year leap count 1', [[2016, 6, 29], [2024, 8, 6]], [2958, 8.104109589]], ['regression multi-year leap count 2', [[1995, 1, 29], [2001, 6, 8]], [2320, 6.356164384]], ['partial repair probe 1', [[2094, 10, 26], [2097, 2, 28]], [855, 2.342465753]], ['partial repair probe 2', [[2089, 3, 24], [2095, 12, 22]], [2463, 6.747945205]], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['boundary control 2', [[2020, 1, 1], [2020, 1, 1]], [0, 0.0]], ['normal control 1', [[2074, 2, 4], [2075, 2, 4]], [365, 1.0]], ['normal control 2', [[2076, 5, 16], [2076, 7, 27]], [72, 0.197260274]]], [['regression multi-year leap count 1', [[2011, 9, 13], [2020, 2, 16]], [3076, 8.42739726]], ['regression multi-year leap count 2', [[2037, 2, 6], [2047, 6, 19]], [3783, 10.364383562]], ['partial repair probe 1', [[2036, 10, 17], [2042, 2, 13]], [1944, 5.326027397]], ['partial repair probe 2', [[2013, 11, 1], [2019, 12, 24]], [2243, 6.145205479]], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], [365, 1.0]], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], [365, 1.0]], ['normal control 1', [[2000, 3, 15], [2004, 6, 27]], [1564, 4.284931507]], ['normal control 2', [[2024, 1, 1], [2024, 9, 26]], [268, 0.734246575]]]]
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 multi-year leap count 1 | [2633, 7.21369863] | [2632, 7.210958904] | Failed |
| regression multi-year leap count 2 | [3882, 10.635616438] | [3881, 10.632876712] | Failed |
| partial repair probe 1 | [1399, 3.832876712] | [1398, 3.830136986] | Failed |
| partial repair probe 2 | [2113, 5.789041096] | [2112, 5.78630137] | Failed |
| boundary control 1 | [365, 1.0] | [365, 1.0] | Passed |
| boundary control 2 | [305, 0.835616438] | [305, 0.835616438] | Passed |
| normal control 1 | [124, 0.339726027] | [124, 0.339726027] | Passed |
| normal control 2 | [271, 0.742465753] | [271, 0.742465753] | Passed |
SHA-256 / ea861e44c92e800d1aa6e35ca970532fabfd64dda06767ea0787859a8ceac94b
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:51.391171+00:00.
Case digest / d4803d090ba57a520226f20d4853b4b814896a801728afbbba5b74c3c5e38ac3