Skip to content

Net Michigan business and rental losses in household resources (MI-1040CR lines 16, 17 and 30) - #9790

Merged
MaxGhenis merged 15 commits into
mainfrom
mi-household-resources-business-losses
Oct 6, 2026
Merged

MaxGhenis merged 15 commits into
mainfrom
mi-household-resources-business-losses

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

mi_household_resources floored each business and rental source at zero on its own, then subtracted every federal above-the-line deduction, including the business part of loss_ald. That is the losses it had just floored away, so a business or rental loss came off household resources after all. Example: wages 50,000 and a rental loss of 30,000. The model gave 20,000; MI-1040CR line 33 is 50,000. #9788 stopped the capital part of the same double count. This PR removes the rest and follows the form's netting:

  • Line 16 nets Schedule C, Form 4797 Part II, Schedule E Parts II and III, and Schedule F, then floors the total at zero.
  • Line 17 nets Schedule E Parts I, IV and V (rents, royalties, REMIC income, which has no input, and farm rental), then floors the total at zero.
  • Lines 16 and 17 count only the claimant's and spouse's items (MCL 206.508(3): "'Household' means a claimant and spouse"). A dependent's business and rental income and losses are on the dependent's own return, as in loss_ald and irs_gross_income.
  • Line 30 is the U.S. Schedule 1 adjustments: the federal above-the-line deduction list without loss_ald.

