{"abstract":"A net investment loss reduces other tax through a negative surtax.","category":"Tax bracket computation","checks":7,"contract":"solve(nii, magi, status): stipulated 3.8% surtax on the lesser of net investment income and MAGI above the status threshold (single 200000, mfj 250000, mfs 125000), where neither amount counts below zero. Amounts are whole dollars; return the surtax in integer cents rounded half-up.","evaluation_group":"w2-tax_bracket_computation-net-investment-surtax","failed_approach":"Clamping only negative NII still lets a MAGI below the threshold give a negative base.","family":"w2-tax_bracket_computation-net-investment-surtax-negative-components","id":"FA-62571","implementations":{"attempt":{"sha256":"b5dc4c32b000f8ae58de6e5b6a7eb7738812b792dd6d696f38bfbf7103df860a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(nii, magi, status):\n    thr = {'single': 200000, 'mfj': 250000, 'mfs': 125000}[status]\n    base = min(max(0, nii), magi - thr)\n    return int(base * Fraction(38, 10) + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression negative-components 1', (-4000, 400000, 'single'), 0),\n  ('regression negative-components 2', (10000, 190000, 'single'), 0),\n  ('partial repair guard 2', (0, 125001, 'single'), 0), ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: odd dollars', (7, 400000, 'mfj'), 27)],\n [('regression negative-components 1', (0, 125001, 'single'), 0),\n  ('regression negative-components 2', (0, 105501, 'mfj'), 0), ('partial repair guard 2', (13, 125001, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (13, 125001, 'single'), 0),\n  ('regression negative-components 2', (13, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 125001, 'mfj'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 0)],\n [('regression negative-components 1', (0, 125001, 'mfj'), 0),\n  ('regression negative-components 2', (0, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 123762, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (0, 123762, 'single'), 0),\n  ('regression negative-components 2', (7, 125001, 'mfj'), 0), ('partial repair guard 2', (31498, 125001, 'single'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 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":"90c8f6e2e68caf912d91e1ef538f946ee4cab7615f626aed93462be72b4551f9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(nii, magi, status):\n    thr = {'single': 200000, 'mfj': 250000, 'mfs': 125000}[status]\n    base = min(nii, magi - thr)\n    return int(base * Fraction(38, 10) + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression negative-components 1', (-4000, 400000, 'single'), 0),\n  ('regression negative-components 2', (10000, 190000, 'single'), 0),\n  ('partial repair guard 2', (0, 125001, 'single'), 0), ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: odd dollars', (7, 400000, 'mfj'), 27)],\n [('regression negative-components 1', (0, 125001, 'single'), 0),\n  ('regression negative-components 2', (0, 105501, 'mfj'), 0), ('partial repair guard 2', (13, 125001, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (13, 125001, 'single'), 0),\n  ('regression negative-components 2', (13, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 125001, 'mfj'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 0)],\n [('regression negative-components 1', (0, 125001, 'mfj'), 0),\n  ('regression negative-components 2', (0, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 123762, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (0, 123762, 'single'), 0),\n  ('regression negative-components 2', (7, 125001, 'mfj'), 0), ('partial repair guard 2', (31498, 125001, 'single'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 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":"845292c59c9658a67ec8a88aba0849329a84c0703fbc1de7cec08b7f58bcdc63","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(nii, magi, status):\n    thr = {'single': 200000, 'mfj': 250000, 'mfs': 125000}[status]\n    base = max(0, min(nii, magi - thr))\n    return int(base * Fraction(38, 10) + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression negative-components 1', (-4000, 400000, 'single'), 0),\n  ('regression negative-components 2', (10000, 190000, 'single'), 0),\n  ('partial repair guard 2', (0, 125001, 'single'), 0), ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: odd dollars', (7, 400000, 'mfj'), 27)],\n [('regression negative-components 1', (0, 125001, 'single'), 0),\n  ('regression negative-components 2', (0, 105501, 'mfj'), 0), ('partial repair guard 2', (13, 125001, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (13, 125001, 'single'), 0),\n  ('regression negative-components 2', (13, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 125001, 'mfj'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 0)],\n [('regression negative-components 1', (0, 125001, 'mfj'), 0),\n  ('regression negative-components 2', (0, 200001, 'mfj'), 0), ('partial repair guard 2', (0, 123762, 'single'), 0),\n  ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0), ('control: odd dollars', (7, 400000, 'mfj'), 27),\n  ('control: excess binding', (50000, 230000, 'single'), 114000)],\n [('regression negative-components 1', (0, 123762, 'single'), 0),\n  ('regression negative-components 2', (7, 125001, 'mfj'), 0), ('partial repair guard 2', (31498, 125001, 'single'), 0),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: separate filer', (5001, 130000, 'mfs'), 19000),\n  ('control: investment loss', (-4000, 400000, 'single'), 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-net-investment-surtax-negative-components","generated_at":"2026-09-29T14:47:05.951339+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":"Floor the surtax base at zero.","root_cause":"The base min(nii, excess) is not floored at zero.","sha256":"e77d526734004be8ef8d52bf5b87616f61733b1157af639c25bafe1b39ba9f71","title":"An investment loss produces a negative surtax · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.666,"exit_code":1,"observations":[{"actual":0,"check":"regression negative-components 1","expected":0,"passed":true},{"actual":-37999,"check":"regression negative-components 2","expected":0,"passed":false},{"actual":-284995,"check":"partial repair guard 2","expected":0,"passed":false},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":19000,"check":"control: separate filer","expected":19000,"passed":true},{"actual":27,"check":"control: odd dollars","expected":27,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression negative-components 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"regression negative-components 2\", \"actual\": -37999, \"expected\": 0, \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": -284995, \"expected\": 0, \"passed\": false}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: separate filer\", \"actual\": 19000, \"expected\": 19000, \"passed\": true}, {\"check\": \"control: odd dollars\", \"actual\": 27, \"expected\": 27, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.015,"exit_code":1,"observations":[{"actual":-15199,"check":"regression negative-components 1","expected":0,"passed":false},{"actual":-37999,"check":"regression negative-components 2","expected":0,"passed":false},{"actual":-284995,"check":"partial repair guard 2","expected":0,"passed":false},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":19000,"check":"control: separate filer","expected":19000,"passed":true},{"actual":27,"check":"control: odd dollars","expected":27,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression negative-components 1\", \"actual\": -15199, \"expected\": 0, \"passed\": false}, {\"check\": \"regression negative-components 2\", \"actual\": -37999, \"expected\": 0, \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": -284995, \"expected\": 0, \"passed\": false}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: separate filer\", \"actual\": 19000, \"expected\": 19000, \"passed\": true}, {\"check\": \"control: odd dollars\", \"actual\": 27, \"expected\": 27, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.804,"exit_code":0,"observations":[{"actual":0,"check":"regression negative-components 1","expected":0,"passed":true},{"actual":0,"check":"regression negative-components 2","expected":0,"passed":true},{"actual":0,"check":"partial repair guard 2","expected":0,"passed":true},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":19000,"check":"control: separate filer","expected":19000,"passed":true},{"actual":27,"check":"control: odd dollars","expected":27,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression negative-components 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"regression negative-components 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: separate filer\", \"actual\": 19000, \"expected\": 19000, \"passed\": true}, {\"check\": \"control: odd dollars\", \"actual\": 27, \"expected\": 27, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}