Repository navigation
Conversation
Swapping a married couple's is_tax_unit_head and is_tax_unit_spouse labels changed state income tax in Arkansas, Iowa, Mississippi, Montana and Oklahoma (Delaware's code had the same pattern without an observed effect). - Arkansas, Delaware, Iowa, Mississippi and Montana put dependents' income on the head's column of a separate-column return. A shared helper, move_dependent_amounts_to_filer, now puts it on the column of the spouse with the greater income of their own and splits an exact tie, following the rule for parents filing separately (26 U.S.C. 1(g)(5)(B), Form 8814). - Montana's joint itemized deductions counted only the head's mortgage and investment interest; they now count every member's. - Oklahoma's property tax credit accepted a disabled head but not a disabled spouse; either spouse now qualifies, as for age. Adds YAML cases for each formula and a Hypothesis property test that swapping the labels leaves state income tax unchanged to the cent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tests The independent review of #9981 found four more state formulas that change when a couple's head and spouse labels are exchanged: - Minnesota's dependent care credit and Montana's dependent care deduction counted an incapacitated spouse but not an incapacitated head. - Delaware's combined separate return sent the EITC (and the dependent care credit) to the head's column on equal taxable incomes, and split the dependent personal credits with a floor/ceil heuristic that was not symmetric. Ties now go to the column where they cut tax most, and the split searches every allocation. - Missouri's property tax credit tested the surviving-spouse pathway on the head only; either spouse can be the claimant. Also: - Montana's joint itemized deductions count the spouses' interest, not a dependent's own. - The helper's docstring and the state comments call the dependent allocation a modelling convention, and state its one-spouse precondition. - The property test covers MN and MO, incapacity, adult care expenses, survivor benefits, veterans and dependents' DE/MT additions, adds the review's counterexamples, and asserts finite values with rtol=0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Delaware: the dependent personal-credit split, and on equal Line 23
incomes the dependent care credit and EITC columns, are now chosen
together to minimise the columns' tax after the EITC
(de_combined_separate_credit_choices). Maximising credits used first, or
sending the dependent care credit to the roomier column, could leave
more tax than main's labelling did.
- Oregon: either married filer with a disability is the other's qualifying
spouse for the working family household and dependent care credit, and
either filer's earnings, or a disabled spouse's imputed earnings, meet
the employment test ("you" also means your spouse on a joint return).
- The property test covers Oregon and a disabled, incapacitated spouse,
and states that couples with a spouse claimed elsewhere are out of scope.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uses The #9617 cross-check found one Mississippi pure head/spouse swap that still changed state tax: the microdata supply the health savings account deduction at the tax-unit level, and person_share_of_tax_unit_amount gave a deduction with no per-person amounts to the head's column. It now takes an opt-in split_between_spouses flag, which the Mississippi health savings account, self-employed health insurance and self-employed retirement adjustments use: the head and spouse each take half. Medicaid AGI keeps the head fallback. The property test now draws tax-unit deductions with no per-person split, and fails on the previous head for this case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 8, 2026
This branch has not been deployed
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
Which spouse a married couple lists first is a convention of the form, but swapping
is_tax_unit_headandis_tax_unit_spouse(with every other input kept) changed state income tax in Arkansas, Iowa, Mississippi, Montana and Oklahoma. The review of #9617 found this for 12,944 dataset units that only exchange head and spouse: federal outcomes unchanged, state tax −$8.931M (2025) and −$8.551M (2026).This PR makes those taxes independent of the label:
mainar_agi_indivput dependents' net income on the head's column (Filing Status 4)de_agi_indiv, same pattern (Filing Status 4)main(see below)ia_net_income, same pattern (status 3)ms_agiput dependents' positive income on the head's column (combined return; the "joint" path is per column too)mt_agi_indiv, same pattern (Filing Status 2a, ≤2023); and both joint itemized deduction variables counted only the head's mortgage and investment interest (all years)mt_agi_indiv; joint itemized deductions add every member's interest, as the federalinterest_deductiondoesok_ptcaccepted a disabled head but not a disabled spouse (either spouse's age already counted)A shared helper,
move_dependent_amounts_to_filerinmodel_api.py, holds the dependent rule.How the swap asymmetry was found
main(f33a4b3): 6 seeds × 40 random married couples per state (with and without dependents, 27 income and deduction inputs per adult), every state, 2019–2027, each couple simulated twice with the labels exchanged. Only AR (all years), IA (2019–2022), MS (all years) and MT (all years; some couples without dependents) changed by more than $0.005. No other state did.main: 25 crafted couple types (offsetting incomes, zero incomes, one disabled or elderly spouse, one earner, equal spouses, interest paid by one spouse) in every state, 2021–2026. Only Oklahoma changed: $200 ofok_ptcfor a low-income couple with a disabled non-head spouse.main: the dependent'sirs_gross_income,adjusted_gross_income_personandde_pre_exclusions_agiare all 0, andde_income_taxis $6,137.12 under either labelling.de_pre_exclusions_agiisadjusted_gross_income_person+de_additions(an input with no formula) −de_subtractions(floored at 0), so a dependent reachesde_agi_indivonly through ade_additionsinput. The DE change keeps the same rule as the other states for that case.mt_itemized_deductions_for_federal_itemization_jointwas $12,018.81 with one spouse as head and $22,023.81 with the other.The law, and the methodology choice (for the hub to queue for Max)
What each state says about a dependent's income on a separate-column return. None of the five states has a rule. Each tells spouses to report their own income in their own column:
So under the law a dependent's income belongs on neither column: it is on the dependent's own return. PolicyEngine-US nonetheless counts dependents' income on the filers' return in these states, on both the joint and the separate path (the model does not compute dependents' own returns, #9618). This PR keeps that and changes only which column gets it.
Rule chosen: the spouse with the greater income takes it; an exact tie splits it equally. The one federal rule that puts a child's income on a parent's return addresses parents filing separately: the child's income goes on "the return of the parent with the greater taxable income" (IRS Form 8814 instructions; 26 U.S.C. 1(g)(5)(B)). Montana says separate-column filers report income as on a separate federal return, and the others treat each column as a separate return. The comparison uses each spouse's own state net income before the move (per-spouse taxable income is not computed, and AR prorates itemized deductions by this income). The tie split keeps the rule independent of the label.
Alternatives Max may prefer:
Oklahoma interpretation. 68 O.S. 2906 allows a claim by "any totally disabled person, who is the head of a household", and Form 538-H defines head of household as "a person who as owner or joint owner maintained a home". A totally disabled spouse who jointly owns the home is such a person, and the form asks about "you or your spouse" for age.
mainalready counted either spouse's age. This PR counts either spouse's disability too.Invariants
These hold for every input:
state_income_taxandstate_income_tax_before_refundable_creditsunchanged, in every state and year.ar_agi_indiv,de_agi_indiv,ia_net_income,ms_agiandmt_agi_indivis the same under either labelling.Tests
ar_agi_indiv,de_agi_indiv,ia_net_income,ms_agi,mt_agi_indiv, both Montana joint itemized deduction files andok_ptc. Two existing expectations change because they encoded the asymmetry:ms_agi(the spouse's $10,000 exceeds the head's $9,000, so the spouse now takes the $3,000) andia_net_income"unit test 2" (equal $8,000 spouses now split the $600).policyengine_us/tests/core/test_state_tax_head_spouse_swap_invariance.pychecks invariants 1–3:main: all 8 tests fail (log:~/reviews/us-hub/state-swap-invariance/logs/property-test-main.log). For example: "state_income_tax in 2021 changes when the head and spouse labels are exchanged: AR 277.84 -> 271.62, ... IA 7328.70 -> 6964.60". Hypothesis also reports MS 1972.15 -> 2135.20 and MT 10562.37 -> 10564.16.property-test-branch.log).Microsimulation impact
A real microsimulation, main (f33a4b3) against this branch (cd24bdd), on the default dataset
populace_us_2024.h5@populace-us-2024-spm-20260909, run throughlockrun.sh(arrays in~/reviews/pe-us-merge-backlog-2026-10-02/impact/out/ssw-{b,p}.*). These are weighted changes in state income tax, branch minus main, in $ millions:mt_agi_indiv, the only other Montana change, applies only through 2023, when filing separately on one form ended.de_agi_indiv(see above), Iowa's separate filing ended after 2022, and no Oklahoma unit hasok_ptcin either run.A 2025 cross-check, #9617 on current main with and without this fix, is running and will be added here.
Overlaps
mt_itemized_deductions_for_federal_itemization_joint(to the §163(d) deduction). Whichever lands second keeps Limit investment interest deductions under §163(d) and Form 4952 #9977's investment line and this PR's tax-unit mortgage interest. Neither PR changes the other's semantics.mt_agi_indivabove the dependent-allocation block that this PR replaces. This should be a textual merge only.Follow-ups (not in this PR)
Label-dependent fallbacks with no observed tax effect in either scan:
ia_prorate_fractionandva_agi_sharegive 100% to the head when the couple's total is 0;mo_adjusted_gross_incomegives the head all the remaining ALDs when the couple's gross income is not positive; andmd_two_income_subtractiongives the head the couple's whole federal AGI when their gross income is not positive. Separately, Montana's itemized deductions usemortgage_interest, which includesnon_deductible_mortgage_interest.axiom: 68 O.S. §2906 TheAxiomFoundation/rulespec-us#1555 queued | Minn. Stat. 290.067 / 26 USC 21(b)(1)(C) TheAxiomFoundation/rulespec-us#1603 queued | RSMo 135.010(1) TheAxiomFoundation/rulespec-us#1604 queued | ORS 315.264 / 26 USC 21 TheAxiomFoundation/rulespec-us#1605 queued | 30 Del. C. §1110 / PIT-RES line27 TheAxiomFoundation/rulespec-us#1606 queued | 30 Del. C. §1114 TheAxiomFoundation/rulespec-us#1607 queued | 30 Del. C. §1117 TheAxiomFoundation/rulespec-us#1608 queued | MCA 15-30-2131(1)(a), (1)(c)(i)(C) TheAxiomFoundation/rulespec-us#1512 queued | MCA 15-30-2131 (Montana itemized deductions, 2021–2023) queued, blocked: the corpus has only the repeal notice | n/a for the dependent-income column rule: it places income the law keeps on dependents' own returns (#9618), so there is no provision to mirror | n/a for unknown-account ownership and first-listed output storage conventions
🤖 Generated with Claude Code