Skip to content

Count railroad benefits in state tax worksheets, income tests and limits as each state's law does - #10722

Draft
MaxGhenis wants to merge 12 commits into
rrb-federal-taxfrom
state-sseb-worksheets
Draft

MaxGhenis wants to merge 12 commits into
rrb-federal-taxfrom
state-sseb-worksheets

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Stacks on #10696 (base branch rrb-federal-tax). GitHub retargets this PR to main when #10696 merges. GitHub runs pr.yaml only on PRs against main, and its jobs skip drafts, so CI first runs after the retarget, when the PR leaves draft or on the next push after that.

After #10696, taxable_social_security and tax_unit_taxable_social_security hold only the title II share of section 86's taxable amount, and taxable_railroad_social_security_equivalent_benefits holds the tier 1 share. A state variable that recomputes section 86, or builds an income measure from title II amounts, leaves out the social security equivalent benefit. This PR checks every state tax variable and parameter that reads social_security, taxable_social_security, tax_unit_taxable_social_security or tax_unit_social_security_for_taxability against that state's statute and form, and counts railroad benefits as the state does under that law. The model subtracts the taxable railroad benefits once, through #10696's 45 U.S.C. 231m(a) subtraction (taxable_railroad_benefits), and no Social Security subtraction takes them again. #10764 covers state benefit programs.

The limits and income tests this PR changes read the three railroad parts, or the two parts AGI leaves out, never the railroad_benefits total. Four state provisions already read that total: Indiana's civil service annuity deduction, Kentucky's pension exclusion, Michigan's household resources and Utah's homeowner and renter relief. This PR changes the variable's docstring to say that a total entered there reaches those provisions, income totals and benefit programs, but no federal tax.

Changes

Worksheets that recompute section 86 or take Form 1040 lines 6a and 6b

State Provision Law or form Change
MN Social Security subtraction (M1M line 12), in the baseline and the HF1938 repeal reform Minn. Stat. 290.0132 subd. 26(i): provisional income as section 86(b)(2) MAGI "plus one-half of the taxable Social Security benefits", with "Social Security benefits" in the IRC 86(d)(1) meaning Builds provisional income from gross income less all taxable benefits (Form 1040 line 6b), plus half of those taxable benefits, title II and tier 1. Reduces all taxable benefits under the simplified method, then takes out the taxable tier 1 benefits that the 231m subtraction removes, and caps the alternate method at taxable title II benefits. At or below the threshold, subtracts the taxable title II benefits on line 12 and leaves tier 1 to line 17.
CT Social Security benefit adjustment (CT-1040 line 41) Conn. Gen. Stat. 12-701(a)(20)(B)(x), through IRC 86(d)(1) Counts tier 1 on lines A and B, and takes line D out of taxable title II benefits first.
IA Reportable Social Security, 2021 and 2022 IA 1040 step 4 worksheet Adds half of the filers' title II and tier 1 benefits on line 7, keeps the student loan interest deduction off line 8, and leaves dependents' benefits off line 1.
MA Unemployment compensation deduction, 2021 Worksheet line 7 (Form 1040 line 6a less 6b) Takes the filers' section 86 benefits.
WI Unemployment compensation subtraction Schedule SB worksheet line 4 (Form 1040 line 6b) Takes both taxable shares.
DC Disability exclusion D-2440 line 6 (D-40 line 10, "social security and tier 1 railroad retirement") Subtracts both taxable shares.

Deduction limits that shrink because of railroad benefits

State Provision Law or form Change
ME Pension income deduction 36 M.R.S. 5122(2)(M-2)(1)(a)(ii) Cuts the cap by railroad retirement benefits as well as title II.
MD Pension exclusion Tax-General 10-209(b)(2); Worksheet 13A line 3 Same, taxable or not.
ID Retirement benefits deduction Idaho Code 63-3022A(3); Form 39R line 8b Same.
MI Seven retirement and standard deduction limits Form 4884; Worksheet 2; MCL 206.30 Cuts each limit by the taxable railroad benefits in federal AGI as well as military retirement pay.

Income tests that count railroad benefits

