FAILURE MAP
← Case archive

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

Step-up coupon accrued interest: every accrued day uses the rate in force at settlement · case 01

Accrued interest after a step-up charges the new rate for days before the step.

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

ROOT CAUSE

The rate lookup is done once at the settlement date rather than per accrued day.

THE FAILURE

The rate lookup is done once at the settlement date rather than per accrued day.

Unsuccessful approach: Using the rate at the period start ignores steps within the period.

Case contract

Inputs prev and next coupon dates, settlement in [prev, next], a list of [date, rate] steps (unordered; a step applies on and after its date), the base rate before any step, and frequency. Each accrued day d in [prev, settle) earns the rate in force on d. Accrued = 100/freq * sum(rates)/days(prev, next), rounded to 6.

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(prev, nxt, settle, steps, base_rate, freq):
    P = datetime.date(*prev)
    Q = datetime.date(*nxt)
    S = datetime.date(*settle)
    period = (Q - P).days
    sched = sorted((datetime.date(*s[0]), s[1]) for s in steps)
    def rate_on(x):
        r = base_rate
        for when, v in sched:
            if when <= x:
                r = v
        return r
    total = Fraction(0)
    x = P
    while x < S:
        total += Fraction(str(rate_on(S)))
        x += datetime.timedelta(days=1)
    return round(float(total * 100 / freq / period), 6)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression per-day rate lookup 1', [[2033, 12, 19], [2034, 12, 19], [2034, 11, 14], [[[2034, 2, 8], 0.035], [[2034, 5, 30], 0.06], [[2034, 6, 9], 0.03], [[2033, 12, 8], 0.05]], 0.025, 1], 3.226027], ['regression per-day rate lookup 2', [[2014, 3, 3], [2014, 9, 3], [2014, 7, 16], [[[2014, 3, 8], 0.06], [[2014, 3, 6], 0.03]], 0.025, 2], 2.15625], ['partial repair probe 1', [[2036, 11, 30], [2037, 5, 30], [2037, 4, 3], [[[2037, 2, 11], 0.05], [[2037, 4, 30], 0.05], [[2037, 4, 3], 0.08]], 0.025, 2], 1.208564], ['partial repair probe 2', [[2034, 3, 2], [2035, 3, 2], [2034, 9, 9], [[[2034, 8, 14], 0.07], [[2035, 1, 29], 0.04], [[2035, 3, 11], 0.07], [[2035, 1, 29], 0.07]], 0.02, 1], 1.40274], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2013, 9, 15], [2014, 3, 15], [2013, 10, 2], [[[2014, 2, 10], 0.03], [[2013, 12, 19], 0.06], [[2014, 3, 18], 0.05], [[2014, 2, 21], 0.04]], 0.02, 2], 0.093923], ['normal control 2', [[2014, 6, 16], [2014, 9, 16], [2014, 6, 16], [[[2014, 7, 25], 0.07], [[2014, 5, 23], 0.07], [[2014, 8, 2], 0.03]], 0.025, 4], 0.0], ['normal control 3', [[2025, 5, 31], [2026, 5, 31], [2026, 1, 31], [], 0.02, 1], 1.342466]], [['regression per-day rate lookup 1', [[2011, 8, 9], [2012, 8, 9], [2012, 1, 19], [[[2012, 3, 18], 0.035], [[2012, 4, 7], 0.07], [[2011, 7, 16], 0.05], [[2012, 3, 10], 0.035], [[2012, 1, 19], 0.08]], 0.025, 1], 2.226776], ['regression per-day rate lookup 2', [[2034, 4, 11], [2034, 7, 11], [2034, 5, 28], [[[2034, 7, 10], 0.05], [[2034, 6, 26], 0.05], [[2034, 4, 22], 0.07]], 0.02, 4], 0.752747], ['partial repair probe 1', [[2020, 5, 8], [2021, 5, 8], [2020, 7, 28], [[[2020, 9, 4], 0.04], [[2021, 1, 15], 0.06], [[2020, 5, 13], 0.05]], 0.025, 1], 1.075342], ['partial repair probe 2', [[2027, 8, 21], [2028, 2, 21], [2028, 2, 11], [[[2027, 10, 20], 0.03], [[2027, 9, 24], 0.04], [[2027, 12, 7], 0.07]], 0.025, 2], 2.160326], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2022, 10, 29], [2023, 1, 29], [2022, 11, 21], [], 0.025, 4], 0.15625], ['normal control 2', [[2019, 6, 1], [2019, 9, 1], [2019, 7, 23], [], 0.02, 4], 0.282609], ['normal control 3', [[2032, 5, 22], [2033, 5, 22], [2032, 6, 6], [[[2032, 12, 14], 0.07]], 0.02, 1], 0.082192]], [['regression per-day rate lookup 1', [[2025, 12, 30], [2026, 6, 30], [2026, 4, 4], [[[2025, 12, 13], 0.04], [[2026, 7, 6], 0.06], [[2026, 4, 4], 0.08]], 0.025, 2], 1.043956], ['regression per-day rate lookup 2', [[2013, 9, 29], [2014, 9, 29], [2013, 12, 5], [[[2014, 2, 10], 0.06], [[2013, 12, 5], 0.08]], 0.02, 1], 0.367123], ['partial repair probe 1', [[2026, 3, 30], [2026, 9, 30], [2026, 8, 8], [[[2026, 10, 9], 0.05], [[2026, 6, 5], 0.07], [[2026, 9, 20], 0.035]], 0.02, 2], 1.581522], ['partial repair probe 2', [[2018, 1, 11], [2018, 7, 11], [2018, 7, 5], [[[2018, 5, 5], 0.05], [[2018, 5, 7], 0.035], [[2018, 5, 13], 0.04]], 0.025, 2], 1.458564], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2027, 8, 3], [2028, 2, 3], [2027, 9, 8], [], 0.025, 2], 0.244565], ['normal control 2', [[2012, 1, 27], [2012, 4, 27], [2012, 2, 24], [[[2012, 3, 24], 0.05]], 0.02, 4], 0.153846], ['normal control 3', [[2019, 1, 8], [2019, 4, 8], [2019, 4, 5], [], 0.02, 4], 0.483333]], [['regression per-day rate lookup 1', [[2040, 10, 31], [2041, 4, 30], [2041, 2, 21], [[[2040, 12, 24], 0.04], [[2041, 1, 11], 0.03], [[2040, 12, 3], 0.03], [[2041, 3, 7], 0.04]], 0.025, 2], 0.940608], ['regression per-day rate lookup 2', [[2038, 5, 31], [2039, 5, 31], [2038, 11, 27], [[[2039, 1, 5], 0.07], [[2038, 8, 3], 0.05], [[2038, 7, 21], 0.03]], 0.025, 1], 2.045205], ['partial repair probe 1', [[2011, 11, 27], [2012, 5, 27], [2012, 2, 8], [[[2011, 12, 6], 0.07], [[2012, 4, 12], 0.05], [[2012, 2, 10], 0.07], [[2012, 2, 16], 0.05]], 0.02, 2], 1.28022], ['partial repair probe 2', [[2038, 8, 30], [2039, 2, 28], [2039, 1, 31], [[[2038, 10, 16], 0.06], [[2038, 9, 29], 0.07], [[2038, 8, 29], 0.035]], 0.025, 2], 2.379121], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2039, 11, 14], [2040, 5, 14], [2040, 2, 5], [], 0.025, 2], 0.570055], ['normal control 2', [[2011, 4, 30], [2011, 7, 30], [2011, 5, 21], [[[2011, 5, 25], 0.03]], 0.025, 4], 0.144231], ['normal control 3', [[2031, 2, 9], [2032, 2, 9], [2031, 6, 3], [], 0.025, 1], 0.780822]], [['regression per-day rate lookup 1', [[2028, 8, 31], [2028, 11, 30], [2028, 10, 21], [[[2028, 10, 6], 0.06]], 0.02, 4], 0.445055], ['regression per-day rate lookup 2', [[2026, 11, 28], [2027, 11, 28], [2027, 10, 9], [[[2027, 6, 15], 0.035], [[2027, 9, 17], 0.035], [[2027, 10, 8], 0.05], [[2027, 10, 9], 0.08]], 0.025, 1], 2.479452], ['partial repair probe 1', [[2020, 12, 5], [2021, 12, 5], [2021, 11, 17], [[[2021, 1, 11], 0.05], [[2020, 11, 26], 0.06]], 0.025, 1], 4.854795], ['partial repair probe 2', [[2029, 7, 15], [2029, 10, 15], [2029, 9, 25], [[[2029, 6, 28], 0.04], [[2029, 7, 30], 0.05], [[2029, 9, 25], 0.08]], 0.025, 4], 0.9375], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2027, 8, 19], [2027, 11, 19], [2027, 10, 26], [], 0.025, 4], 0.461957], ['normal control 2', [[2011, 7, 30], [2012, 1, 30], [2012, 1, 9], [], 0.02, 2], 0.88587], ['normal control 3', [[2027, 1, 1], [2028, 1, 1], [2027, 7, 1], [[[2027, 10, 5], 0.03], [[2027, 9, 20], 0.035]], 0.025, 1], 1.239726]]]
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 per-day rate lookup 12.7123293.226027Failed
regression per-day rate lookup 22.2010872.15625Failed
partial repair probe 12.7403311.208564Failed
partial repair probe 23.6630141.40274Failed
boundary control 10.00.0Passed
normal control 10.0939230.093923Passed
normal control 20.00.0Passed
normal control 31.3424661.342466Passed

