{"abstract":"Periods ending on a leap day count one fewer stub day or one fewer whole year.","category":"Bond day-count conventions","checks":8,"contract":"Inputs start < end [y,m,d]. Count whole years n stepping back from the end date (an end of 29 February maps to 28 February in non-leap years) while the stepped date is not before start. The stub runs from start to the end stepped back n years; its denominator is 366 if a 29 February lies in (start, stub end], else 365. Return n + stub days/denominator rounded to 9 decimals.","evaluation_group":"w2-bond_day_count_conventions-act-act-afb","failed_approach":"Mapping to 28 February even in leap years shortens anniversaries that do exist.","family":"w2-bond_day_count_conventions-act-act-afb-leap-anniversary-mapping","id":"FA-61301","implementations":{"attempt":{"sha256":"4d186cde445586c3aa2f9cfcc2fd530681957b74e6ef3a844b8d0f4c86870024","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(a, b):\n    A = datetime.date(*a)\n    B = datetime.date(*b)\n    def leap(y):\n        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0\n    def back_years(n):\n        y = B.year - n\n        if B.month == 2 and B.day == 29:\n            return datetime.date(y, 2, 28)\n        return datetime.date(y, B.month, B.day)\n    n = 0\n    while back_years(n + 1) >= A:\n        n += 1\n    stub_end = back_years(n)\n    has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= stub_end for y in range(A.year, stub_end.year + 1))\n    den = 366 if has29 else 365\n    return round(n + (stub_end - A).days / den, 9)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression leap anniversary mapping 1', [[2010, 10, 29], [2012, 2, 29]], 1.334246575], ['regression leap anniversary mapping 2', [[2005, 3, 30], [2008, 2, 29]], 2.917808219], ['partial repair probe 1', [[1996, 1, 30], [2004, 2, 29]], 8.081967213], ['partial repair probe 2', [[2003, 5, 10], [2004, 2, 29]], 0.806010929], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2069, 7, 30], [2074, 8, 3]], 5.010958904], ['normal control 2', [[2005, 4, 25], [2009, 10, 22]], 4.493150685], ['normal control 3', [[2020, 6, 30], [2026, 1, 7]], 5.523287671]], [['regression leap anniversary mapping 1', [[1998, 10, 13], [2004, 2, 29]], 5.378082192], ['regression leap anniversary mapping 2', [[1999, 2, 28], [2004, 2, 29]], 5.0], ['partial repair probe 1', [[2011, 3, 31], [2024, 2, 29]], 12.915300546], ['partial repair probe 2', [[2011, 7, 23], [2012, 2, 29]], 0.603825137], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2093, 8, 31], [2093, 10, 22]], 0.142465753], ['normal control 2', [[2069, 11, 30], [2073, 8, 25]], 3.734246575], ['normal control 3', [[2075, 1, 27], [2081, 10, 22]], 6.734246575]], [['regression leap anniversary mapping 1', [[2010, 8, 29], [2016, 2, 29]], 5.501369863], ['regression leap anniversary mapping 2', [[2013, 7, 23], [2016, 2, 29]], 2.602739726], ['partial repair probe 1', [[2003, 8, 6], [2008, 2, 29]], 4.56557377], ['partial repair probe 2', [[2003, 12, 4], [2004, 2, 29]], 0.237704918], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2084, 7, 30], [2092, 7, 14]], 7.956164384], ['normal control 2', [[2054, 8, 16], [2056, 3, 16]], 1.580821918], ['normal control 3', [[2062, 9, 23], [2066, 12, 16]], 4.230136986]], [['regression leap anniversary mapping 1', [[2029, 12, 24], [2032, 2, 29]], 2.180821918], ['regression leap anniversary mapping 2', [[2018, 4, 22], [2020, 2, 29]], 1.854794521], ['partial repair probe 1', [[2015, 3, 5], [2020, 2, 29]], 4.986338798], ['partial repair probe 2', [[2007, 7, 27], [2032, 2, 29]], 24.592896175], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2024, 4, 6], [2031, 2, 24]], 6.887671233], ['normal control 2', [[2033, 6, 29], [2040, 5, 23]], 6.898630137], ['normal control 3', [[2051, 1, 7], [2058, 2, 25]], 7.134246575]], [['regression leap anniversary mapping 1', [[2006, 11, 30], [2008, 2, 29]], 1.246575342], ['regression leap anniversary mapping 2', [[2004, 5, 31], [2020, 2, 29]], 15.747945205], ['partial repair probe 1', [[2023, 4, 11], [2028, 2, 29]], 4.885245902], ['partial repair probe 2', [[1999, 6, 29], [2020, 2, 29]], 20.669398907], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2087, 6, 12], [2090, 7, 1]], 3.052054795], ['normal control 2', [[2082, 4, 17], [2085, 1, 14]], 2.745205479], ['normal control 3', [[2067, 10, 30], [2069, 5, 28]], 1.576502732]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"7c5fa1768671ec8c5e0b1bd9e8d88c0a1a34a444549101957724417c9a1eccd9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(a, b):\n    A = datetime.date(*a)\n    B = datetime.date(*b)\n    def leap(y):\n        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0\n    def back_years(n):\n        y = B.year - n\n        if B.month == 2 and B.day == 29 and not leap(y):\n            return datetime.date(y, 3, 1)\n        return datetime.date(y, B.month, B.day)\n    n = 0\n    while back_years(n + 1) >= A:\n        n += 1\n    stub_end = back_years(n)\n    has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= stub_end for y in range(A.year, stub_end.year + 1))\n    den = 366 if has29 else 365\n    return round(n + (stub_end - A).days / den, 9)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression leap anniversary mapping 1', [[2010, 10, 29], [2012, 2, 29]], 1.334246575], ['regression leap anniversary mapping 2', [[2005, 3, 30], [2008, 2, 29]], 2.917808219], ['partial repair probe 1', [[1996, 1, 30], [2004, 2, 29]], 8.081967213], ['partial repair probe 2', [[2003, 5, 10], [2004, 2, 29]], 0.806010929], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2069, 7, 30], [2074, 8, 3]], 5.010958904], ['normal control 2', [[2005, 4, 25], [2009, 10, 22]], 4.493150685], ['normal control 3', [[2020, 6, 30], [2026, 1, 7]], 5.523287671]], [['regression leap anniversary mapping 1', [[1998, 10, 13], [2004, 2, 29]], 5.378082192], ['regression leap anniversary mapping 2', [[1999, 2, 28], [2004, 2, 29]], 5.0], ['partial repair probe 1', [[2011, 3, 31], [2024, 2, 29]], 12.915300546], ['partial repair probe 2', [[2011, 7, 23], [2012, 2, 29]], 0.603825137], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2093, 8, 31], [2093, 10, 22]], 0.142465753], ['normal control 2', [[2069, 11, 30], [2073, 8, 25]], 3.734246575], ['normal control 3', [[2075, 1, 27], [2081, 10, 22]], 6.734246575]], [['regression leap anniversary mapping 1', [[2010, 8, 29], [2016, 2, 29]], 5.501369863], ['regression leap anniversary mapping 2', [[2013, 7, 23], [2016, 2, 29]], 2.602739726], ['partial repair probe 1', [[2003, 8, 6], [2008, 2, 29]], 4.56557377], ['partial repair probe 2', [[2003, 12, 4], [2004, 2, 29]], 0.237704918], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2084, 7, 30], [2092, 7, 14]], 7.956164384], ['normal control 2', [[2054, 8, 16], [2056, 3, 16]], 1.580821918], ['normal control 3', [[2062, 9, 23], [2066, 12, 16]], 4.230136986]], [['regression leap anniversary mapping 1', [[2029, 12, 24], [2032, 2, 29]], 2.180821918], ['regression leap anniversary mapping 2', [[2018, 4, 22], [2020, 2, 29]], 1.854794521], ['partial repair probe 1', [[2015, 3, 5], [2020, 2, 29]], 4.986338798], ['partial repair probe 2', [[2007, 7, 27], [2032, 2, 29]], 24.592896175], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2024, 4, 6], [2031, 2, 24]], 6.887671233], ['normal control 2', [[2033, 6, 29], [2040, 5, 23]], 6.898630137], ['normal control 3', [[2051, 1, 7], [2058, 2, 25]], 7.134246575]], [['regression leap anniversary mapping 1', [[2006, 11, 30], [2008, 2, 29]], 1.246575342], ['regression leap anniversary mapping 2', [[2004, 5, 31], [2020, 2, 29]], 15.747945205], ['partial repair probe 1', [[2023, 4, 11], [2028, 2, 29]], 4.885245902], ['partial repair probe 2', [[1999, 6, 29], [2020, 2, 29]], 20.669398907], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2087, 6, 12], [2090, 7, 1]], 3.052054795], ['normal control 2', [[2082, 4, 17], [2085, 1, 14]], 2.745205479], ['normal control 3', [[2067, 10, 30], [2069, 5, 28]], 1.576502732]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"5caaa375fd773631549225adb4a0a6f1082dc8af65de5a9d035ce445ac19d051","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(a, b):\n    A = datetime.date(*a)\n    B = datetime.date(*b)\n    def leap(y):\n        return (y % 4 == 0 and y % 100 != 0) or y % 400 == 0\n    def back_years(n):\n        y = B.year - n\n        if B.month == 2 and B.day == 29 and not leap(y):\n            return datetime.date(y, 2, 28)\n        return datetime.date(y, B.month, B.day)\n    n = 0\n    while back_years(n + 1) >= A:\n        n += 1\n    stub_end = back_years(n)\n    has29 = any(leap(y) and A < datetime.date(y, 2, 29) <= stub_end for y in range(A.year, stub_end.year + 1))\n    den = 366 if has29 else 365\n    return round(n + (stub_end - A).days / den, 9)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression leap anniversary mapping 1', [[2010, 10, 29], [2012, 2, 29]], 1.334246575], ['regression leap anniversary mapping 2', [[2005, 3, 30], [2008, 2, 29]], 2.917808219], ['partial repair probe 1', [[1996, 1, 30], [2004, 2, 29]], 8.081967213], ['partial repair probe 2', [[2003, 5, 10], [2004, 2, 29]], 0.806010929], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2069, 7, 30], [2074, 8, 3]], 5.010958904], ['normal control 2', [[2005, 4, 25], [2009, 10, 22]], 4.493150685], ['normal control 3', [[2020, 6, 30], [2026, 1, 7]], 5.523287671]], [['regression leap anniversary mapping 1', [[1998, 10, 13], [2004, 2, 29]], 5.378082192], ['regression leap anniversary mapping 2', [[1999, 2, 28], [2004, 2, 29]], 5.0], ['partial repair probe 1', [[2011, 3, 31], [2024, 2, 29]], 12.915300546], ['partial repair probe 2', [[2011, 7, 23], [2012, 2, 29]], 0.603825137], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2093, 8, 31], [2093, 10, 22]], 0.142465753], ['normal control 2', [[2069, 11, 30], [2073, 8, 25]], 3.734246575], ['normal control 3', [[2075, 1, 27], [2081, 10, 22]], 6.734246575]], [['regression leap anniversary mapping 1', [[2010, 8, 29], [2016, 2, 29]], 5.501369863], ['regression leap anniversary mapping 2', [[2013, 7, 23], [2016, 2, 29]], 2.602739726], ['partial repair probe 1', [[2003, 8, 6], [2008, 2, 29]], 4.56557377], ['partial repair probe 2', [[2003, 12, 4], [2004, 2, 29]], 0.237704918], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2084, 7, 30], [2092, 7, 14]], 7.956164384], ['normal control 2', [[2054, 8, 16], [2056, 3, 16]], 1.580821918], ['normal control 3', [[2062, 9, 23], [2066, 12, 16]], 4.230136986]], [['regression leap anniversary mapping 1', [[2029, 12, 24], [2032, 2, 29]], 2.180821918], ['regression leap anniversary mapping 2', [[2018, 4, 22], [2020, 2, 29]], 1.854794521], ['partial repair probe 1', [[2015, 3, 5], [2020, 2, 29]], 4.986338798], ['partial repair probe 2', [[2007, 7, 27], [2032, 2, 29]], 24.592896175], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2024, 4, 6], [2031, 2, 24]], 6.887671233], ['normal control 2', [[2033, 6, 29], [2040, 5, 23]], 6.898630137], ['normal control 3', [[2051, 1, 7], [2058, 2, 25]], 7.134246575]], [['regression leap anniversary mapping 1', [[2006, 11, 30], [2008, 2, 29]], 1.246575342], ['regression leap anniversary mapping 2', [[2004, 5, 31], [2020, 2, 29]], 15.747945205], ['partial repair probe 1', [[2023, 4, 11], [2028, 2, 29]], 4.885245902], ['partial repair probe 2', [[1999, 6, 29], [2020, 2, 29]], 20.669398907], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['normal control 1', [[2087, 6, 12], [2090, 7, 1]], 3.052054795], ['normal control 2', [[2082, 4, 17], [2085, 1, 14]], 2.745205479], ['normal control 3', [[2067, 10, 30], [2069, 5, 28]], 1.576502732]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-bond_day_count_conventions-act-act-afb-leap-anniversary-mapping","generated_at":"2026-09-29T14:46:53.967892+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.","repair":"Map 29 February to 28 February in years without a leap day.","root_cause":"The anniversary of 29 February in a common year is taken as 1 March.","sha256":"df08932c9da878a8cb097a90ead3c7884530b8f50e19ddf7244c464596413d64","title":"Act/Act AFB whole-year decomposition: a 29 February end steps back to 1 March in common years · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.957,"exit_code":1,"observations":[{"actual":1.334246575,"check":"regression leap anniversary mapping 1","expected":1.334246575,"passed":true},{"actual":2.917808219,"check":"regression leap anniversary mapping 2","expected":2.917808219,"passed":true},{"actual":8.079452055,"check":"partial repair probe 1","expected":8.081967213,"passed":false},{"actual":0.805479452,"check":"partial repair probe 2","expected":0.806010929,"passed":false},{"actual":1.0,"check":"boundary control 1","expected":1.0,"passed":true},{"actual":5.010958904,"check":"normal control 1","expected":5.010958904,"passed":true},{"actual":4.493150685,"check":"normal control 2","expected":4.493150685,"passed":true},{"actual":5.523287671,"check":"normal control 3","expected":5.523287671,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression leap anniversary mapping 1\", \"actual\": 1.334246575, \"expected\": 1.334246575, \"passed\": true}, {\"check\": \"regression leap anniversary mapping 2\", \"actual\": 2.917808219, \"expected\": 2.917808219, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 8.079452055, \"expected\": 8.081967213, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 0.805479452, \"expected\": 0.806010929, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 5.010958904, \"expected\": 5.010958904, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 4.493150685, \"expected\": 4.493150685, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": 5.523287671, \"expected\": 5.523287671, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.693,"exit_code":1,"observations":[{"actual":1.336986301,"check":"regression leap anniversary mapping 1","expected":1.334246575,"passed":false},{"actual":2.920547945,"check":"regression leap anniversary mapping 2","expected":2.917808219,"passed":false},{"actual":8.081967213,"check":"partial repair probe 1","expected":8.081967213,"passed":true},{"actual":0.806010929,"check":"partial repair probe 2","expected":0.806010929,"passed":true},{"actual":1.0,"check":"boundary control 1","expected":1.0,"passed":true},{"actual":5.010958904,"check":"normal control 1","expected":5.010958904,"passed":true},{"actual":4.493150685,"check":"normal control 2","expected":4.493150685,"passed":true},{"actual":5.523287671,"check":"normal control 3","expected":5.523287671,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression leap anniversary mapping 1\", \"actual\": 1.336986301, \"expected\": 1.334246575, \"passed\": false}, {\"check\": \"regression leap anniversary mapping 2\", \"actual\": 2.920547945, \"expected\": 2.917808219, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 8.081967213, \"expected\": 8.081967213, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0.806010929, \"expected\": 0.806010929, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 5.010958904, \"expected\": 5.010958904, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 4.493150685, \"expected\": 4.493150685, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": 5.523287671, \"expected\": 5.523287671, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.167,"exit_code":0,"observations":[{"actual":1.334246575,"check":"regression leap anniversary mapping 1","expected":1.334246575,"passed":true},{"actual":2.917808219,"check":"regression leap anniversary mapping 2","expected":2.917808219,"passed":true},{"actual":8.081967213,"check":"partial repair probe 1","expected":8.081967213,"passed":true},{"actual":0.806010929,"check":"partial repair probe 2","expected":0.806010929,"passed":true},{"actual":1.0,"check":"boundary control 1","expected":1.0,"passed":true},{"actual":5.010958904,"check":"normal control 1","expected":5.010958904,"passed":true},{"actual":4.493150685,"check":"normal control 2","expected":4.493150685,"passed":true},{"actual":5.523287671,"check":"normal control 3","expected":5.523287671,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression leap anniversary mapping 1\", \"actual\": 1.334246575, \"expected\": 1.334246575, \"passed\": true}, {\"check\": \"regression leap anniversary mapping 2\", \"actual\": 2.917808219, \"expected\": 2.917808219, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 8.081967213, \"expected\": 8.081967213, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0.806010929, \"expected\": 0.806010929, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 5.010958904, \"expected\": 5.010958904, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 4.493150685, \"expected\": 4.493150685, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": 5.523287671, \"expected\": 5.523287671, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}