{"abstract":"Half-cent surtax amounts are dropped.","category":"Tax bracket computation","checks":7,"contract":"solve(state, nonref, ref, pct): amounts in integer cents; pct a decimal percentage string. State tax after nonrefundable credits is max(0, state - nonref). The local surtax is pct% of that amount, rounded half-up to cents. Refundable credits then apply to the combined total in full (a negative total is a refund). Return [local, total].","evaluation_group":"w2-tax_bracket_computation-local-piggyback-surtax","failed_approach":"Rounding half-to-even still drops half-cents that follow an even cent.","family":"w2-tax_bracket_computation-local-piggyback-surtax-surtax-rounding","id":"FA-62696","implementations":{"attempt":{"sha256":"4f2ca36609ce7266ef4372f931784d8ad5b5d50e12d6d8cd7414543d3d081ce4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(state, nonref, ref, pct):\n    after = max(0, state - nonref)\n    local = round(after * Fraction(pct) / 100)\n    return [local, after + local - ref]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression surtax-rounding 1', (333, 0, 0, '1.5'), [5, 338]),\n  ('regression surtax-rounding 2', (1001, 0, 0, '50'), [501, 1502]),\n  ('partial repair guard 2', (30452, 0, 24792, '12.5'), [3807, 9467]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: no surtax', (4200, 100, 0, '0'), [0, 4100])],\n [('regression surtax-rounding 1', (1003, 0, 0, '50'), [502, 1505]),\n  ('regression surtax-rounding 2', (133783, 45064, 0, '17.5'), [15526, 104245]),\n  ('partial repair guard 1', (52009, 0, 500, '50'), [26005, 77514]),\n  ('partial repair guard 2', (196677, 0, 9000, '50'), [98339, 286016]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (86323, 79662, 500, '12.5'), [833, 6994]),\n  ('regression surtax-rounding 2', (44678, 28763, 500, '50'), [7958, 23373]),\n  ('partial repair guard 1', (61555, 4786, 9000, '50'), [28385, 76154]),\n  ('partial repair guard 2', (122180, 1000, 13173, '17.5'), [21207, 129214]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])],\n [('regression surtax-rounding 1', (176644, 20000, 500, '8'), [12532, 168676]),\n  ('regression surtax-rounding 2', (96269, 20000, 9000, '8'), [6102, 73371]),\n  ('partial repair guard 1', (80433, 0, 9000, '50'), [40217, 111650]),\n  ('partial repair guard 2', (139853, 20000, 0, '50'), [59927, 179780]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (197930, 2867, 500, '12.5'), [24383, 218946]),\n  ('regression surtax-rounding 2', (39524, 0, 0, '8'), [3162, 42686]),\n  ('partial repair guard 1', (199421, 104, 500, '50'), [99659, 298476]),\n  ('partial repair guard 2', (57505, 1000, 0, '50'), [28253, 84758]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])]]\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":"0bfdab531828ef9fc1c7cbd8a19151e7183522b0edf58db179a3d85730c04f49","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(state, nonref, ref, pct):\n    after = max(0, state - nonref)\n    local = int(after * Fraction(pct) / 100)\n    return [local, after + local - ref]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression surtax-rounding 1', (333, 0, 0, '1.5'), [5, 338]),\n  ('regression surtax-rounding 2', (1001, 0, 0, '50'), [501, 1502]),\n  ('partial repair guard 2', (30452, 0, 24792, '12.5'), [3807, 9467]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: no surtax', (4200, 100, 0, '0'), [0, 4100])],\n [('regression surtax-rounding 1', (1003, 0, 0, '50'), [502, 1505]),\n  ('regression surtax-rounding 2', (133783, 45064, 0, '17.5'), [15526, 104245]),\n  ('partial repair guard 1', (52009, 0, 500, '50'), [26005, 77514]),\n  ('partial repair guard 2', (196677, 0, 9000, '50'), [98339, 286016]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (86323, 79662, 500, '12.5'), [833, 6994]),\n  ('regression surtax-rounding 2', (44678, 28763, 500, '50'), [7958, 23373]),\n  ('partial repair guard 1', (61555, 4786, 9000, '50'), [28385, 76154]),\n  ('partial repair guard 2', (122180, 1000, 13173, '17.5'), [21207, 129214]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])],\n [('regression surtax-rounding 1', (176644, 20000, 500, '8'), [12532, 168676]),\n  ('regression surtax-rounding 2', (96269, 20000, 9000, '8'), [6102, 73371]),\n  ('partial repair guard 1', (80433, 0, 9000, '50'), [40217, 111650]),\n  ('partial repair guard 2', (139853, 20000, 0, '50'), [59927, 179780]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (197930, 2867, 500, '12.5'), [24383, 218946]),\n  ('regression surtax-rounding 2', (39524, 0, 0, '8'), [3162, 42686]),\n  ('partial repair guard 1', (199421, 104, 500, '50'), [99659, 298476]),\n  ('partial repair guard 2', (57505, 1000, 0, '50'), [28253, 84758]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])]]\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":"f14efcd883afc20724ab376efed40d8f8cb3fe1f9cc024c652e8d6464cd94562","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(state, nonref, ref, pct):\n    after = max(0, state - nonref)\n    local = int(after * Fraction(pct) / 100 + Fraction(1, 2))\n    return [local, after + local - ref]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression surtax-rounding 1', (333, 0, 0, '1.5'), [5, 338]),\n  ('regression surtax-rounding 2', (1001, 0, 0, '50'), [501, 1502]),\n  ('partial repair guard 2', (30452, 0, 24792, '12.5'), [3807, 9467]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: no surtax', (4200, 100, 0, '0'), [0, 4100])],\n [('regression surtax-rounding 1', (1003, 0, 0, '50'), [502, 1505]),\n  ('regression surtax-rounding 2', (133783, 45064, 0, '17.5'), [15526, 104245]),\n  ('partial repair guard 1', (52009, 0, 500, '50'), [26005, 77514]),\n  ('partial repair guard 2', (196677, 0, 9000, '50'), [98339, 286016]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (86323, 79662, 500, '12.5'), [833, 6994]),\n  ('regression surtax-rounding 2', (44678, 28763, 500, '50'), [7958, 23373]),\n  ('partial repair guard 1', (61555, 4786, 9000, '50'), [28385, 76154]),\n  ('partial repair guard 2', (122180, 1000, 13173, '17.5'), [21207, 129214]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])],\n [('regression surtax-rounding 1', (176644, 20000, 500, '8'), [12532, 168676]),\n  ('regression surtax-rounding 2', (96269, 20000, 9000, '8'), [6102, 73371]),\n  ('partial repair guard 1', (80433, 0, 9000, '50'), [40217, 111650]),\n  ('partial repair guard 2', (139853, 20000, 0, '50'), [59927, 179780]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502]), ('control: no surtax', (4200, 100, 0, '0'), [0, 4100]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000])],\n [('regression surtax-rounding 1', (197930, 2867, 500, '12.5'), [24383, 218946]),\n  ('regression surtax-rounding 2', (39524, 0, 0, '8'), [3162, 42686]),\n  ('partial repair guard 1', (199421, 104, 500, '50'), [99659, 298476]),\n  ('partial repair guard 2', (57505, 1000, 0, '50'), [28253, 84758]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: credits exceed tax', (1000, 3000, 500, '20'), [0, -500]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500])]]\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-local-piggyback-surtax-surtax-rounding","generated_at":"2026-09-29T14:47:07.107948+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":"Round half-up to cents.","root_cause":"The surtax is truncated instead of rounded half-up.","sha256":"dfe32cf4259efb0587842b3777b2866404b9562e16ecb65b1bdc95a81ddec518","title":"The local surtax is truncated to cents · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.153,"exit_code":1,"observations":[{"actual":[5,338],"check":"regression surtax-rounding 1","expected":[5,338],"passed":true},{"actual":[500,1501],"check":"regression surtax-rounding 2","expected":[501,1502],"passed":false},{"actual":[3806,9466],"check":"partial repair guard 2","expected":[3807,9467],"passed":false},{"actual":[14000,89000],"check":"control: typical","expected":[14000,89000],"passed":true},{"actual":[0,-500],"check":"control: credits exceed tax","expected":[0,-500],"passed":true},{"actual":[500,-4500],"check":"control: large refund","expected":[500,-4500],"passed":true},{"actual":[0,4100],"check":"control: no surtax","expected":[0,4100],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression surtax-rounding 1\", \"actual\": [5, 338], \"expected\": [5, 338], \"passed\": true}, {\"check\": \"regression surtax-rounding 2\", \"actual\": [500, 1501], \"expected\": [501, 1502], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [3806, 9466], \"expected\": [3807, 9467], \"passed\": false}, {\"check\": \"control: typical\", \"actual\": [14000, 89000], \"expected\": [14000, 89000], \"passed\": true}, {\"check\": \"control: credits exceed tax\", \"actual\": [0, -500], \"expected\": [0, -500], \"passed\": true}, {\"check\": \"control: large refund\", \"actual\": [500, -4500], \"expected\": [500, -4500], \"passed\": true}, {\"check\": \"control: no surtax\", \"actual\": [0, 4100], \"expected\": [0, 4100], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.919,"exit_code":1,"observations":[{"actual":[4,337],"check":"regression surtax-rounding 1","expected":[5,338],"passed":false},{"actual":[500,1501],"check":"regression surtax-rounding 2","expected":[501,1502],"passed":false},{"actual":[3806,9466],"check":"partial repair guard 2","expected":[3807,9467],"passed":false},{"actual":[14000,89000],"check":"control: typical","expected":[14000,89000],"passed":true},{"actual":[0,-500],"check":"control: credits exceed tax","expected":[0,-500],"passed":true},{"actual":[500,-4500],"check":"control: large refund","expected":[500,-4500],"passed":true},{"actual":[0,4100],"check":"control: no surtax","expected":[0,4100],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression surtax-rounding 1\", \"actual\": [4, 337], \"expected\": [5, 338], \"passed\": false}, {\"check\": \"regression surtax-rounding 2\", \"actual\": [500, 1501], \"expected\": [501, 1502], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [3806, 9466], \"expected\": [3807, 9467], \"passed\": false}, {\"check\": \"control: typical\", \"actual\": [14000, 89000], \"expected\": [14000, 89000], \"passed\": true}, {\"check\": \"control: credits exceed tax\", \"actual\": [0, -500], \"expected\": [0, -500], \"passed\": true}, {\"check\": \"control: large refund\", \"actual\": [500, -4500], \"expected\": [500, -4500], \"passed\": true}, {\"check\": \"control: no surtax\", \"actual\": [0, 4100], \"expected\": [0, 4100], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.421,"exit_code":0,"observations":[{"actual":[5,338],"check":"regression surtax-rounding 1","expected":[5,338],"passed":true},{"actual":[501,1502],"check":"regression surtax-rounding 2","expected":[501,1502],"passed":true},{"actual":[3807,9467],"check":"partial repair guard 2","expected":[3807,9467],"passed":true},{"actual":[14000,89000],"check":"control: typical","expected":[14000,89000],"passed":true},{"actual":[0,-500],"check":"control: credits exceed tax","expected":[0,-500],"passed":true},{"actual":[500,-4500],"check":"control: large refund","expected":[500,-4500],"passed":true},{"actual":[0,4100],"check":"control: no surtax","expected":[0,4100],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression surtax-rounding 1\", \"actual\": [5, 338], \"expected\": [5, 338], \"passed\": true}, {\"check\": \"regression surtax-rounding 2\", \"actual\": [501, 1502], \"expected\": [501, 1502], \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": [3807, 9467], \"expected\": [3807, 9467], \"passed\": true}, {\"check\": \"control: typical\", \"actual\": [14000, 89000], \"expected\": [14000, 89000], \"passed\": true}, {\"check\": \"control: credits exceed tax\", \"actual\": [0, -500], \"expected\": [0, -500], \"passed\": true}, {\"check\": \"control: large refund\", \"actual\": [500, -4500], \"expected\": [500, -4500], \"passed\": true}, {\"check\": \"control: no surtax\", \"actual\": [0, 4100], \"expected\": [0, 4100], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}