Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0bcebf6
Net capital gain distributions inside the capital loss limit
MaxGhenis Oct 4, 2026
9afd5aa
Merge remote-tracking branch 'upstream/main' into sch-d-cg-distributi…
MaxGhenis Oct 4, 2026
bb6eb56
Count distributions inside Schedule D in the NII invariant reference
MaxGhenis Oct 4, 2026
6f03491
Test the netting when a reform drops a gross income source
MaxGhenis Oct 4, 2026
9c20294
Address review: Michigan adjustments, filer-only worksheet test, floors
MaxGhenis Oct 4, 2026
fb5ccb2
Merge remote-tracking branch 'upstream/main' into sch-d-cg-distributi…
MaxGhenis Oct 4, 2026
b047c78
Follow 1211(b) in the #9647 invariant and a Maryland surtax test
MaxGhenis Oct 5, 2026
1a54e89
Net Michigan business and rental losses on MI-1040CR lines 16 and 17
MaxGhenis Oct 5, 2026
8d5163e
Merge upstream/main into mi-household-resources-business-losses
MaxGhenis Oct 5, 2026
b6c5f61
Keep dependents' business and rental items off Michigan lines 16 and 17
MaxGhenis Oct 5, 2026
e0ab86d
Count only the claimant and spouse in Michigan household resources
MaxGhenis Oct 5, 2026
31149d1
Give the membership property tests an explicit FIP grant
MaxGhenis Oct 5, 2026
fcecf1f
Keep dependents' above-the-line deductions off the filer's AGI
MaxGhenis Oct 5, 2026
1a97062
Test that the ALD total stays between 0 and the all-member sum
MaxGhenis Oct 5, 2026
bbff993
Merge #9801 (dependents' above-the-line deductions) into mi-household…
MaxGhenis Oct 5, 2026
3f22244
Read the federal Schedule 1 aggregates on Michigan line 30; reformabl…
MaxGhenis Oct 5, 2026
68f36eb
Merge remote-tracking branch 'upstream/main' into sch-d-cg-distributi…
MaxGhenis Oct 6, 2026
638c794
Add the combined #9781 regression case, a joint Maryland surtax case,…
MaxGhenis Oct 6, 2026
c45512e
Merge remote-tracking branch 'upstream/sch-d-cg-distributions-agi' in…
MaxGhenis Oct 6, 2026
0a2ca21
Use tax_unit_non_dep_add for lines 16 and 17; describe the dependent …
MaxGhenis Oct 6, 2026
4617ad3
Merge remote-tracking branch 'upstream/mi-household-resources-busines…
MaxGhenis Oct 6, 2026
b10ac14
Keep a supplied net_capital_gains amount on the filer's line 7a; add …
MaxGhenis Oct 6, 2026
8d494de
Document supplied net_capital_gains on the filer's line 7a; add NII a…
MaxGhenis Oct 6, 2026
1afac06
Merge remote-tracking branch 'upstream/main' into mi-household-resour…
MaxGhenis Oct 6, 2026
546c601
Pass include_dependents on Michigan line 30; test a dependent's posit…
MaxGhenis Oct 6, 2026
abff6ae
Merge main into Michigan household resources claimant-spouse branch
MaxGhenis Oct 9, 2026
afaad53
Merge main to include filer Schedule D capital gains fixes
MaxGhenis Oct 9, 2026
78a4631
Use shared filer Schedule D lines without dependent rounding drift
MaxGhenis Oct 9, 2026
27ffb3b
Preserve supplied capital gains without rounded residuals
MaxGhenis Oct 9, 2026
b09d151
Recognize Michigan dependent pension SSI interaction (d1143)
MaxGhenis Oct 9, 2026
dd85603
Compute dependent SSI in Michigan retirement regression
MaxGhenis Oct 9, 2026
08f20a9
Cite the 2025 MI-1040CR-7 book for Michigan household resources
MaxGhenis Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/filer-schedule-d-line16-rounding.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the filers' shared Schedule D lines for Form 1040 capital gains, preserving supplied aggregate inputs without letting dependents' large gains introduce rounding errors.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Recognize the intended Michigan dependent-retirement SSI interaction in state tax invariants and add a regression for the resulting heating credit increase.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Michigan household resources count only the claimant's and spouse's own income, capital gains and Schedule 1 adjustments (MCL 206.508(3)), keeping the Social Security, SSI, railroad retirement, child support and public assistance received for dependents (MI-1040CR lines 21, 22 and 27) and premiums paid for the family (line 31). The filer's Form 1040 line 7a amount, read by Michigan and by federal net investment income, now keeps a net capital gains amount supplied for the tax unit, less only the dependents' own gains and losses.
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
description: Michigan accounts for the following income sources as the household resources.
values:
2021-01-01:
# Each source counts for the claimant and spouse only (MCL 206.508(3)),
# except those in household_resources_all_members (lines 21, 22 and 27).
# MI-1040CR line 14, wages, including strike pay.
- irs_employment_income
- strike_benefits
# MI-1040CR line 15, interest and dividends.
- dividend_income
- interest_income
# MI-1040CR line 16, net business income: U.S. Schedule C, Form 4797
Expand All @@ -18,22 +22,35 @@ values:
# as a total.
- rental_income
- farm_rent_income
# MI-1040CR line 18, pensions and annuities.
- pension_income
- retirement_benefits_from_ss_exempt_employment
- loss_limited_net_capital_gains
# MI-1040CR line 19, net capital gains and losses from the filer's U.S.
# Schedule D, a loss limited to $3,000 ($1,500 married filing separately).
- filer_loss_limited_net_capital_gains
# MI-1040CR line 20, alimony and other taxable income.
- alimony_income
- gambling_winnings
# MI-1040CR line 21, Social Security, SSI and railroad retirement
# benefits, including amounts received for dependents.
- social_security
- ssi
- ssi
- railroad_benefits
# MI-1040CR line 22, child support.
- child_support_received
# MI-1040CR line 23, unemployment compensation.
- unemployment_compensation
# Gifts received or expenses paid on your behalf
# MI-1040CR line 24, gifts received or expenses paid on your behalf.
- miscellaneous_income
# MI-1040CR line 26, veterans' benefits and workers' compensation.
- veterans_benefits
- workers_compensation
# MI-1040CR line 14, long-term disability benefits.
- disability_benefits
# Guaranteed income pilot payments, the recipient's own.
- gi_cash_assistance
# MI-1040CR line 27, payments to the household by MDHHS and other public
# assistance.
- tanf
- general_assistance
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
description: Michigan counts these household resources sources for every tax unit member, not only the claimant and spouse, as amounts the claimant receives for others in the household.
values:
2021-01-01:
# MI-1040CR line 21: Social Security, SSI and railroad retirement
# benefits, including "amounts received for minor children or other
# dependent adults who live with you".
- social_security
- ssi
- railroad_benefits
# MI-1040CR line 22: "child support and all payments received as a foster
# parent".
- child_support_received
# MI-1040CR line 27: "the total payments made to your household by MDHHS
# and all other public assistance payments". A Family Independence
# Program grant covers the children in the case.
- tanf
- general_assistance
metadata:
unit: list
period: year
label: Michigan household resources sources counted for every member
reference:
- title: MCL 206.508(3) and (4), household and total household resources
href: https://www.legislature.mi.gov/Laws/MCL?objectName=mcl-206-508
- title: Michigan 2025 Individual Income Tax Instructions, MI-1040CR lines 21, 22 and 27
href: https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2025/MI-1040-Book.pdf#page=32
- title: Michigan 2024 Home Heating Credit Instructions, MI-1040CR-7 lines 26, 27 and 32
href: https://web.archive.org/web/20250202150154/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2024/BOOK_MI-1040CR-7.pdf#page=8
- title: Michigan 2025 Home Heating Credit Instructions, MI-1040CR-7 lines 24, 25 and 30
href: https://web.archive.org/web/20260218211009/https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2025/MI-1040CR-7-Book.pdf?rev=e4ba4fedc63942e48442037517312d4a&hash=AF396E577B1932DF55BFD7F22D7EF06A#page=9
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
1. `tax_unit_non_dep_add` equals a numpy reference: the head's and spouse's
amounts of person-level variables plus tax-unit-level variables. For tax
units without dependents it equals `add`.
2. In every state with an income tax, giving the dependents retirement income
never lowers the filer's state income tax. Outside
2. Outside STATES_WITH_INTENDED_RETIREMENT_TAX_DECREASES, giving the
dependents retirement income never lowers the filer's state income tax.
Michigan is an intended exception: a dependent adult's pension can lower
their SSI and increase the claimant's refundable credit. Outside
STATES_COUNTING_DEPENDENT_INCOME it changes neither the state AGI nor the
state taxable income. (State income tax itself may still rise: credits
keyed to household income, such as Oklahoma's sales tax relief credit,
count every household member's income.)
count every household member's income.) Michigan's pension benefits,
subtractions and tax before refundable credits must remain unchanged.
3. A unit whose dependents have no income has the same inputs in both
populations, so its state income tax, AGI and taxable income are the same
in both: no unit's results depend on another unit's inputs.
Expand Down Expand Up @@ -368,6 +371,14 @@ def test_tax_unit_non_dep_add_edge_cases():
# subtracting income that never entered AGI; property 2 checks only that it
# never lowers tax there.
STATES_COUNTING_DEPENDENT_INCOME = {"AL", "AR", "IA", "MS", "NJ"}
# Intended exception per ruling d1143 (2026-10-09): follow MI-1040CR lines
# 18 and 21 (2025 MI-1040 booklet, PDF page 28 / printed page 32):
# https://www.michigan.gov/taxes/-/media/Project/Websites/taxes/Forms/IIT/TY2025/MI-1040-Book.pdf#page=28
# Line 18 counts pensions only for the claimant and spouse; line 21 counts
# SSI received for dependent adults who live with them. A dependent adult's
# pension can reduce SSI, lower household resources and raise refundable
# credits, while the claimant's pension subtractions and tax base stay fixed.
STATES_WITH_INTENDED_RETIREMENT_TAX_DECREASES = {"MI"}
YEARS = [2025, 2026]


Expand Down Expand Up @@ -402,11 +413,32 @@ def test_dependents_retirement_income_never_reduces_state_income_tax(year):
assert not leaked.any(), sorted(set(states[leaked]))

lowered = tax_with < tax_without - TOLERANCE
assert not lowered.any(), sorted(set(states[lowered]))
intended_exception = np.isin(
states, list(STATES_WITH_INTENDED_RETIREMENT_TAX_DECREASES)
)
unexpectedly_lowered = lowered & ~intended_exception
assert not unexpectedly_lowered.any(), sorted(set(states[unexpectedly_lowered]))

counts_dependents = np.isin(states, list(STATES_COUNTING_DEPENDENT_INCOME))
changed &= ~counts_dependents
assert not changed.any(), sorted(set(states[changed]))

# Michigan's intended exception concerns refundable credits only; a
# dependent's pension must never enter the claimant's pension subtraction.
mi = states == "MI"
for variable in [
"mi_pension_benefit",
"mi_subtractions",
"mi_income_tax_before_refundable_credits",
]:
np.testing.assert_allclose(
with_income.calculate(variable, year)[mi],
without_income.calculate(variable, year)[mi],
rtol=0,
atol=TOLERANCE,
err_msg=f"Michigan {variable} changed with dependent retirement income",
)

# The population must exercise the property, including the paths gated on
# the filers' Social Security and on ages of 73 or more.
assert has_dependent_income.sum() >= len(INCOME_TAX_STATES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,186 @@
capital_gains_tax: 1_500
# The same filer income and HOH tax calculation as the child-dividends case.
regular_tax_before_credits: 22_938


- name: A dependent's very large gain cannot round a dollar off the filer's Schedule D
period: 2025
input:
people:
head:
age: 30
employment_income: 20_000
long_term_capital_gains: 977
child:
age: 8
is_tax_unit_dependent: true
long_term_capital_gains: 16_776_240
tax_units:
tax_unit:
members: [head, child]
households:
household:
members: [head, child]
state_code: TX
output:
# The float32 all-member aggregate rounds 16,777,217 to 16,777,216.
# Subtracting the child's 16,776,240 would give 976, rather than 977.
# Schedule D line 16 and Form 1040 line 7a use the filer's own gain.
filer_loss_limited_net_capital_gains: 977
net_capital_gain: 977
dwks09: 977
dwks10: 977
adjusted_gross_income: 20_977

- name: Each spouse's distributions are floored before they enter the shared Schedule D
period: 2025
input:
people:
head:
age: 35
is_tax_unit_head: true
long_term_capital_gains: 6_000
non_sch_d_capital_gains: -2_000
spouse:
age: 34
is_tax_unit_spouse: true
short_term_capital_gains: -3_000
non_sch_d_capital_gains: 1_500
child:
age: 8
is_tax_unit_dependent: true
long_term_capital_gains: 10_000
non_sch_d_capital_gains: 9_000
tax_units:
tax_unit:
members: [head, spouse, child]
marital_units:
couple:
members: [head, spouse]
child_unit:
members: [child]
households:
household:
members: [head, spouse, child]
state_code: TX
output:
# Line 13 is max(0, -2,000) + max(0, 1,500) = 1,500, with no child
# distributions. Line 15 is 7,500; line 7 is -3,000; line 16 is 4,500.
filing_status: JOINT
filer_loss_limited_net_capital_gains: 4_500
net_capital_gain: 4_500
dwks09: 4_500
dwks10: 4_500

- name: A supplied aggregate still excludes the dependent in Form 1040 line 7a
period: 2025
input:
people:
head:
age: 35
long_term_capital_gains: 6_000
short_term_capital_gains: -1_000
non_sch_d_capital_gains: 1_500
child:
age: 8
is_tax_unit_dependent: true
long_term_capital_gains: 10_000
short_term_capital_gains: -2_000
non_sch_d_capital_gains: 9_000
tax_units:
tax_unit:
members: [head, child]
net_capital_gains: 15_000
households:
household:
members: [head, child]
state_code: TX
output:
# The supplied 15,000 covers all members. Remove the child's 8,000 and
# add the head's 1,500 distributions: Schedule D line 16 is 8,500.
filer_loss_limited_net_capital_gains: 8_500
# Preserve the documented aggregate/component split: line 15 is 7,500,
# so worksheet line 9 is min(7,500, 8,500), while the statutory amount
# uses component-derived lines 15 and 7: 7,500 - 1,000 = 6,500.
dwks09: 7_500
dwks10: 7_500
net_capital_gain: 6_500


- name: A large supplied aggregate keeps the dollar in its component adjustment
period: 2025
input:
people:
head:
age: 35
long_term_capital_gains: -1
tax_units:
tax_unit:
members: [head]
net_capital_gains: 16_777_216
households:
household:
members: [head]
state_code: TX
output:
# The aggregate is supplied, rather than the component-derived -1.
# Reconciling through a float32 difference from -1 rounds 16,777,217
# down by a dollar. Read the differing supplied aggregate directly.
filer_loss_limited_net_capital_gains: 16_777_216
# The component-derived line 15 remains a loss, so the preexisting
# aggregate/component split gives no statutory gain or worksheet gain.
net_capital_gain: 0
dwks09: 0
dwks10: 0

- name: A supplied aggregate removes a large dependent gain without borrowing its rounding error
period: 2025
input:
people:
head:
age: 35
long_term_capital_gains: 977
child:
age: 8
is_tax_unit_dependent: true
long_term_capital_gains: 16_776_240
tax_units:
tax_unit:
members: [head, child]
net_capital_gains: 20_000_000
households:
household:
members: [head, child]
state_code: TX
output:
# The supplied all-member gain is 20,000,000. Removing the child's
# own 16,776,240 gives 3,223,760. A residual against the rounded
# computed aggregate (16,777,216) incorrectly adds a dollar to this.
filer_loss_limited_net_capital_gains: 3_223_760
# Component-derived line 15 remains 977, so the preexisting
# aggregate/component split gives that gain to the worksheet and
# statutory net-capital-gain calculation.
net_capital_gain: 977
dwks09: 977
dwks10: 977

- name: A supplied capital gain survives a much larger filer component
period: 2025
input:
people:
head:
age: 35
long_term_capital_gains: 1_152_921_504_606_846_976
tax_units:
tax_unit:
members: [head]
net_capital_gains: 1
households:
household:
members: [head]
state_code: TX
output:
# The component gain is 2**60, exactly representable in float32.
# Even a float64 residual of 1 - 2**60 loses the supplied dollar when
# added back to the component gain. No dependent gains need removal.
filer_loss_limited_net_capital_gains: 1
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,15 @@
net_investment_income: 6_000
# 3.8% x 6,000
net_investment_income_tax: 228

- name: A supplied net capital gains amount is net investment income
period: 2025
input:
employment_income: 300_000
net_capital_gains: 100_000
state_code: TX
output:
# Form 8960 line 5a: the filer's Form 1040 line 7a, 100,000.
filer_loss_limited_net_capital_gains: 100_000
net_investment_income: 100_000

Loading
Loading