Repository navigation
Net Michigan business and rental losses in household resources (MI-1040CR lines 16, 17 and 30) - #9790
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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>
This was referenced Oct 5, 2026
…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>
This was referenced Oct 6, 2026
…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
Contributor
Author
|
Hand-off to the US + core hub. Head
|
Contributor
Author
|
Merged by the US + core hub on its merge gates. Audit:
|
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>
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
mi_household_resourcesfloored each business and rental source at zero on its own, then subtracted every federal above-the-line deduction, including the business part ofloss_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:loss_aldandirs_gross_income.loss_ald.Removing
loss_aldalone would have been wrong in the other direction. With per-source floors, a Schedule C loss could not offset S corporation income; onlyloss_aldwas bringing it back. For example, Schedule C −10,000 and S corporation income 30,000 give line 16 = 20,000. Aloss_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
mainatdf70a46db2, 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_aldandself_employed_pension_contribution_ald, which sum every member onmain. 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:loss_ald(line 30), computed from the list itself, so a reform that editsgov.irs.ald.deductionsstill lands right;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_resourcesaddsestate_income(Schedule E Part III) andother_net_gain(Form 4797 Part II) to line 16. Before, their losses came off throughloss_ald, but their income never counted.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:
loss_aldof 30,000 is subtracted.above_the_line_deductionsby 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.above_the_line_deductionsdirectly. They now use a real Schedule 1 adjustment (the early withdrawal penalty) and keep their expected values.13 new cases:
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 becauseloss_aldrestores the offset. They fail under aloss_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: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.loss_ald: a reform that removesloss_aldfromgov.irs.ald.deductionschanges AGI but not household resources.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_aldin 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 intest_mi_household_resources_losses.pypass (about 64 s, 2.0 GB peak). They pass again on head14bfcbc7f8, which mergesmainafter #9788 landed. That merge changes no Michigan code, so the microsimulation below (branch0a2ca21b4a) 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) onpopulace_us_2024.h5@populace-us-2024-spm-20260909: 79,729 tax units, 1,974 in Michigan.mi_household_resources(weighted, Michigan)mi_homestead_property_tax_creditmi_home_heating_creditmi_eitcmi_refundable_creditsmi_income_tax/state_income_taxadjusted_gross_income,loss_ald,above_the_line_deductions,income_taxloss_ald.b047c783ab, branch1a54e8999f) had one fall of the same kind (−$11.93 weighted) and the same 115 rises.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 inr1/andr2-stale/).Not in this PR (follow-ups)
us_bonds_for_higher_ed(Form 8815; its interest already counts on line 15, "including nontaxable interest"),qualified_adoption_assistance_expense,specified_possession_incomeandpuerto_rico_income.axiom: TheAxiomFoundation/rulespec-us#1491 queued (MCL 206.508(4) has no rulespec-us module; the corpus row
us-mi/statute/206.508exists; the signed encoder run needs approval)🤖 Generated with Claude Code