Skip to content

Subtract US government interest from Montana taxable income from 2024 - #10772

Open
MaxGhenis wants to merge 3 commits into
mainfrom
mt-2024-base-gaps
Open

MaxGhenis wants to merge 3 commits into
mainfrom
mt-2024-base-gaps

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #9707.

What was wrong

MCA 15-30-2120(3)(b)(i) subtracts "interest from obligations of the United States government and exempt-interest dividends attributable to that interest" from federal taxable income. Form 2 reports the subtraction on Schedule I, Part I: line 11 in 2024 (instructions, PDF p. 25) and line 9 in 2025 (instructions, PDF p. 23). The 2024 and 2025 entries of gov.states.mt.tax.income.subtractions.subtractions left out us_govt_interest_person, so from 2024 the model taxed that interest. The 2024 case in mt_us_govt_bond_interest.yaml expected 0, so the suite recorded the bug.

Each row below comes from a Simulation run on main (61d9e85) and on this branch:

Household Year Main: Montana taxable income / tax This PR By hand from Form 2 and the statute
Single, wages 50,000, Treasury interest 1,000 2024 36,400 / 1,901.60 35,400 / 1,842.60 35,400 / 1,842.60
Same household 2025 35,250 / 1,826.55 34,250 / 1,767.55 34,250 / 1,767.55
Joint, wages 80,000, spouse's Treasury interest 3,000 2025 51,500 / 2,532.10 48,500 / 2,355.10 48,500 / 2,355.10
Single, wages 10,000, Treasury interest 10,000 2024 5,400 / 253.80 0 / 0 0 / 0

The 2025 tax column applies the brackets of MCA 15-30-2103(1) and (3): 5.9% less 253.20 single and 506.40 joint. The 2025 instructions' rate table (PDF p. 18) rounds those amounts to $253 and $506, which gives 1,767.75 and 2,355.50. This PR records the difference as source-conflict candidate us-mt:rate-table-offset-rounding; the model and tests follow the statute.

Changes

  • subtractions.yaml: add us_govt_interest_person to the 2024 and 2025 lists (2026 uses the 2025 list), with the statute and form line in comments, and cite MCA 15-30-2120(3)(b)(i). A comment notes the (3) lead-in's inclusion limit and points to State US-government-interest subtractions exceed the interest in federal income (dependents, §135 exclusion, unchecked inputs) #10780.
  • mt_us_govt_bond_interest.yaml: each case enters the interest as taxable interest too. The 2024 case now expects 5,000, and a new 2025 case also expects 5,000.
  • New mt_taxable_income.yaml: 15 Form 2 cases for 2024–2026. Each starts from household inputs (wages, medical expenses, mortgage interest, taxes paid, interest) and runs through the federal model, so it also checks which federal amounts Montana reads. Comments carry the worksheet and Form 2 arithmetic.
  • New test_mt_us_govt_interest_subtraction.py: a Hypothesis test of the invariants below.
  • source_conflicts/candidates.yaml: us-mt:rate-table-offset-rounding (see above).

The rest of the 2024+ base

The task was to check Montana's whole 2024+ base. #10038 (merged 2026-11-07) rebuilt it from federal taxable income, with the QBI add-back (MCA 15-30-2120(2)(i)) and the capped state income tax add-back ((2)(j)). Its 2024+ cases, like main's other Montana cases, mostly enter federal amounts (adjusted_gross_income, itemized_taxable_income_deductions, tax_unit_itemizes, salt_deduction, standard_deduction) as inputs. This PR's cases start from household inputs instead, with values hand computed from the 2024 and 2025 Form 2, the revised 2024 Worksheet A and the 2025 Worksheet B (instructions, PDF p. 22). On main:

  • the 10 cases without US government interest pass unchanged. They cover medical and SALT-capped itemizers, the standard-deduction limit on the add-back, the QBI exclusion, the 2025 move of the add-back to Schedule I, the enhanced senior deduction (counted once), the 2025 SALT phase-down, and 2026 rolling conformity with the §68 limitation;
  • the 5 US-interest cases fail, and they pass here.

