FAILURE MAP
← Case archive

FA-59209 / Payroll withholding rules / Member archive

Multi-state wage allocation by work days: leftover distribution · case 04

All leftover cents land in a single state.

Member previewVariant 4 · 3 implementations · 10 checks per implementation

Case 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}.

Why this case matters

State wage allocation must sum exactly to the paycheck with a deterministic remainder rule.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression 0{"CT": 84335, "MA": 84333, "NJ": 56222, "NY": 421668}{"CT": 84334, "MA": 84334, "NJ": 56222, "NY": 421668}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