{"abstract":"Married-filing-separately returns escape the surtax up to 250000.","category":"Tax bracket computation","checks":6,"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":"Using the single threshold for separate filers is still too high.","family":"w2-tax_bracket_computation-net-investment-surtax-status-threshold","id":"FA-62566","implementations":{"attempt":{"sha256":"04ac880f3dcf244a3f28f73f8053c61ef7684353fcc3b9d831a8f77a720b46d7","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': 200000}[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 status-threshold 1', (5001, 130000, 'mfs'), 19000),\n  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0)],\n [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),\n  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),\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 status-threshold 1', (7, 200001, 'mfs'), 27),\n  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),\n  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),\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 status-threshold 1', (13, 166865, 'mfs'), 49),\n  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),\n  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),\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 status-threshold 1', (119220, 200001, 'mfs'), 285004),\n  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),\n  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),\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":"d446f4d11a3b44346cd5de4c217853a18dd2f0f3120e09fbf20db7aa8fe66162","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': 250000}[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 status-threshold 1', (5001, 130000, 'mfs'), 19000),\n  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0)],\n [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),\n  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),\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 status-threshold 1', (7, 200001, 'mfs'), 27),\n  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),\n  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),\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 status-threshold 1', (13, 166865, 'mfs'), 49),\n  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),\n  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),\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 status-threshold 1', (119220, 200001, 'mfs'), 285004),\n  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),\n  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),\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":"14dd3744a2a8280627712575689f7374f2cbbd92b0e429c937ac633b41779b25","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 status-threshold 1', (5001, 130000, 'mfs'), 19000),\n  ('regression status-threshold 2', (13, 125001, 'mfs'), 4),\n  ('control: excess binding', (50000, 230000, 'single'), 114000),\n  ('control: nii binding', (20000, 300000, 'mfj'), 76000), ('control: investment loss', (-4000, 400000, 'single'), 0),\n  ('control: below threshold', (10000, 190000, 'single'), 0)],\n [('regression status-threshold 1', (7, 250001, 'mfs'), 27), ('regression status-threshold 2', (13, 250001, 'mfs'), 49),\n  ('partial repair guard 1', (7, 200001, 'mfs'), 27), ('partial repair guard 2', (34287, 200001, 'mfs'), 130291),\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 status-threshold 1', (7, 200001, 'mfs'), 27),\n  ('regression status-threshold 2', (34287, 200001, 'mfs'), 130291),\n  ('partial repair guard 1', (13, 166865, 'mfs'), 49), ('partial repair guard 2', (13, 200001, 'mfs'), 49),\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 status-threshold 1', (13, 166865, 'mfs'), 49),\n  ('regression status-threshold 2', (13, 200001, 'mfs'), 49),\n  ('partial repair guard 1', (119220, 200001, 'mfs'), 285004), ('partial repair guard 2', (7, 169672, 'mfs'), 27),\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 status-threshold 1', (119220, 200001, 'mfs'), 285004),\n  ('regression status-threshold 2', (7, 169672, 'mfs'), 27),\n  ('partial repair guard 1', (177822, 250001, 'mfs'), 475004), ('partial repair guard 2', (158618, 125001, 'mfs'), 4),\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-status-threshold","generated_at":"2026-09-29T14:47:05.927905+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":"Use 125000 for married filing separately.","root_cause":"The threshold table maps mfs to 250000.","sha256":"e99c7363c07be2b5b13a9f7c87fab1df0123bd841e206272203a183d12d14be2","title":"Separate filers use the joint threshold · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.652,"exit_code":1,"observations":[{"actual":0,"check":"regression status-threshold 1","expected":19000,"passed":false},{"actual":0,"check":"regression status-threshold 2","expected":4,"passed":false},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":0,"check":"control: investment loss","expected":0,"passed":true},{"actual":0,"check":"control: below threshold","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression status-threshold 1\", \"actual\": 0, \"expected\": 19000, \"passed\": false}, {\"check\": \"regression status-threshold 2\", \"actual\": 0, \"expected\": 4, \"passed\": false}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: investment loss\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: below threshold\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.295,"exit_code":1,"observations":[{"actual":0,"check":"regression status-threshold 1","expected":19000,"passed":false},{"actual":0,"check":"regression status-threshold 2","expected":4,"passed":false},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":0,"check":"control: investment loss","expected":0,"passed":true},{"actual":0,"check":"control: below threshold","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression status-threshold 1\", \"actual\": 0, \"expected\": 19000, \"passed\": false}, {\"check\": \"regression status-threshold 2\", \"actual\": 0, \"expected\": 4, \"passed\": false}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: investment loss\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: below threshold\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.107,"exit_code":0,"observations":[{"actual":19000,"check":"regression status-threshold 1","expected":19000,"passed":true},{"actual":4,"check":"regression status-threshold 2","expected":4,"passed":true},{"actual":114000,"check":"control: excess binding","expected":114000,"passed":true},{"actual":76000,"check":"control: nii binding","expected":76000,"passed":true},{"actual":0,"check":"control: investment loss","expected":0,"passed":true},{"actual":0,"check":"control: below threshold","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression status-threshold 1\", \"actual\": 19000, \"expected\": 19000, \"passed\": true}, {\"check\": \"regression status-threshold 2\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"control: excess binding\", \"actual\": 114000, \"expected\": 114000, \"passed\": true}, {\"check\": \"control: nii binding\", \"actual\": 76000, \"expected\": 76000, \"passed\": true}, {\"check\": \"control: investment loss\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: below threshold\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}