{"abstract":"Stubs in periods of more than a year use 366 because of leap days in the whole years.","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":"OR-ing the correct search with the stub end year leap status still overcounts.","family":"w2-bond_day_count_conventions-act-act-afb-stub-leap-window","id":"FA-61311","implementations":{"attempt":{"sha256":"ee19ab500d8ff0d65fa2ca3fdafffd4e2e0bab291e7fb2ebc89f028695e3c8d1","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 or leap(stub_end.year) 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 stub leap window 1', [[2059, 3, 3], [2062, 3, 16]], 3.035616438], ['regression stub leap window 2', [[2022, 6, 12], [2030, 6, 23]], 8.030136986], ['partial repair probe 1', [[2016, 3, 31], [2019, 7, 2]], 3.254794521], ['partial repair probe 2', [[2088, 7, 31], [2088, 10, 23]], 0.230136986], ['boundary control 1', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[1991, 10, 30], [1995, 7, 29]], 3.745901639], ['normal control 2', [[2097, 11, 30], [2098, 2, 21]], 0.22739726]], [['regression stub leap window 1', [[2067, 4, 30], [2072, 9, 7]], 5.356164384], ['regression stub leap window 2', [[2053, 2, 8], [2057, 12, 7]], 4.82739726], ['partial repair probe 1', [[2068, 8, 18], [2070, 8, 23]], 2.01369863], ['partial repair probe 2', [[2040, 5, 31], [2042, 11, 14]], 2.457534247], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2017, 12, 31], [2018, 5, 3]], 0.336986301], ['normal control 2', [[2052, 2, 28], [2059, 11, 6]], 7.68852459]], [['regression stub leap window 1', [[2030, 1, 31], [2034, 12, 4]], 4.84109589], ['regression stub leap window 2', [[1993, 2, 28], [2000, 11, 9]], 7.695890411], ['partial repair probe 1', [[2068, 3, 23], [2069, 12, 20]], 1.745205479], ['partial repair probe 2', [[2076, 7, 3], [2077, 8, 10]], 1.104109589], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2036, 9, 30], [2038, 9, 29]], 1.997260274], ['normal control 2', [[2019, 7, 18], [2024, 2, 29]], 4.617486339]], [['regression stub leap window 1', [[2004, 5, 26], [2008, 2, 29]], 3.761643836], ['regression stub leap window 2', [[2010, 12, 22], [2012, 2, 29]], 1.18630137], ['partial repair probe 1', [[2084, 8, 12], [2087, 8, 15]], 3.008219178], ['partial repair probe 2', [[2092, 4, 30], [2092, 10, 27]], 0.493150685], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2011, 3, 11], [2012, 2, 29]], 0.969945355], ['normal control 2', [[2012, 8, 30], [2015, 5, 30]], 2.747945205]], [['regression stub leap window 1', [[2001, 5, 31], [2009, 1, 23]], 7.649315068], ['regression stub leap window 2', [[2015, 2, 28], [2021, 8, 1]], 6.421917808], ['partial repair probe 1', [[2056, 2, 29], [2059, 9, 9]], 3.528767123], ['partial repair probe 2', [[2068, 3, 28], [2071, 10, 31]], 3.594520548], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[2046, 3, 23], [2046, 7, 28]], 0.347945205], ['normal control 2', [[2080, 6, 2], [2082, 2, 16]], 1.709589041]]]\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":"734b982bced0397fbddf0df5463f9981abbfcbe47be014f5348757da17775b41","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) <= B for y in range(A.year, B.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 stub leap window 1', [[2059, 3, 3], [2062, 3, 16]], 3.035616438], ['regression stub leap window 2', [[2022, 6, 12], [2030, 6, 23]], 8.030136986], ['partial repair probe 1', [[2016, 3, 31], [2019, 7, 2]], 3.254794521], ['partial repair probe 2', [[2088, 7, 31], [2088, 10, 23]], 0.230136986], ['boundary control 1', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[1991, 10, 30], [1995, 7, 29]], 3.745901639], ['normal control 2', [[2097, 11, 30], [2098, 2, 21]], 0.22739726]], [['regression stub leap window 1', [[2067, 4, 30], [2072, 9, 7]], 5.356164384], ['regression stub leap window 2', [[2053, 2, 8], [2057, 12, 7]], 4.82739726], ['partial repair probe 1', [[2068, 8, 18], [2070, 8, 23]], 2.01369863], ['partial repair probe 2', [[2040, 5, 31], [2042, 11, 14]], 2.457534247], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2017, 12, 31], [2018, 5, 3]], 0.336986301], ['normal control 2', [[2052, 2, 28], [2059, 11, 6]], 7.68852459]], [['regression stub leap window 1', [[2030, 1, 31], [2034, 12, 4]], 4.84109589], ['regression stub leap window 2', [[1993, 2, 28], [2000, 11, 9]], 7.695890411], ['partial repair probe 1', [[2068, 3, 23], [2069, 12, 20]], 1.745205479], ['partial repair probe 2', [[2076, 7, 3], [2077, 8, 10]], 1.104109589], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2036, 9, 30], [2038, 9, 29]], 1.997260274], ['normal control 2', [[2019, 7, 18], [2024, 2, 29]], 4.617486339]], [['regression stub leap window 1', [[2004, 5, 26], [2008, 2, 29]], 3.761643836], ['regression stub leap window 2', [[2010, 12, 22], [2012, 2, 29]], 1.18630137], ['partial repair probe 1', [[2084, 8, 12], [2087, 8, 15]], 3.008219178], ['partial repair probe 2', [[2092, 4, 30], [2092, 10, 27]], 0.493150685], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2011, 3, 11], [2012, 2, 29]], 0.969945355], ['normal control 2', [[2012, 8, 30], [2015, 5, 30]], 2.747945205]], [['regression stub leap window 1', [[2001, 5, 31], [2009, 1, 23]], 7.649315068], ['regression stub leap window 2', [[2015, 2, 28], [2021, 8, 1]], 6.421917808], ['partial repair probe 1', [[2056, 2, 29], [2059, 9, 9]], 3.528767123], ['partial repair probe 2', [[2068, 3, 28], [2071, 10, 31]], 3.594520548], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[2046, 3, 23], [2046, 7, 28]], 0.347945205], ['normal control 2', [[2080, 6, 2], [2082, 2, 16]], 1.709589041]]]\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":"26de7292414bf5fb5b2c4d0ad11e595a34e858457d12eccb6301694b96364d2e","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 stub leap window 1', [[2059, 3, 3], [2062, 3, 16]], 3.035616438], ['regression stub leap window 2', [[2022, 6, 12], [2030, 6, 23]], 8.030136986], ['partial repair probe 1', [[2016, 3, 31], [2019, 7, 2]], 3.254794521], ['partial repair probe 2', [[2088, 7, 31], [2088, 10, 23]], 0.230136986], ['boundary control 1', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[1991, 10, 30], [1995, 7, 29]], 3.745901639], ['normal control 2', [[2097, 11, 30], [2098, 2, 21]], 0.22739726]], [['regression stub leap window 1', [[2067, 4, 30], [2072, 9, 7]], 5.356164384], ['regression stub leap window 2', [[2053, 2, 8], [2057, 12, 7]], 4.82739726], ['partial repair probe 1', [[2068, 8, 18], [2070, 8, 23]], 2.01369863], ['partial repair probe 2', [[2040, 5, 31], [2042, 11, 14]], 2.457534247], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2017, 12, 31], [2018, 5, 3]], 0.336986301], ['normal control 2', [[2052, 2, 28], [2059, 11, 6]], 7.68852459]], [['regression stub leap window 1', [[2030, 1, 31], [2034, 12, 4]], 4.84109589], ['regression stub leap window 2', [[1993, 2, 28], [2000, 11, 9]], 7.695890411], ['partial repair probe 1', [[2068, 3, 23], [2069, 12, 20]], 1.745205479], ['partial repair probe 2', [[2076, 7, 3], [2077, 8, 10]], 1.104109589], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2036, 9, 30], [2038, 9, 29]], 1.997260274], ['normal control 2', [[2019, 7, 18], [2024, 2, 29]], 4.617486339]], [['regression stub leap window 1', [[2004, 5, 26], [2008, 2, 29]], 3.761643836], ['regression stub leap window 2', [[2010, 12, 22], [2012, 2, 29]], 1.18630137], ['partial repair probe 1', [[2084, 8, 12], [2087, 8, 15]], 3.008219178], ['partial repair probe 2', [[2092, 4, 30], [2092, 10, 27]], 0.493150685], ['boundary control 1', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['boundary control 2', [[2019, 3, 1], [2024, 2, 29]], 4.99726776], ['normal control 1', [[2011, 3, 11], [2012, 2, 29]], 0.969945355], ['normal control 2', [[2012, 8, 30], [2015, 5, 30]], 2.747945205]], [['regression stub leap window 1', [[2001, 5, 31], [2009, 1, 23]], 7.649315068], ['regression stub leap window 2', [[2015, 2, 28], [2021, 8, 1]], 6.421917808], ['partial repair probe 1', [[2056, 2, 29], [2059, 9, 9]], 3.528767123], ['partial repair probe 2', [[2068, 3, 28], [2071, 10, 31]], 3.594520548], ['boundary control 1', [[2024, 1, 1], [2025, 1, 1]], 1.0], ['boundary control 2', [[2023, 2, 28], [2024, 2, 29]], 1.0], ['normal control 1', [[2046, 3, 23], [2046, 7, 28]], 0.347945205], ['normal control 2', [[2080, 6, 2], [2082, 2, 16]], 1.709589041]]]\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-stub-leap-window","generated_at":"2026-09-29T14:46:54.176905+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":"Search for 29 February only inside (start, stub end].","root_cause":"The 29 February search runs up to the final end date instead of the stub end.","sha256":"585fd63352f1a2ebf89d81f285cb97319f6b9609c2ae32e1ec0c0bfd49bf758a","title":"Act/Act AFB whole-year decomposition: the leap-day search looks at the whole period instead of the stub · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.062,"exit_code":1,"observations":[{"actual":3.035616438,"check":"regression stub leap window 1","expected":3.035616438,"passed":true},{"actual":8.030136986,"check":"regression stub leap window 2","expected":8.030136986,"passed":true},{"actual":3.254098361,"check":"partial repair probe 1","expected":3.254794521,"passed":false},{"actual":0.229508197,"check":"partial repair probe 2","expected":0.230136986,"passed":false},{"actual":4.99726776,"check":"boundary control 1","expected":4.99726776,"passed":true},{"actual":1.0,"check":"boundary control 2","expected":1.0,"passed":true},{"actual":3.745901639,"check":"normal control 1","expected":3.745901639,"passed":true},{"actual":0.22739726,"check":"normal control 2","expected":0.22739726,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression stub leap window 1\", \"actual\": 3.035616438, \"expected\": 3.035616438, \"passed\": true}, {\"check\": \"regression stub leap window 2\", \"actual\": 8.030136986, \"expected\": 8.030136986, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 3.254098361, \"expected\": 3.254794521, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 0.229508197, \"expected\": 0.230136986, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 4.99726776, \"expected\": 4.99726776, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 3.745901639, \"expected\": 3.745901639, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 0.22739726, \"expected\": 0.22739726, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.476,"exit_code":1,"observations":[{"actual":3.035519126,"check":"regression stub leap window 1","expected":3.035616438,"passed":false},{"actual":8.030054645,"check":"regression stub leap window 2","expected":8.030136986,"passed":false},{"actual":3.254794521,"check":"partial repair probe 1","expected":3.254794521,"passed":true},{"actual":0.230136986,"check":"partial repair probe 2","expected":0.230136986,"passed":true},{"actual":4.99726776,"check":"boundary control 1","expected":4.99726776,"passed":true},{"actual":1.0,"check":"boundary control 2","expected":1.0,"passed":true},{"actual":3.745901639,"check":"normal control 1","expected":3.745901639,"passed":true},{"actual":0.22739726,"check":"normal control 2","expected":0.22739726,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression stub leap window 1\", \"actual\": 3.035519126, \"expected\": 3.035616438, \"passed\": false}, {\"check\": \"regression stub leap window 2\", \"actual\": 8.030054645, \"expected\": 8.030136986, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 3.254794521, \"expected\": 3.254794521, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0.230136986, \"expected\": 0.230136986, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 4.99726776, \"expected\": 4.99726776, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 3.745901639, \"expected\": 3.745901639, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 0.22739726, \"expected\": 0.22739726, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.565,"exit_code":0,"observations":[{"actual":3.035616438,"check":"regression stub leap window 1","expected":3.035616438,"passed":true},{"actual":8.030136986,"check":"regression stub leap window 2","expected":8.030136986,"passed":true},{"actual":3.254794521,"check":"partial repair probe 1","expected":3.254794521,"passed":true},{"actual":0.230136986,"check":"partial repair probe 2","expected":0.230136986,"passed":true},{"actual":4.99726776,"check":"boundary control 1","expected":4.99726776,"passed":true},{"actual":1.0,"check":"boundary control 2","expected":1.0,"passed":true},{"actual":3.745901639,"check":"normal control 1","expected":3.745901639,"passed":true},{"actual":0.22739726,"check":"normal control 2","expected":0.22739726,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression stub leap window 1\", \"actual\": 3.035616438, \"expected\": 3.035616438, \"passed\": true}, {\"check\": \"regression stub leap window 2\", \"actual\": 8.030136986, \"expected\": 8.030136986, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 3.254794521, \"expected\": 3.254794521, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0.230136986, \"expected\": 0.230136986, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 4.99726776, \"expected\": 4.99726776, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 1.0, \"expected\": 1.0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 3.745901639, \"expected\": 3.745901639, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 0.22739726, \"expected\": 0.22739726, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}