State Provision Law or form Change
MN Elderly and disabled subtraction (M1R) Minn. Stat. 290.0802 subd. 1(a), (c) Reads the three railroad parts instead of the railroad_benefits total, and leaves dependents' Social Security out of the base cut, as section 22(c)(3) does.
MN Homestead credit refund (M1PR lines 2 and 6) Minn. Stat. 290A.03 subd. 3(a)(2)(v) and (b)(2) Adds the filers' nontaxable tier 1 benefits on line 2. Adds the tax-free rest of the railroad annuity on line 6, since subd. 3(a)(2)(v) counts an annuity "not exclusively funded by the claimant or spouse" and railroad employers pay tier 2 tax too (26 U.S.C. 3221(b)).
MT Elderly homeowner or renter credit MCA 15-30-2337(9)(a)(i) and (b) Adds untaxed tier 1 benefits. Leaves out the tax-free rest of the annuity, which returns the employee's own contributions, tier 2 taxes among them (IRC 72(r)(2)), since Montana reduces income by the taxpayer's basis under (9)(b).
NY Real property tax credit IT-214 line 13 Adds the untaxed part of every tier.
OK Sales tax and property tax credits Forms 538-S and 538-H line 5 Adds all three parts.
MA Senior circuit breaker M.G.L. c. 62 s. 6(k)(1) Adds all three parts.
ND Renter's refund N.D.C.C. 57-02-08.1(5)(c) Adds tier 1 and taxable tier 2, and leaves exempt tier 2 out.
MO Property tax credit RSMo 135.010; Form MO-PTS lines 2 and 4 Adds all three parts to Missouri AGI, which removes the taxable ones.
RI Property tax relief R.I. Gen. Laws 44-33-3 Adds the two parts AGI leaves out.
ME Fairness credits 36 M.R.S. 5213-A and 5219-KK Same.
WI Homestead credit Wis. Stat. 71.52(6) Same.
WA Senior and disabled property tax exemption RCW 84.36.383(7)(g) Same.
NM Modified gross income NMSA 7-2-2(L) Adds all three parts.
VT Renter credit 32 V.S.A. 6061(18)(C), "as defined under 26 U.S.C. 86(d)" Counts excluded tier 1 at the 75 percent rate of excluded Social Security benefits.
CO Sales tax refund C.R.S. 39-22-2003, with 39-22-103(11) Counts excluded tier 1 as excluded Social Security, and leaves exempt tier 2 out.
WV Homestead excess property tax credit W. Va. Code 11-21-23(d)(1)(D), with 11-21-9(a) Same.

Audited, no code change

A YAML case covers each provision where a form and its statute differ or where we chose between readings.

  • Missouri Sections A, B and C, Utah's Social Security credit, Rhode Island's modification and Vermont's retirement exemption keep title II only. Their statutes name the Social Security Act, or the state takes tier 1 out under a separate provision.
  • Before 2024, the model reaches Montana's worksheet result by another route: it leaves taxable tier 1 benefits in line 3 and takes them out with the railroad subtraction in line 8.
  • From Tax railroad retirement benefits under IRC 86 and 72(r) and subtract them from state income #10696 on, the model counts half of tier 1 and gross tier 2 in Pennsylvania's property tax or rent rebate; this PR only rewords its comments.
  • Minnesota's marriage credit, New Jersey (PAS-1 from 2026), Virginia's age deduction, Indiana's civil service annuity, Massachusetts gross income, Mississippi, Alabama and Arkansas needed nothing. Nor did Colorado's, Nebraska's, New Mexico's and West Virginia's Social Security subtractions, whose bases already subtract taxable_railroad_benefits.

Other effects

  • For Minnesota's alternate Social Security subtraction, the model now adds half of the taxable benefits to provisional income, where it added half of all benefits. For every filer with benefits, title II or tier 1, provisional income falls by half of the untaxed benefits, and filers in the phase-out range subtract more. For example, a 2026 joint return with $150,000 of gross income and $100,000 of Social Security benefits, $85,000 of them taxable, now subtracts $2,066, up from $566. The HF1938 repeal reform's subtraction changes the same way.
  • Connecticut filers at or above the AGI threshold who have both title II and tier 1 benefits subtract less on line 41, by up to a quarter of the tier 1 benefits. The model now counts those benefits on line D and still subtracts all of the taxable tier 1 benefits under 231m.
  • The model leaves dependents' own benefits out of the Connecticut (line A), Minnesota (M1M and M1R), Iowa and Massachusetts worksheets, which take the filers' benefits only.

