{"abstract":"Taxable income drops to zero in a year after a large loss.","category":"Tax bracket computation","checks":8,"contract":"solve(years, life): years are pre-deduction incomes by year index (negative = operating loss). A loss year reports taxable 0 and creates a carryforward [origin, amount]. In an income year, carryforwards older than life years (year - origin > life) expire; the rest are applied oldest first, limited in total to floor(80% of that year's income). Return [taxable_by_year, remaining] where remaining lists [origin, amount] with amount > 0 not expired as of the final year.","contract_signature":"years, life","evaluation_group":"w2-tax_bracket_computation-loss-carryforward-limitation","failed_approach":"Applying the 80% limit to each carryforward separately lets several carryforwards exceed it together.","family":"w2-tax_bracket_computation-loss-carryforward-limitation-eighty-percent-limit","id":"FA-62646","implementations":{"attempt":{"sha256":"680d0a4f5f80e6833668a311272c4ebac2e700219dc61697cb122c010058f734","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(years, life):\n    nols, out = [], []\n    for y, inc in enumerate(years):\n        if inc < 0:\n            out.append(0)\n            nols.append([y, -inc])\n            continue\n        nols = [n for n in nols if y - n[0] <= life]\n        room = inc * 80 // 100\n        for n in nols:\n            use = min(n[1], inc * 80 // 100)\n            n[1] -= use\n            room -= use\n            inc -= use\n        out.append(inc)\n    last = len(years) - 1\n    return [out, [[o, a] for o, a in nols if a > 0 and last - o <= life]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression eighty-percent-limit 1', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('regression eighty-percent-limit 2', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('partial repair guard 1', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, 31870, -10000], 5),\n   [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []]),\n  ('control: expiry boundary', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []])],\n [('regression eighty-percent-limit 1', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('regression eighty-percent-limit 2', ([10000, -4000, -6000, 5000, 5000], 3),\n   [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('partial repair guard 1', ([5000, -3000, 4980, -1988, -10000, -10000, 20000], 5),\n   [[5000, 0, 1980, 0, 0, 0, 4000], [[5, 5988]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, -10000, 0], 20),\n   [[0, 0, 4000, 0, 0], [[0, 34000], [1, 10000], [3, 10000]]]),\n  ('control: odd cap', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []])],\n [('regression eighty-percent-limit 1', ([-50000, -10000, 20000, 31870, -10000], 5),\n   [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]]),\n  ('regression eighty-percent-limit 2', ([5000, -3000, 4980, -1988, -10000, -10000, 20000], 5),\n   [[5000, 0, 1980, 0, 0, 0, 4000], [[5, 5988]]]),\n  ('partial repair guard 1', ([60000, 0, -20645, -27117, 0, -50000, 20000], 5),\n   [[60000, 0, 0, 0, 0, 0, 4000], [[2, 4645], [3, 27117], [5, 50000]]]),\n  ('partial repair guard 2', ([5000, 0, 20000, -3000, -33269, 5000, -10000], 5),\n   [[5000, 0, 20000, 0, 0, 1000, 0], [[4, 32269], [6, 10000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []])],\n [('regression eighty-percent-limit 1', ([-50000, 20000], 5), [[0, 4000], [[0, 34000]]]),\n  ('regression eighty-percent-limit 2', ([-50000, -10000, 20000, -10000, 0], 20),\n   [[0, 0, 4000, 0, 0], [[0, 34000], [1, 10000], [3, 10000]]]),\n  ('partial repair guard 1', ([60880, -50000, -50000, 60000, -50000], 3),\n   [[60880, 0, 0, 12000, 0], [[1, 2000], [2, 50000], [4, 50000]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, 5000], 20), [[0, 0, 4000, 1000], [[0, 30000], [1, 10000]]]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []]),\n  ('control: odd cap', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('control: expiry boundary', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('control: losses after income', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]])],\n [('regression eighty-percent-limit 1', ([60000, 0, -20645, -27117, 0, -50000, 20000], 5),\n   [[60000, 0, 0, 0, 0, 0, 4000], [[2, 4645], [3, 27117], [5, 50000]]]),\n  ('regression eighty-percent-limit 2', ([5000, 0, 20000, -3000, -33269, 5000, -10000], 5),\n   [[5000, 0, 20000, 0, 0, 1000, 0], [[4, 32269], [6, 10000]]]),\n  ('partial repair guard 1', ([-50000, 0, 0, 0, -3000, 5000], 20), [[0, 0, 0, 0, 0, 1000], [[0, 46000], [4, 3000]]]),\n  ('partial repair guard 2', ([-3000, -50000, 2641, -3000, -50000], 5),\n   [[0, 0, 529, 0, 0], [[0, 888], [1, 50000], [3, 3000], [4, 50000]]]),\n  ('control: losses after income', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []])]]\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":"1d2ebb425f60a8896dfd1ceb89b881f80db7e004b71665caf7a3887c49adeba6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(years, life):\n    nols, out = [], []\n    for y, inc in enumerate(years):\n        if inc < 0:\n            out.append(0)\n            nols.append([y, -inc])\n            continue\n        nols = [n for n in nols if y - n[0] <= life]\n        room = inc * 80 // 100\n        for n in nols:\n            use = min(n[1], inc)\n            n[1] -= use\n            room -= use\n            inc -= use\n        out.append(inc)\n    last = len(years) - 1\n    return [out, [[o, a] for o, a in nols if a > 0 and last - o <= life]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression eighty-percent-limit 1', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('regression eighty-percent-limit 2', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('partial repair guard 1', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, 31870, -10000], 5),\n   [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []]),\n  ('control: expiry boundary', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []])],\n [('regression eighty-percent-limit 1', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('regression eighty-percent-limit 2', ([10000, -4000, -6000, 5000, 5000], 3),\n   [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('partial repair guard 1', ([5000, -3000, 4980, -1988, -10000, -10000, 20000], 5),\n   [[5000, 0, 1980, 0, 0, 0, 4000], [[5, 5988]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, -10000, 0], 20),\n   [[0, 0, 4000, 0, 0], [[0, 34000], [1, 10000], [3, 10000]]]),\n  ('control: odd cap', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []])],\n [('regression eighty-percent-limit 1', ([-50000, -10000, 20000, 31870, -10000], 5),\n   [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]]),\n  ('regression eighty-percent-limit 2', ([5000, -3000, 4980, -1988, -10000, -10000, 20000], 5),\n   [[5000, 0, 1980, 0, 0, 0, 4000], [[5, 5988]]]),\n  ('partial repair guard 1', ([60000, 0, -20645, -27117, 0, -50000, 20000], 5),\n   [[60000, 0, 0, 0, 0, 0, 4000], [[2, 4645], [3, 27117], [5, 50000]]]),\n  ('partial repair guard 2', ([5000, 0, 20000, -3000, -33269, 5000, -10000], 5),\n   [[5000, 0, 20000, 0, 0, 1000, 0], [[4, 32269], [6, 10000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []])],\n [('regression eighty-percent-limit 1', ([-50000, 20000], 5), [[0, 4000], [[0, 34000]]]),\n  ('regression eighty-percent-limit 2', ([-50000, -10000, 20000, -10000, 0], 20),\n   [[0, 0, 4000, 0, 0], [[0, 34000], [1, 10000], [3, 10000]]]),\n  ('partial repair guard 1', ([60880, -50000, -50000, 60000, -50000], 3),\n   [[60880, 0, 0, 12000, 0], [[1, 2000], [2, 50000], [4, 50000]]]),\n  ('partial repair guard 2', ([-50000, -10000, 20000, 5000], 20), [[0, 0, 4000, 1000], [[0, 30000], [1, 10000]]]),\n  ('control: expired', ([-10000, 0, 0, 10000], 2), [[0, 0, 0, 10000], []]),\n  ('control: odd cap', ([-50000, 10001], 5), [[0, 2001], [[0, 42000]]]),\n  ('control: expiry boundary', ([-8000, 0, 5000], 2), [[0, 0, 1000], [[0, 4000]]]),\n  ('control: losses after income', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]])],\n [('regression eighty-percent-limit 1', ([60000, 0, -20645, -27117, 0, -50000, 20000], 5),\n   [[60000, 0, 0, 0, 0, 0, 4000], [[2, 4645], [3, 27117], [5, 50000]]]),\n  ('regression eighty-percent-limit 2', ([5000, 0, 20000, -3000, -33269, 5000, -10000], 5),\n   [[5000, 0, 20000, 0, 0, 1000, 0], [[4, 32269], [6, 10000]]]),\n  ('partial repair guard 1', ([-50000, 0, 0, 0, -3000, 5000], 20), [[0, 0, 0, 0, 0, 1000], [[0, 46000], [4, 3000]]]),\n  ('partial repair guard 2', ([-3000, -50000, 2641, -3000, -50000], 5),\n   [[0, 0, 529, 0, 0], [[0, 888], [1, 50000], [3, 3000], [4, 50000]]]),\n  ('control: losses after income', ([10000, -4000, -6000, 5000, 5000], 3), [[10000, 0, 0, 1000, 1000], [[2, 2000]]]),\n  ('control: no losses', ([1000, 2000], 1), [[1000, 2000], []]),\n  ('control: fifo two years', ([-10000, 5000, 20000], 5), [[0, 1000, 14000], []]),\n  ('control: two losses', ([-5000, -3000, 10000], 5), [[0, 0, 2000], []])]]\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-loss-carryforward-limitation-eighty-percent-limit","generated_at":"2026-09-29T14:47:06.629294+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":"The deduction room is the full income instead of 80% of it.","sha256":"31d82ad0f2219b59b2848097c62fd729f2acf6206dc3fbc8930314a89bc4e82e","title":"Carryforwards offset the whole year's income · 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":40.3,"exit_code":1,"observations":[{"actual":[[0,1000,14000],[]],"check":"regression eighty-percent-limit 1","expected":[[0,1000,14000],[]],"passed":true},{"actual":[[0,2001],[[0,42000]]],"check":"regression eighty-percent-limit 2","expected":[[0,2001],[[0,42000]]],"passed":true},{"actual":[[10000,0,0,200,1000],[[2,1200]]],"check":"partial repair guard 1","expected":[[10000,0,0,1000,1000],[[2,2000]]],"passed":false},{"actual":[[0,0,800,1275,0],[[0,8504],[1,1701],[4,10000]]],"check":"partial repair guard 2","expected":[[0,0,4000,6374,0],[[0,8504],[1,10000],[4,10000]]],"passed":false},{"actual":[[0,0,2000],[]],"check":"control: two losses","expected":[[0,0,2000],[]],"passed":true},{"actual":[[0,0,0,10000],[]],"check":"control: expired","expected":[[0,0,0,10000],[]],"passed":true},{"actual":[[0,0,1000],[[0,4000]]],"check":"control: expiry boundary","expected":[[0,0,1000],[[0,4000]]],"passed":true},{"actual":[[1000,2000],[]],"check":"control: no losses","expected":[[1000,2000],[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression eighty-percent-limit 1\", \"actual\": [[0, 1000, 14000], []], \"expected\": [[0, 1000, 14000], []], \"passed\": true}, {\"check\": \"regression eighty-percent-limit 2\", \"actual\": [[0, 2001], [[0, 42000]]], \"expected\": [[0, 2001], [[0, 42000]]], \"passed\": true}, {\"check\": \"partial repair guard 1\", \"actual\": [[10000, 0, 0, 200, 1000], [[2, 1200]]], \"expected\": [[10000, 0, 0, 1000, 1000], [[2, 2000]]], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [[0, 0, 800, 1275, 0], [[0, 8504], [1, 1701], [4, 10000]]], \"expected\": [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]], \"passed\": false}, {\"check\": \"control: two losses\", \"actual\": [[0, 0, 2000], []], \"expected\": [[0, 0, 2000], []], \"passed\": true}, {\"check\": \"control: expired\", \"actual\": [[0, 0, 0, 10000], []], \"expected\": [[0, 0, 0, 10000], []], \"passed\": true}, {\"check\": \"control: expiry boundary\", \"actual\": [[0, 0, 1000], [[0, 4000]]], \"expected\": [[0, 0, 1000], [[0, 4000]]], \"passed\": true}, {\"check\": \"control: no losses\", \"actual\": [[1000, 2000], []], \"expected\": [[1000, 2000], []], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.048,"exit_code":1,"observations":[{"actual":[[0,0,15000],[]],"check":"regression eighty-percent-limit 1","expected":[[0,1000,14000],[]],"passed":false},{"actual":[[0,0],[[0,39999]]],"check":"regression eighty-percent-limit 2","expected":[[0,2001],[[0,42000]]],"passed":false},{"actual":[[10000,0,0,0,0],[]],"check":"partial repair guard 1","expected":[[10000,0,0,1000,1000],[[2,2000]]],"passed":false},{"actual":[[0,0,0,0,0],[[1,8130],[4,10000]]],"check":"partial repair guard 2","expected":[[0,0,4000,6374,0],[[0,8504],[1,10000],[4,10000]]],"passed":false},{"actual":[[0,0,2000],[]],"check":"control: two losses","expected":[[0,0,2000],[]],"passed":true},{"actual":[[0,0,0,10000],[]],"check":"control: expired","expected":[[0,0,0,10000],[]],"passed":true},{"actual":[[0,0,0],[[0,3000]]],"check":"control: expiry boundary","expected":[[0,0,1000],[[0,4000]]],"passed":false},{"actual":[[1000,2000],[]],"check":"control: no losses","expected":[[1000,2000],[]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression eighty-percent-limit 1\", \"actual\": [[0, 0, 15000], []], \"expected\": [[0, 1000, 14000], []], \"passed\": false}, {\"check\": \"regression eighty-percent-limit 2\", \"actual\": [[0, 0], [[0, 39999]]], \"expected\": [[0, 2001], [[0, 42000]]], \"passed\": false}, {\"check\": \"partial repair guard 1\", \"actual\": [[10000, 0, 0, 0, 0], []], \"expected\": [[10000, 0, 0, 1000, 1000], [[2, 2000]]], \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": [[0, 0, 0, 0, 0], [[1, 8130], [4, 10000]]], \"expected\": [[0, 0, 4000, 6374, 0], [[0, 8504], [1, 10000], [4, 10000]]], \"passed\": false}, {\"check\": \"control: two losses\", \"actual\": [[0, 0, 2000], []], \"expected\": [[0, 0, 2000], []], \"passed\": true}, {\"check\": \"control: expired\", \"actual\": [[0, 0, 0, 10000], []], \"expected\": [[0, 0, 0, 10000], []], \"passed\": true}, {\"check\": \"control: expiry boundary\", \"actual\": [[0, 0, 0], [[0, 3000]]], \"expected\": [[0, 0, 1000], [[0, 4000]]], \"passed\": false}, {\"check\": \"control: no losses\", \"actual\": [[1000, 2000], []], \"expected\": [[1000, 2000], []], \"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."}}