Removing loss_ald alone would have been wrong in the other direction. With per-source floors, a Schedule C loss could not offset S corporation income; only loss_ald was bringing it back. For example, Schedule C −10,000 and S corporation income 30,000 give line 16 = 20,000. A loss_ald-only change gives 30,000 (80,000 in total with wages of 50,000, against the form's 70,000).

#9788 (this PR's prerequisite) is merged. This branch merges main at df70a46db2, so the diff here is this PR's own change only (5 files).

Dependents' self-employment deductions (until #9801). Line 30 still subtracts self_employment_tax_ald and self_employed_pension_contribution_ald, which sum every member on main. So a dependent's positive Schedule C or F income now lowers the claimant's household resources by the deductible half of the dependent's self-employment tax and any SEP deduction. Example (2025): claimant wages 50,000 and a dependent's Schedule C 20,000 give 48,587.05; the form gives 50,000. Before this PR the same household got 68,587.05, so the absolute error shrinks, but its sign flips. #9801 makes those two deductions sum the head and spouse only. #9796, which builds on this PR and merges #9801, pins the form's 50,000 with tests (a dependent's own Schedule C income, positive or negative, leaves household resources unchanged).

The law and the forms

MCL 206.508(4): "'Total household resources' means all income received by all persons of a household in a tax year while members of a household, ... and increased by the following deductions from federal gross income: (a) Any net business loss after netting all business income and loss. (b) Any net rental or royalty loss. (c) Any carryback or carryforward of a net operating loss as defined in section 172(b)(2) of the internal revenue code."

2025 MI-1040 book (page 26), "Total Household Resources": "They are AGI, excluding net business and farm losses, net rent and royalty losses, and any carryover of a net operating loss, plus all income exempt or excluded from AGI."

MI-1040CR line 16 (page 31): "Enter amounts to the extent included in AGI from: • U.S. Schedule C (Profit or Loss from Business). • Part II (Ordinary Gains and Losses) of the U.S. Form 4797. • Part II (Income or Loss from Partnerships and S Corporations) and Part III (Income or Loss from Estates and Trusts) of the U.S. Schedule E. • U.S. Schedule F (Profit or Loss from Farming). • Include income items reported as a distributive share. If the total is negative enter '0.'"

Line 17: "Enter amounts to the extent included in AGI from: • Part I (Income or Loss from Rental Real Estate and Royalties) of the U.S. Schedule E. • Part IV (Income or Loss from Real Estate Mortgage Investment Conduits (REMIC)) of the U.S. Schedule E (rents, royalties). • Part V (Net farm rental income or (loss) from Form 4835) of the U.S. Schedule E. If the total is negative enter '0.'"

Line 30 (page 32): "Enter total adjustments from your U.S. Form 1040, Schedule 1. Describe adjustments to income. These adjustments reduce total household resources and include some of the following: • Payments to IRAs, SEP, SIMPLE, or qualified plans • Student loan interest deduction • ... • Deduction for self-employment tax • Self-employed health insurance deduction • Penalty on early withdrawal of savings • Alimony paid if deductible on your U.S. Form 1040 • Jury duty pay you gave to your employer • Archer Medical Savings Account (MSA) deduction • Health Savings Account (HSA) deduction • Any other adjustments to gross income included on your 2025 U.S. Form 1040, Schedule 1." Business, rental and capital losses are Schedule 1 Part I income items (and Schedule C, D, E and F), not Part II adjustments.

The 2024 instructions have the same line 16, 17 and 30 text and the same page 26 definition.

Changes

  • mi_household_resources:
    • sums the line 16 sources and floors the total at zero, and does the same for the line 17 sources;
    • adds every other source as before;
    • subtracts the federal above-the-line deductions other than loss_ald (line 30), computed from the list itself, so a reform that edits gov.irs.ald.deductions still lands right;
    • subtracts health insurance premiums (line 31), unchanged.
  • Lines 16 and 17 sum each source over the head and spouse with tax_unit_non_dep_add. That helper sums a person-level source over non-dependents and takes a tax-unit-level one (other_net_gain) as is.
  • gov.states.mi.tax.income.household_resources adds estate_income (Schedule E Part III) and other_net_gain (Form 4797 Part II) to line 16. Before, their losses came off through loss_ald, but their income never counted.
  • The reference URL for the 2024 MI-1040CR-7 book goes back to main's archived copy. Net capital gain distributions inside the capital loss limit in AGI #9788's michigan.gov link now returns 404. The 2025 MI-1040CR-7 book's URL does too, and michigan.gov's 2025 forms page now links "MI-1040CR-7" to its home heating credit deadline page. The statute's Legislature page and the 2025 book pages 26 and 31 are added.

Tests

mi_household_resources.yaml, with MI-1040CR line comments and expected values worked out from the form:

  • Changed expectations:

    • "Negative business income floored at 0" (and its SSTB twin): 50,000 becomes 100,000.
    • "Negative rental income floored at 0": 20,000 becomes 50,000. Its comment said loss_ald of 30,000 is subtracted.
    • "Farm operations income counted as household resources": the test zeroed above_the_line_deductions by input, which line 30 no longer reads. It now expects 50,000 less the deduction for self-employment tax (3,532.39), which line 30 lists: 46,467.61.
    • "Cannot be negative", "Reduced to 0" and "Partially reduced": these input above_the_line_deductions directly. They now use a real Schedule 1 adjustment (the early withdrawal penalty) and keep their expected values.
  • 13 new cases:

    • netting within line 16: Schedule C, S corporation, estate and Form 4797 losses against income;
    • a net line 16 loss floored at zero;
    • netting within line 17: rental against farm rental;
    • a business loss that does not reduce rental income, and the reverse;
    • estate income and Form 4797 gains counted;
    • Schedule 1 adjustments with a business loss;
    • a dependent's Schedule C loss, rental loss and S corporation income, none of which reach the claimant's lines 16 and 17.

    Nine of the 24 cases fail on Net capital gain distributions inside the capital loss limit in AGI #9788's head (638c794a18) and pass here. Five pass on both: those netting cases match the form today only because loss_ald restores the offset. They fail under a loss_ald-only fix (checked with a reform that keeps per-source floors: 80,000 vs 70,000, 75,000 vs 65,000, 70,000 vs 65,000, 70,000 vs 62,000, and 69,076.12 vs 65,076.11).

tests/test_mi_household_resources_losses.py: a 2,187-household grid (every sign combination of the seven line 16 and 17 sources) and Hypothesis tests (one- and two-person units, amounts up to ±$500,000, capital gains, early withdrawal penalties, premiums). The grid fails on #9788's head. Invariants, for every input:

  1. mi_household_resources = max(0, wages + max(0, line 16 sources) + max(0, line 17 sources) + max(−3,000, capital gains) − Schedule 1 adjustments − premiums). This is a differential test against a reference written from the form.
  2. It does not depend on loss_ald: a reform that removes loss_ald from gov.irs.ald.deductions changes AGI but not household resources.
  3. Losses stay in their own line. When every line 16 source is zero or negative, the result equals the result with them set to zero; the same holds for line 17.
  4. 0 ≤ household resources ≤ the sum of positive income amounts.
  5. More S corporation, estate, Form 4797, rental or farm rental income raises household resources by between 0 and the increase. Intended exception: Schedule C and F income can lower household resources when line 16 is floored. The extra income still raises the self-employment tax deduction on line 30. The form gives that result.
  6. A dependent's business and rental losses, and S corporation, estate and rental income, leave household resources unchanged (test_dependents_business_and_rental_items). Positive Schedule C and F income for a dependent is left out until Keep dependents' above-the-line deductions off the filer's AGI #9801; see above.

Property 2 is checked on the grid, which builds the reform once.

Tolerances are one cent or eight float32 spacings at the household's total absolute amount: $0.25 at $500,000, and up to about $4 for the largest two-person households drawn. Hypothesis's first counterexamples were float32 rounding in the test's own arithmetic, not model errors. In one, subtracting a large loss_ald in the check lost 0.014. In the other, a change of 17,152 read as 17,152.031 near $530,000, where the float32 spacing is 0.0625. The adjustments check now sums line 30 directly, as the formula does.

On head 0a2ca21b4a, all 614 Michigan YAML tests and the 5 tests in test_mi_household_resources_losses.py pass (about 64 s, 2.0 GB peak). They pass again on head 14bfcbc7f8, which merges main after #9788 landed. That merge changes no Michigan code, so the microsimulation below (branch 0a2ca21b4a) still describes this PR.

Microsimulation (default dataset, 2026, policyengine-core 3.32.12)

Base: main plus #9788, which is #9788's head 638c794a18. Branch: 0a2ca21b4a. The two ran one at a time under the shared heavy-job lock and a 24 GB watchdog (peak 14.8 GB) on populace_us_2024.h5@populace-us-2024-spm-20260909: 79,729 tax units, 1,974 in Michigan.

base branch change
mi_household_resources (weighted, Michigan) $518.21B $521.54B +$3.33B (123 units: 115 up, 8 down)
mi_homestead_property_tax_credit $830.6M $801.9M −$28.7M (8 units)
mi_home_heating_credit $184.6M $172.4M −$12.2M (13 units)
mi_eitc $617.9M $617.9M 0
mi_refundable_credits $1,633.1M $1,592.2M −$40.9M (19 units)
mi_income_tax / state_income_tax +$40.9M (19 units)
adjusted_gross_income, loss_ald, above_the_line_deductions, income_tax 0 (bitwise identical)
  • Household resources rise for 115 Michigan units, with a median rise of $7,098. Among Michigan units, 43 have a negative line 16 total, 66 a negative line 17 total, and 114 a positive loss_ald.
  • They fall for 8 units, by $31,843 weighted in all.
    • Seven are the dependent change: a dependent's positive Schedule C or rental income no longer counts. These falls run from $0.42 to $1,086,852. The three largest (rental income of $1,086,852 and Schedule C income of $32,889 and $2,751) are in units with zero weight.
    • The eighth falls by $0.001, from float32 summation order. An earlier run without the dependent change (base b047c783ab, branch 1a54e8999f) had one fall of the same kind (−$11.93 weighted) and the same 115 rises.
  • No tax unit outside Michigan changes.
  • Higher household resources cut the two household-resources-tested credits, which are refundable, so Michigan income tax net of credits rises by the same $40.9M.
  • The dataset has no other_net_gain (Form 4797) amounts.

Scripts, logs and the full per-variable table: ~/reviews/pe-us-mi-household-resources-2026-10-05/microsim/ (diff_2026.txt; the earlier runs are in r1/ and r2-stale/).

Not in this PR (follow-ups)

axiom: TheAxiomFoundation/rulespec-us#1491 queued (MCL 206.508(4) has no rulespec-us module; the corpus row us-mi/statute/206.508 exists; the signed encoder run needs approval)

🤖 Generated with Claude Code

MaxGhenis and others added 9 commits October 4, 2026 15:13
A filer with capital losses or other capital gains enters capital gain
distributions on Schedule D line 13 (2025 Instructions for Schedule D), so
they net against the losses before the 26 U.S.C. 1211(b) limit on line 21.
The model added distributions (non_sch_d_capital_gains) to gross income and
deducted min(3,000, losses) separately: a 5,000 long-term loss with 3,000 of
distributions gave 0 in AGI instead of -2,000.

- capital_losses_allowed_against_gains (new): losses allowed up to the
  gains in gross income, distributions included (1211(b), first part).
- limited_capital_loss: the net loss up to the limit (1211(b)(1)-(2),
  Schedule D line 21). loss_ald deducts both. This also nets spouses'
  gains and losses on a joint return.
- loss_limited_net_capital_gains (+ person version): Form 1040 line 7a,
  max(-limit, LT + ST + distributions). Net investment income no longer
  adds the distributions separately (Form 8960 line 5a).
- has_qdiv_or_ltcg: qualified dividends, or Schedule D lines 15 and 16
  both above zero (Form 1040 instructions, line 16).
- dependent_taxable_ss_magi: the same netting on the dependent's return.
- dc_self_employment_loss_addition: subtracts both capital parts of
  loss_ald.

Tests: YAML cases with form line comments; grid, Hypothesis property and
monotonicity tests.

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

# Conflicts:
#	policyengine_us/parameters/gov/irs/investment/income/sources.yaml
filer_loss_limited_net_capital_gains (from #9784) now nets the head and
spouse's capital gain distributions with their Schedule D gains and losses
before the 1211(b) limit, and net investment income no longer adds the
distributions separately. The invariant test's reference computation
follows: distributions move from the person-level Form 8960 amounts to
the Schedule D inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
capital_losses_allowed_against_gains counts only the capital gains that
gov.irs.gross_income.sources includes, and dependent_taxable_ss_magi nets
distributions only when both sources are listed. Cover both branches with
reforms that drop non_sch_d_capital_gains or capital_gains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the independent review of #9788:
- mi_household_resources subtracted all above-the-line deductions,
  including the capital loss already netted in the capital gains line
  (MI-1040CR line 30 is U.S. Schedule 1 adjustments only). It now leaves
  out capital_losses_allowed_against_gains and limited_capital_loss. The
  two existing loss-limit cases double counted the loss: 44,000 -> 47,000
  and 47,000 -> 48,500.
- has_qdiv_or_ltcg figures Schedule D lines 15 and 16 over the head and
  spouse, so a dependent's loss cannot switch off the filer's worksheet.
- Distributions are floored at zero per person in every line 7a variable
  (box 2a is not negative), as irs_gross_income does.
- Capital losses are deductible only while capital_gains is a gross income
  source, matching dependent_taxable_ss_magi under such a reform.
- Test that the two loss-limit parameters agree; rename the #9784
  invariant test that no longer compares with the pre-change formula.
- loss_ald label: "Business and capital loss ALD".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI caught two tests written against the old capital loss formula:
- test_dependent_losses_agi_invariants (#9647) compared limited_capital_loss
  with min(cap, sum of losses), which does not net one spouse's gains
  against the other's losses. Its reference now splits 1211(b) the same
  way: losses allowed up to the gains, plus the excess up to the cap.
  Renamed ..._match_all_member_formula.
- md_capital_gains_surtax "partial offset" set capital_losses (a formula
  variable, max(0, -capital_gains)) to 50,000 next to 150,000 of net gains,
  a state no inputs can produce, and its comment applied the $3,000 cap to
  losses within gains. It now inputs the short-term loss directly
  (30,000 gains less 50,000 losses = -20,000): Schedule D line 16 and Form
  502CG line 1 are 100,000, surtax 2,000 (same on main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MCL 206.508(4) adds back "any net business loss after netting all business
income and loss" and "any net rental or royalty loss". The MI-1040CR nets
line 16 (Schedule C, Form 4797 Part II, Schedule E Parts II and III,
Schedule F) and line 17 (Schedule E Parts I and V) and floors each total at
zero. Line 30 is the U.S. Schedule 1 adjustments, so loss_ald, which holds
business, rental and capital losses, is no longer subtracted there.

Estate and trust income and Form 4797 ordinary gains now count on line 16.

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

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (14bfcbc).
⚠️ Report is 228 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9790   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         1    -3     
  Lines           76        26   -50     
  Branches         2         3    +1     
=========================================
- Hits            76        26   -50     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

MCL 206.508(3): "'Household' means a claimant and spouse." Netting every
tax unit member's sources let a dependent's business or rental loss offset
the claimant's income (a 15-year-old's Schedule C loss of 20,000 took the
claimant's household resources from 70,000 to 50,000). Lines 16 and 17 now
sum only non-dependents, as loss_ald and irs_gross_income do.

Tests: three dependent YAML cases and a deterministic dependent property
test. The loss_ald reform check now runs once, on the grid, instead of on
every Hypothesis example; test_properties drops from 931 s in CI to about
8 s. The deterministic tests no longer need hypothesis. Small inputs are
drawn at $100 or more, the tolerance docstring is corrected, and comments
list Schedule E Part IV (REMIC) on line 17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 4 commits October 5, 2026 22:43
…ons-agi

# Conflicts:
#	policyengine_us/tests/core/test_dependent_losses_agi_invariants.py
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
… and move the distributions comment

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to mi-household-resources-business-losses

# Conflicts:
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
…change in the changelog

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

# Conflicts:
#	policyengine_us/tests/policy/baseline/gov/states/mi/tax/income/mi_household_resources.yaml
#	policyengine_us/variables/gov/states/mi/tax/income/mi_household_resources.py
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub. Head 14bfcbc7f8.

@MaxGhenis
MaxGhenis merged commit 4732913 into main Oct 6, 2026
37 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged by the US + core hub on its merge gates. Audit:

@MaxGhenis
MaxGhenis deleted the mi-household-resources-business-losses branch October 6, 2026 08:28
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
Brings in #9841 (28 percent rate gain and unrecaptured section 1250 gain
netted against losses), #9801, #9790, #9779, #9768, #9741 and #9630. Only
test_section_911_tax_stacking.py changed on both sides, in different
functions, and git merged it without conflict. #9841 passes Schedule D
lines 18 and 19 entered already netted through unchanged, and this
branch's capital_gains_tax, reforms and tests read the section 911
amounts and Schedule D inputs that #9841 keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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