SHA-256 / 28dab61935b9ecbe64253035978ed0a49a4c9647b34d0456b48be0c55fff998e

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(prev, nxt, settle, steps, base_rate, freq):
    P = datetime.date(*prev)
    Q = datetime.date(*nxt)
    S = datetime.date(*settle)
    period = (Q - P).days
    sched = sorted((datetime.date(*s[0]), s[1]) for s in steps)
    def rate_on(x):
        r = base_rate
        for when, v in sched:
            if when <= x:
                r = v
        return r
    total = Fraction(0)
    x = P
    while x < S:
        total += Fraction(str(rate_on(P)))
        x += datetime.timedelta(days=1)
    return round(float(total * 100 / freq / period), 6)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression per-day rate lookup 1', [[2033, 12, 19], [2034, 12, 19], [2034, 11, 14], [[[2034, 2, 8], 0.035], [[2034, 5, 30], 0.06], [[2034, 6, 9], 0.03], [[2033, 12, 8], 0.05]], 0.025, 1], 3.226027], ['regression per-day rate lookup 2', [[2014, 3, 3], [2014, 9, 3], [2014, 7, 16], [[[2014, 3, 8], 0.06], [[2014, 3, 6], 0.03]], 0.025, 2], 2.15625], ['partial repair probe 1', [[2036, 11, 30], [2037, 5, 30], [2037, 4, 3], [[[2037, 2, 11], 0.05], [[2037, 4, 30], 0.05], [[2037, 4, 3], 0.08]], 0.025, 2], 1.208564], ['partial repair probe 2', [[2034, 3, 2], [2035, 3, 2], [2034, 9, 9], [[[2034, 8, 14], 0.07], [[2035, 1, 29], 0.04], [[2035, 3, 11], 0.07], [[2035, 1, 29], 0.07]], 0.02, 1], 1.40274], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2013, 9, 15], [2014, 3, 15], [2013, 10, 2], [[[2014, 2, 10], 0.03], [[2013, 12, 19], 0.06], [[2014, 3, 18], 0.05], [[2014, 2, 21], 0.04]], 0.02, 2], 0.093923], ['normal control 2', [[2014, 6, 16], [2014, 9, 16], [2014, 6, 16], [[[2014, 7, 25], 0.07], [[2014, 5, 23], 0.07], [[2014, 8, 2], 0.03]], 0.025, 4], 0.0], ['normal control 3', [[2025, 5, 31], [2026, 5, 31], [2026, 1, 31], [], 0.02, 1], 1.342466]], [['regression per-day rate lookup 1', [[2011, 8, 9], [2012, 8, 9], [2012, 1, 19], [[[2012, 3, 18], 0.035], [[2012, 4, 7], 0.07], [[2011, 7, 16], 0.05], [[2012, 3, 10], 0.035], [[2012, 1, 19], 0.08]], 0.025, 1], 2.226776], ['regression per-day rate lookup 2', [[2034, 4, 11], [2034, 7, 11], [2034, 5, 28], [[[2034, 7, 10], 0.05], [[2034, 6, 26], 0.05], [[2034, 4, 22], 0.07]], 0.02, 4], 0.752747], ['partial repair probe 1', [[2020, 5, 8], [2021, 5, 8], [2020, 7, 28], [[[2020, 9, 4], 0.04], [[2021, 1, 15], 0.06], [[2020, 5, 13], 0.05]], 0.025, 1], 1.075342], ['partial repair probe 2', [[2027, 8, 21], [2028, 2, 21], [2028, 2, 11], [[[2027, 10, 20], 0.03], [[2027, 9, 24], 0.04], [[2027, 12, 7], 0.07]], 0.025, 2], 2.160326], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2022, 10, 29], [2023, 1, 29], [2022, 11, 21], [], 0.025, 4], 0.15625], ['normal control 2', [[2019, 6, 1], [2019, 9, 1], [2019, 7, 23], [], 0.02, 4], 0.282609], ['normal control 3', [[2032, 5, 22], [2033, 5, 22], [2032, 6, 6], [[[2032, 12, 14], 0.07]], 0.02, 1], 0.082192]], [['regression per-day rate lookup 1', [[2025, 12, 30], [2026, 6, 30], [2026, 4, 4], [[[2025, 12, 13], 0.04], [[2026, 7, 6], 0.06], [[2026, 4, 4], 0.08]], 0.025, 2], 1.043956], ['regression per-day rate lookup 2', [[2013, 9, 29], [2014, 9, 29], [2013, 12, 5], [[[2014, 2, 10], 0.06], [[2013, 12, 5], 0.08]], 0.02, 1], 0.367123], ['partial repair probe 1', [[2026, 3, 30], [2026, 9, 30], [2026, 8, 8], [[[2026, 10, 9], 0.05], [[2026, 6, 5], 0.07], [[2026, 9, 20], 0.035]], 0.02, 2], 1.581522], ['partial repair probe 2', [[2018, 1, 11], [2018, 7, 11], [2018, 7, 5], [[[2018, 5, 5], 0.05], [[2018, 5, 7], 0.035], [[2018, 5, 13], 0.04]], 0.025, 2], 1.458564], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2027, 8, 3], [2028, 2, 3], [2027, 9, 8], [], 0.025, 2], 0.244565], ['normal control 2', [[2012, 1, 27], [2012, 4, 27], [2012, 2, 24], [[[2012, 3, 24], 0.05]], 0.02, 4], 0.153846], ['normal control 3', [[2019, 1, 8], [2019, 4, 8], [2019, 4, 5], [], 0.02, 4], 0.483333]], [['regression per-day rate lookup 1', [[2040, 10, 31], [2041, 4, 30], [2041, 2, 21], [[[2040, 12, 24], 0.04], [[2041, 1, 11], 0.03], [[2040, 12, 3], 0.03], [[2041, 3, 7], 0.04]], 0.025, 2], 0.940608], ['regression per-day rate lookup 2', [[2038, 5, 31], [2039, 5, 31], [2038, 11, 27], [[[2039, 1, 5], 0.07], [[2038, 8, 3], 0.05], [[2038, 7, 21], 0.03]], 0.025, 1], 2.045205], ['partial repair probe 1', [[2011, 11, 27], [2012, 5, 27], [2012, 2, 8], [[[2011, 12, 6], 0.07], [[2012, 4, 12], 0.05], [[2012, 2, 10], 0.07], [[2012, 2, 16], 0.05]], 0.02, 2], 1.28022], ['partial repair probe 2', [[2038, 8, 30], [2039, 2, 28], [2039, 1, 31], [[[2038, 10, 16], 0.06], [[2038, 9, 29], 0.07], [[2038, 8, 29], 0.035]], 0.025, 2], 2.379121], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2039, 11, 14], [2040, 5, 14], [2040, 2, 5], [], 0.025, 2], 0.570055], ['normal control 2', [[2011, 4, 30], [2011, 7, 30], [2011, 5, 21], [[[2011, 5, 25], 0.03]], 0.025, 4], 0.144231], ['normal control 3', [[2031, 2, 9], [2032, 2, 9], [2031, 6, 3], [], 0.025, 1], 0.780822]], [['regression per-day rate lookup 1', [[2028, 8, 31], [2028, 11, 30], [2028, 10, 21], [[[2028, 10, 6], 0.06]], 0.02, 4], 0.445055], ['regression per-day rate lookup 2', [[2026, 11, 28], [2027, 11, 28], [2027, 10, 9], [[[2027, 6, 15], 0.035], [[2027, 9, 17], 0.035], [[2027, 10, 8], 0.05], [[2027, 10, 9], 0.08]], 0.025, 1], 2.479452], ['partial repair probe 1', [[2020, 12, 5], [2021, 12, 5], [2021, 11, 17], [[[2021, 1, 11], 0.05], [[2020, 11, 26], 0.06]], 0.025, 1], 4.854795], ['partial repair probe 2', [[2029, 7, 15], [2029, 10, 15], [2029, 9, 25], [[[2029, 6, 28], 0.04], [[2029, 7, 30], 0.05], [[2029, 9, 25], 0.08]], 0.025, 4], 0.9375], ['boundary control 1', [[2024, 1, 1], [2024, 7, 1], [2024, 1, 1], [], 0.02, 2], 0.0], ['normal control 1', [[2027, 8, 19], [2027, 11, 19], [2027, 10, 26], [], 0.025, 4], 0.461957], ['normal control 2', [[2011, 7, 30], [2012, 1, 30], [2012, 1, 9], [], 0.02, 2], 0.88587], ['normal control 3', [[2027, 1, 1], [2028, 1, 1], [2027, 7, 1], [[[2027, 10, 5], 0.03], [[2027, 9, 20], 0.035]], 0.025, 1], 1.239726]]]
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 per-day rate lookup 14.5205483.226027Failed
regression per-day rate lookup 20.917122.15625Failed
partial repair probe 10.8563541.208564Failed
partial repair probe 21.0465751.40274Failed
boundary control 10.00.0Passed
normal control 10.0939230.093923Passed
normal control 20.00.0Passed
normal control 31.3424661.342466Passed

SHA-256 / 2fd952053e169c18300748426b754268c5f6defaf6d5fc91a893d63e9ff146b8

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

Case digest / fb683261f47fd0b950af3786dd70c21902d6b0b813e730662e1791e3c914ad48