{"abstract":"Table lookups report cents although the table is in whole dollars.","category":"Tax bracket computation","checks":6,"contract":"solve(income, brackets): stipulated tax-table lookup. income < 0 returns 0 and incomes below 5 have zero tax. For income < 100000 the tax is the progressive tax on the midpoint of the income's band, rounded half-up to whole dollars: bands are 25 wide below 3000 ([0,25), [25,50), ...) and 50 wide from 3000 ([3000,3050), ...). Incomes of 100000 or more use the exact progressive tax rounded half-up to cents. Return integer cents.","evaluation_group":"w2-tax_bracket_computation-tax-table-midpoint-bands","failed_approach":"Truncating to whole dollars drops the half-dollar rounding.","family":"w2-tax_bracket_computation-tax-table-midpoint-bands-table-dollar-rounding","id":"FA-62521","implementations":{"attempt":{"sha256":"1c78122aa10d9c2a029332dd10ae4a7eec8bd21be26f63d4693d02fe1fe80546","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    if income < 5: return 0\n    if income >= 100000: return cents(prog(income, brackets))\n    w = 25 if income < 3000 else 50\n    lo = income // w * w\n    mid = lo + Fraction(w, 2)\n    return int(prog(mid, brackets)) * 100\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression table-dollar-rounding 1', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('regression table-dollar-rounding 2', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100)],\n [('regression table-dollar-rounding 1', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('regression table-dollar-rounding 2', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('partial repair guard 2', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024)],\n [('regression table-dollar-rounding 1', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('regression table-dollar-rounding 2', (603, [[10000, '10'], [40000, '12'], [None, '22']]), 6100),\n  ('partial repair guard 1', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   29900),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024),\n  ('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],\n [('regression table-dollar-rounding 1',\n   (5, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 100),\n  ('regression table-dollar-rounding 2', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (3000, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   30300),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],\n [('regression table-dollar-rounding 1',\n   (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 29900),\n  ('regression table-dollar-rounding 2', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (3024, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('partial repair guard 2', (1428, [[10000, '10'], [40000, '12'], [None, '22']]), 14400),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400)]]\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":"6a6fe9ddb10ffd099a5777bca5f54b0c6d2786a1dde5468c6c9ed414beab3d07","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    if income < 5: return 0\n    if income >= 100000: return cents(prog(income, brackets))\n    w = 25 if income < 3000 else 50\n    lo = income // w * w\n    mid = lo + Fraction(w, 2)\n    return cents(prog(mid, brackets))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression table-dollar-rounding 1', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('regression table-dollar-rounding 2', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100)],\n [('regression table-dollar-rounding 1', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('regression table-dollar-rounding 2', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('partial repair guard 2', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024)],\n [('regression table-dollar-rounding 1', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('regression table-dollar-rounding 2', (603, [[10000, '10'], [40000, '12'], [None, '22']]), 6100),\n  ('partial repair guard 1', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   29900),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024),\n  ('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],\n [('regression table-dollar-rounding 1',\n   (5, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 100),\n  ('regression table-dollar-rounding 2', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (3000, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   30300),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],\n [('regression table-dollar-rounding 1',\n   (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 29900),\n  ('regression table-dollar-rounding 2', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (3024, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('partial repair guard 2', (1428, [[10000, '10'], [40000, '12'], [None, '22']]), 14400),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400)]]\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":"62f1fe2ac223fa05b792ca1275a03151f46cada465425f12a4c8265618e0c90f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(income, brackets):\n    def prog(x, br):\n        tax, lower = Fraction(0), 0\n        for upper, rate in br:\n            top = x if upper is None else min(x, upper)\n            if top > lower: tax += (top - lower) * Fraction(rate) / 100\n            if upper is None or x <= upper: break\n            lower = upper\n        return tax\n    def cents(v):\n        v = v * 100\n        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))\n    \n    if income < 5: return 0\n    if income >= 100000: return cents(prog(income, brackets))\n    w = 25 if income < 3000 else 50\n    lo = income // w * w\n    mid = lo + Fraction(w, 2)\n    return int(prog(mid, brackets) + Fraction(1, 2)) * 100\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression table-dollar-rounding 1', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('regression table-dollar-rounding 2', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100)],\n [('regression table-dollar-rounding 1', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('regression table-dollar-rounding 2', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('partial repair guard 2', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024)],\n [('regression table-dollar-rounding 1', (576, [[10000, '10'], [40000, '12'], [None, '22']]), 5900),\n  ('regression table-dollar-rounding 2', (603, [[10000, '10'], [40000, '12'], [None, '22']]), 6100),\n  ('partial repair guard 1', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   29900),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400),\n  ('control: above cutoff', (100001, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1740024),\n  ('control: band edge', (40050, [[10000, '10'], [40000, '12'], [None, '22']]), 461700),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900)],\n [('regression table-dollar-rounding 1',\n   (5, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 100),\n  ('regression table-dollar-rounding 2', (99999, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 2', (3000, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   30300),\n  ('control: last narrow band', (2999, [[10000, '10'], [40000, '12'], [None, '22']]), 29900),\n  ('control: first wide band', (3000, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('control: ordinary', (12345, [[10000, '10'], [40000, '12'], [None, '22']]), 127900),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000)],\n [('regression table-dollar-rounding 1',\n   (2999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]), 29900),\n  ('regression table-dollar-rounding 2', (99975, [[10000, '10'], [40000, '12'], [None, '22']]), 1779500),\n  ('partial repair guard 1', (3024, [[10000, '10'], [40000, '12'], [None, '22']]), 30300),\n  ('partial repair guard 2', (1428, [[10000, '10'], [40000, '12'], [None, '22']]), 14400),\n  ('control: table cutoff', (100000, [[10000, '10'], [40000, '12'], [None, '22']]), 1780000),\n  ('control: tiny', (4, [[10000, '10'], [40000, '12'], [None, '22']]), 0),\n  ('control: small', (24, [[10000, '10'], [40000, '12'], [None, '22']]), 100),\n  ('control: just under cutoff', (99999, [[11000, '10'], [44725, '12'], [95375, '22'], [182100, '24'], [None, '32.5']]),\n   1739400)]]\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-tax-table-midpoint-bands-table-dollar-rounding","generated_at":"2026-09-29T14:47:05.317832+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":"Round the midpoint tax half-up to whole dollars.","root_cause":"The midpoint tax is rounded to cents rather than to whole dollars.","sha256":"fccd0dff0cf6952fd1ef742a8bf790bf936bf7731678e261ea0346cf5272d0df","title":"Tax-table amounts keep cents · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.315,"exit_code":1,"observations":[{"actual":29800,"check":"regression table-dollar-rounding 1","expected":29900,"passed":false},{"actual":30200,"check":"regression table-dollar-rounding 2","expected":30300,"passed":false},{"actual":127900,"check":"control: ordinary","expected":127900,"passed":true},{"actual":1780000,"check":"control: table cutoff","expected":1780000,"passed":true},{"actual":0,"check":"control: tiny","expected":0,"passed":true},{"actual":100,"check":"control: small","expected":100,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression table-dollar-rounding 1\", \"actual\": 29800, \"expected\": 29900, \"passed\": false}, {\"check\": \"regression table-dollar-rounding 2\", \"actual\": 30200, \"expected\": 30300, \"passed\": false}, {\"check\": \"control: ordinary\", \"actual\": 127900, \"expected\": 127900, \"passed\": true}, {\"check\": \"control: table cutoff\", \"actual\": 1780000, \"expected\": 1780000, \"passed\": true}, {\"check\": \"control: tiny\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: small\", \"actual\": 100, \"expected\": 100, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.858,"exit_code":1,"observations":[{"actual":29875,"check":"regression table-dollar-rounding 1","expected":29900,"passed":false},{"actual":30250,"check":"regression table-dollar-rounding 2","expected":30300,"passed":false},{"actual":127900,"check":"control: ordinary","expected":127900,"passed":true},{"actual":1780000,"check":"control: table cutoff","expected":1780000,"passed":true},{"actual":0,"check":"control: tiny","expected":0,"passed":true},{"actual":125,"check":"control: small","expected":100,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression table-dollar-rounding 1\", \"actual\": 29875, \"expected\": 29900, \"passed\": false}, {\"check\": \"regression table-dollar-rounding 2\", \"actual\": 30250, \"expected\": 30300, \"passed\": false}, {\"check\": \"control: ordinary\", \"actual\": 127900, \"expected\": 127900, \"passed\": true}, {\"check\": \"control: table cutoff\", \"actual\": 1780000, \"expected\": 1780000, \"passed\": true}, {\"check\": \"control: tiny\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: small\", \"actual\": 125, \"expected\": 100, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.95,"exit_code":0,"observations":[{"actual":29900,"check":"regression table-dollar-rounding 1","expected":29900,"passed":true},{"actual":30300,"check":"regression table-dollar-rounding 2","expected":30300,"passed":true},{"actual":127900,"check":"control: ordinary","expected":127900,"passed":true},{"actual":1780000,"check":"control: table cutoff","expected":1780000,"passed":true},{"actual":0,"check":"control: tiny","expected":0,"passed":true},{"actual":100,"check":"control: small","expected":100,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression table-dollar-rounding 1\", \"actual\": 29900, \"expected\": 29900, \"passed\": true}, {\"check\": \"regression table-dollar-rounding 2\", \"actual\": 30300, \"expected\": 30300, \"passed\": true}, {\"check\": \"control: ordinary\", \"actual\": 127900, \"expected\": 127900, \"passed\": true}, {\"check\": \"control: table cutoff\", \"actual\": 1780000, \"expected\": 1780000, \"passed\": true}, {\"check\": \"control: tiny\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control: small\", \"actual\": 100, \"expected\": 100, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}