Repository navigation
Conversation
…5,000 per separate column Form 2, Itemized Deductions Schedule, line 5 (2021-2023) adds lines 5a through 5d and caps the total at $10,000 (single, head of household, married filing jointly) or $5,000 (married filing separately). - mt_salt_deduction: a joint return's taxes are pooled and capped once, on the head. It had capped each spouse separately, so a couple with $8,000 each deducted $16,000. - mt_salt_deduction_indiv (new): each column of a return filed separately on the same form (status 2a) is capped at $5,000. The separate-columns path had used the tax unit's joint cap ($10,000). - Line 5a: add the tax unit's general sales taxes (state_sales_tax, local_sales_tax), split equally between a couple's columns. - From 2024 (schedule discontinued) the per-person amounts are as before; the 2024 Worksheet A change is separate. The 2021-2023 switch is gov.states.mt.tax.income.deductions.itemized. state_specific_deduction_applies, byte-identical to the file in #9903 and #9947. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction
Review r1 found that local_income_tax is not always zero for a Montana
household: PolicyEngine levies the Kansas City and St. Louis earnings
taxes and the Philadelphia wage tax on earnings in those cities without a
residence test. Line 5 adds "any local income taxes that you paid".
- mt_salt_deduction: the joint return's line 5 adds local_income_tax.
- mt_salt_deduction_indiv: each column takes the tax unit's local income
tax in proportion to the person's own earnings taxed by those cities
("Deductions that are attributable to only one spouse must be claimed
by that spouse"); without such earnings it is divided like the sales
taxes.
- YAML: Kansas City cases for a single return, a joint return at the
cap, and two separate-column cases. The Hypothesis file adds Kansas
City earnings to its draws and reference calculation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r2: dividing the tax unit's local income tax by each spouse's share of taxable city earnings is exact only when everyone pays the same rate with no credit. PolicyEngine sets Philadelphia's rate per person and subtracts St. Louis credits per person. - New Person variables mo_kansas_city_earnings_tax_person, mo_st_louis_earnings_tax_person and pa_philadelphia_wage_tax_person hold each person's own tax, with the existing formulas. The tax-unit variables now add them up, so their values do not change. - mt_salt_deduction_indiv: each column takes its own spouse's city tax. Any other local income tax of the tax unit (none for a Montana household) is divided like the sales taxes. - YAML: first tests for the three city taxes; Montana cases for a Philadelphia reduced rate, a St. Louis credit, two cities with one column at the cap, and a joint return with two cities. - Hypothesis: St. Louis earnings and per-person credits in the draws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Montana's 2021–2023 Itemized Deductions Schedule, line 5, caps state and local taxes at $10,000 for single, head of household and joint returns, and at $5,000 for married filing separately. PolicyEngine applied the cap to each person:
mt_salt_deductioncapped each spouse, and the joint aggregates added the spouses up. A 2023 couple with $8,000 of real estate taxes each deducted $16,000. The form allows $10,000.What Montana's forms say
Changes
mt_salt_deduction(Person). For 2021–2023 it is line 5 for the whole return, on the head: min(lines 5a + 5b + 5c over the tax unit, the cap for the filing status). The joint aggregates (mt_itemized_deductions_jointandmt_itemized_deductions_for_federal_itemization_joint) already add it over the tax unit, so they are not edited. From 2024 the formula is main's.mt_salt_deduction_indiv(Person, new). Each status 2a column. A married couple's columns are each capped at $5,000; any other filer's single column is capped at the amount for their own status. Each column takes its own spouse's city taxes (line 5b). It replacesmt_salt_deductioninmt_itemized_deductions_indivandmt_itemized_deductions_for_federal_itemization_indiv(one line each).mo_kansas_city_earnings_tax_person,mo_st_louis_earnings_tax_personandpa_philadelphia_wage_tax_personhold each person's own tax, with the existing formulas. The three tax-unit variables now add them up. Main gives the same tax-unit amounts on the new city tests' households, andtests/core/test_local_employee_taxes.py(11 tests) passes.gov.states.mt.tax.income.deductions.itemized.state_specific_deduction_applies(true 2021–2023, false from 2024). The file is byte-identical (blob8b6d633) to the one Floor Montana's joint-return medical and standard deductions on the return's Montana AGI, and on federal AGI from 2024 #9903 and Deduct Montana's 2021–2023 medical and long-term care insurance premiums in full (Itemized Deductions Schedule lines 2–3) #9947 add, and to the one in the pending 2024+ branch (below). Whichever lands first, the others merge cleanly.Lines 5a, 5b and 5d
state_sales_taxandlocal_sales_taxare tax-unit amounts. They are zero for Montana households unless entered: every Montana entry in the IRS optional sales tax table is 0 for 2021–2023, andlocal_sales_taxis 20% ofstate_sales_taxoutside its no-local-tax list. A couple's 2a columns split them equally, with the existingspouse_allocation_ratethat the charitable deduction also uses. The form allows "any proportional amount".local_income_tax, PolicyEngine levies three without a residence test: the Kansas City and St. Louis earnings taxes and the Philadelphia wage tax, each on its own taxable-earnings input. (NYC tax applies toin_nychouseholds, the Indiana county tax to Indiana households and the Wilmington tax to Delaware households.)local_income_taxgoes into line 5.mt_itemized_deductions_jointalready depended onlocal_income_taxthrough the federal income tax deduction (federal tax, then SALT, thenlocal_income_tax), so this adds no new cycle. The federal-itemization variants feed onlystate_itemized_deductions, which no formula reads.state_and_local_sales_or_income_taxandreal_estate_taxes.2024 and later: unchanged
From 2024
mt_salt_deductionkeeps main's per-person amounts.mt_salt_deduction_indivis zero because filing separately on the same form ended:mt_married_filing_separately_on_same_return_eligibleis false from 2024, which already zeroed the separate-column aggregates on main. The Hypothesis file checks 2024 and 2026 against main's formula. The 2024+ regime (Form 2 starting from federal taxable income, Worksheet A) is in another session's branch,mt-federal-taxable-income-2024, not here.Household example
A couple with wages of $80,000 and $60,000 and real estate taxes of $8,000 each, from
Simulationruns on main (b7e4229d86) and this branch:mt_salt_deductionmt_salt_deduction_indivmt_itemized_deductions_jointmt_itemized_deductions_indivmt_files_separatelymt_income_taxFor 2021 the same household's Montana tax goes from 3,860.85 to 4,274.85. Each column loses $3,000 of SALT; each change is 6,000 times the rate (6.75% in 2023, 6.9% in 2021).
Tests
YAML. The expectations come from the line 5 arithmetic, which each case's comments show.
mt_salt_deduction.yaml: 8 new cases (joint above the cap, joint below it, joint with sales taxes, single with sales taxes, head of household, single with a Kansas City earnings tax, joint at the cap with one, joint with Kansas City and Philadelphia taxes). The 4 existing cases are unchanged.mt_salt_deduction_indiv.yaml(new): 13 cases (couple above the cap, one spouse below it, sales taxes split, a dependent, single above and below the single cap, a married person on a separate form, 2024, and five city tax cases: one spouse's Kansas City tax, both spouses' with one column at the cap, Philadelphia nonresident and reduced rates, a St. Louis credit, and Kansas City plus Philadelphia with one column at the cap).gov/local/mo/kansas_city/.../mo_kansas_city_earnings_tax.yaml,gov/local/mo/st_louis/.../mo_st_louis_earnings_tax.yamlandgov/local/pa/philadelphia/.../pa_philadelphia_wage_tax.yaml, with per-person and tax-unit amounts.mt_itemized_deductions_indiv.yamlandfederal_itemization/mt_itemized_deductions_for_federal_itemization_indiv.yaml: the SALT input is renamed tomt_salt_deduction_indiv. Expectations are unchanged.mt_salt_deductioncases fail. The couple above the cap gets [8,000, 8,000]. The couple below the cap gets [6,000, 2,500], the right total but split across the spouses. The two sales tax cases leave out line 5a. Withmt_salt_deductionstanding in for the new variable, 5 of the 8mt_salt_deduction_indivcases fail: married columns cap at $10,000, a dependent keeps their own amount, and 2024 gives 8,000 each. The single and separate-form cases pass on main.0a4846c7b1, one file at a time:mt_salt_deduction.yaml12 passed,mt_salt_deduction_indiv.yaml13, the three city files 1 + 1 + 2, andtests/core/test_local_employee_taxes.py11. At0222cabda4:mt_itemized_deductions_indiv.yaml4,mt_itemized_deductions_joint.yaml4, and the two federal-itemization files 4 each. CI at9d184261a9(run 37687652780, attempt 2) passed all 35 jobs, including every Baseline state shard; CI at0a4846c7b1is pending.Hypothesis,
test_mt_salt_deduction_invariants.py. YAML cannot cover these: many mixed tax units (single, head of household, separate, joint, joint with dependents, some with sales taxes, Kansas City and St. Louis earnings, and per-person St. Louis credits) in one vectorized simulation, results under changed inputs, and the 2024+ comparison.0a4846c7b1(macOS, heavily loaded machine,/usr/bin/time -l): 18.1 s in pytest, 52.6 s wall with imports, maximum resident set size 1.08 GB..pyfiles undergov/statesalready do: in the Rest Pythonpolicygroup, and in Full Suite - Baseline (states-shard-4), where the batch runner passes whole folders to pytest. In shard 4 of run 37687652780 its tests took at least 14.9 s of call time. In run 37687652780 its 7 tests took 9.1 s of the group's 308.7 s of test time. The group took 7:15 wall with peak RSS 14.19 GB. Six recent runs without this file on other branches (excludingtrim-rest-test-cost, which cuts this group) took 7:45–9:12 wall with peak RSS 14.19–14.27 GB, so the file adds no measurable memory. (These are Linux CI figures; the local figures above are macOS.)9d184261a9.Invariants
Merge order and conflicts
git merge-treefrom0a4846c7b1against each open Montana PR head (and it merges cleanly into main at7b956eb401): #9877 (6eefe271dc), #9888 (e352ed05bb), #9903 (7fb88f0abf), #9947 (4a5802c1a8), #9981 (d4641289a0) and #9890 (eaabd72547) all merge cleanly. #9585 (b584e8b160) conflicts with main itself in Arkansas files and shares no Montana file with this PR. #10004 (880058056e, opened after this PR) conflicts inmt_itemized_deductions_indiv.yamland its federal-itemization twin. In case 3 it renames the line above this PR's renamed SALT input (mortgage_interesttodeductible_mortgage_interest). Keep both renames: with that resolution both files andmt_salt_deduction_indiv.yamlpass in a merge of0a4846c7b1with #10004 at880058056e(5 + 5 + 13 cases). #9888's new separate-path cases setmt_salt_deduction: 0. After both merge that input no longer reaches the columns, but the computedmt_salt_deduction_indivis also 0 there. In an actual merge with #9888, the two separate-column itemized files, the joint itemized file, its casualty file and this PR's new file pass (29 cases).Microsim
None. The default dataset (
populace_us_2024.h5, tagpopulace-us-2024-spm-20260909) stores inputs for 2024 only (_time_period= 2024), so a 2021–2023 run computes from empty inputs and shows no change. From 2024 the formulas are main's (see above).Review
0222cabda4): REQUEST_CHANGES. P2: the claim thatlocal_income_taxis always zero for a Montana household was false (a Kansas City earnings tax has no residence test), so line 5b is now included (9d184261a9). P3: describe years before 2021 precisely (done above). It verified the law, formulas, 2024+ equality, all 33 YAML expectations by hand, the household table and the parameter blobs; it could not run tests on the loaded machine. Full text:~/reviews/us-hub/mt-salt-cap/review-r1.md.9d184261a9; no Subfleet lane could serve it): REQUEST_CHANGES. P2: dividing city taxes by share of taxable earnings is exact only with one rate and no credits, but PolicyEngine sets Philadelphia's rate per person and St. Louis credits per person. Fixed in0a4846c7b1with the person-level city taxes. P3s fixed here: the Invariants wording, the second CI job, the dependents note, the measuring tool, and the docstring. Full text:~/reviews/us-hub/mt-salt-cap/review-r2.md.Methodology notes
real_estate_taxesas theirs. The form lets a couple allocate jointly paid taxes "in any proportional amount", which matters at the $5,000 cap. This PR does not optimize that, and neither do the other separate-column deductions.salt. In 2a columns dependents have none, as in the other separate-column deductions.axiom: former MCA 15-30-2131(1)(a) (Itemized Deductions Schedule line 5) TheAxiomFoundation/rulespec-us#1520 queued
🤖 Generated with Claude Code