Readings recorded in source_conflicts/candidates.yaml

Thirteen state entries: us-ct:social-security-adjustment-railroad-tier-1, -order; us-mn:elderly-disabled-subtraction-railroad-benefits, homestead-credit-refund-railroad-annuity-tax-free-part, marriage-credit-railroad-tier-1, marriage-credit-subtracted-social-security, social-security-subtraction-provisional-income-benefits, social-security-subtraction-railroad-tier-1-order; us-mo:pension-income-test-railroad-tier-1, social-security-deduction-railroad-tier-1; us-nd:renters-refund-railroad-benefits; us-ut:social-security-credit-railroad-tier-1; us-vt:retirement-income-exemption-railroad-tier-1.

Twelve carry a ruling under the statute-first rule: nine follow the statute, and three follow the form where the statute leaves the question open. The Minnesota provisional income entry follows the statute: in 2019 the Legislature inserted "taxable" into subd. 26's definition, effective for 2018, and the Department of Revenue kept half of all benefits in its worksheets for 2018 to 2025. We found us-mn:marriage-credit-subtracted-social-security during the audit. It concerns a provision this PR leaves unchanged, so the entry stays unreviewed.

The cross-state entry us:railroad-benefits-in-state-income-tests stays open. It asks whether, under 45 U.S.C. 231m(a), a state may count the annuity in an income test, phase-out or deduction limit. This PR applies each state's provision as written and leaves that pattern for a ruling.

Invariants

policyengine_us/tests/test_state_railroad_benefit_provisions.py runs these with Hypothesis.

  • S1, swap. Moving benefits from title II to tier 1, with or without the rest of a railroad annuity, leaves federal AGI unchanged. In every income tax state but the two exceptions below, the swap never raises state income tax before refundable credits.
  • S2, no-tax states. In the states that tax no filer's Social Security, the same swap leaves state income tax unchanged.
  • S3, income tests. The swap leaves eighteen state income tests unchanged, with any wages, pensions and rest of a railroad annuity.
  • S4, pension caps. The swap leaves Maine's, Maryland's and Idaho's pension deductions unchanged, with or without the rest of an annuity. Benefits never raise the deduction, and with a binding pension and no other railroad benefits, tier 1 benefits reduce it.
  • S5, Minnesota bounds. 0 <= mn_social_security_subtraction <= taxable title II, and the subtraction plus taxable tier 1 at least matches the subtraction of the same benefits as title II.
  • S6, one subtraction. Adding tier 1 benefits and the rest of an annuity never lowers a state's base: state AGI, or state taxable income where the reported AGI includes the benefits. Each of eight Social Security subtractions (CO, CT, MD, MN, NE, NM, RI, WV) stays at or below the taxable title II benefits. If the model's Connecticut or Rhode Island subtraction takes the taxable tier 1 benefits a second time, both tests fail.
  • D1, differential. An independent walk of the 2025 Minnesota worksheet, written from the published form, matches mn_social_security_subtraction for every filing status. At steps 12 and 13 the walk adds half of line 6b, as subd. 26(i) defines provisional income.

The test file labels two exceptions and one model gap:

  • S1 and S2 exempt Michigan, which cuts the limits by the railroad benefits in federal AGI and not by Social Security (MCL 206.30; Form 4884).
  • S1 lets Minnesota's tax rise by its top rate times the elderly or disabled subtraction lost. Minnesota cuts that subtraction's base by benefits "included in federal gross income but not subject to state taxation" (Minn. Stat. 290.0802 subd. 1(c)), which take in taxable tier 1 benefits and not taxable title II.
  • After refundable credits, Idaho fails S2: USDA counts railroad retirement benefits as SNAP income (7 CFR 273.9(b)(2)(ii)), the model's SNAP income list leaves them out (Count railroad_benefits where Social Security is counted: household net income, SNAP, HUD and program income lists #10551), and Idaho denies its grocery credit for SNAP months. S2 skips that check until the list counts railroad benefits.

