{"abstract":"Remote employees with no recorded work days have wages allocated to no state.","category":"Payroll withholding rules","checks":9,"contract":"Input {wage, days: {state: work days}, resident}. With zero total days all wages go to the resident state. Otherwise each state gets floor(wage*days/total); leftover cents go one each to states ranked by largest fractional remainder, ties by the base order (days descending, then state name). States allocated 0 cents are omitted. Return {state: cents}.","evaluation_group":"w2-payroll-withholding-workday-wage-allocation","failed_approach":"The attempt lists every state with zero cents, still leaving the paycheck unallocated.","family":"w2-payroll-withholding-workday-wage-allocation-zero-day-fallback","id":"FA-59196","implementations":{"attempt":{"sha256":"b5c3b09b3a74e6898d780e2ffe1008f5d1bc4c56b8ececb6d3a34d2881e0ec59","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    days = x['days']\n    total = sum(days.values())\n    if total == 0:\n        return {s: 0 for s in days}\n    order = sorted(days, key=lambda s: (-days[s], s))\n    alloc = {s: x['wage'] * days[s] // total for s in order}\n    rema = sorted(order, key=lambda s: (-(x['wage'] * days[s] % total), order.index(s)))\n    left = x['wage'] - sum(alloc.values())\n    for s in rema[:left]:\n        alloc[s] += 1\n    return {s: v for s, v in alloc.items() if v}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', {'wage': 5000, 'days': {'NY': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 5000}), ('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('partial-repair probe', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 410311, 'days': {'PA': 10}, 'resident': 'CT'}, {'PA': 410311}), ('normal control', {'wage': 9, 'days': {'PA': 1, 'CT': 8}, 'resident': 'NY'}, {'CT': 8, 'PA': 1}), ('normal control', {'wage': 61318, 'days': {'CT': 0, 'MA': 0, 'PA': 12, 'NJ': 19}, 'resident': 'NY'}, {'NJ': 37582, 'PA': 23736}), ('normal control', {'wage': 17, 'days': {'NJ': 1, 'PA': 3, 'NY': 3}, 'resident': 'NY'}, {'NY': 7, 'PA': 7, 'NJ': 3})], [('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 874754, 'days': {'PA': 19}, 'resident': 'CT'}, {'PA': 874754}), ('normal control', {'wage': 315271, 'days': {'PA': 2, 'NY': 3, 'CT': 1}, 'resident': 'NJ'}, {'NY': 157636, 'PA': 105090, 'CT': 52545}), ('normal control', {'wage': 273177, 'days': {'PA': 0, 'NY': 1, 'NJ': 3}, 'resident': 'NJ'}, {'NJ': 204883, 'NY': 68294}), ('normal control', {'wage': 1, 'days': {'NJ': 15}, 'resident': 'NY'}, {'NJ': 1})], [('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 424602, 'days': {'PA': 2, 'CT': 0, 'NJ': 7, 'NY': 0}, 'resident': 'CT'}, {'NJ': 330246, 'PA': 94356}), ('normal control', {'wage': 179374, 'days': {'PA': 20, 'NJ': 2, 'MA': 0}, 'resident': 'NY'}, {'PA': 163067, 'NJ': 16307}), ('normal control', {'wage': 172162, 'days': {'MA': 6, 'CT': 3, 'PA': 11}, 'resident': 'NJ'}, {'PA': 94689, 'MA': 51649, 'CT': 25824}), ('normal control', {'wage': 14, 'days': {'PA': 0, 'MA': 2}, 'resident': 'CT'}, {'MA': 14})], [('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 27, 'days': {'NY': 0}, 'resident': 'NY'}, {'NY': 27}), ('partial-repair probe', {'wage': 455522, 'days': {'MA': 0, 'CT': 0}, 'resident': 'NY'}, {'NY': 455522}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 525270, 'days': {'MA': 2, 'PA': 11, 'NJ': 22}, 'resident': 'NJ'}, {'NJ': 330170, 'PA': 165085, 'MA': 30015}), ('normal control', {'wage': 2, 'days': {'NJ': 2, 'PA': 2, 'NY': 0, 'MA': 1}, 'resident': 'CT'}, {'NJ': 1, 'PA': 1}), ('normal control', {'wage': 16, 'days': {'CT': 3, 'PA': 1}, 'resident': 'CT'}, {'CT': 12, 'PA': 4}), ('normal control', {'wage': 802876, 'days': {'NJ': 10, 'MA': 0, 'NY': 0, 'PA': 1}, 'resident': 'CT'}, {'NJ': 729887, 'PA': 72989})], [('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('regression', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('partial-repair probe', {'wage': 402912, 'days': {'CT': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 402912}), ('partial-repair probe', {'wage': 891837, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 891837}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 10, 'days': {'CT': 19, 'MA': 0}, 'resident': 'NJ'}, {'CT': 10}), ('normal control', {'wage': 5, 'days': {'MA': 17, 'NY': 2, 'PA': 9}, 'resident': 'NJ'}, {'MA': 3, 'PA': 2}), ('normal control', {'wage': 200160, 'days': {'CT': 0, 'NJ': 3, 'NY': 17, 'PA': 0}, 'resident': 'CT'}, {'NY': 170136, 'NJ': 30024}), ('normal control', {'wage': 254323, 'days': {'NY': 1, 'PA': 8, 'NJ': 15, 'MA': 0}, 'resident': 'NY'}, {'NJ': 158952, 'PA': 84774, 'NY': 10597})]]\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":"c93a61b72fda0dca77c0a9225a21e7cab4a085feccddd24b3cf714eb6d56b5e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    days = x['days']\n    total = sum(days.values())\n    if total == 0:\n        return {}\n    order = sorted(days, key=lambda s: (-days[s], s))\n    alloc = {s: x['wage'] * days[s] // total for s in order}\n    rema = sorted(order, key=lambda s: (-(x['wage'] * days[s] % total), order.index(s)))\n    left = x['wage'] - sum(alloc.values())\n    for s in rema[:left]:\n        alloc[s] += 1\n    return {s: v for s, v in alloc.items() if v}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', {'wage': 5000, 'days': {'NY': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 5000}), ('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('partial-repair probe', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 410311, 'days': {'PA': 10}, 'resident': 'CT'}, {'PA': 410311}), ('normal control', {'wage': 9, 'days': {'PA': 1, 'CT': 8}, 'resident': 'NY'}, {'CT': 8, 'PA': 1}), ('normal control', {'wage': 61318, 'days': {'CT': 0, 'MA': 0, 'PA': 12, 'NJ': 19}, 'resident': 'NY'}, {'NJ': 37582, 'PA': 23736}), ('normal control', {'wage': 17, 'days': {'NJ': 1, 'PA': 3, 'NY': 3}, 'resident': 'NY'}, {'NY': 7, 'PA': 7, 'NJ': 3})], [('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 874754, 'days': {'PA': 19}, 'resident': 'CT'}, {'PA': 874754}), ('normal control', {'wage': 315271, 'days': {'PA': 2, 'NY': 3, 'CT': 1}, 'resident': 'NJ'}, {'NY': 157636, 'PA': 105090, 'CT': 52545}), ('normal control', {'wage': 273177, 'days': {'PA': 0, 'NY': 1, 'NJ': 3}, 'resident': 'NJ'}, {'NJ': 204883, 'NY': 68294}), ('normal control', {'wage': 1, 'days': {'NJ': 15}, 'resident': 'NY'}, {'NJ': 1})], [('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 424602, 'days': {'PA': 2, 'CT': 0, 'NJ': 7, 'NY': 0}, 'resident': 'CT'}, {'NJ': 330246, 'PA': 94356}), ('normal control', {'wage': 179374, 'days': {'PA': 20, 'NJ': 2, 'MA': 0}, 'resident': 'NY'}, {'PA': 163067, 'NJ': 16307}), ('normal control', {'wage': 172162, 'days': {'MA': 6, 'CT': 3, 'PA': 11}, 'resident': 'NJ'}, {'PA': 94689, 'MA': 51649, 'CT': 25824}), ('normal control', {'wage': 14, 'days': {'PA': 0, 'MA': 2}, 'resident': 'CT'}, {'MA': 14})], [('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 27, 'days': {'NY': 0}, 'resident': 'NY'}, {'NY': 27}), ('partial-repair probe', {'wage': 455522, 'days': {'MA': 0, 'CT': 0}, 'resident': 'NY'}, {'NY': 455522}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 525270, 'days': {'MA': 2, 'PA': 11, 'NJ': 22}, 'resident': 'NJ'}, {'NJ': 330170, 'PA': 165085, 'MA': 30015}), ('normal control', {'wage': 2, 'days': {'NJ': 2, 'PA': 2, 'NY': 0, 'MA': 1}, 'resident': 'CT'}, {'NJ': 1, 'PA': 1}), ('normal control', {'wage': 16, 'days': {'CT': 3, 'PA': 1}, 'resident': 'CT'}, {'CT': 12, 'PA': 4}), ('normal control', {'wage': 802876, 'days': {'NJ': 10, 'MA': 0, 'NY': 0, 'PA': 1}, 'resident': 'CT'}, {'NJ': 729887, 'PA': 72989})], [('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('regression', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('partial-repair probe', {'wage': 402912, 'days': {'CT': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 402912}), ('partial-repair probe', {'wage': 891837, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 891837}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 10, 'days': {'CT': 19, 'MA': 0}, 'resident': 'NJ'}, {'CT': 10}), ('normal control', {'wage': 5, 'days': {'MA': 17, 'NY': 2, 'PA': 9}, 'resident': 'NJ'}, {'MA': 3, 'PA': 2}), ('normal control', {'wage': 200160, 'days': {'CT': 0, 'NJ': 3, 'NY': 17, 'PA': 0}, 'resident': 'CT'}, {'NY': 170136, 'NJ': 30024}), ('normal control', {'wage': 254323, 'days': {'NY': 1, 'PA': 8, 'NJ': 15, 'MA': 0}, 'resident': 'NY'}, {'NJ': 158952, 'PA': 84774, 'NY': 10597})]]\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":"22708b04f9e6affe1c3a85edecc62617e028ee9ece057e2b3f01eadeb0d10940","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    days = x['days']\n    total = sum(days.values())\n    if total == 0:\n        return {x['resident']: x['wage']}\n    order = sorted(days, key=lambda s: (-days[s], s))\n    alloc = {s: x['wage'] * days[s] // total for s in order}\n    rema = sorted(order, key=lambda s: (-(x['wage'] * days[s] % total), order.index(s)))\n    left = x['wage'] - sum(alloc.values())\n    for s in rema[:left]:\n        alloc[s] += 1\n    return {s: v for s, v in alloc.items() if v}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression (boundary)', {'wage': 5000, 'days': {'NY': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 5000}), ('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('partial-repair probe', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 410311, 'days': {'PA': 10}, 'resident': 'CT'}, {'PA': 410311}), ('normal control', {'wage': 9, 'days': {'PA': 1, 'CT': 8}, 'resident': 'NY'}, {'CT': 8, 'PA': 1}), ('normal control', {'wage': 61318, 'days': {'CT': 0, 'MA': 0, 'PA': 12, 'NJ': 19}, 'resident': 'NY'}, {'NJ': 37582, 'PA': 23736}), ('normal control', {'wage': 17, 'days': {'NJ': 1, 'PA': 3, 'NY': 3}, 'resident': 'NY'}, {'NY': 7, 'PA': 7, 'NJ': 3})], [('regression', {'wage': 22, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 22}), ('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('partial-repair probe', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 874754, 'days': {'PA': 19}, 'resident': 'CT'}, {'PA': 874754}), ('normal control', {'wage': 315271, 'days': {'PA': 2, 'NY': 3, 'CT': 1}, 'resident': 'NJ'}, {'NY': 157636, 'PA': 105090, 'CT': 52545}), ('normal control', {'wage': 273177, 'days': {'PA': 0, 'NY': 1, 'NJ': 3}, 'resident': 'NJ'}, {'NJ': 204883, 'NY': 68294}), ('normal control', {'wage': 1, 'days': {'NJ': 15}, 'resident': 'NY'}, {'NJ': 1})], [('regression', {'wage': 231015, 'days': {'PA': 0}, 'resident': 'CT'}, {'CT': 231015}), ('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('partial-repair probe', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 424602, 'days': {'PA': 2, 'CT': 0, 'NJ': 7, 'NY': 0}, 'resident': 'CT'}, {'NJ': 330246, 'PA': 94356}), ('normal control', {'wage': 179374, 'days': {'PA': 20, 'NJ': 2, 'MA': 0}, 'resident': 'NY'}, {'PA': 163067, 'NJ': 16307}), ('normal control', {'wage': 172162, 'days': {'MA': 6, 'CT': 3, 'PA': 11}, 'resident': 'NJ'}, {'PA': 94689, 'MA': 51649, 'CT': 25824}), ('normal control', {'wage': 14, 'days': {'PA': 0, 'MA': 2}, 'resident': 'CT'}, {'MA': 14})], [('regression', {'wage': 761711, 'days': {'MA': 0}, 'resident': 'NJ'}, {'NJ': 761711}), ('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('partial-repair probe', {'wage': 27, 'days': {'NY': 0}, 'resident': 'NY'}, {'NY': 27}), ('partial-repair probe', {'wage': 455522, 'days': {'MA': 0, 'CT': 0}, 'resident': 'NY'}, {'NY': 455522}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 525270, 'days': {'MA': 2, 'PA': 11, 'NJ': 22}, 'resident': 'NJ'}, {'NJ': 330170, 'PA': 165085, 'MA': 30015}), ('normal control', {'wage': 2, 'days': {'NJ': 2, 'PA': 2, 'NY': 0, 'MA': 1}, 'resident': 'CT'}, {'NJ': 1, 'PA': 1}), ('normal control', {'wage': 16, 'days': {'CT': 3, 'PA': 1}, 'resident': 'CT'}, {'CT': 12, 'PA': 4}), ('normal control', {'wage': 802876, 'days': {'NJ': 10, 'MA': 0, 'NY': 0, 'PA': 1}, 'resident': 'CT'}, {'NJ': 729887, 'PA': 72989})], [('regression', {'wage': 399573, 'days': {'CT': 0}, 'resident': 'CT'}, {'CT': 399573}), ('regression', {'wage': 2, 'days': {'NJ': 0}, 'resident': 'NJ'}, {'NJ': 2}), ('partial-repair probe', {'wage': 402912, 'days': {'CT': 0, 'NJ': 0}, 'resident': 'NJ'}, {'NJ': 402912}), ('partial-repair probe', {'wage': 891837, 'days': {'CT': 0}, 'resident': 'NY'}, {'NY': 891837}), ('boundary control', {'wage': 100, 'days': {'NY': 1, 'NJ': 1, 'CT': 1}, 'resident': 'NJ'}, {'CT': 34, 'NJ': 33, 'NY': 33}), ('normal control', {'wage': 10, 'days': {'CT': 19, 'MA': 0}, 'resident': 'NJ'}, {'CT': 10}), ('normal control', {'wage': 5, 'days': {'MA': 17, 'NY': 2, 'PA': 9}, 'resident': 'NJ'}, {'MA': 3, 'PA': 2}), ('normal control', {'wage': 200160, 'days': {'CT': 0, 'NJ': 3, 'NY': 17, 'PA': 0}, 'resident': 'CT'}, {'NY': 170136, 'NJ': 30024}), ('normal control', {'wage': 254323, 'days': {'NY': 1, 'PA': 8, 'NJ': 15, 'MA': 0}, 'resident': 'NY'}, {'NJ': 158952, 'PA': 84774, 'NY': 10597})]]\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-workday-wage-allocation-zero-day-fallback","generated_at":"2026-09-29T14:46:34.021969+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"State wage allocation must sum exactly to the paycheck with a deterministic remainder rule.","repair":"Restore the contract rule at the zero-day fallback step: use `return {x['resident']: x['wage']}`.","root_cause":"The zero-day case drops the paycheck instead of sourcing it to the resident state.","sha256":"38497cf6057c9d978d2eb4319f382ee01d5ad4c8500e74491d0e2f532e967c3d","title":"Multi-state wage allocation by work days: zero-day fallback · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.541,"exit_code":1,"observations":[{"actual":{"NJ":0,"NY":0},"check":"regression (boundary) 0","expected":{"NJ":5000},"passed":false},{"actual":{"CT":0},"check":"regression 1","expected":{"NY":22},"passed":false},{"actual":{"PA":0},"check":"partial-repair probe 2","expected":{"CT":231015},"passed":false},{"actual":{"MA":0},"check":"partial-repair probe 3","expected":{"NJ":761711},"passed":false},{"actual":{"CT":34,"NJ":33,"NY":33},"check":"boundary control 4","expected":{"CT":34,"NJ":33,"NY":33},"passed":true},{"actual":{"PA":410311},"check":"normal control 5","expected":{"PA":410311},"passed":true},{"actual":{"CT":8,"PA":1},"check":"normal control 6","expected":{"CT":8,"PA":1},"passed":true},{"actual":{"NJ":37582,"PA":23736},"check":"normal control 7","expected":{"NJ":37582,"PA":23736},"passed":true},{"actual":{"NJ":3,"NY":7,"PA":7},"check":"normal control 8","expected":{"NJ":3,"NY":7,"PA":7},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": {\"NY\": 0, \"NJ\": 0}, \"expected\": {\"NJ\": 5000}, \"passed\": false}, {\"check\": \"regression 1\", \"actual\": {\"CT\": 0}, \"expected\": {\"NY\": 22}, \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": {\"PA\": 0}, \"expected\": {\"CT\": 231015}, \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": {\"MA\": 0}, \"expected\": {\"NJ\": 761711}, \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"expected\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": {\"PA\": 410311}, \"expected\": {\"PA\": 410311}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {\"CT\": 8, \"PA\": 1}, \"expected\": {\"CT\": 8, \"PA\": 1}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {\"NJ\": 37582, \"PA\": 23736}, \"expected\": {\"NJ\": 37582, \"PA\": 23736}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"expected\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.338,"exit_code":1,"observations":[{"actual":{},"check":"regression (boundary) 0","expected":{"NJ":5000},"passed":false},{"actual":{},"check":"regression 1","expected":{"NY":22},"passed":false},{"actual":{},"check":"partial-repair probe 2","expected":{"CT":231015},"passed":false},{"actual":{},"check":"partial-repair probe 3","expected":{"NJ":761711},"passed":false},{"actual":{"CT":34,"NJ":33,"NY":33},"check":"boundary control 4","expected":{"CT":34,"NJ":33,"NY":33},"passed":true},{"actual":{"PA":410311},"check":"normal control 5","expected":{"PA":410311},"passed":true},{"actual":{"CT":8,"PA":1},"check":"normal control 6","expected":{"CT":8,"PA":1},"passed":true},{"actual":{"NJ":37582,"PA":23736},"check":"normal control 7","expected":{"NJ":37582,"PA":23736},"passed":true},{"actual":{"NJ":3,"NY":7,"PA":7},"check":"normal control 8","expected":{"NJ":3,"NY":7,"PA":7},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": {}, \"expected\": {\"NJ\": 5000}, \"passed\": false}, {\"check\": \"regression 1\", \"actual\": {}, \"expected\": {\"NY\": 22}, \"passed\": false}, {\"check\": \"partial-repair probe 2\", \"actual\": {}, \"expected\": {\"CT\": 231015}, \"passed\": false}, {\"check\": \"partial-repair probe 3\", \"actual\": {}, \"expected\": {\"NJ\": 761711}, \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"expected\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": {\"PA\": 410311}, \"expected\": {\"PA\": 410311}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {\"CT\": 8, \"PA\": 1}, \"expected\": {\"CT\": 8, \"PA\": 1}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {\"NJ\": 37582, \"PA\": 23736}, \"expected\": {\"NJ\": 37582, \"PA\": 23736}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"expected\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.182,"exit_code":0,"observations":[{"actual":{"NJ":5000},"check":"regression (boundary) 0","expected":{"NJ":5000},"passed":true},{"actual":{"NY":22},"check":"regression 1","expected":{"NY":22},"passed":true},{"actual":{"CT":231015},"check":"partial-repair probe 2","expected":{"CT":231015},"passed":true},{"actual":{"NJ":761711},"check":"partial-repair probe 3","expected":{"NJ":761711},"passed":true},{"actual":{"CT":34,"NJ":33,"NY":33},"check":"boundary control 4","expected":{"CT":34,"NJ":33,"NY":33},"passed":true},{"actual":{"PA":410311},"check":"normal control 5","expected":{"PA":410311},"passed":true},{"actual":{"CT":8,"PA":1},"check":"normal control 6","expected":{"CT":8,"PA":1},"passed":true},{"actual":{"NJ":37582,"PA":23736},"check":"normal control 7","expected":{"NJ":37582,"PA":23736},"passed":true},{"actual":{"NJ":3,"NY":7,"PA":7},"check":"normal control 8","expected":{"NJ":3,"NY":7,"PA":7},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression (boundary) 0\", \"actual\": {\"NJ\": 5000}, \"expected\": {\"NJ\": 5000}, \"passed\": true}, {\"check\": \"regression 1\", \"actual\": {\"NY\": 22}, \"expected\": {\"NY\": 22}, \"passed\": true}, {\"check\": \"partial-repair probe 2\", \"actual\": {\"CT\": 231015}, \"expected\": {\"CT\": 231015}, \"passed\": true}, {\"check\": \"partial-repair probe 3\", \"actual\": {\"NJ\": 761711}, \"expected\": {\"NJ\": 761711}, \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"expected\": {\"CT\": 34, \"NJ\": 33, \"NY\": 33}, \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": {\"PA\": 410311}, \"expected\": {\"PA\": 410311}, \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": {\"CT\": 8, \"PA\": 1}, \"expected\": {\"CT\": 8, \"PA\": 1}, \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": {\"NJ\": 37582, \"PA\": 23736}, \"expected\": {\"NJ\": 37582, \"PA\": 23736}, \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"expected\": {\"NY\": 7, \"PA\": 7, \"NJ\": 3}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}