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
Combine Montana deductible mortgage limits with filer-only interest aggregation; preserve raw investment interest pending #9977. Retain Delaware claimable-filer rules in the symmetric credit optimizer, with paired filing-exception regressions. Use Oregon's claimable-filer qualifying-individual helper and retain single-filer coverage.
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
Swapping a married couple's
is_tax_unit_headandis_tax_unit_spouselabels while keeping every other input fixed can change state income tax. The review of #9617 first found this for 12,944 dataset units: federal outcomes were unchanged, while state tax moved by −$8.931M in 2025 and −$8.551M in 2026. This PR removes the identified label dependencies in nine states.ar_agi_indivmoves the dependents' net income to the filer with greater own state net income; exact ties split it equally.de_agi_indiv; jointly chooses dependent personal-credit allocations and the permitted CDCC/EITC recipients to minimize combined separate tax. Review r1 makes candidate scoring match downstream float32 calculations. The CDCC tie election and inherited EITC comparison remain readings for Max, described below.ia_net_income, retaining signed own income.ms_agi, preserving negative filer columns and clipping dependent losses before transfer. HSA, self-employed health-insurance and pension deductions retain known per-person attribution; amounts with no per-person attribution split equally between the spouses.mt_agi_indiv(through 2023). Both joint itemized-deduction formulas add both filers' deductible mortgage interest and investment-interest expenses, excluding dependents. The legacy dependent-care qualifying-individual formula recognizes an incapacitated spouse under either label and excludes a single filer as their own qualifying individual.The shared
move_dependent_amounts_to_filerhelper inmodel_api.pycontains the dependent-income convention. The Delaware helper keeps each eligible filer's own personal credit and aged credit in that person's column, while coordinating the other credit choices.How the swap asymmetry was found
f33a4b3b16) used six seeds and 40 married couples per state, with and without dependents, 27 adult income/deduction inputs and years 2019–2027. AR, IA through 2022, MS and MT changed by more than $0.005.de_pre_exclusions_agiwere zero, and state tax was $6,137.12 under both labels. A dependent reaches this allocation through inputs such asde_additions. This historical result does not imply that Delaware's credit routing was invariant.The law and methodology choices (for the hub to queue for Max)
The dependent-income convention is a new modelling reading, not a state rule requiring a dependent's income to appear on a parent's return. The reviewed instructions give each filer their own column: Arkansas 2025 instructions, p. 12, Delaware 2025 instructions, p. 5, Iowa 2021 instructions, p. 7, Mississippi instructions, p. 5, and Montana 2023 instructions, p. 12. A dependent's own return income belongs on that dependent's return. PE currently includes these amounts on the filers' return and does not compute dependents' own returns (#9618); this PR preserves that existing coverage boundary and changes the receiving column.
count_cdcc_eligible, now applied symmetrically in Minnesota; it is not a new two-spouse entitlement.The Delaware authority search covered the 2025, 2024, 2023, 2022, 2013 and 2011 resident instructions; the 2025 Tax Preference Report; the TIM index and TIM 2005-02; the administrative-code index; and targeted official-domain searches for regulations and technical guidance. None located a CDCC equality election or reconciled the EITC comparison. The 2011 booklet already contains the EITC conflict: taxable-income prose alongside a greater-tax worksheet comparison. The actual 2025 worksheet supports the statute's greater-remaining-tax comparison. The PR keeps the two implemented routing readings and explicitly queues them for Max.
A 2025 EITC-routing disagreement exists because the age credit can reverse the ordering. Consider full-year residents filing jointly federally and combined-separately in Delaware, with no dependents, no other income or adjustments, neither spouse claimable elsewhere, and otherwise eligible for childless federal EITC:
Higher taxable income selects A; greater remaining tax selects B. The 2025 IRS EIC table gives $244 federal EITC at $23,000 of married-joint income without qualifying children, yielding a $10.98 refundable Delaware alternative and $48.80 nonrefundable potential. Taxable-income routing cannot use nonrefundable EITC against A's zero balance, so household tax is $64 − $10.98 = $53.02. Greater-tax routing applies $48.80 against B, producing $15.20. These hand calculations use published tax-table amounts before whole-dollar return rounding; they are not model results. PE's continuous-rate gross taxes are $212.25/$173.25, leaving $0/$63.25, which also reverses the ordering; the precise table-based liabilities above should not be attributed to PE.
Proportional income shares are undefined only when the spouses' combined income is zero. With mixed signs and a nonzero total they are defined, but can be negative or exceed one; this makes them a further allocation choice for signed IA/MS incomes. Dropping dependent income should be considered with dependents' own-return modelling (#9618), so that income is not simply removed from the tax system.
For Oklahoma, 68 O.S. §2906 and Form 538-H, p. 3 require the claimant to own or jointly own and maintain the home, and furnish their own support for home furnishings and other material necessities. The PR's either-spouse reading assumes the qualifying disabled spouse meets those claimant conditions; joint ownership or disability alone does not establish all of them. The formula does not add new inputs to establish those conditions. The form's age question already refers to either spouse.
Invariants and tests
The intended invariants are unchanged tax-unit tax when labels are exchanged; unchanged per-person AR/DE/IA/MS/legacy-MT income columns; conservation of each formula's dependent amount across the filer columns; and unchanged allocation for units with no spouse. Mississippi preserves its existing clipping of dependent losses before transfer. The helper assumes one head and at most one spouse.
The property test
test_state_tax_head_spouse_swap_invariance.pyruns Hypothesis batches and seeded edge cases in AR, DE, IA, MN, MO, MS, MT, OK and OR for 2021–2026, an all-state seeded guard for 2026, and an independent numpy reference for AR/DE/IA/MS allocations. Review r1 adds the Delaware high-income rounding witness to the seeded population, alongside YAML regressions under both labels.Five existing numerical YAML cases change, rather than the two named in the earlier body:
ia_net_income.yaml:IA net income unit test 2, nowSpouses with equal net income split the dependent net income equallyms_agi.yaml:The dependent income is allocated to the head, nowThe dependent income goes to the spouse with the greater income, here not the headms_health_savings_account_adjustment.yaml:A joint return without per-person amounts attributes the deduction once, to the head, now...half to each spouseA dependent's income is not reduced by the filer's deduction, nor by the dependent's own accountWithout per-person amounts the head takes the deduction, even above the head's own income, now...each spouse takes half, even above one spouse's own incomeThe Missouri claimant-only test is also recast explicitly: a spouse personally meeting both age and survivor-benefit requirements now qualifies, while a separate case retains
falsewhen age and benefits belong to different spouses. Montana's joint itemized YAML files preserve main's mortgage-cap cases and usedeductible_mortgage_interestin the PR's filer-aggregation cases.Historical validation of the original test version failed all eight tests on original main and passed all eight on the branch. Its local macOS arm64 measurement was 25 seconds test time, 45 seconds including imports and 2.9 GB peak RSS; those are historical figures, not a benchmark of the expanded final test. The file remains in the Rest/core CI group. Review-r1 pre-change property run: 8 passed in 63.81 seconds, 78.79 seconds wall time. Peak RSS was unavailable because the sandbox denied the timing tool's
sysctlcall. The added Delaware witness joins the existing yearly batches without adding model constructions. Review-r1 after-change measurement: 8 passed in 37.56 seconds, 62.31 seconds wall time; peak RSS remained unavailable. These are single local runs with variable timing, so the difference is not evidence of a reliable speed improvement. Rest/core CI placement is unchanged.Review r1: responses
9981-de-fail-before.log: 1 failed, 7 passed in 10.52 seconds, with expected $131,091.96875 versus actual $131,091.984375 (difference $0.015625 > $0.001 tolerance). After-change output:9981-de-pass-after.log: 8 passed in 11.56 seconds, including both labelings at $131,091.96875 within the $0.001 YAML tolerance.9981-delaware-authority.md; code comments now cite the statute, instruction booklet and actual worksheet.axiom:line is preserved exactly and the attribution footer remains last.UV_NO_SYNC=1 make formatpassed: two files reformatted and 7,316 unchanged.Every file in the main-merge report's table, including the new Delaware regression coverage, was rerun individually in the foreground with
OMP_NUM_THREADS,OPENBLAS_NUM_THREADS,MKL_NUM_THREADS,VECLIB_MAXIMUM_THREADSandNUMEXPR_NUM_THREADSset to 4 andOMP_WAIT_POLICY=PASSIVE.All 209 tests passed across 26 files: 27 Python and 182 YAML, including the two new high-income Delaware label regressions.
make formatandgit diff --checkpassed.test_state_tax_head_spouse_swap_invariance.pytest_ms_health_savings_account_adjustment_invariants.pytest_mt_mortgage_interest_federal_limit_properties.pytest_claimable_filer_federal_invariants.pytest_claimable_filer_or_me_hi_invariants.pyar_agi_indiv.yamlde_agi_indiv.yamlde_income_tax_before_refundable_credits_separate.yamlde_personal_credit_indv.yamlde_personal_credits.yamlia_net_income.yamlmn_cdcc_dependent_count.yamlmo_ptc_taxunit_eligible.yamlms_health_savings_account_adjustment.yamlms_agi.yamlmt_child_dependent_care_expense_deduction_qualifying_individual.yamlmt_itemized_deductions_joint.yamlmt_itemized_deductions_for_federal_itemization_joint.yamlmt_itemized_deductions_indiv.yamlmt_itemized_deductions_for_federal_itemization_indiv.yamlmt_agi_indiv.yamlok_ptc.yamlor_wfhdc_employment_eligible.yamlor_wfhdc_has_qualified_individual_eligible.yamlor_cdcc_relevent_expenses.yamlor_wfhdc_eligibility_category.yamlMicrosimulation impact
Rerun 2026-10-19 by the hub at this head
df6550b10bagainst main at the merge basef9b55fc4dd, on the default datasetpopulace_us_2024.h5@populace-us-2024-spm-20260909, throughlockrun.sh, with a by-state breakdown. State income tax, weighted, $ millions:mt_itemized_deductions_jointchanges on 2 zero-weight records in 2025. The earlier run's base,f33a4b3b16, predates Count only deductible mortgage interest in Montana, give Maryland spouses their own losses, report the whole Virginia EITC #10004's merge into main on 2026-10-09, and Count only deductible mortgage interest in Montana, give Maryland spouses their own losses, report the whole Virginia EITC #10004 also changed Montana's joint interest lines.The earlier figures (
cd24bdd4afagainstf33a4b3b16: all states -7.057 in 2025 and -5.995 in 2026, mostly Montana) are superseded by this table. Comparison files:fixes/9981-impact/on the hub host.Merge with main and overlaps
The previous merge brought in main
f9b55fc4dd05f1bed921a4dd06cb8c81f6ceb2c7via2df930fac41a9dbd51d84c3a0e70b0aab9776cf0. Review r1 started from the requested head2df930fac41a9dbd51d84c3a0e70b0aab9776cf0; fetchedgh/mainremainedf9b55fc4dd05f1bed921a4dd06cb8c81f6ceb2c7, already merged. No new merge or conflict resolutions were required. The review-r1 head isdf6550b10bd4006bcc5e80fff22a7870d7f9c407.mt_agi_indivabove the allocation block; Leave dependents' own items out of DC, Delaware and Ohio subtractions #9939/Leave dependents' capital income out of state lines on the filers' return #9894 change amounts that can reach filer state lines. Honor dataset-supplied tax-unit roles #9617 makes dataset-supplied roles reach these formulas and is the origin of this follow-up.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