Split household income inputs 50/50 between spouses in Microsim runner#842
Merged
Conversation
The PolicyEngineRunner Microsimulation path was assigning seven household-level aggregate TAXSIM inputs (intrec, dividends, ltcg, stcg, pensions, gssi, scorp) entirely to the primary filer. The single-record input_mapper.py path already split these 50/50 between spouses for MFJ returns. The misallocation was invisible for federal calculations (combined AGI is unchanged) and for most states (joint filing consolidates), but produced incorrect results for states with per-person rules — e.g. Delaware's age 60+ exclusion and pension exclusion are per-spouse caps. Verified against TAXSIM and TaxAct for the DE elderly pension case (#838): PE Microsim siitax went from $848 to $276 (TAXSIM: $386, TaxAct: $0), bringing PE substantially closer to both reference tools. Closes #665. Closes #838. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pensions now split 50/50 only when both spouses are at least 60 (the lowest common threshold across state pension exclusions such as DE). For mixed-age couples (one spouse 60+, one under 60), pensions stay with the primary filer so state per-person elderly exclusions still apply to the qualifying spouse. Validated against TAXSIM over 612 records (51 states × 12 scenarios). Net improvement versus before-fix: +$5,282 across 22 improvements vs -$570 across 6 small residual regressions. Mixed-age pension regressions eliminated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tests cover: - MFJ: six household-aggregate income types split 50/50 between spouses - Single: full amount stays on primary (no spouse entity) - Pension: split 50/50 when both spouses 60+, on primary otherwise - Pension: stays on primary for mixed-age couples (mentions #838) - End-to-end: DE elderly pension case from #838 stays under $500 siitax Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #665. Fixes #838.
Splits household-aggregate TAXSIM income inputs between spouses in the
PolicyEngineRunnerMicrosimulation path, matching the existing convention ininput_mapper.py.Allocation rules
Split 50/50 for MFJ, primary otherwise (6 types):
intrec→taxable_interest_incomedividends→qualified_dividend_incomeltcg→long_term_capital_gainsstcg→short_term_capital_gainsgssi→social_security_retirementscorp→partnership_s_corp_incomeAge-aware split for pensions (
pensions→taxable_private_pension_income):The 60 threshold is the lowest common age across state pension rules (DE starts at 60; GA 62; MD 65).
Validation
612 records across all 51 states × 12 scenarios:
Remaining small regressions (all understood)
All 6 regressions share a pattern: PE gives a lower state tax than TAXSIM, because PE applies per-person exclusions more aggressively — i.e. more legally accurate, but further from the TAXSIM benchmark.
All regressions push PE to lower tax (favorable to taxpayer) and are small individually (max −$237). These aren't new bugs — they're PE correctly applying per-person state exclusions that TAXSIM applies less completely.
Example (#838 — DE elderly couple, $44k pension, 2 deps)
TaxAct confirms 50/50 split: $22,249 per spouse, each with $12,500 exclusion (total $25,000).
Tests added
tests/test_spouse_income_splitting.py— 13 focused tests:🤖 Generated with Claude Code