{"abstract":"A company whose dividends lift it above the limit keeps small-profits treatment.","category":"Tax bracket computation","checks":7,"contract":"solve(profits, dividends, associates, days): stipulated small-profits relief. Limits L = 50000 and U = 250000 are divided by (associates + 1) and prorated by days/365 (exact fractions). Augmented profits A = profits + dividends decide the band: A <= L taxes profits N at 19%; A >= U at 25%; otherwise tax = 25% of N minus 3/200 * (U - A) * N / A. Return integer cents rounded half-up.","evaluation_group":"w2-tax_bracket_computation-marginal-relief-band","failed_approach":"Using A for the band but dropping the N/A factor over-relieves companies with dividends.","family":"w2-tax_bracket_computation-marginal-relief-band-augmented-profits","id":"FA-62591","implementations":{"attempt":{"sha256":"98ff8a122f035eef523d8b809c19d643db704f2ba1d70bed9a0d86382f8a12b0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(profits, dividends, associates, days):\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    div = associates + 1\n    L = Fraction(50000 * days, 365 * div)\n    U = Fraction(250000 * days, 365 * div)\n    A = profits + dividends\n    N = Fraction(profits)\n    if A <= L: tax = N * 19 / 100\n    elif A >= U: tax = N * 25 / 100\n    else: tax = N * 25 / 100 - Fraction(3, 200) * (U - A)\n    return cents(tax)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression augmented-profits 1', (100000, 25000, 0, 365), 2350000),\n  ('regression augmented-profits 2', (200000, 60000, 0, 365), 5000000),\n  ('partial repair guard 2', (100000, 5000, 1, 365), 2471429), ('control: small profits', (40000, 0, 0, 365), 760000),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500)],\n [('regression augmented-profits 1', (100000, 5000, 1, 365), 2471429),\n  ('regression augmented-profits 2', (50000, 25000, 0, 365), 1075000), ('partial repair guard 1', (0, 5000, 4, 181), 0),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000)],\n [('regression augmented-profits 1', (100000, 5000, 0, 300), 2356458),\n  ('regression augmented-profits 2', (50000, 60000, 0, 365), 1154545),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000),\n  ('control: small profits', (40000, 0, 0, 365), 760000), ('control: relief zone', (100000, 0, 0, 365), 2275000)],\n [('regression augmented-profits 1', (30000, 5000, 0, 200), 618875),\n  ('regression augmented-profits 2', (30000, 25000, 4, 365), 750000), ('partial repair guard 1', (0, 25000, 0, 181), 0),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000)],\n [('regression augmented-profits 1', (50000, 60000, 0, 90), 1250000),\n  ('regression augmented-profits 2', (50000, 5000, 0, 300), 1044801),\n  ('partial repair guard 2', (180000, 60000, 0, 365), 4488750),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000)]]\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":"5e5f5346f6a136a379b928048435a1d6253bd36598756bfe697ffcd7c2e60a57","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(profits, dividends, associates, days):\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    div = associates + 1\n    L = Fraction(50000 * days, 365 * div)\n    U = Fraction(250000 * days, 365 * div)\n    A = profits\n    N = Fraction(profits)\n    if A <= L: tax = N * 19 / 100\n    elif A >= U: tax = N * 25 / 100\n    else: tax = N * 25 / 100 - Fraction(3, 200) * (U - A) * N / A\n    return cents(tax)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression augmented-profits 1', (100000, 25000, 0, 365), 2350000),\n  ('regression augmented-profits 2', (200000, 60000, 0, 365), 5000000),\n  ('partial repair guard 2', (100000, 5000, 1, 365), 2471429), ('control: small profits', (40000, 0, 0, 365), 760000),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500)],\n [('regression augmented-profits 1', (100000, 5000, 1, 365), 2471429),\n  ('regression augmented-profits 2', (50000, 25000, 0, 365), 1075000), ('partial repair guard 1', (0, 5000, 4, 181), 0),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000)],\n [('regression augmented-profits 1', (100000, 5000, 0, 300), 2356458),\n  ('regression augmented-profits 2', (50000, 60000, 0, 365), 1154545),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000),\n  ('control: small profits', (40000, 0, 0, 365), 760000), ('control: relief zone', (100000, 0, 0, 365), 2275000)],\n [('regression augmented-profits 1', (30000, 5000, 0, 200), 618875),\n  ('regression augmented-profits 2', (30000, 25000, 4, 365), 750000), ('partial repair guard 1', (0, 25000, 0, 181), 0),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000)],\n [('regression augmented-profits 1', (50000, 60000, 0, 90), 1250000),\n  ('regression augmented-profits 2', (50000, 5000, 0, 300), 1044801),\n  ('partial repair guard 2', (180000, 60000, 0, 365), 4488750),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000)]]\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":"8220b29d7c1bf7340ad059fe336b43a4a046bd3831631cf8f2014d773a230225","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(profits, dividends, associates, days):\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    div = associates + 1\n    L = Fraction(50000 * days, 365 * div)\n    U = Fraction(250000 * days, 365 * div)\n    A = profits + dividends\n    N = Fraction(profits)\n    if A <= L: tax = N * 19 / 100\n    elif A >= U: tax = N * 25 / 100\n    else: tax = N * 25 / 100 - Fraction(3, 200) * (U - A) * N / A\n    return cents(tax)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression augmented-profits 1', (100000, 25000, 0, 365), 2350000),\n  ('regression augmented-profits 2', (200000, 60000, 0, 365), 5000000),\n  ('partial repair guard 2', (100000, 5000, 1, 365), 2471429), ('control: small profits', (40000, 0, 0, 365), 760000),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500)],\n [('regression augmented-profits 1', (100000, 5000, 1, 365), 2471429),\n  ('regression augmented-profits 2', (50000, 25000, 0, 365), 1075000), ('partial repair guard 1', (0, 5000, 4, 181), 0),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000)],\n [('regression augmented-profits 1', (100000, 5000, 0, 300), 2356458),\n  ('regression augmented-profits 2', (50000, 60000, 0, 365), 1154545),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000),\n  ('control: small profits', (40000, 0, 0, 365), 760000), ('control: relief zone', (100000, 0, 0, 365), 2275000)],\n [('regression augmented-profits 1', (30000, 5000, 0, 200), 618875),\n  ('regression augmented-profits 2', (30000, 25000, 4, 365), 750000), ('partial repair guard 1', (0, 25000, 0, 181), 0),\n  ('control: relief zone', (100000, 0, 0, 365), 2275000), ('control: main rate', (300000, 0, 0, 365), 7500000),\n  ('control: associated company', (60000, 0, 1, 365), 1402500),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000)],\n [('regression augmented-profits 1', (50000, 60000, 0, 90), 1250000),\n  ('regression augmented-profits 2', (50000, 5000, 0, 300), 1044801),\n  ('partial repair guard 2', (180000, 60000, 0, 365), 4488750),\n  ('control: with dividends', (100000, 25000, 0, 365), 2350000), ('control: short period', (30000, 0, 0, 181), 609041),\n  ('control: two associates short', (70000, 5000, 2, 200), 1750000),\n  ('control: dividends push to main rate', (200000, 60000, 0, 365), 5000000)]]\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-marginal-relief-band-augmented-profits","generated_at":"2026-09-29T14:47:05.988490+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":"Use A = profits + dividends for the band test and the relief fraction.","root_cause":"The band test uses taxable profits instead of augmented profits.","sha256":"6f9cace55a9c34037d62666bc04b0f511ba92ddd5ff689171d7f02e8e8942f99","title":"Exempt dividends are ignored when choosing the rate band · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.139,"exit_code":1,"observations":[{"actual":2312500,"check":"regression augmented-profits 1","expected":2350000,"passed":false},{"actual":5000000,"check":"regression augmented-profits 2","expected":5000000,"passed":true},{"actual":2470000,"check":"partial repair guard 2","expected":2471429,"passed":false},{"actual":760000,"check":"control: small profits","expected":760000,"passed":true},{"actual":2275000,"check":"control: relief zone","expected":2275000,"passed":true},{"actual":7500000,"check":"control: main rate","expected":7500000,"passed":true},{"actual":1402500,"check":"control: associated company","expected":1402500,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression augmented-profits 1\", \"actual\": 2312500, \"expected\": 2350000, \"passed\": false}, {\"check\": \"regression augmented-profits 2\", \"actual\": 5000000, \"expected\": 5000000, \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": 2470000, \"expected\": 2471429, \"passed\": false}, {\"check\": \"control: small profits\", \"actual\": 760000, \"expected\": 760000, \"passed\": true}, {\"check\": \"control: relief zone\", \"actual\": 2275000, \"expected\": 2275000, \"passed\": true}, {\"check\": \"control: main rate\", \"actual\": 7500000, \"expected\": 7500000, \"passed\": true}, {\"check\": \"control: associated company\", \"actual\": 1402500, \"expected\": 1402500, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.687,"exit_code":1,"observations":[{"actual":2275000,"check":"regression augmented-profits 1","expected":2350000,"passed":false},{"actual":4925000,"check":"regression augmented-profits 2","expected":5000000,"passed":false},{"actual":2462500,"check":"partial repair guard 2","expected":2471429,"passed":false},{"actual":760000,"check":"control: small profits","expected":760000,"passed":true},{"actual":2275000,"check":"control: relief zone","expected":2275000,"passed":true},{"actual":7500000,"check":"control: main rate","expected":7500000,"passed":true},{"actual":1402500,"check":"control: associated company","expected":1402500,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression augmented-profits 1\", \"actual\": 2275000, \"expected\": 2350000, \"passed\": false}, {\"check\": \"regression augmented-profits 2\", \"actual\": 4925000, \"expected\": 5000000, \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": 2462500, \"expected\": 2471429, \"passed\": false}, {\"check\": \"control: small profits\", \"actual\": 760000, \"expected\": 760000, \"passed\": true}, {\"check\": \"control: relief zone\", \"actual\": 2275000, \"expected\": 2275000, \"passed\": true}, {\"check\": \"control: main rate\", \"actual\": 7500000, \"expected\": 7500000, \"passed\": true}, {\"check\": \"control: associated company\", \"actual\": 1402500, \"expected\": 1402500, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.429,"exit_code":0,"observations":[{"actual":2350000,"check":"regression augmented-profits 1","expected":2350000,"passed":true},{"actual":5000000,"check":"regression augmented-profits 2","expected":5000000,"passed":true},{"actual":2471429,"check":"partial repair guard 2","expected":2471429,"passed":true},{"actual":760000,"check":"control: small profits","expected":760000,"passed":true},{"actual":2275000,"check":"control: relief zone","expected":2275000,"passed":true},{"actual":7500000,"check":"control: main rate","expected":7500000,"passed":true},{"actual":1402500,"check":"control: associated company","expected":1402500,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression augmented-profits 1\", \"actual\": 2350000, \"expected\": 2350000, \"passed\": true}, {\"check\": \"regression augmented-profits 2\", \"actual\": 5000000, \"expected\": 5000000, \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": 2471429, \"expected\": 2471429, \"passed\": true}, {\"check\": \"control: small profits\", \"actual\": 760000, \"expected\": 760000, \"passed\": true}, {\"check\": \"control: relief zone\", \"actual\": 2275000, \"expected\": 2275000, \"passed\": true}, {\"check\": \"control: main rate\", \"actual\": 7500000, \"expected\": 7500000, \"passed\": true}, {\"check\": \"control: associated company\", \"actual\": 1402500, \"expected\": 1402500, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}