{"abstract":"A mis-keyed bracket table silently produces a tax figure.","category":"Tax bracket computation","checks":6,"contract":"solve(income, brackets): brackets is [[upper, rate_percent], ...] with strictly increasing positive uppers and a final open bracket [None, rate]; otherwise return 'ERR:brackets'. Each rate applies only to the slice of income in (previous upper, upper]. Negative income is taxed as zero. The tax is summed exactly and rounded half-up to cents once, returned as integer cents.","evaluation_group":"w2-tax_bracket_computation-progressive-marginal-slices","failed_approach":"Checking only adjacent pairs after the first bracket misses a bad first threshold.","family":"w2-tax_bracket_computation-progressive-marginal-slices-threshold-validation","id":"FA-62356","implementations":{"attempt":{"sha256":"0429aa19ae80b45b0b0fc87f18ea894f127b535d0e07047826f14ff1804ba856","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    if not brackets or brackets[-1][0] is not None: return 'ERR:brackets'\n    uppers = [u for u, _ in brackets[:-1]]\n    if any(b <= a for a, b in zip(uppers[1:], uppers[2:])): return 'ERR:brackets'\n    x = max(0, income)\n    tax, lower = Fraction(0), 0\n    for upper, rate in brackets:\n        top = x if upper is None else min(x, upper)\n        if top > lower:\n            tax += (top - lower) * Fraction(rate) / 100\n        if upper is None or x <= upper: break\n        lower = upper\n    return int(tax * 100 + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression threshold-validation 1', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (500, [[0, '10'], [None, '30']]), 'ERR:brackets'),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (1, [[44000, '15'], [44000, '22'], [None, '40.5']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[60000, '22'], [60000, '15'], [188000, '33.3'], [None, '37']]),\n   'ERR:brackets'),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets')],\n [('regression threshold-validation 1', (999, [[24000, '33.3'], [24000, '22'], [150000, '10'], [None, '37']]),\n   'ERR:brackets'),\n  ('regression threshold-validation 2',\n   (40000, [[83000, '5'], [83000, '10'], [156000, '10'], [192000, '10'], [None, '37']]), 'ERR:brackets'),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('control: closed top', (10, [[10000, '10'], [20000, '20']]), 'ERR:brackets'),\n  ('control: high earner', (250001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   5917183),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713)],\n [('regression threshold-validation 1', (10000, [[178000, '24'], [178000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[44000, '5'], [44000, '15'], [None, '37']]), 'ERR:brackets'),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (999, [[105000, '15'], [105000, '24'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[138000, '15'], [138000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140)]]\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":"a3c0c41470e8e0f982e6da184724f5e528ce6f2b9fb8e69ba7c2fc0c183c32f1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    if not brackets or brackets[-1][0] is not None: return 'ERR:brackets'\n    uppers = [u for u, _ in brackets[:-1]]\n    x = max(0, income)\n    tax, lower = Fraction(0), 0\n    for upper, rate in brackets:\n        top = x if upper is None else min(x, upper)\n        if top > lower:\n            tax += (top - lower) * Fraction(rate) / 100\n        if upper is None or x <= upper: break\n        lower = upper\n    return int(tax * 100 + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression threshold-validation 1', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (500, [[0, '10'], [None, '30']]), 'ERR:brackets'),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (1, [[44000, '15'], [44000, '22'], [None, '40.5']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[60000, '22'], [60000, '15'], [188000, '33.3'], [None, '37']]),\n   'ERR:brackets'),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets')],\n [('regression threshold-validation 1', (999, [[24000, '33.3'], [24000, '22'], [150000, '10'], [None, '37']]),\n   'ERR:brackets'),\n  ('regression threshold-validation 2',\n   (40000, [[83000, '5'], [83000, '10'], [156000, '10'], [192000, '10'], [None, '37']]), 'ERR:brackets'),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('control: closed top', (10, [[10000, '10'], [20000, '20']]), 'ERR:brackets'),\n  ('control: high earner', (250001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   5917183),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713)],\n [('regression threshold-validation 1', (10000, [[178000, '24'], [178000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[44000, '5'], [44000, '15'], [None, '37']]), 'ERR:brackets'),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (999, [[105000, '15'], [105000, '24'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[138000, '15'], [138000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140)]]\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":"bc4394eb6be7cee552ab42fa5a848dcfd149528b9ee8b9ae496b18d0899782c7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    if not brackets or brackets[-1][0] is not None: return 'ERR:brackets'\n    uppers = [u for u, _ in brackets[:-1]]\n    if any(b <= a for a, b in zip([0] + uppers, uppers)): return 'ERR:brackets'\n    x = max(0, income)\n    tax, lower = Fraction(0), 0\n    for upper, rate in brackets:\n        top = x if upper is None else min(x, upper)\n        if top > lower:\n            tax += (top - lower) * Fraction(rate) / 100\n        if upper is None or x <= upper: break\n        lower = upper\n    return int(tax * 100 + Fraction(1, 2))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression threshold-validation 1', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (500, [[0, '10'], [None, '30']]), 'ERR:brackets'),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (1, [[44000, '15'], [44000, '22'], [None, '40.5']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[60000, '22'], [60000, '15'], [188000, '33.3'], [None, '37']]),\n   'ERR:brackets'),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets')],\n [('regression threshold-validation 1', (999, [[24000, '33.3'], [24000, '22'], [150000, '10'], [None, '37']]),\n   'ERR:brackets'),\n  ('regression threshold-validation 2',\n   (40000, [[83000, '5'], [83000, '10'], [156000, '10'], [192000, '10'], [None, '37']]), 'ERR:brackets'),\n  ('control: non increasing', (10000, [[10000, '10'], [5000, '20'], [None, '30']]), 'ERR:brackets'),\n  ('control: closed top', (10, [[10000, '10'], [20000, '20']]), 'ERR:brackets'),\n  ('control: high earner', (250001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   5917183),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713)],\n [('regression threshold-validation 1', (10000, [[178000, '24'], [178000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[44000, '5'], [44000, '15'], [None, '37']]), 'ERR:brackets'),\n  ('control: single bracket', (777, [[None, '12.5']]), 9713),\n  ('control: three brackets', (50000, [[10000, '10'], [40000, '12'], [None, '22']]), 680000),\n  ('control: at first threshold', (10000, [[10000, '10'], [40000, '12'], [None, '22']]), 100000),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0)],\n [('regression threshold-validation 1', (999, [[105000, '15'], [105000, '24'], [None, '30']]), 'ERR:brackets'),\n  ('regression threshold-validation 2', (10000, [[138000, '15'], [138000, '33.3'], [None, '45']]), 'ERR:brackets'),\n  ('control: zero', (0, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: negative', (-5, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: one over threshold', (40001, [[10000, '10'], [40000, '12'], [None, '22']]), 460022),\n  ('control: fractional rate', (12345, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   126140)]]\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-progressive-marginal-slices-threshold-validation","generated_at":"2026-09-29T14:47:03.931305+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":"Reject schedules whose uppers are not strictly increasing and positive.","root_cause":"Only the open final bracket is validated; threshold order is not checked.","sha256":"2e7b77d349947626df02824b847824f240c406d82ef135137653fb13e346f628","title":"A schedule with non-increasing thresholds is accepted · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.226,"exit_code":1,"observations":[{"actual":100000,"check":"regression threshold-validation 1","expected":"ERR:brackets","passed":false},{"actual":15000,"check":"regression threshold-validation 2","expected":"ERR:brackets","passed":false},{"actual":680000,"check":"control: three brackets","expected":680000,"passed":true},{"actual":100000,"check":"control: at first threshold","expected":100000,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true},{"actual":0,"check":"control: negative","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression threshold-validation 1\", \"actual\": 100000, \"expected\": \"ERR:brackets\", \"passed\": false}, {\"check\": \"regression threshold-validation 2\", \"actual\": 15000, \"expected\": \"ERR:brackets\", \"passed\": false}, {\"check\": \"control: three brackets\", \"actual\": 680000, \"expected\": 680000, \"passed\": true}, {\"check\": \"control: at first threshold\", \"actual\": 100000, \"expected\": 100000, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: negative\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.222,"exit_code":1,"observations":[{"actual":100000,"check":"regression threshold-validation 1","expected":"ERR:brackets","passed":false},{"actual":15000,"check":"regression threshold-validation 2","expected":"ERR:brackets","passed":false},{"actual":680000,"check":"control: three brackets","expected":680000,"passed":true},{"actual":100000,"check":"control: at first threshold","expected":100000,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true},{"actual":0,"check":"control: negative","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression threshold-validation 1\", \"actual\": 100000, \"expected\": \"ERR:brackets\", \"passed\": false}, {\"check\": \"regression threshold-validation 2\", \"actual\": 15000, \"expected\": \"ERR:brackets\", \"passed\": false}, {\"check\": \"control: three brackets\", \"actual\": 680000, \"expected\": 680000, \"passed\": true}, {\"check\": \"control: at first threshold\", \"actual\": 100000, \"expected\": 100000, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: negative\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.197,"exit_code":0,"observations":[{"actual":"ERR:brackets","check":"regression threshold-validation 1","expected":"ERR:brackets","passed":true},{"actual":"ERR:brackets","check":"regression threshold-validation 2","expected":"ERR:brackets","passed":true},{"actual":680000,"check":"control: three brackets","expected":680000,"passed":true},{"actual":100000,"check":"control: at first threshold","expected":100000,"passed":true},{"actual":0,"check":"control: zero","expected":0,"passed":true},{"actual":0,"check":"control: negative","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression threshold-validation 1\", \"actual\": \"ERR:brackets\", \"expected\": \"ERR:brackets\", \"passed\": true}, {\"check\": \"regression threshold-validation 2\", \"actual\": \"ERR:brackets\", \"expected\": \"ERR:brackets\", \"passed\": true}, {\"check\": \"control: three brackets\", \"actual\": 680000, \"expected\": 680000, \"passed\": true}, {\"check\": \"control: at first threshold\", \"actual\": 100000, \"expected\": 100000, \"passed\": true}, {\"check\": \"control: zero\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: negative\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}