I also checked three things in the code:

  • Dependents. mt_taxable_income_joint.formula_2024 sums mt_additions and mt_subtractions over the head and spouse only. That matches federal AGI: irs_gross_income zeroes every income source of a tax-unit dependent, so a dependent's interest never reaches the return.
  • The old interest exemption. mt_interest_exemption_person is 0 from 2024, because gov.states.mt.tax.income.exemptions.applies is false from 2024.
  • Other readers of mt_subtractions. mt_agi_joint, mt_agi_indiv and the two taxable Social Security helpers also read it, so for a household with US government interest the legacy mt_agi now nets that interest too. None of them reaches 2024+ Montana tax:
    • formula_2024 reads none of them;
    • from 2024 mt_income_tax_before_refundable_credits_unit takes the joint computation, and mt_agi_indiv applies only where married_filing_separately_on_same_return_allowed holds; that parameter turns false in 2024;
    • the legacy deductions that read mt_agi_joint return 0 or the federal amounts from 2024 (state_specific_deduction_applies and the child care deduction's in_effect turn false in 2024; misc_floor_applies turned false in 2018);
    • taxsim_state_agi, and its alias state_agi, report federal AGI for Montana from 2024 (states_using_federal_agi).

Not in this PR

Tests

  • The 18 Montana YAML cases pass: 15 in mt_taxable_income.yaml and 3 in mt_us_govt_bond_interest.yaml.
  • Mutation check against main's model (61d9e85): 7 YAML cases fail (the 5 US-interest cases and the 2024 and 2025 bond cases) and 11 pass. The Python test's worked case fails too: Montana taxable income stays 5,400 with the interest, against 0 expected.
  • test_mt_us_govt_interest_subtraction.py passes: a worked test for 2024–2025, then 10 derandomized Hypothesis examples plus 8 pinned households for 2024–2026.
  • test_source_conflicts.py passes with the new candidate.

CI cost

test_mt_us_govt_interest_subtraction.py is the only Python addition, and it builds one small Simulation per example. It checks what the YAML cases can't: the invariants over generated household mixes (single and joint, dependent holders, partial US shares, the zero floor, seniors whose taxable income carries cents), and that federal taxable income stays equal across the classification variants.

  • Linux CI at ddad751 (run 42683732871): 0.61 s for the worked test and 7.86 s for the properties, in the Rest test group remaining-1 (shard 4). That group ran 2,055 tests in 20:36 of wall time at a peak RSS of 9.75 GiB (GNU time's 10,226,288 KiB); the whole shard job took 25:43.
  • Linux CI at this head, which adds the third variant and a pinned household: pending; I'll fill it in from the run's timing artifacts.
  • Local, on a loaded macOS host (load average 107–144), not comparable with CI: 21.5 s and 81.3 s, with a 2.26 GB peak footprint for the pytest process.

Invariants

The test runs each household three times: the bondholder's taxable interest and US interest set to (I, u), (I, 0) and (0, 0). The inputs keep to the model's input contract: u ≤ I on the same person, with none of it excluded under 26 U.S.C. 135. Let TI₀ be Montana taxable income without the subtraction, and u_in = min(u, AGI(I) − AGI(0)), the US interest that federal AGI includes (u for a head or spouse, 0 for a dependent). For every household and each year from 2024 to 2026:

  1. Same federal base: federal taxable income matches across (I, u) and (I, 0).
  2. Accounting: Montana taxable income falls by min(u_in, TI₀).
  3. Monotone: Montana income tax does not rise.
  4. Bound: Montana taxable income stays at or above zero.

From 2025 the enhanced senior deduction phases out at 6% of MAGI, so taxable income can carry cents. Comparisons allow the larger of one cent and four float32 steps at the compared magnitude.

The pinned households cover the zero floor binding, a dependent holding the bonds, interior cuts (single and joint), and a senior whose taxable income carries cents. A wider local run of the same assertions also passed: 152 households a year (24 seeded draws of 6 households plus the 8 pinned). In 2024, 2025 and 2026 the floor bound 4, 3 and 3 times, a dependent held bonds 29 times each year, interior cuts occurred 7, 8 and 7 times, and taxable income carried cents 0, 2 and 2 times.

Microsimulation impact

Pending: 2025 and 2026, default dataset, main against this branch. us_govt_interest_person has no formula, and the certified default dataset (populace_us_2024.h5, sha256 6496cc43…, which matches DEFAULT_DATASET_SHA256) has no column for it among its 378, so every record's subtraction stays at 0. I'll replace this section with the measured results.

Coordination

Axiom

axiom: MCA 15-30-2120(3)(b)(i) encoded-correct for TY2026 (rulespec-us us-mt/policies/income_tax/resident_core_liability_pipeline.yaml, companion direct title 15 modifications and state tax addback) | TheAxiomFoundation/rulespec-us#2148 queued for TY2024–2025

🤖 Generated with Claude Code

MCA 15-30-2120(3)(b)(i) subtracts interest from obligations of the United
States government from federal taxable income. The model's 2024 and 2025
subtraction lists omitted us_govt_interest_person, so from 2024 it taxed
that interest (2024 Form 2 Schedule I, Part I, line 11; 2025 line 9).

Restore it in both lists and correct the 2024 expectation in
mt_us_govt_bond_interest.yaml, which recorded the bug. Add
mt_taxable_income.yaml: end-to-end Form 2 cases for 2024-2026, hand
computed from the forms and the revised Worksheet A / Worksheet B, run
from household inputs through the federal model.

Add test_mt_us_govt_interest_subtraction.py, a Hypothesis test of three
invariants for 2024-2026: Montana taxable income falls by exactly
min(u, taxable income before the subtraction) when the head or spouse
holds the bonds and not at all when a dependent does; Montana tax does
not rise; Montana taxable income stays nonnegative.

Fixes #9707.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits November 11, 2026 00:42
…ding

Review follow-ups for #9707:
- Bond interest cases now enter the interest as taxable interest too, the
  model's input contract.
- The property test runs a third, no-interest variant and derives the US
  interest that federal AGI includes, replacing the hard-coded dependent rule;
  it also checks that federal taxable income matches across variants and
  allows float32 rounding at the compared magnitude, since the 2025-2026 senior
  deduction phase-out leaves cents. A senior case with cents joins the pins.
- New 2026 Form 2 case for the subtraction; corrected the medical comment
  (the repealed 2023 schedule also floored medical at 7.5% of Montana AGI).
- Comment on the subtraction list and the test docstring point to #10780 for
  the (3) lead-in's inclusion limit.
- source_conflicts/candidates.yaml: us-mt:rate-table-offset-rounding, the
  2025 rate table's whole-dollar offsets against the statute's brackets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Interest excluded under 26 U.S.C. 135 satisfies u <= taxable interest, so the
contract also needs "none of it excluded under section 135" (review nit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Montana: US government obligation interest is no longer subtracted from 2024

1 participant