S6 gives its households no title II benefits and no Part B premium. The model splits section 86's taxable amount between title II and tier 1 in proportion, so more tier 1 moves part of that amount off title II, which some states tax. Higher benefits can also end a filer's Medicare Savings Program eligibility, so the state stops paying the premium that Idaho and Ohio let filers subtract. S6 skips Oregon, which subtracts federal income tax inside its AGI, and skips Colorado and South Carolina when part of the benefits falls within the standard deduction.

CI runs 8 examples each for S1 and S2 and the first S6 test, 15 each for S3 and S4, 25 each for S5 and the second S6 test, and 40 for D1. Locally the file ran in 4 to 11 minutes. In a longer hunt, at 40 to 200 examples a test, we found one counterexample, in S3. When it computes its SSI supplement, Oklahoma rounds "the monthly amount of each income source" to the nearest dollar (OAC 317:35-5-42(i)), so when the swap merged two monthly payments into one, ok_gross_income moved by $12. To keep that rounding out of S1 to S3, the swap households take up no SSI, and S3 keeps the case as an explicit example. A second hunt over S1 to S3, at 40 and 80 examples, found no counterexample.

The PR adds 58 YAML cases in 35 files, five of the files new. We derived each expected value from the statute or form, and most cases show the arithmetic line by line in comments.

Coordination with #10764

#10764's test_state_benefit_railroad_income.py lists two files from Washington's senior and disabled exemption among those that read Social Security without railroad benefits. One entry names the exemption's income list, which on main has no tax-free railroad amount to add; this PR adds those amounts. When a merge of main brings that test here, delete the income list's entry in the same merge, since the test fails on entries that no longer apply. The other entry, the disability retirement test, stays.

Depends on #10696

#10696 has merge conflicts with main, and its latest CI run fails states-shard-4 (the 2014 case in wv_senior_citizen_disability_deduction_person.yaml) and Python shard 5 (test_negative_or_missing_tier_1_benefits_raise[nan]). Both tests fail on this branch too; this PR changes neither.

axiom: TheAxiomFoundation/rulespec-us#2141 queued

🤖 Generated with Claude Code

MaxGhenis and others added 7 commits November 8, 2026 14:59
Minn. Stat. 290.0132 subd. 26(i) gives "Social Security benefits" the IRC
86(d)(1) meaning, so the line 12 worksheet runs on title II and tier 1
benefits together. Provisional income now starts from gross income less all
taxable benefits and adds half of the head's and spouse's section 86 benefits;
the simplified method reduces all taxable benefits and then takes out the tier
1 benefits that the 231m subtraction removes (steps 26-29), and below the
threshold line 12 is the title II share.

The elderly and disabled subtraction applies 290.0802 subd. 1: the reduction
counts all of the head's and spouse's railroad retirement benefits, and AGI
leaves out the taxable ones. The homestead refund adds nontaxable tier 1
benefits to M1PR line 2, and the marriage credit gets tests for leaving out
taxable tier 1 benefits, which Minnesota taxable income never includes.

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

Connecticut's Social Security benefit adjustment (12-701(a)(20)(B)(x)) reads
the federal worksheet, which counts tier 1 railroad retirement benefits under
IRC 86(d)(1). Line A now takes the section 86 benefits, and line D comes out
of the taxable title II benefits first, since clause (iv) subtracts every
taxable tier 1 benefit that clause (x) does not.

Iowa's 2021-2022 reportable Social Security worksheet now follows the form:
line 7 adds half of the head's and spouse's title II and tier 1 benefits,
line 8 leaves out the student loan interest deduction, and line 1 leaves out
dependents' benefits. The old formula left half of the benefits out of line 7.

Missouri, Utah and Rhode Island already read title II amounts as their
statutes direct; new tests pin those readings, and source-conflict entries
record where their forms take Form 1040 line 6b instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e, Michigan and DC provisions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides changed Minnesota's elderly and disabled subtraction and
Pennsylvania's property tax rebate income the same way. Keep this branch's
wording and both sides' test cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a, Massachusetts, Idaho and North Dakota provisions

Each change follows the state's statute or form:

- DC disability exclusion, line 6: Form D-40 line 10 holds taxable title II
  and tier 1 benefits.
- Maryland and Maine pension caps, and Idaho's retirement deduction cap:
  the statutes reduce each cap by Railroad Retirement Act benefits, taxable
  or not.
