{"abstract":"Quarterly FUTA liability differs by a few cents from the rate applied to total taxable wages.","category":"Payroll withholding rules","checks":10,"contract":"Input {employees: [[ytd, wages, state]], credit_reduction: {state: basis points}, carry}. Per employee taxable = min(wages, max(0, 7,000.00 - ytd)). Each line costs taxable*(60 + reduction bp); lines are summed in cent-basis-point units and the quarter liability is rounded half-up once. A deposit is due when liability plus carried undeposited liability is more than 500.00. Return [taxable_total, liability, deposit_due].","evaluation_group":"w2-payroll-withholding-futa-credit-reduction","failed_approach":"The attempt truncates each employee line, drifting the total downward.","family":"w2-payroll-withholding-futa-credit-reduction-liability-rounding-stage","id":"FA-59081","implementations":{"attempt":{"sha256":"54889be7d3bb8ecdf0da15916d40f281e84051bdab62132c6703d16deacccf09","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    total_bp = 0\n    taxable_total = 0\n    for ytd, wages, st in x['employees']:\n        t = min(wages, max(0, 700000 - ytd))\n        taxable_total += t\n        line = t * (60 + x['credit_reduction'].get(st, 0))\n        total_bp += line // 10000 * 10000\n    liability = (total_bp + 5000) // 10000\n    return [taxable_total, liability, liability + x['carry'] > 50000]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'employees': [[0, 1366, 'TX'], [0, 110884, 'CT']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [112250, 674, False]), ('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[700000, 169234, 'NY'], [1252894, 424268, 'CT'], [0, 17305, 'CA']], 'credit_reduction': {}, 'carry': 6676}, [17305, 104, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 386714, 'CT'], [700000, 335040, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 92238, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[1226498, 242483, 'CT'], [700000, 208545, 'CA'], [1294547, 6890, 'NY']], 'credit_reduction': {'CA': 90}, 'carry': 16440}, [0, 0, False]), ('normal control', {'employees': [[278512, 329204, 'CT'], [726123, 497336, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 48178}, [329204, 1975, True])], [('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('partial-repair probe', {'employees': [[1804354, 167912, 'CT'], [501525, 208360, 'CA'], [0, 261050, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [459525, 5922, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 395432, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 50000}, [395432, 4745, True]), ('normal control', {'employees': [[700000, 276921, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 45461}, [0, 0, False]), ('normal control', {'employees': [[1883523, 169842, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 489338, 'CT']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [0, 0, False])], [('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('partial-repair probe', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[0, 152949, 'CT'], [199614, 315226, 'TX']], 'credit_reduction': {}, 'carry': 23841}, [468175, 2809, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 204593, 'CA'], [700000, 443120, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[997952, 486233, 'CT'], [1510820, 394052, 'TX']], 'credit_reduction': {}, 'carry': 5423}, [0, 0, False]), ('normal control', {'employees': [[700000, 16090, 'NY'], [1237814, 31301, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 185137, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 31444}, [0, 0, False])], [('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('partial-repair probe', {'employees': [[0, 80817, 'CA'], [1367038, 69564, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [80817, 485, True]), ('partial-repair probe', {'employees': [[700000, 197663, 'CA'], [1911040, 104779, 'CT'], [0, 119592, 'NY']], 'credit_reduction': {}, 'carry': 39745}, [119592, 718, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[209483, 408670, 'NY'], [1754601, 20957, 'TX'], [839652, 414637, 'TX'], [534708, 392249, 'CA'], [700000, 141320, 'CA']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 14909}, [573962, 7383, False]), ('normal control', {'employees': [[700000, 132484, 'NY']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[1144116, 183620, 'CA'], [913960, 129867, 'NY'], [604265, 205102, 'CT'], [1068658, 443383, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [95735, 574, False]), ('normal control', {'employees': [[0, 229094, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 44833}, [229094, 2749, False])], [('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('regression', {'employees': [[600906, 231669, 'CA'], [0, 335471, 'CA'], [700000, 233980, 'CA'], [163691, 35969, 'CA'], [93071, 55837, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [526371, 3158, True]), ('partial-repair probe', {'employees': [[1148812, 65672, 'TX'], [874881, 68496, 'TX'], [700000, 246758, 'CA'], [1529600, 133370, 'NY'], [0, 22316, 'TX']], 'credit_reduction': {}, 'carry': 0}, [22316, 134, False]), ('partial-repair probe', {'employees': [[150141, 484498, 'NY'], [700000, 187126, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [484498, 2907, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 223552, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [223552, 1341, True]), ('normal control', {'employees': [[757466, 156766, 'TX'], [700000, 33282, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[892995, 392688, 'CA']], 'credit_reduction': {}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[700000, 101649, 'TX'], [255245, 435415, 'NY'], [1060191, 58223, 'CA'], [700000, 244076, 'NY'], [767509, 385008, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 26061}, [435415, 2612, False])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"437bf6d4cbc35b67a87b0f75319c921ead208c449324b31f3848f4d4a55e9cab","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    total_bp = 0\n    taxable_total = 0\n    for ytd, wages, st in x['employees']:\n        t = min(wages, max(0, 700000 - ytd))\n        taxable_total += t\n        line = t * (60 + x['credit_reduction'].get(st, 0))\n        total_bp += (line + 5000) // 10000 * 10000\n    liability = (total_bp + 5000) // 10000\n    return [taxable_total, liability, liability + x['carry'] > 50000]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'employees': [[0, 1366, 'TX'], [0, 110884, 'CT']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [112250, 674, False]), ('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[700000, 169234, 'NY'], [1252894, 424268, 'CT'], [0, 17305, 'CA']], 'credit_reduction': {}, 'carry': 6676}, [17305, 104, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 386714, 'CT'], [700000, 335040, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 92238, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[1226498, 242483, 'CT'], [700000, 208545, 'CA'], [1294547, 6890, 'NY']], 'credit_reduction': {'CA': 90}, 'carry': 16440}, [0, 0, False]), ('normal control', {'employees': [[278512, 329204, 'CT'], [726123, 497336, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 48178}, [329204, 1975, True])], [('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('partial-repair probe', {'employees': [[1804354, 167912, 'CT'], [501525, 208360, 'CA'], [0, 261050, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [459525, 5922, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 395432, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 50000}, [395432, 4745, True]), ('normal control', {'employees': [[700000, 276921, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 45461}, [0, 0, False]), ('normal control', {'employees': [[1883523, 169842, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 489338, 'CT']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [0, 0, False])], [('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('partial-repair probe', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[0, 152949, 'CT'], [199614, 315226, 'TX']], 'credit_reduction': {}, 'carry': 23841}, [468175, 2809, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 204593, 'CA'], [700000, 443120, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[997952, 486233, 'CT'], [1510820, 394052, 'TX']], 'credit_reduction': {}, 'carry': 5423}, [0, 0, False]), ('normal control', {'employees': [[700000, 16090, 'NY'], [1237814, 31301, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 185137, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 31444}, [0, 0, False])], [('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('partial-repair probe', {'employees': [[0, 80817, 'CA'], [1367038, 69564, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [80817, 485, True]), ('partial-repair probe', {'employees': [[700000, 197663, 'CA'], [1911040, 104779, 'CT'], [0, 119592, 'NY']], 'credit_reduction': {}, 'carry': 39745}, [119592, 718, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[209483, 408670, 'NY'], [1754601, 20957, 'TX'], [839652, 414637, 'TX'], [534708, 392249, 'CA'], [700000, 141320, 'CA']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 14909}, [573962, 7383, False]), ('normal control', {'employees': [[700000, 132484, 'NY']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[1144116, 183620, 'CA'], [913960, 129867, 'NY'], [604265, 205102, 'CT'], [1068658, 443383, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [95735, 574, False]), ('normal control', {'employees': [[0, 229094, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 44833}, [229094, 2749, False])], [('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('regression', {'employees': [[600906, 231669, 'CA'], [0, 335471, 'CA'], [700000, 233980, 'CA'], [163691, 35969, 'CA'], [93071, 55837, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [526371, 3158, True]), ('partial-repair probe', {'employees': [[1148812, 65672, 'TX'], [874881, 68496, 'TX'], [700000, 246758, 'CA'], [1529600, 133370, 'NY'], [0, 22316, 'TX']], 'credit_reduction': {}, 'carry': 0}, [22316, 134, False]), ('partial-repair probe', {'employees': [[150141, 484498, 'NY'], [700000, 187126, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [484498, 2907, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 223552, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [223552, 1341, True]), ('normal control', {'employees': [[757466, 156766, 'TX'], [700000, 33282, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[892995, 392688, 'CA']], 'credit_reduction': {}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[700000, 101649, 'TX'], [255245, 435415, 'NY'], [1060191, 58223, 'CA'], [700000, 244076, 'NY'], [767509, 385008, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 26061}, [435415, 2612, False])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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":"ed3a8a1fd67d6b3b2e9e87c31c032b86baba23b5bd9600e29b63a77e2ca6292c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    total_bp = 0\n    taxable_total = 0\n    for ytd, wages, st in x['employees']:\n        t = min(wages, max(0, 700000 - ytd))\n        taxable_total += t\n        line = t * (60 + x['credit_reduction'].get(st, 0))\n        total_bp += line\n    liability = (total_bp + 5000) // 10000\n    return [taxable_total, liability, liability + x['carry'] > 50000]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression', {'employees': [[0, 1366, 'TX'], [0, 110884, 'CT']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [112250, 674, False]), ('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[700000, 169234, 'NY'], [1252894, 424268, 'CT'], [0, 17305, 'CA']], 'credit_reduction': {}, 'carry': 6676}, [17305, 104, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 386714, 'CT'], [700000, 335040, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 92238, 'TX']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[1226498, 242483, 'CT'], [700000, 208545, 'CA'], [1294547, 6890, 'NY']], 'credit_reduction': {'CA': 90}, 'carry': 16440}, [0, 0, False]), ('normal control', {'employees': [[278512, 329204, 'CT'], [726123, 497336, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 48178}, [329204, 1975, True])], [('regression', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('partial-repair probe', {'employees': [[0, 271790, 'CT'], [0, 338127, 'NY'], [641967, 53016, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [662933, 4455, True]), ('partial-repair probe', {'employees': [[1804354, 167912, 'CT'], [501525, 208360, 'CA'], [0, 261050, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [459525, 5922, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 395432, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 50000}, [395432, 4745, True]), ('normal control', {'employees': [[700000, 276921, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 45461}, [0, 0, False]), ('normal control', {'employees': [[1883523, 169842, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 489338, 'CT']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [0, 0, False])], [('regression', {'employees': [[396254, 477582, 'NY'], [839542, 250192, 'TX'], [1310770, 427394, 'TX'], [1503697, 51559, 'TX'], [188874, 4682, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 0}, [308428, 1851, False]), ('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('partial-repair probe', {'employees': [[376476, 262345, 'CA'], [0, 47415, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 21513}, [309760, 4220, False]), ('partial-repair probe', {'employees': [[0, 152949, 'CT'], [199614, 315226, 'TX']], 'credit_reduction': {}, 'carry': 23841}, [468175, 2809, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[700000, 204593, 'CA'], [700000, 443120, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[997952, 486233, 'CT'], [1510820, 394052, 'TX']], 'credit_reduction': {}, 'carry': 5423}, [0, 0, False]), ('normal control', {'employees': [[700000, 16090, 'NY'], [1237814, 31301, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [0, 0, False]), ('normal control', {'employees': [[700000, 185137, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 31444}, [0, 0, False])], [('regression', {'employees': [[189443, 281945, 'TX'], [0, 460002, 'TX'], [33055, 315242, 'CA']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [1057189, 9180, True]), ('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('partial-repair probe', {'employees': [[0, 80817, 'CA'], [1367038, 69564, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [80817, 485, True]), ('partial-repair probe', {'employees': [[700000, 197663, 'CA'], [1911040, 104779, 'CT'], [0, 119592, 'NY']], 'credit_reduction': {}, 'carry': 39745}, [119592, 718, False]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[209483, 408670, 'NY'], [1754601, 20957, 'TX'], [839652, 414637, 'TX'], [534708, 392249, 'CA'], [700000, 141320, 'CA']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 14909}, [573962, 7383, False]), ('normal control', {'employees': [[700000, 132484, 'NY']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[1144116, 183620, 'CA'], [913960, 129867, 'NY'], [604265, 205102, 'CT'], [1068658, 443383, 'TX']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 0}, [95735, 574, False]), ('normal control', {'employees': [[0, 229094, 'NY']], 'credit_reduction': {'CA': 90, 'NY': 60}, 'carry': 44833}, [229094, 2749, False])], [('regression', {'employees': [[526959, 328635, 'CT'], [319400, 23395, 'CT'], [700000, 350261, 'CT'], [700000, 458444, 'TX']], 'credit_reduction': {'CA': 90}, 'carry': 50000}, [196436, 1179, True]), ('regression', {'employees': [[600906, 231669, 'CA'], [0, 335471, 'CA'], [700000, 233980, 'CA'], [163691, 35969, 'CA'], [93071, 55837, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [526371, 3158, True]), ('partial-repair probe', {'employees': [[1148812, 65672, 'TX'], [874881, 68496, 'TX'], [700000, 246758, 'CA'], [1529600, 133370, 'NY'], [0, 22316, 'TX']], 'credit_reduction': {}, 'carry': 0}, [22316, 134, False]), ('partial-repair probe', {'employees': [[150141, 484498, 'NY'], [700000, 187126, 'CT']], 'credit_reduction': {}, 'carry': 50000}, [484498, 2907, True]), ('boundary control', {'employees': [[0, 5000000, 'CA']], 'credit_reduction': {}, 'carry': 50000}, [700000, 4200, True]), ('boundary control', {'employees': [[0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 700000, 'TX'], [0, 1333334, 'TX']], 'credit_reduction': {}, 'carry': 0}, [4200000, 25200, False]), ('normal control', {'employees': [[0, 223552, 'TX']], 'credit_reduction': {}, 'carry': 50000}, [223552, 1341, True]), ('normal control', {'employees': [[757466, 156766, 'TX'], [700000, 33282, 'CT']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[892995, 392688, 'CA']], 'credit_reduction': {}, 'carry': 0}, [0, 0, False]), ('normal control', {'employees': [[700000, 101649, 'TX'], [255245, 435415, 'NY'], [1060191, 58223, 'CA'], [700000, 244076, 'NY'], [767509, 385008, 'CA']], 'credit_reduction': {'CT': 30, 'CA': 120}, 'carry': 26061}, [435415, 2612, False])]]\nfor i, (label, args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (label, i), 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 teaching model of a stipulated payroll rule with toy thresholds and rates. It makes no claim of conformance to any tax authority, statute or jurisdiction and is not payroll software. 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-payroll-withholding-futa-credit-reduction-liability-rounding-stage","generated_at":"2026-09-29T14:46:32.795093+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"FUTA credit reductions apply only to taxable wages in the affected state, and deposit timing depends on accumulated liability.","repair":"Restore the contract rule at the liability rounding stage step: use `total_bp += line`.","root_cause":"Each employee line is rounded to cents before summation instead of rounding the aggregate once.","sha256":"9852923f59ed0d59f4cf0d8f54cd064fe4c41207019052411d7df367e82140a1","title":"FUTA liability with credit-reduction states: liability rounding stage · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.316,"exit_code":1,"observations":[{"actual":[112250,673,false],"check":"regression 0","expected":[112250,674,false],"passed":false},{"actual":[309760,4219,false],"check":"regression 1","expected":[309760,4220,false],"passed":false},{"actual":[17305,103,false],"check":"partial-repair probe 2","expected":[17305,104,false],"passed":false},{"actual":[662933,4453,true],"check":"partial-repair probe 3","expected":[662933,4455,true],"passed":false},{"actual":[700000,4200,true],"check":"boundary control 4","expected":[700000,4200,true],"passed":true},{"actual":[4200000,25200,false],"check":"boundary control 5","expected":[4200000,25200,false],"passed":true},{"actual":[0,0,false],"check":"normal control 6","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 7","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 8","expected":[0,0,false],"passed":true},{"actual":[329204,1975,true],"check":"normal control 9","expected":[329204,1975,true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [112250, 673, false], \"expected\": [112250, 674, false], \"passed\": false}, {\"check\": \"regression 1\", \"actual\": [309760, 4219, false], \"expected\": [309760, 4220, false], \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": [17305, 103, false], \"expected\": [17305, 104, false], \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": [662933, 4453, true], \"expected\": [662933, 4455, true], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [700000, 4200, true], \"expected\": [700000, 4200, true], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [4200000, 25200, false], \"expected\": [4200000, 25200, false], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [329204, 1975, true], \"expected\": [329204, 1975, true], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.783,"exit_code":1,"observations":[{"actual":[112250,673,false],"check":"regression 0","expected":[112250,674,false],"passed":false},{"actual":[309760,4219,false],"check":"regression 1","expected":[309760,4220,false],"passed":false},{"actual":[17305,104,false],"check":"partial-repair probe 2","expected":[17305,104,false],"passed":true},{"actual":[662933,4455,true],"check":"partial-repair probe 3","expected":[662933,4455,true],"passed":true},{"actual":[700000,4200,true],"check":"boundary control 4","expected":[700000,4200,true],"passed":true},{"actual":[4200000,25200,false],"check":"boundary control 5","expected":[4200000,25200,false],"passed":true},{"actual":[0,0,false],"check":"normal control 6","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 7","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 8","expected":[0,0,false],"passed":true},{"actual":[329204,1975,true],"check":"normal control 9","expected":[329204,1975,true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [112250, 673, false], \"expected\": [112250, 674, false], \"passed\": false}, {\"check\": \"regression 1\", \"actual\": [309760, 4219, false], \"expected\": [309760, 4220, false], \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": [17305, 104, false], \"expected\": [17305, 104, false], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [662933, 4455, true], \"expected\": [662933, 4455, true], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [700000, 4200, true], \"expected\": [700000, 4200, true], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [4200000, 25200, false], \"expected\": [4200000, 25200, false], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [329204, 1975, true], \"expected\": [329204, 1975, true], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.651,"exit_code":0,"observations":[{"actual":[112250,674,false],"check":"regression 0","expected":[112250,674,false],"passed":true},{"actual":[309760,4220,false],"check":"regression 1","expected":[309760,4220,false],"passed":true},{"actual":[17305,104,false],"check":"partial-repair probe 2","expected":[17305,104,false],"passed":true},{"actual":[662933,4455,true],"check":"partial-repair probe 3","expected":[662933,4455,true],"passed":true},{"actual":[700000,4200,true],"check":"boundary control 4","expected":[700000,4200,true],"passed":true},{"actual":[4200000,25200,false],"check":"boundary control 5","expected":[4200000,25200,false],"passed":true},{"actual":[0,0,false],"check":"normal control 6","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 7","expected":[0,0,false],"passed":true},{"actual":[0,0,false],"check":"normal control 8","expected":[0,0,false],"passed":true},{"actual":[329204,1975,true],"check":"normal control 9","expected":[329204,1975,true],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression 0\", \"actual\": [112250, 674, false], \"expected\": [112250, 674, false], \"passed\": true}, {\"check\": \"regression 1\", \"actual\": [309760, 4220, false], \"expected\": [309760, 4220, false], \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": [17305, 104, false], \"expected\": [17305, 104, false], \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": [662933, 4455, true], \"expected\": [662933, 4455, true], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [700000, 4200, true], \"expected\": [700000, 4200, true], \"passed\": true}, {\"check\": \"boundary control 5\", \"actual\": [4200000, 25200, false], \"expected\": [4200000, 25200, false], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [0, 0, false], \"expected\": [0, 0, false], \"passed\": true}, {\"check\": \"normal control 9\", \"actual\": [329204, 1975, true], \"expected\": [329204, 1975, true], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}