{"abstract":"Each child's half-part is capped at half the stipulated amount.","category":"Tax bracket computation","checks":6,"contract":"solve(income, halves, couple): stipulated household quotient. Parts p = halves/2; the base is 2 parts for a couple and 1 otherwise (fewer halves than the base returns 'ERR:parts'). Tax with all parts = p * T(income/p) using slices 0% to 11294, 11% to 28797, 30% to 82341, 41% to 177106, 45% above. The benefit of each half-part beyond the base is capped at 1759: tax = max(full, T_base - 1759 * extra_halves) where T_base = base * T(income/base). Return whole units rounded down.","evaluation_group":"w2-tax_bracket_computation-family-quotient-cap","failed_approach":"Flooring the extra halves to whole parts ignores an odd half-part entirely.","family":"w2-tax_bracket_computation-family-quotient-cap-cap-unit","id":"FA-62631","implementations":{"attempt":{"sha256":"82da8a57c31a488ad529e865379ebe52b502a06870c7cddfe5ebabaaa1fe3f54","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, halves, couple):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    base = 2 if couple else 1\n    if halves < 2 * base: return 'ERR:parts'\n    scale = [[11294, '0'], [28797, '11'], [82341, '30'], [177106, '41'], [None, '45']]\n    def tax_for(p): return p * prog(Fraction(income) / p, scale)\n    full = tax_for(Fraction(halves, 2))\n    capped = tax_for(Fraction(base)) - 1759 * ((halves - 2 * base) // 2)\n    return int(max(full, capped))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression cap-unit 1', (80000, 6, True), 7054), ('regression cap-unit 2', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts')],\n [('regression cap-unit 1', (250000, 8, True), 63921), ('regression cap-unit 2', (40000, 7, False), 51),\n  ('partial repair guard 1', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527), ('control: single one part', (40000, 2, False), 5286),\n  ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-unit 1', (150000, 6, True), 28054), ('regression cap-unit 2', (80000, 6, False), 10250),\n  ('partial repair guard 1', (40000, 7, False), 51), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: couple with two children', (80000, 6, True), 7054)],\n [('regression cap-unit 1', (193969, 6, True), 44466), ('regression cap-unit 2', (150000, 8, True), 24536),\n  ('partial repair guard 1', (80000, 6, False), 10250), ('control: couple with two children', (80000, 6, True), 7054),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-unit 1', (80000, 8, False), 6732), ('regression cap-unit 2', (274066, 8, True), 73788),\n  ('partial repair guard 1', (150000, 8, True), 24536), ('partial repair guard 2', (40000, 5, True), 1294),\n  ('control: single parent', (60000, 3, False), 9527), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)]]\nfor label, args, expected in cases[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":"b2426cab50e85f3681b6ed7e123c1fffb0b6d2dda717b021d56c52415e30e140","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, halves, couple):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    base = 2 if couple else 1\n    if halves < 2 * base: return 'ERR:parts'\n    scale = [[11294, '0'], [28797, '11'], [82341, '30'], [177106, '41'], [None, '45']]\n    def tax_for(p): return p * prog(Fraction(income) / p, scale)\n    full = tax_for(Fraction(halves, 2))\n    capped = tax_for(Fraction(base)) - 1759 * Fraction(halves - 2 * base, 2)\n    return int(max(full, capped))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression cap-unit 1', (80000, 6, True), 7054), ('regression cap-unit 2', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts')],\n [('regression cap-unit 1', (250000, 8, True), 63921), ('regression cap-unit 2', (40000, 7, False), 51),\n  ('partial repair guard 1', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527), ('control: single one part', (40000, 2, False), 5286),\n  ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-unit 1', (150000, 6, True), 28054), ('regression cap-unit 2', (80000, 6, False), 10250),\n  ('partial repair guard 1', (40000, 7, False), 51), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: couple with two children', (80000, 6, True), 7054)],\n [('regression cap-unit 1', (193969, 6, True), 44466), ('regression cap-unit 2', (150000, 8, True), 24536),\n  ('partial repair guard 1', (80000, 6, False), 10250), ('control: couple with two children', (80000, 6, True), 7054),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-unit 1', (80000, 8, False), 6732), ('regression cap-unit 2', (274066, 8, True), 73788),\n  ('partial repair guard 1', (150000, 8, True), 24536), ('partial repair guard 2', (40000, 5, True), 1294),\n  ('control: single parent', (60000, 3, False), 9527), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)]]\nfor label, args, expected in cases[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":"93e1eb0dd6c7dcd41ecbb5f329a29835e903f5bc074292c1cedc399d86dfaf7a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, halves, couple):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    base = 2 if couple else 1\n    if halves < 2 * base: return 'ERR:parts'\n    scale = [[11294, '0'], [28797, '11'], [82341, '30'], [177106, '41'], [None, '45']]\n    def tax_for(p): return p * prog(Fraction(income) / p, scale)\n    full = tax_for(Fraction(halves, 2))\n    capped = tax_for(Fraction(base)) - 1759 * (halves - 2 * base)\n    return int(max(full, capped))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression cap-unit 1', (80000, 6, True), 7054), ('regression cap-unit 2', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts')],\n [('regression cap-unit 1', (250000, 8, True), 63921), ('regression cap-unit 2', (40000, 7, False), 51),\n  ('partial repair guard 1', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527), ('control: single one part', (40000, 2, False), 5286),\n  ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-unit 1', (150000, 6, True), 28054), ('regression cap-unit 2', (80000, 6, False), 10250),\n  ('partial repair guard 1', (40000, 7, False), 51), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572),\n  ('control: couple with two children', (80000, 6, True), 7054)],\n [('regression cap-unit 1', (193969, 6, True), 44466), ('regression cap-unit 2', (150000, 8, True), 24536),\n  ('partial repair guard 1', (80000, 6, False), 10250), ('control: couple with two children', (80000, 6, True), 7054),\n  ('control: low income family', (30000, 5, True), 194), ('control: too few parts', (50000, 3, True), 'ERR:parts'),\n  ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-unit 1', (80000, 8, False), 6732), ('regression cap-unit 2', (274066, 8, True), 73788),\n  ('partial repair guard 1', (150000, 8, True), 24536), ('partial repair guard 2', (40000, 5, True), 1294),\n  ('control: single parent', (60000, 3, False), 9527), ('control: large family high income', (250000, 8, True), 63921),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)]]\nfor label, args, expected in cases[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, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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-tax_bracket_computation-family-quotient-cap-cap-unit","generated_at":"2026-09-29T14:47:06.500133+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tax computations hinge on which slice, threshold, ordering and rounding rule applies at each step; a misplaced boundary silently misstates liabilities.","repair":"Allow 1759 per extra half-part.","root_cause":"The cap uses 1759 per full extra part (extra_halves / 2).","sha256":"27e200282d163c055718bd87034f27bc3bc359858ce6a9d5556d1b86a0b2fc4e","title":"The benefit cap is applied per extra part instead of per extra half-part · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.193,"exit_code":1,"observations":[{"actual":8813,"check":"regression cap-unit 1","expected":7054,"passed":false},{"actual":11286,"check":"regression cap-unit 2","expected":9527,"passed":false},{"actual":5286,"check":"control: single one part","expected":5286,"passed":true},{"actual":10572,"check":"control: couple two parts","expected":10572,"passed":true},{"actual":815,"check":"control: low income family","expected":194,"passed":false},{"actual":"ERR:parts","check":"control: too few parts","expected":"ERR:parts","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression cap-unit 1\", \"actual\": 8813, \"expected\": 7054, \"passed\": false}, {\"check\": \"regression cap-unit 2\", \"actual\": 11286, \"expected\": 9527, \"passed\": false}, {\"check\": \"control: single one part\", \"actual\": 5286, \"expected\": 5286, \"passed\": true}, {\"check\": \"control: couple two parts\", \"actual\": 10572, \"expected\": 10572, \"passed\": true}, {\"check\": \"control: low income family\", \"actual\": 815, \"expected\": 194, \"passed\": false}, {\"check\": \"control: too few parts\", \"actual\": \"ERR:parts\", \"expected\": \"ERR:parts\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.596,"exit_code":1,"observations":[{"actual":8813,"check":"regression cap-unit 1","expected":7054,"passed":false},{"actual":10406,"check":"regression cap-unit 2","expected":9527,"passed":false},{"actual":5286,"check":"control: single one part","expected":5286,"passed":true},{"actual":10572,"check":"control: couple two parts","expected":10572,"passed":true},{"actual":194,"check":"control: low income family","expected":194,"passed":true},{"actual":"ERR:parts","check":"control: too few parts","expected":"ERR:parts","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression cap-unit 1\", \"actual\": 8813, \"expected\": 7054, \"passed\": false}, {\"check\": \"regression cap-unit 2\", \"actual\": 10406, \"expected\": 9527, \"passed\": false}, {\"check\": \"control: single one part\", \"actual\": 5286, \"expected\": 5286, \"passed\": true}, {\"check\": \"control: couple two parts\", \"actual\": 10572, \"expected\": 10572, \"passed\": true}, {\"check\": \"control: low income family\", \"actual\": 194, \"expected\": 194, \"passed\": true}, {\"check\": \"control: too few parts\", \"actual\": \"ERR:parts\", \"expected\": \"ERR:parts\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.473,"exit_code":0,"observations":[{"actual":7054,"check":"regression cap-unit 1","expected":7054,"passed":true},{"actual":9527,"check":"regression cap-unit 2","expected":9527,"passed":true},{"actual":5286,"check":"control: single one part","expected":5286,"passed":true},{"actual":10572,"check":"control: couple two parts","expected":10572,"passed":true},{"actual":194,"check":"control: low income family","expected":194,"passed":true},{"actual":"ERR:parts","check":"control: too few parts","expected":"ERR:parts","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression cap-unit 1\", \"actual\": 7054, \"expected\": 7054, \"passed\": true}, {\"check\": \"regression cap-unit 2\", \"actual\": 9527, \"expected\": 9527, \"passed\": true}, {\"check\": \"control: single one part\", \"actual\": 5286, \"expected\": 5286, \"passed\": true}, {\"check\": \"control: couple two parts\", \"actual\": 10572, \"expected\": 10572, \"passed\": true}, {\"check\": \"control: low income family\", \"actual\": 194, \"expected\": 194, \"passed\": true}, {\"check\": \"control: too few parts\", \"actual\": \"ERR:parts\", \"expected\": \"ERR:parts\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}