{"abstract":"Families with extra parts pay less than the capped 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":"Applying the cap only beyond two extra half-parts ignores it for smaller families.","family":"w2-tax_bracket_computation-family-quotient-cap-cap-direction","id":"FA-62626","implementations":{"attempt":{"sha256":"dab705bdba62dd97b1f31c69d53a1e5ecaca5fed92dd4719903b37c9191a44f8","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) if halves - 2 * base > 2 else full)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression cap-direction 1', (80000, 6, True), 7054), ('regression cap-direction 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-direction 1', (30000, 5, True), 194), ('regression cap-direction 2', (250000, 8, True), 63921),\n  ('partial repair guard 1', (150000, 6, True), 28054), ('partial repair guard 2', (193969, 6, True), 44466),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-direction 1', (40000, 7, False), 51), ('regression cap-direction 2', (40000, 8, True), 0),\n  ('partial repair guard 1', (150000, 4, False), 42210), ('partial repair guard 2', (70423, 3, False), 12654),\n  ('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-direction 1', (150000, 6, True), 28054), ('regression cap-direction 2', (16143, 5, False), 0),\n  ('partial repair guard 1', (287118, 5, True), 84416), ('partial repair guard 2', (247910, 5, True), 68341),\n  ('control: couple with two children', (80000, 6, True), 7054), ('control: low income family', (30000, 5, True), 194),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-direction 1', (80000, 6, False), 10250), ('regression cap-direction 2', (193969, 6, True), 44466),\n  ('partial repair guard 1', (80000, 4, False), 13768), ('partial repair guard 2', (80000, 3, False), 15527),\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":"ba9d5604f834540ce36e0b73c22a12aa7112b458337ad7c78ddb6a12fc46633f","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(min(full, capped))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression cap-direction 1', (80000, 6, True), 7054), ('regression cap-direction 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-direction 1', (30000, 5, True), 194), ('regression cap-direction 2', (250000, 8, True), 63921),\n  ('partial repair guard 1', (150000, 6, True), 28054), ('partial repair guard 2', (193969, 6, True), 44466),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-direction 1', (40000, 7, False), 51), ('regression cap-direction 2', (40000, 8, True), 0),\n  ('partial repair guard 1', (150000, 4, False), 42210), ('partial repair guard 2', (70423, 3, False), 12654),\n  ('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-direction 1', (150000, 6, True), 28054), ('regression cap-direction 2', (16143, 5, False), 0),\n  ('partial repair guard 1', (287118, 5, True), 84416), ('partial repair guard 2', (247910, 5, True), 68341),\n  ('control: couple with two children', (80000, 6, True), 7054), ('control: low income family', (30000, 5, True), 194),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-direction 1', (80000, 6, False), 10250), ('regression cap-direction 2', (193969, 6, True), 44466),\n  ('partial repair guard 1', (80000, 4, False), 13768), ('partial repair guard 2', (80000, 3, False), 15527),\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":"d390b1267b6eb0b13ac7fd9064a8ca829eff549cde0c0220f5865d4d7a380c88","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-direction 1', (80000, 6, True), 7054), ('regression cap-direction 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-direction 1', (30000, 5, True), 194), ('regression cap-direction 2', (250000, 8, True), 63921),\n  ('partial repair guard 1', (150000, 6, True), 28054), ('partial repair guard 2', (193969, 6, True), 44466),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527),\n  ('control: single one part', (40000, 2, False), 5286), ('control: couple two parts', (80000, 4, True), 10572)],\n [('regression cap-direction 1', (40000, 7, False), 51), ('regression cap-direction 2', (40000, 8, True), 0),\n  ('partial repair guard 1', (150000, 4, False), 42210), ('partial repair guard 2', (70423, 3, False), 12654),\n  ('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-direction 1', (150000, 6, True), 28054), ('regression cap-direction 2', (16143, 5, False), 0),\n  ('partial repair guard 1', (287118, 5, True), 84416), ('partial repair guard 2', (247910, 5, True), 68341),\n  ('control: couple with two children', (80000, 6, True), 7054), ('control: low income family', (30000, 5, True), 194),\n  ('control: too few parts', (50000, 3, True), 'ERR:parts'), ('control: single parent', (60000, 3, False), 9527)],\n [('regression cap-direction 1', (80000, 6, False), 10250), ('regression cap-direction 2', (193969, 6, True), 44466),\n  ('partial repair guard 1', (80000, 4, False), 13768), ('partial repair guard 2', (80000, 3, False), 15527),\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-direction","generated_at":"2026-09-29T14:47:06.417704+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":"Take the larger of the full-quotient tax and the capped tax.","root_cause":"The result is min(full, capped) instead of max(full, capped).","sha256":"c6a23f2d4ac49fec914b279be69f318f1682e34ce020ff2aa372875f293dfa60","title":"The half-part benefit cap lowers tax instead of limiting the benefit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.974,"exit_code":1,"observations":[{"actual":5072,"check":"regression cap-direction 1","expected":7054,"passed":false},{"actual":7929,"check":"regression cap-direction 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-direction 1\", \"actual\": 5072, \"expected\": 7054, \"passed\": false}, {\"check\": \"regression cap-direction 2\", \"actual\": 7929, \"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"},"broken":{"elapsed_ms":43.377,"exit_code":1,"observations":[{"actual":5072,"check":"regression cap-direction 1","expected":7054,"passed":false},{"actual":7929,"check":"regression cap-direction 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":-943,"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-direction 1\", \"actual\": 5072, \"expected\": 7054, \"passed\": false}, {\"check\": \"regression cap-direction 2\", \"actual\": 7929, \"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\": -943, \"expected\": 194, \"passed\": false}, {\"check\": \"control: too few parts\", \"actual\": \"ERR:parts\", \"expected\": \"ERR:parts\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.839,"exit_code":0,"observations":[{"actual":7054,"check":"regression cap-direction 1","expected":7054,"passed":true},{"actual":9527,"check":"regression cap-direction 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-direction 1\", \"actual\": 7054, \"expected\": 7054, \"passed\": true}, {\"check\": \"regression cap-direction 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"}