{"abstract":"Credits larger than the state tax produce a negative local surtax and an extra refund.","category":"Tax bracket computation","checks":6,"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].","contract_signature":"state, nonref, ref, pct","evaluation_group":"w2-tax_bracket_computation-local-piggyback-surtax","failed_approach":"Flooring only the local surtax still lets the negative credited state tax create a refund.","family":"w2-tax_bracket_computation-local-piggyback-surtax-credited-floor","id":"FA-62691","implementations":{"attempt":{"sha256":"eec3b473cc7465a887be8389418aff425502de433dce89dc023efd788a338a07","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 = state - nonref\n    local = max(0, 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 credited-floor 1', (1000, 3000, 500, '20'), [0, -500]),\n  ('regression credited-floor 2', (18157, 72365, 10702, '3.25'), [0, -10702]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502])],\n [('regression credited-floor 1', (60634, 89812, 9000, '12.5'), [0, -9000]),\n  ('regression credited-floor 2', (7099, 20000, 500, '20'), [0, -500]),\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 credited-floor 1', (44659, 45143, 0, '1.5'), [0, 0]),\n  ('regression credited-floor 2', (63135, 85065, 500, '20'), [0, -500]),\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 credited-floor 1', (5225, 20000, 9000, '8'), [0, -9000]),\n  ('regression credited-floor 2', (18855, 20000, 500, '50'), [0, -500]),\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 credited-floor 1', (56595, 97017, 0, '1.5'), [0, 0]),\n  ('regression credited-floor 2', (27017, 95158, 26974, '20'), [0, -26974]),\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":"bed80bf8c6334e8bccf345cc17eb9a519c3ac3f28c02ddd4eab9f6ea188554cc","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 = 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 credited-floor 1', (1000, 3000, 500, '20'), [0, -500]),\n  ('regression credited-floor 2', (18157, 72365, 10702, '3.25'), [0, -10702]),\n  ('control: typical', (100000, 20000, 5000, '17.5'), [14000, 89000]),\n  ('control: rounding', (333, 0, 0, '1.5'), [5, 338]),\n  ('control: large refund', (5000, 1000, 9000, '12.5'), [500, -4500]),\n  ('control: half cent', (1001, 0, 0, '50'), [501, 1502])],\n [('regression credited-floor 1', (60634, 89812, 9000, '12.5'), [0, -9000]),\n  ('regression credited-floor 2', (7099, 20000, 500, '20'), [0, -500]),\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 credited-floor 1', (44659, 45143, 0, '1.5'), [0, 0]),\n  ('regression credited-floor 2', (63135, 85065, 500, '20'), [0, -500]),\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 credited-floor 1', (5225, 20000, 9000, '8'), [0, -9000]),\n  ('regression credited-floor 2', (18855, 20000, 500, '50'), [0, -500]),\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 credited-floor 1', (56595, 97017, 0, '1.5'), [0, 0]),\n  ('regression credited-floor 2', (27017, 95158, 26974, '20'), [0, -26974]),\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-credited-floor","generated_at":"2026-09-29T14:47:07.032365+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.","root_cause":"State tax after nonrefundable credits is not floored at zero.","sha256":"7e82ad8b7e50316a9cc2d9f767c26c993c041da52aacc69026967e29c924d742","title":"Excess nonrefundable credits make the surtax negative · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.994,"exit_code":1,"observations":[{"actual":[0,-2500],"check":"regression credited-floor 1","expected":[0,-500],"passed":false},{"actual":[0,-64910],"check":"regression credited-floor 2","expected":[0,-10702],"passed":false},{"actual":[14000,89000],"check":"control: typical","expected":[14000,89000],"passed":true},{"actual":[5,338],"check":"control: rounding","expected":[5,338],"passed":true},{"actual":[500,-4500],"check":"control: large refund","expected":[500,-4500],"passed":true},{"actual":[501,1502],"check":"control: half cent","expected":[501,1502],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression credited-floor 1\", \"actual\": [0, -2500], \"expected\": [0, -500], \"passed\": false}, {\"check\": \"regression credited-floor 2\", \"actual\": [0, -64910], \"expected\": [0, -10702], \"passed\": false}, {\"check\": \"control: typical\", \"actual\": [14000, 89000], \"expected\": [14000, 89000], \"passed\": true}, {\"check\": \"control: rounding\", \"actual\": [5, 338], \"expected\": [5, 338], \"passed\": true}, {\"check\": \"control: large refund\", \"actual\": [500, -4500], \"expected\": [500, -4500], \"passed\": true}, {\"check\": \"control: half cent\", \"actual\": [501, 1502], \"expected\": [501, 1502], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.105,"exit_code":1,"observations":[{"actual":[-399,-2899],"check":"regression credited-floor 1","expected":[0,-500],"passed":false},{"actual":[-1761,-66671],"check":"regression credited-floor 2","expected":[0,-10702],"passed":false},{"actual":[14000,89000],"check":"control: typical","expected":[14000,89000],"passed":true},{"actual":[5,338],"check":"control: rounding","expected":[5,338],"passed":true},{"actual":[500,-4500],"check":"control: large refund","expected":[500,-4500],"passed":true},{"actual":[501,1502],"check":"control: half cent","expected":[501,1502],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression credited-floor 1\", \"actual\": [-399, -2899], \"expected\": [0, -500], \"passed\": false}, {\"check\": \"regression credited-floor 2\", \"actual\": [-1761, -66671], \"expected\": [0, -10702], \"passed\": false}, {\"check\": \"control: typical\", \"actual\": [14000, 89000], \"expected\": [14000, 89000], \"passed\": true}, {\"check\": \"control: rounding\", \"actual\": [5, 338], \"expected\": [5, 338], \"passed\": true}, {\"check\": \"control: large refund\", \"actual\": [500, -4500], \"expected\": [500, -4500], \"passed\": true}, {\"check\": \"control: half cent\", \"actual\": [501, 1502], \"expected\": [501, 1502], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}