- Wisconsin unemployment subtraction: worksheet line 4 takes Form 1040
  line 6b.
- New York IT-214 line 13, Oklahoma Forms 538-S and 538-H line 5, and
  Massachusetts c.62 s.6(k)(1) count railroad benefits by name or as
  retirement receipts.
- North Dakota's renter's refund: N.D.C.C. 57-02-08.1(5)(c), logged as a
  source conflict.

Maine, Maryland and New York read the railroad parts rather than
railroad_benefits, so a total entered in that variable stays out of tax.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Missouri's property tax credit, Rhode Island's RI-1040H, Maine's fairness
credits, Wisconsin's homestead credit, Washington's senior exemption and New
Mexico's modified gross income name railroad retirement benefits. Vermont's
renter credit, Colorado's sales tax refund and West Virginia's homestead
excess credit count Social Security benefits with their federal meaning, so
excluded tier 1 benefits count there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Swapping title II benefits for tier 1 benefits now has to leave federal AGI
alone, never raise state tax outside Michigan, and leave every state income
test and pension cap unchanged. A step-by-step 2025 Schedule M1M line 12
worksheet checks Minnesota's formula. Also pin Montana's pre-2024 worksheet
with tier 1 benefits, and log the open 45 U.S.C. 231m(a) question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Count tier 1 railroad benefits in state Social Security provisions as each state's law does Count railroad benefits in state tax worksheets, income tests and limits as each state's law does Nov 9, 2026
MaxGhenis and others added 4 commits November 9, 2026 12:57
Minnesota's Social Security subtraction adds half of the taxable benefits to
provisional income, as Minn. Stat. 290.0132 subd. 26(i) defines it since the
2019 amendment, in the baseline and in the HF1938 repeal reform. The M1M
worksheets add half of all benefits; the register entry records the reading.

Minnesota's homestead credit refund income counts the tax-free rest of a
railroad annuity, which 290A.03 subd. 3(a)(2)(v) reaches because railroad
employers fund tier 2 too (26 U.S.C. 3221(b)).

The property tests now hold Minnesota's S1 increase to its top rate times the
elderly or disabled subtraction lost, treat Idaho's SNAP-driven S2 change as a
model gap tied to #10551, add the rest of the annuity to S3 and S4, and add S6:
railroad benefits never lower a state base, and each Social Security
subtraction stays within taxable title II benefits. D1 follows subd. 26(i).

Rhode Island's worksheet leaves railroad benefits out, so its register entry
goes; Utah's entry ends in 2024, when the worksheet starts taking those
benefits back out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first property hunt found one counterexample in S3: Oklahoma's
supplement rounds "the monthly amount of each income source" to the nearest
dollar (OAC 317:35-5-42(i)), and the swap turns two payments into one, so
ok_gross_income moved by $12. The swap households now take up no SSI, and
S3 pins the case as an explicit example.

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

The changelog named Minnesota's marriage credit and Minn. Stat. 290.0675,
but this branch changes no marriage credit code: Minnesota subtracts taxable
tier 1 under 45 U.S.C. 231m(a), so the credit's earned income measure, which
counts benefits "to the extent included in Minnesota taxable income", leaves
them out.

The Idaho skip in S2 now ends when the SNAP unearned income list counts all
three railroad parts, not only when it counts the railroad_benefits total.

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

MCA 15-30-2337(9)(b) reduces income "by the taxpayer's basis", and the
2025 Schedule 2EC line 5 tells filers to leave "your cost or net
investment" out of pensions and annuities. The tax-free part of a railroad
annuity recovers the employee's tier 2 taxes, which IRC 72(r)(2) treats as
employee contributions, so it is basis. Montana still counts the untaxed
tier 1 benefits in full under (9)(a)(i). The 2025 case falls from 27,000
to 26,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename the Montana case to say the employee's basis stays out, and say in
the code comment that the tax-free part returns the employee's own
contributions, which under IRC 72(r)(2) include tier 2 taxes.

The Idaho skip in S2 ends once the SNAP list counts tier 1 benefits, alone
or in the railroad_benefits total: the swap gives both households the same
rest of the annuity, so only tier 1 separates them.

Co-Authored-By: Claude Fable 5.2 <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.

1 participant