FA-59217 / Payroll withholding rules / Member archive
Multi-state wage allocation by work days: zero allocation filter · case 02
Allocation results list states with zero cents allocated.
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 fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | {"MA": 3, "NY": 0, "PA": 2} | {"MA": 3, "PA": 2} | 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 ↗