{"abstract":"Refundable credits never produce a refund.","category":"Tax bracket computation","checks":7,"contract":"solve(tax, credits): tax is integer cents >= 0; credits is a list of [kind, cents] with kind 'nonref' (nonrefundable, unused part lost), 'carry' (nonrefundable, unused part carried forward) or 'ref' (refundable). Unknown kinds return 'ERR:kind'. Apply all nonref credits first (limited to the remaining tax), then carry credits (limited to what remains), then refundable credits in full (a negative result is a refund). Return [final_tax, carryforward].","evaluation_group":"w2-tax_bracket_computation-credit-ordering","failed_approach":"Limiting refundable credits to the original tax still withholds refunds.","family":"w2-tax_bracket_computation-credit-ordering-refundable-limit","id":"FA-62481","implementations":{"attempt":{"sha256":"15a7aa826ceec3f8c36cc2a94c8fee8c8378de3bff296a1f7b1bdb65211b7a94","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tax, credits):\n    tot = {'nonref': 0, 'carry': 0, 'ref': 0}\n    for kind, amount in credits:\n        if kind not in tot: return 'ERR:kind'\n        tot[kind] += amount\n    n, c, r = tot['nonref'], tot['carry'], tot['ref']\n    t = tax\n    use_n = min(n, t)\n    t -= use_n\n    use_c = min(c, t)\n    t -= use_c\n    cf = c - use_c\n    t -= min(r, tax)\n    return [t, cf]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression refundable-limit 1', (500, [['ref', 700]]), [-200, 0]),\n  ('regression refundable-limit 2', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('partial repair guard 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('regression refundable-limit 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('partial repair guard 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('partial repair guard 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200])],\n [('regression refundable-limit 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('regression refundable-limit 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('partial repair guard 1', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 2', (100, [['ref', 300]]), [-200, 0]), ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0]), ('control: no tax carry', (0, [['carry', 50]]), [0, 50])],\n [('regression refundable-limit 1', (444, [['nonref', 806], ['ref', 2], ['nonref', 464], ['ref', 0]]), [-2, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 1', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 2', (0, [['ref', 100], ['carry', 100]]), [-100, 100]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (100, [['ref', 300]]), [-200, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 1', (500, [['carry', 100], ['nonref', 100], ['ref', 634], ['nonref', 100]]), [-434, 0]),\n  ('partial repair guard 2', (500, [['ref', 50], ['ref', 50], ['nonref', 0], ['ref', 2444]]), [-2044, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0])]]\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":"67ca01684902a0099313aceb3e258f2600821592d51e7aace77ea54dfaabf41f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tax, credits):\n    tot = {'nonref': 0, 'carry': 0, 'ref': 0}\n    for kind, amount in credits:\n        if kind not in tot: return 'ERR:kind'\n        tot[kind] += amount\n    n, c, r = tot['nonref'], tot['carry'], tot['ref']\n    t = tax\n    use_n = min(n, t)\n    t -= use_n\n    use_c = min(c, t)\n    t -= use_c\n    cf = c - use_c\n    t = max(0, t - r)\n    return [t, cf]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression refundable-limit 1', (500, [['ref', 700]]), [-200, 0]),\n  ('regression refundable-limit 2', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('partial repair guard 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('regression refundable-limit 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('partial repair guard 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('partial repair guard 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200])],\n [('regression refundable-limit 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('regression refundable-limit 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('partial repair guard 1', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 2', (100, [['ref', 300]]), [-200, 0]), ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0]), ('control: no tax carry', (0, [['carry', 50]]), [0, 50])],\n [('regression refundable-limit 1', (444, [['nonref', 806], ['ref', 2], ['nonref', 464], ['ref', 0]]), [-2, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 1', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 2', (0, [['ref', 100], ['carry', 100]]), [-100, 100]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (100, [['ref', 300]]), [-200, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 1', (500, [['carry', 100], ['nonref', 100], ['ref', 634], ['nonref', 100]]), [-434, 0]),\n  ('partial repair guard 2', (500, [['ref', 50], ['ref', 50], ['nonref', 0], ['ref', 2444]]), [-2044, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0])]]\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":"49598d0814ca8dbab98bc022c19a6afcbca021600fbb0f2dff79b795d3c84b2b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tax, credits):\n    tot = {'nonref': 0, 'carry': 0, 'ref': 0}\n    for kind, amount in credits:\n        if kind not in tot: return 'ERR:kind'\n        tot[kind] += amount\n    n, c, r = tot['nonref'], tot['carry'], tot['ref']\n    t = tax\n    use_n = min(n, t)\n    t -= use_n\n    use_c = min(c, t)\n    t -= use_c\n    cf = c - use_c\n    t -= r\n    return [t, cf]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression refundable-limit 1', (500, [['ref', 700]]), [-200, 0]),\n  ('regression refundable-limit 2', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('partial repair guard 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('regression refundable-limit 2', (0, [['carry', 300], ['ref', 50]]), [-50, 300]),\n  ('partial repair guard 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('partial repair guard 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200])],\n [('regression refundable-limit 1', (0, [['ref', 2834], ['carry', 0]]), [-2834, 0]),\n  ('regression refundable-limit 2', (0, [['nonref', 100], ['ref', 0], ['ref', 50], ['carry', 300]]), [-50, 300]),\n  ('partial repair guard 1', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 2', (100, [['ref', 300]]), [-200, 0]), ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0]), ('control: no tax carry', (0, [['carry', 50]]), [0, 50])],\n [('regression refundable-limit 1', (444, [['nonref', 806], ['ref', 2], ['nonref', 464], ['ref', 0]]), [-2, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 931], ['carry', 300], ['ref', 50]]), [-981, 200]),\n  ('partial repair guard 1', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 2', (0, [['ref', 100], ['carry', 100]]), [-100, 100]),\n  ('control: no tax carry', (0, [['carry', 50]]), [0, 50]),\n  ('control: unknown kind', (100, [['bonus', 5]]), 'ERR:kind'),\n  ('control: nonref exceeds tax', (300, [['nonref', 500], ['ref', 100]]), [-100, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200])],\n [('regression refundable-limit 1', (100, [['ref', 300]]), [-200, 0]),\n  ('regression refundable-limit 2', (100, [['ref', 50], ['ref', 300], ['ref', 300], ['ref', 100]]), [-650, 0]),\n  ('partial repair guard 1', (500, [['carry', 100], ['nonref', 100], ['ref', 634], ['nonref', 100]]), [-434, 0]),\n  ('partial repair guard 2', (500, [['ref', 50], ['ref', 50], ['nonref', 0], ['ref', 2444]]), [-2044, 0]),\n  ('control: split carries', (900, [['carry', 400], ['nonref', 600], ['carry', 100]]), [0, 200]),\n  ('control: empty', (1234, []), [1234, 0]),\n  ('control: all kinds', (1000, [['nonref', 400], ['carry', 800], ['ref', 300]]), [-300, 200]),\n  ('control: refund', (500, [['ref', 700]]), [-200, 0])]]\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-credit-ordering-refundable-limit","generated_at":"2026-09-29T14:47:05.058455+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":"Apply refundable credits in full; a negative result is a refund.","root_cause":"The final result is floored at zero after refundable credits.","sha256":"a842cd20bee1c504eba2abfd62e218a8dc285b46ca851623e1736c2d0052609d","title":"Refundable credits are capped at the remaining tax · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.434,"exit_code":1,"observations":[{"actual":[0,0],"check":"regression refundable-limit 1","expected":[-200,0],"passed":false},{"actual":[-300,200],"check":"regression refundable-limit 2","expected":[-300,200],"passed":true},{"actual":[0,300],"check":"partial repair guard 2","expected":[-50,300],"passed":false},{"actual":[0,50],"check":"control: no tax carry","expected":[0,50],"passed":true},{"actual":"ERR:kind","check":"control: unknown kind","expected":"ERR:kind","passed":true},{"actual":[-100,0],"check":"control: nonref exceeds tax","expected":[-100,0],"passed":true},{"actual":[0,200],"check":"control: split carries","expected":[0,200],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression refundable-limit 1\", \"actual\": [0, 0], \"expected\": [-200, 0], \"passed\": false}, {\"check\": \"regression refundable-limit 2\", \"actual\": [-300, 200], \"expected\": [-300, 200], \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": [0, 300], \"expected\": [-50, 300], \"passed\": false}, {\"check\": \"control: no tax carry\", \"actual\": [0, 50], \"expected\": [0, 50], \"passed\": true}, {\"check\": \"control: unknown kind\", \"actual\": \"ERR:kind\", \"expected\": \"ERR:kind\", \"passed\": true}, {\"check\": \"control: nonref exceeds tax\", \"actual\": [-100, 0], \"expected\": [-100, 0], \"passed\": true}, {\"check\": \"control: split carries\", \"actual\": [0, 200], \"expected\": [0, 200], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.689,"exit_code":1,"observations":[{"actual":[0,0],"check":"regression refundable-limit 1","expected":[-200,0],"passed":false},{"actual":[0,200],"check":"regression refundable-limit 2","expected":[-300,200],"passed":false},{"actual":[0,300],"check":"partial repair guard 2","expected":[-50,300],"passed":false},{"actual":[0,50],"check":"control: no tax carry","expected":[0,50],"passed":true},{"actual":"ERR:kind","check":"control: unknown kind","expected":"ERR:kind","passed":true},{"actual":[0,0],"check":"control: nonref exceeds tax","expected":[-100,0],"passed":false},{"actual":[0,200],"check":"control: split carries","expected":[0,200],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression refundable-limit 1\", \"actual\": [0, 0], \"expected\": [-200, 0], \"passed\": false}, {\"check\": \"regression refundable-limit 2\", \"actual\": [0, 200], \"expected\": [-300, 200], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [0, 300], \"expected\": [-50, 300], \"passed\": false}, {\"check\": \"control: no tax carry\", \"actual\": [0, 50], \"expected\": [0, 50], \"passed\": true}, {\"check\": \"control: unknown kind\", \"actual\": \"ERR:kind\", \"expected\": \"ERR:kind\", \"passed\": true}, {\"check\": \"control: nonref exceeds tax\", \"actual\": [0, 0], \"expected\": [-100, 0], \"passed\": false}, {\"check\": \"control: split carries\", \"actual\": [0, 200], \"expected\": [0, 200], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.756,"exit_code":0,"observations":[{"actual":[-200,0],"check":"regression refundable-limit 1","expected":[-200,0],"passed":true},{"actual":[-300,200],"check":"regression refundable-limit 2","expected":[-300,200],"passed":true},{"actual":[-50,300],"check":"partial repair guard 2","expected":[-50,300],"passed":true},{"actual":[0,50],"check":"control: no tax carry","expected":[0,50],"passed":true},{"actual":"ERR:kind","check":"control: unknown kind","expected":"ERR:kind","passed":true},{"actual":[-100,0],"check":"control: nonref exceeds tax","expected":[-100,0],"passed":true},{"actual":[0,200],"check":"control: split carries","expected":[0,200],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression refundable-limit 1\", \"actual\": [-200, 0], \"expected\": [-200, 0], \"passed\": true}, {\"check\": \"regression refundable-limit 2\", \"actual\": [-300, 200], \"expected\": [-300, 200], \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": [-50, 300], \"expected\": [-50, 300], \"passed\": true}, {\"check\": \"control: no tax carry\", \"actual\": [0, 50], \"expected\": [0, 50], \"passed\": true}, {\"check\": \"control: unknown kind\", \"actual\": \"ERR:kind\", \"expected\": \"ERR:kind\", \"passed\": true}, {\"check\": \"control: nonref exceeds tax\", \"actual\": [-100, 0], \"expected\": [-100, 0], \"passed\": true}, {\"check\": \"control: split carries\", \"actual\": [0, 200], \"expected\": [0, 200], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}