FA-61146 / Bond day-count conventions / Open access
Business/252 day count with daily compounding factor: business days are counted in (start, end] · case 01
Periods starting on a Friday and ending on a Monday count the wrong business day.
ROOT CAUSE
The loop skips the start date and includes the end date.
VERIFIED REPAIR
Count business days from start inclusive to end exclusive.
Unsuccessful approach: Including both ends adds a business day whenever the end is a business day.
Case contract
Inputs start and end [y,m,d], a holiday list (may contain weekend dates and duplicates) and an annual rate in percent. bd counts weekdays in [start, end) that are not holidays. Factor = (1 + rate/100)^(bd/252). Return [bd, factor rounded to 8 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
N = 1
observations = []
def solve(start, end, holidays, rate):
S = datetime.date(*start)
E = datetime.date(*end)
H = {datetime.date(*h) for h in holidays}
bd = 0
x = S + datetime.timedelta(days=1)
while x <= E:
if x.weekday() < 5 and x not in H:
bd += 1
x += datetime.timedelta(days=1)
factor = (1 + rate / 100) ** (bd / 252)
return [bd, round(factor, 8)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression business day interval ends 1', [[2023, 2, 28], [2023, 9, 27], [[2023, 7, 8], [2023, 7, 8], [2023, 9, 14], [2023, 5, 21], [2023, 2, 28], [2023, 2, 28]], 2.0], [149, 1.01177751]], ['regression business day interval ends 2', [[2027, 4, 29], [2027, 5, 9], [[2027, 4, 24], [2027, 5, 13], [2027, 4, 26], [2027, 5, 6], [2027, 5, 14], [2027, 5, 12]], 10.75], [6, 1.00243403]], ['partial repair probe 1', [[2019, 11, 5], [2019, 12, 12], [[2019, 11, 30], [2019, 11, 9], [2019, 11, 9], [2019, 12, 5], [2019, 12, 16]], 10.75], [26, 1.01059035]], ['partial repair probe 2', [[2021, 3, 1], [2021, 12, 1], [[2021, 4, 12], [2021, 4, 9]], 6.5], [195, 1.04993735]], ['normal control 1', [[2020, 2, 29], [2020, 12, 6], [[2020, 9, 12], [2020, 5, 25], [2020, 8, 26]], 13.65], [198, 1.10576211]], ['normal control 2', [[2021, 9, 4], [2021, 10, 9], [[2021, 10, 13], [2021, 9, 5], [2021, 10, 8], [2021, 9, 9], [2021, 9, 28], [2021, 10, 3]], 10.75], [22, 1.0089538]], ['normal control 3', [[2019, 11, 30], [2020, 7, 11], [[2020, 5, 17]], 10.75], [160, 1.06697625]], ['normal control 4', [[2027, 7, 9], [2027, 7, 19], [[2027, 7, 9], [2027, 7, 19], [2027, 7, 9], [2027, 7, 12], [2027, 7, 12]], 2.0], [4, 1.00031438]]], [['regression business day interval ends 1', [[2023, 10, 8], [2024, 5, 10], [[2024, 5, 5], [2024, 4, 30], [2023, 12, 10], [2023, 12, 10], [2023, 12, 24], [2023, 12, 24], [2023, 12, 27]], 10.75], [152, 1.06352331]], ['regression business day interval ends 2', [[2030, 12, 7], [2030, 12, 11], [[2030, 12, 16], [2030, 12, 4], [2030, 12, 5], [2030, 12, 5], [2030, 12, 12], [2030, 12, 2], [2030, 12, 9]], 6.5], [1, 1.00024993]], ['partial repair probe 1', [[2021, 2, 23], [2021, 2, 26], [[2021, 3, 2], [2021, 3, 2], [2021, 2, 18], [2021, 3, 1], [2021, 3, 1]], 2.0], [3, 1.00023577]], ['partial repair probe 2', [[2027, 3, 2], [2027, 8, 24], [[2027, 8, 5], [2027, 8, 5], [2027, 3, 12], [2027, 8, 7], [2027, 3, 20]], 13.65], [123, 1.06444488]], ['normal control 1', [[2022, 6, 30], [2022, 7, 3], [[2022, 6, 25], [2022, 7, 4], [2022, 7, 8], [2022, 7, 8], [2022, 6, 30], [2022, 6, 27], [2022, 7, 8], [2022, 7, 8]], 13.65], [1, 1.00050788]], ['normal control 2', [[2027, 4, 3], [2028, 3, 11], [[2027, 6, 10]], 10.75], [244, 1.10391592]], ['normal control 3', [[2024, 5, 19], [2024, 5, 19], [], 13.65], [0, 1.0]], ['normal control 4', [[2020, 5, 17], [2020, 5, 17], [[2020, 5, 20], [2020, 5, 15], [2020, 5, 15], [2020, 5, 22]], 2.0], [0, 1.0]]], [['regression business day interval ends 1', [[2019, 12, 4], [2020, 8, 9], [[2020, 8, 2], [2020, 8, 2], [2020, 5, 22], [2020, 6, 15], [2020, 3, 1]], 13.65], [176, 1.09347889]], ['regression business day interval ends 2', [[2019, 8, 28], [2019, 12, 14], [[2019, 12, 13]], 6.5], [77, 1.01942863]], ['partial repair probe 1', [[2027, 12, 1], [2028, 4, 21], [[2028, 2, 18]], 2.0], [101, 1.00796835]], ['partial repair probe 2', [[2022, 7, 27], [2022, 8, 25], [[2022, 7, 29]], 2.0], [20, 1.00157287]], ['normal control 1', [[2019, 2, 24], [2019, 3, 22], [[2019, 3, 22]], 10.75], [19, 1.00772812]], ['normal control 2', [[2023, 3, 5], [2023, 3, 12], [[2023, 3, 12], [2023, 3, 3], [2023, 3, 13]], 10.75], [5, 1.00202795]], ['normal control 3', [[2018, 7, 28], [2019, 3, 31], [], 10.75], [175, 1.07348075]], ['normal control 4', [[2028, 1, 27], [2028, 1, 28], [[2028, 2, 2], [2028, 1, 31], [2028, 2, 2], [2028, 1, 28], [2028, 1, 27], [2028, 1, 27], [2028, 1, 23]], 10.75], [0, 1.0]]], [['regression business day interval ends 1', [[2025, 10, 21], [2026, 10, 25], [], 6.5], [264, 1.06819852]], ['regression business day interval ends 2', [[2018, 12, 31], [2019, 1, 6], [[2019, 1, 2], [2019, 1, 11], [2018, 12, 26], [2018, 12, 26], [2019, 1, 6], [2019, 1, 6], [2019, 1, 3], [2019, 1, 3]], 13.65], [3, 1.00152442]], ['partial repair probe 1', [[2024, 1, 29], [2024, 2, 22], [[2024, 2, 26], [2024, 2, 24], [2024, 2, 24], [2024, 2, 13]], 6.5], [17, 1.00425734]], ['partial repair probe 2', [[2020, 9, 1], [2021, 3, 19], [[2020, 10, 21], [2020, 10, 13], [2020, 12, 25], [2020, 12, 27], [2020, 11, 25], [2020, 10, 27]], 2.0], [138, 1.01090331]], ['normal control 1', [[2026, 6, 21], [2026, 6, 27], [[2026, 6, 26], [2026, 7, 1], [2026, 7, 1]], 13.65], [4, 1.00203307]], ['normal control 2', [[2024, 2, 28], [2024, 3, 3], [[2024, 2, 28], [2024, 3, 5], [2024, 3, 8], [2024, 2, 29]], 10.75], [1, 1.00040526]], ['normal control 3', [[2019, 3, 16], [2019, 11, 10], [[2019, 8, 8], [2019, 4, 7], [2019, 8, 8]], 2.0], [169, 1.01336891]], ['normal control 4', [[2030, 12, 29], [2031, 12, 28], [[2031, 9, 22], [2031, 11, 13], [2031, 7, 9], [2031, 11, 19]], 10.75], [256, 1.1092964]]], [['regression business day interval ends 1', [[2028, 5, 29], [2028, 11, 5], [], 6.5], [115, 1.02915543]], ['regression business day interval ends 2', [[2025, 2, 22], [2025, 12, 5], [[2025, 2, 19], [2025, 2, 19], [2025, 3, 2]], 6.5], [204, 1.05230143]], ['partial repair probe 1', [[2029, 7, 31], [2030, 6, 24], [[2029, 9, 6], [2029, 9, 6]], 10.75], [233, 1.09900675]], ['partial repair probe 2', [[2024, 12, 30], [2025, 5, 13], [[2025, 1, 24], [2025, 1, 10], [2025, 1, 19], [2025, 5, 15]], 10.75], [94, 1.03882147]], ['normal control 1', [[2030, 2, 24], [2031, 1, 4], [[2030, 10, 20], [2030, 9, 10], [2030, 12, 14], [2030, 3, 23], [2030, 2, 27], [2030, 12, 23]], 6.5], [222, 1.05704555]], ['normal control 2', [[2028, 11, 12], [2028, 11, 13], [[2028, 11, 7], [2028, 11, 7], [2028, 11, 9], [2028, 11, 13], [2028, 11, 14]], 10.75], [0, 1.0]], ['normal control 3', [[2026, 3, 29], [2027, 3, 21], [[2027, 1, 8], [2026, 5, 26], [2026, 4, 3], [2026, 5, 23], [2026, 5, 23], [2026, 9, 30], [2026, 3, 26], [2026, 3, 26]], 10.75], [251, 1.10705135]], ['normal control 4', [[2020, 12, 19], [2020, 12, 20], [[2020, 12, 18], [2020, 12, 18], [2020, 12, 23]], 10.75], [0, 1.0]]]]
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 business day interval ends 1 | [150, 1.01185702] | [149, 1.01177751] | Failed |
| regression business day interval ends 2 | [5, 1.00202795] | [6, 1.00243403] | Failed |
| partial repair probe 1 | [26, 1.01059035] | [26, 1.01059035] | Passed |
| partial repair probe 2 | [195, 1.04993735] | [195, 1.04993735] | Passed |
| normal control 1 | [198, 1.10576211] | [198, 1.10576211] | Passed |
| normal control 2 | [22, 1.0089538] | [22, 1.0089538] | Passed |
| normal control 3 | [160, 1.06697625] | [160, 1.06697625] | Passed |
| normal control 4 | [4, 1.00031438] | [4, 1.00031438] | Passed |
SHA-256 / 19ba1f19ee799e80b796bbb16b5b78509755983231cc904e6982213a08b9afc1
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(start, end, holidays, rate):
S = datetime.date(*start)
E = datetime.date(*end)
H = {datetime.date(*h) for h in holidays}
bd = 0
x = S
while x <= E:
if x.weekday() < 5 and x not in H:
bd += 1
x += datetime.timedelta(days=1)
factor = (1 + rate / 100) ** (bd / 252)
return [bd, round(factor, 8)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression business day interval ends 1', [[2023, 2, 28], [2023, 9, 27], [[2023, 7, 8], [2023, 7, 8], [2023, 9, 14], [2023, 5, 21], [2023, 2, 28], [2023, 2, 28]], 2.0], [149, 1.01177751]], ['regression business day interval ends 2', [[2027, 4, 29], [2027, 5, 9], [[2027, 4, 24], [2027, 5, 13], [2027, 4, 26], [2027, 5, 6], [2027, 5, 14], [2027, 5, 12]], 10.75], [6, 1.00243403]], ['partial repair probe 1', [[2019, 11, 5], [2019, 12, 12], [[2019, 11, 30], [2019, 11, 9], [2019, 11, 9], [2019, 12, 5], [2019, 12, 16]], 10.75], [26, 1.01059035]], ['partial repair probe 2', [[2021, 3, 1], [2021, 12, 1], [[2021, 4, 12], [2021, 4, 9]], 6.5], [195, 1.04993735]], ['normal control 1', [[2020, 2, 29], [2020, 12, 6], [[2020, 9, 12], [2020, 5, 25], [2020, 8, 26]], 13.65], [198, 1.10576211]], ['normal control 2', [[2021, 9, 4], [2021, 10, 9], [[2021, 10, 13], [2021, 9, 5], [2021, 10, 8], [2021, 9, 9], [2021, 9, 28], [2021, 10, 3]], 10.75], [22, 1.0089538]], ['normal control 3', [[2019, 11, 30], [2020, 7, 11], [[2020, 5, 17]], 10.75], [160, 1.06697625]], ['normal control 4', [[2027, 7, 9], [2027, 7, 19], [[2027, 7, 9], [2027, 7, 19], [2027, 7, 9], [2027, 7, 12], [2027, 7, 12]], 2.0], [4, 1.00031438]]], [['regression business day interval ends 1', [[2023, 10, 8], [2024, 5, 10], [[2024, 5, 5], [2024, 4, 30], [2023, 12, 10], [2023, 12, 10], [2023, 12, 24], [2023, 12, 24], [2023, 12, 27]], 10.75], [152, 1.06352331]], ['regression business day interval ends 2', [[2030, 12, 7], [2030, 12, 11], [[2030, 12, 16], [2030, 12, 4], [2030, 12, 5], [2030, 12, 5], [2030, 12, 12], [2030, 12, 2], [2030, 12, 9]], 6.5], [1, 1.00024993]], ['partial repair probe 1', [[2021, 2, 23], [2021, 2, 26], [[2021, 3, 2], [2021, 3, 2], [2021, 2, 18], [2021, 3, 1], [2021, 3, 1]], 2.0], [3, 1.00023577]], ['partial repair probe 2', [[2027, 3, 2], [2027, 8, 24], [[2027, 8, 5], [2027, 8, 5], [2027, 3, 12], [2027, 8, 7], [2027, 3, 20]], 13.65], [123, 1.06444488]], ['normal control 1', [[2022, 6, 30], [2022, 7, 3], [[2022, 6, 25], [2022, 7, 4], [2022, 7, 8], [2022, 7, 8], [2022, 6, 30], [2022, 6, 27], [2022, 7, 8], [2022, 7, 8]], 13.65], [1, 1.00050788]], ['normal control 2', [[2027, 4, 3], [2028, 3, 11], [[2027, 6, 10]], 10.75], [244, 1.10391592]], ['normal control 3', [[2024, 5, 19], [2024, 5, 19], [], 13.65], [0, 1.0]], ['normal control 4', [[2020, 5, 17], [2020, 5, 17], [[2020, 5, 20], [2020, 5, 15], [2020, 5, 15], [2020, 5, 22]], 2.0], [0, 1.0]]], [['regression business day interval ends 1', [[2019, 12, 4], [2020, 8, 9], [[2020, 8, 2], [2020, 8, 2], [2020, 5, 22], [2020, 6, 15], [2020, 3, 1]], 13.65], [176, 1.09347889]], ['regression business day interval ends 2', [[2019, 8, 28], [2019, 12, 14], [[2019, 12, 13]], 6.5], [77, 1.01942863]], ['partial repair probe 1', [[2027, 12, 1], [2028, 4, 21], [[2028, 2, 18]], 2.0], [101, 1.00796835]], ['partial repair probe 2', [[2022, 7, 27], [2022, 8, 25], [[2022, 7, 29]], 2.0], [20, 1.00157287]], ['normal control 1', [[2019, 2, 24], [2019, 3, 22], [[2019, 3, 22]], 10.75], [19, 1.00772812]], ['normal control 2', [[2023, 3, 5], [2023, 3, 12], [[2023, 3, 12], [2023, 3, 3], [2023, 3, 13]], 10.75], [5, 1.00202795]], ['normal control 3', [[2018, 7, 28], [2019, 3, 31], [], 10.75], [175, 1.07348075]], ['normal control 4', [[2028, 1, 27], [2028, 1, 28], [[2028, 2, 2], [2028, 1, 31], [2028, 2, 2], [2028, 1, 28], [2028, 1, 27], [2028, 1, 27], [2028, 1, 23]], 10.75], [0, 1.0]]], [['regression business day interval ends 1', [[2025, 10, 21], [2026, 10, 25], [], 6.5], [264, 1.06819852]], ['regression business day interval ends 2', [[2018, 12, 31], [2019, 1, 6], [[2019, 1, 2], [2019, 1, 11], [2018, 12, 26], [2018, 12, 26], [2019, 1, 6], [2019, 1, 6], [2019, 1, 3], [2019, 1, 3]], 13.65], [3, 1.00152442]], ['partial repair probe 1', [[2024, 1, 29], [2024, 2, 22], [[2024, 2, 26], [2024, 2, 24], [2024, 2, 24], [2024, 2, 13]], 6.5], [17, 1.00425734]], ['partial repair probe 2', [[2020, 9, 1], [2021, 3, 19], [[2020, 10, 21], [2020, 10, 13], [2020, 12, 25], [2020, 12, 27], [2020, 11, 25], [2020, 10, 27]], 2.0], [138, 1.01090331]], ['normal control 1', [[2026, 6, 21], [2026, 6, 27], [[2026, 6, 26], [2026, 7, 1], [2026, 7, 1]], 13.65], [4, 1.00203307]], ['normal control 2', [[2024, 2, 28], [2024, 3, 3], [[2024, 2, 28], [2024, 3, 5], [2024, 3, 8], [2024, 2, 29]], 10.75], [1, 1.00040526]], ['normal control 3', [[2019, 3, 16], [2019, 11, 10], [[2019, 8, 8], [2019, 4, 7], [2019, 8, 8]], 2.0], [169, 1.01336891]], ['normal control 4', [[2030, 12, 29], [2031, 12, 28], [[2031, 9, 22], [2031, 11, 13], [2031, 7, 9], [2031, 11, 19]], 10.75], [256, 1.1092964]]], [['regression business day interval ends 1', [[2028, 5, 29], [2028, 11, 5], [], 6.5], [115, 1.02915543]], ['regression business day interval ends 2', [[2025, 2, 22], [2025, 12, 5], [[2025, 2, 19], [2025, 2, 19], [2025, 3, 2]], 6.5], [204, 1.05230143]], ['partial repair probe 1', [[2029, 7, 31], [2030, 6, 24], [[2029, 9, 6], [2029, 9, 6]], 10.75], [233, 1.09900675]], ['partial repair probe 2', [[2024, 12, 30], [2025, 5, 13], [[2025, 1, 24], [2025, 1, 10], [2025, 1, 19], [2025, 5, 15]], 10.75], [94, 1.03882147]], ['normal control 1', [[2030, 2, 24], [2031, 1, 4], [[2030, 10, 20], [2030, 9, 10], [2030, 12, 14], [2030, 3, 23], [2030, 2, 27], [2030, 12, 23]], 6.5], [222, 1.05704555]], ['normal control 2', [[2028, 11, 12], [2028, 11, 13], [[2028, 11, 7], [2028, 11, 7], [2028, 11, 9], [2028, 11, 13], [2028, 11, 14]], 10.75], [0, 1.0]], ['normal control 3', [[2026, 3, 29], [2027, 3, 21], [[2027, 1, 8], [2026, 5, 26], [2026, 4, 3], [2026, 5, 23], [2026, 5, 23], [2026, 9, 30], [2026, 3, 26], [2026, 3, 26]], 10.75], [251, 1.10705135]], ['normal control 4', [[2020, 12, 19], [2020, 12, 20], [[2020, 12, 18], [2020, 12, 18], [2020, 12, 23]], 10.75], [0, 1.0]]]]
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 business day interval ends 1 | [150, 1.01185702] | [149, 1.01177751] | Failed |
| regression business day interval ends 2 | [6, 1.00243403] | [6, 1.00243403] | Passed |
| partial repair probe 1 | [27, 1.0109999] | [26, 1.01059035] | Failed |
| partial repair probe 2 | [196, 1.05019977] | [195, 1.04993735] | Failed |
| normal control 1 | [198, 1.10576211] | [198, 1.10576211] | Passed |
| normal control 2 | [22, 1.0089538] | [22, 1.0089538] | Passed |
| normal control 3 | [160, 1.06697625] | [160, 1.06697625] | Passed |
| normal control 4 | [4, 1.00031438] | [4, 1.00031438] | Passed |
SHA-256 / 09a6306de9befd18cc5792f7fcaa6c2c4277831e3bcf0575ae8095725068fff1
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(start, end, holidays, rate):
S = datetime.date(*start)
E = datetime.date(*end)
H = {datetime.date(*h) for h in holidays}
bd = 0
x = S
while x < E:
if x.weekday() < 5 and x not in H:
bd += 1
x += datetime.timedelta(days=1)
factor = (1 + rate / 100) ** (bd / 252)
return [bd, round(factor, 8)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression business day interval ends 1', [[2023, 2, 28], [2023, 9, 27], [[2023, 7, 8], [2023, 7, 8], [2023, 9, 14], [2023, 5, 21], [2023, 2, 28], [2023, 2, 28]], 2.0], [149, 1.01177751]], ['regression business day interval ends 2', [[2027, 4, 29], [2027, 5, 9], [[2027, 4, 24], [2027, 5, 13], [2027, 4, 26], [2027, 5, 6], [2027, 5, 14], [2027, 5, 12]], 10.75], [6, 1.00243403]], ['partial repair probe 1', [[2019, 11, 5], [2019, 12, 12], [[2019, 11, 30], [2019, 11, 9], [2019, 11, 9], [2019, 12, 5], [2019, 12, 16]], 10.75], [26, 1.01059035]], ['partial repair probe 2', [[2021, 3, 1], [2021, 12, 1], [[2021, 4, 12], [2021, 4, 9]], 6.5], [195, 1.04993735]], ['normal control 1', [[2020, 2, 29], [2020, 12, 6], [[2020, 9, 12], [2020, 5, 25], [2020, 8, 26]], 13.65], [198, 1.10576211]], ['normal control 2', [[2021, 9, 4], [2021, 10, 9], [[2021, 10, 13], [2021, 9, 5], [2021, 10, 8], [2021, 9, 9], [2021, 9, 28], [2021, 10, 3]], 10.75], [22, 1.0089538]], ['normal control 3', [[2019, 11, 30], [2020, 7, 11], [[2020, 5, 17]], 10.75], [160, 1.06697625]], ['normal control 4', [[2027, 7, 9], [2027, 7, 19], [[2027, 7, 9], [2027, 7, 19], [2027, 7, 9], [2027, 7, 12], [2027, 7, 12]], 2.0], [4, 1.00031438]]], [['regression business day interval ends 1', [[2023, 10, 8], [2024, 5, 10], [[2024, 5, 5], [2024, 4, 30], [2023, 12, 10], [2023, 12, 10], [2023, 12, 24], [2023, 12, 24], [2023, 12, 27]], 10.75], [152, 1.06352331]], ['regression business day interval ends 2', [[2030, 12, 7], [2030, 12, 11], [[2030, 12, 16], [2030, 12, 4], [2030, 12, 5], [2030, 12, 5], [2030, 12, 12], [2030, 12, 2], [2030, 12, 9]], 6.5], [1, 1.00024993]], ['partial repair probe 1', [[2021, 2, 23], [2021, 2, 26], [[2021, 3, 2], [2021, 3, 2], [2021, 2, 18], [2021, 3, 1], [2021, 3, 1]], 2.0], [3, 1.00023577]], ['partial repair probe 2', [[2027, 3, 2], [2027, 8, 24], [[2027, 8, 5], [2027, 8, 5], [2027, 3, 12], [2027, 8, 7], [2027, 3, 20]], 13.65], [123, 1.06444488]], ['normal control 1', [[2022, 6, 30], [2022, 7, 3], [[2022, 6, 25], [2022, 7, 4], [2022, 7, 8], [2022, 7, 8], [2022, 6, 30], [2022, 6, 27], [2022, 7, 8], [2022, 7, 8]], 13.65], [1, 1.00050788]], ['normal control 2', [[2027, 4, 3], [2028, 3, 11], [[2027, 6, 10]], 10.75], [244, 1.10391592]], ['normal control 3', [[2024, 5, 19], [2024, 5, 19], [], 13.65], [0, 1.0]], ['normal control 4', [[2020, 5, 17], [2020, 5, 17], [[2020, 5, 20], [2020, 5, 15], [2020, 5, 15], [2020, 5, 22]], 2.0], [0, 1.0]]], [['regression business day interval ends 1', [[2019, 12, 4], [2020, 8, 9], [[2020, 8, 2], [2020, 8, 2], [2020, 5, 22], [2020, 6, 15], [2020, 3, 1]], 13.65], [176, 1.09347889]], ['regression business day interval ends 2', [[2019, 8, 28], [2019, 12, 14], [[2019, 12, 13]], 6.5], [77, 1.01942863]], ['partial repair probe 1', [[2027, 12, 1], [2028, 4, 21], [[2028, 2, 18]], 2.0], [101, 1.00796835]], ['partial repair probe 2', [[2022, 7, 27], [2022, 8, 25], [[2022, 7, 29]], 2.0], [20, 1.00157287]], ['normal control 1', [[2019, 2, 24], [2019, 3, 22], [[2019, 3, 22]], 10.75], [19, 1.00772812]], ['normal control 2', [[2023, 3, 5], [2023, 3, 12], [[2023, 3, 12], [2023, 3, 3], [2023, 3, 13]], 10.75], [5, 1.00202795]], ['normal control 3', [[2018, 7, 28], [2019, 3, 31], [], 10.75], [175, 1.07348075]], ['normal control 4', [[2028, 1, 27], [2028, 1, 28], [[2028, 2, 2], [2028, 1, 31], [2028, 2, 2], [2028, 1, 28], [2028, 1, 27], [2028, 1, 27], [2028, 1, 23]], 10.75], [0, 1.0]]], [['regression business day interval ends 1', [[2025, 10, 21], [2026, 10, 25], [], 6.5], [264, 1.06819852]], ['regression business day interval ends 2', [[2018, 12, 31], [2019, 1, 6], [[2019, 1, 2], [2019, 1, 11], [2018, 12, 26], [2018, 12, 26], [2019, 1, 6], [2019, 1, 6], [2019, 1, 3], [2019, 1, 3]], 13.65], [3, 1.00152442]], ['partial repair probe 1', [[2024, 1, 29], [2024, 2, 22], [[2024, 2, 26], [2024, 2, 24], [2024, 2, 24], [2024, 2, 13]], 6.5], [17, 1.00425734]], ['partial repair probe 2', [[2020, 9, 1], [2021, 3, 19], [[2020, 10, 21], [2020, 10, 13], [2020, 12, 25], [2020, 12, 27], [2020, 11, 25], [2020, 10, 27]], 2.0], [138, 1.01090331]], ['normal control 1', [[2026, 6, 21], [2026, 6, 27], [[2026, 6, 26], [2026, 7, 1], [2026, 7, 1]], 13.65], [4, 1.00203307]], ['normal control 2', [[2024, 2, 28], [2024, 3, 3], [[2024, 2, 28], [2024, 3, 5], [2024, 3, 8], [2024, 2, 29]], 10.75], [1, 1.00040526]], ['normal control 3', [[2019, 3, 16], [2019, 11, 10], [[2019, 8, 8], [2019, 4, 7], [2019, 8, 8]], 2.0], [169, 1.01336891]], ['normal control 4', [[2030, 12, 29], [2031, 12, 28], [[2031, 9, 22], [2031, 11, 13], [2031, 7, 9], [2031, 11, 19]], 10.75], [256, 1.1092964]]], [['regression business day interval ends 1', [[2028, 5, 29], [2028, 11, 5], [], 6.5], [115, 1.02915543]], ['regression business day interval ends 2', [[2025, 2, 22], [2025, 12, 5], [[2025, 2, 19], [2025, 2, 19], [2025, 3, 2]], 6.5], [204, 1.05230143]], ['partial repair probe 1', [[2029, 7, 31], [2030, 6, 24], [[2029, 9, 6], [2029, 9, 6]], 10.75], [233, 1.09900675]], ['partial repair probe 2', [[2024, 12, 30], [2025, 5, 13], [[2025, 1, 24], [2025, 1, 10], [2025, 1, 19], [2025, 5, 15]], 10.75], [94, 1.03882147]], ['normal control 1', [[2030, 2, 24], [2031, 1, 4], [[2030, 10, 20], [2030, 9, 10], [2030, 12, 14], [2030, 3, 23], [2030, 2, 27], [2030, 12, 23]], 6.5], [222, 1.05704555]], ['normal control 2', [[2028, 11, 12], [2028, 11, 13], [[2028, 11, 7], [2028, 11, 7], [2028, 11, 9], [2028, 11, 13], [2028, 11, 14]], 10.75], [0, 1.0]], ['normal control 3', [[2026, 3, 29], [2027, 3, 21], [[2027, 1, 8], [2026, 5, 26], [2026, 4, 3], [2026, 5, 23], [2026, 5, 23], [2026, 9, 30], [2026, 3, 26], [2026, 3, 26]], 10.75], [251, 1.10705135]], ['normal control 4', [[2020, 12, 19], [2020, 12, 20], [[2020, 12, 18], [2020, 12, 18], [2020, 12, 23]], 10.75], [0, 1.0]]]]
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 business day interval ends 1 | [149, 1.01177751] | [149, 1.01177751] | Passed |
| regression business day interval ends 2 | [6, 1.00243403] | [6, 1.00243403] | Passed |
| partial repair probe 1 | [26, 1.01059035] | [26, 1.01059035] | Passed |
| partial repair probe 2 | [195, 1.04993735] | [195, 1.04993735] | Passed |
| normal control 1 | [198, 1.10576211] | [198, 1.10576211] | Passed |
| normal control 2 | [22, 1.0089538] | [22, 1.0089538] | Passed |
| normal control 3 | [160, 1.06697625] | [160, 1.06697625] | Passed |
| normal control 4 | [4, 1.00031438] | [4, 1.00031438] | Passed |
SHA-256 / beeaf066707a622caff3426f8bec637f1945934db62a888c3dddbaa5f2b54771
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:52.425262+00:00.
Case digest / ab939dcf10f0895d7ff1cd2dd22ae2c2f47a5e8a84e3815580fc365050ca1418