Skip to content

Count Form 4835 farm rent in net investment income, and limit its losses under section 461(l) - #10076

Open
MaxGhenis wants to merge 9 commits into
mainfrom
fix-nii-farm-rent
Open

MaxGhenis wants to merge 9 commits into
mainfrom
fix-nii-farm-rent

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10075.

What was wrong

net_investment_income, the base of the net investment income tax (NIIT) and of Minnesota's NIIT, left out farm_rent_income. That variable holds Form 4835 net farm rental income or loss, which is reported on Schedule E line 40. The same amount was already in AGI and NIIT MAGI. So a farm landlord's crop-share rent raised MAGI but never counted as net investment income, and a Form 4835 loss never reduced it.

The law (verbatim; full extracts with headings are in #10075)

  • Form 8960 line 4a. The 2025 Instructions for Form 8960 (p. 8, "Line 4a—Income From Trades/Businesses/Farming, Rental Real Estate, Royalties, Partnerships, S Corporations, and Trusts") say: "Enter the following amount from your properly completed return. • Schedule 1 (Form 1040), line 3. • Schedule 1 (Form 1040), line 5. • Schedule 1 (Form 1040), line 6." The 2024 instructions (p. 6) list lines 3 and 5.
  • Schedule E line 41. 2025 Schedule E, Part V: "41 Total income or (loss). Combine lines 26, 32, 37, 39, and 40. Enter the result here and on Schedule 1 (Form 1040), line 5". Line 40 is "Net farm rental income or (loss) from Form 4835."
  • Form 4835 is a passive rental. Its header reads "(Income Not Subject to Self-Employment Tax)". Its Purpose of Form says: "Use this form only if the activity was a rental activity for purposes of the passive activity loss limitations." The Form 8960 instructions (p. 4) say: "A passive activity also includes any rental activity, regardless of whether you materially participate."
  • The statute. 26 U.S.C. 1411(c)(1)(A)(i) includes "gross income from … rents, other than such income which is derived in the ordinary course of a trade or business not described in paragraph (2)". Paragraph (2)(A) is "a passive activity (within the meaning of section 469)". Paragraph (c)(6) excludes only items in self-employment income.

So Form 4835 income is rent in NII. Form 8960 line 4b takes it back out only when the rental is nonpassive and rises to a section 162 trade or business: a real estate professional's rental, a rental grouped with a nonpassive business, or property rented to the owner's own nonpassive business.

Changes

  • gov.irs.investment.income.sources: adds farm_rent_income after rental_income, with a comment giving the Form 4835 → Schedule E line 40 → line 41 → Schedule 1 line 5 → Form 8960 line 4a path. Adds references to the 2025 Form 8960 instructions, Form 4835, Schedule E and §1411(c)(2).
  • Dependents. net_investment_income already sums sources over the head and spouse only (tax_unit_non_dep_add), so a dependent's Form 4835 income stays on the dependent's own Form 8960.
  • §461(l): adds excess_business_loss (Form 461 line 16) and net_investment_income_excess_business_loss, adds the latter to the NII sources, and moves limited_business_loss's item list into a shared helper. See "Decisions".
  • farm_rent_income: gains documentation stating that it is the Form 4835 / Schedule E line 40 amount, not subject to self-employment tax, plus a Form 4835 reference.
  • Tests:
    • five worked Form 8960 YAML cases, in net_investment_income_tax.yaml and mn_niit.yaml;
    • three §461(l) NIIT cases in net_investment_income_tax.yaml: the review's counterexample, the same case with a Schedule E rental loss, and a mixed case;
    • new excess_business_loss.yaml (5 cases) and net_investment_income_excess_business_loss.yaml (6 cases);
    • farm_rent_income added to the signed inputs and the reference sum of test_dependent_net_investment_income_invariants.py;
    • one PolicyBench snapshot update, explained below.

Decisions

  • Farm rent counts, signed, like rental_income. The model has no Form 8960 line 4b input for nonpassive rentals, for Schedule E Part I rents or for Form 4835. So it counts all of both. A line 4b rental input would serve both, and the EITC passive basket needs the same split (EITC investment-income test after #9572: dependents' amounts, passive income that is also earned income, and farm rental #9635, draft Count farm rent and leave out passive income that is also earned in the EITC investment income test (26 U.S.C. 32(i)(2)(E)) #9889). That is a separate change.
  • Passive partnership and S-corporation income needed nothing. It has been in the list since Add passive partnership/S-corp income input to the NIIT base #9306 (first released in 1.816.0). Line 4a takes all of Schedule E Part II and line 4b removes the nonpassive part, so summing passive_partnership_s_corp_income gives the same line 4c.
    • Still not modeled: nonpassive income from a §1411(c)(2)(B) trading business, which stays NII.
    • Versions before 1.816.0 have no passive input, so they leave Part II income out of NII entirely.
  • No §469 limit, as in AGI. The model does not apply the §469 passive loss limits. AGI already takes the whole Form 4835 loss through loss_ald, and NII now uses the same amount, as Form 8960 line 4a does with the Schedule 1 line 5 figure.
  • §461(l): NII takes a loss only as far as chapter 1 allows it. This was added after the independent review, and it fixes the same gap for the existing sources.
    • The rule. §1411(c)(1)(B) allows "the deductions allowed by this subtitle". Treas. Reg. 1.1411-4(f) follows the chapter 1 limits (its examples apply §465 and §469). §461(l) disallows business losses beyond business income plus the threshold ($313,000, or $626,000 joint, in 2025).
    • What was wrong. AGI already capped these losses in limited_business_loss. NII added Schedule E rental, Form 4835, estate and passive pass-through losses in full. On main, a single filer with $500,000 of interest and a $600,000 rental loss had NII of −$100,000 and no NIIT; the law gives NII $187,000 and NIIT $7,106.
    • Why not follow the form literally. Form 461 puts the add-back on Schedule 1 line 8p, which Form 8960 line 4a does not take (lines 3, 5 and 6). That omission can't override §1411(c)(1)(B) and Reg. 1.1411-1(a).
    • New variables. excess_business_loss is Form 461 line 16. net_investment_income_excess_business_loss is the part of it that falls on losses NII counts. NII adds that part back (a new entry in gov.irs.investment.income.sources). limited_business_loss now shares its list of items through section_461l_business_income_and_loss; its inputs and summation order are unchanged.
    • When NII losses are the only business losses, the whole excess falls on them, and every reading agrees.
    • When there are also non-NII losses (Schedule C, Schedule F, nonpassive pass-through), no statute, regulation or form instruction says how to split the excess. This PR provisionally splits it in proportion to the two kinds of loss, and the code, tests and docs say so. That matches the split d1014 proposes between spouses for the same limit.
    • The mixed-case rule is queued as d1363 (which supersedes d1343). The alternatives are NII losses first, by analogy to Reg. 1.1411-4(h)(2), or non-NII losses first. Whichever is chosen is a one-line change in the new variable.
    • Code H doesn't change which estate losses count (fixed after review round 3). A Schedule E Part III loss is on Form 8960 line 4a in full, and the Schedule K-1 (Form 1041) box 14 code H adjustment is a separate line 7 item. The 2025 Form 1041 instructions ("Beneficiary reporting", p. 38) say: "The only instance where code H will be a positive number is when" the estate or trust holds a section 1291 fund, CFC or QEF interest whose distribution is NII but not taxable income. So a positive code H is separate income and never takes the loss out of NII.

Worked examples (hand-computed from the Form 8960 lines, not PolicyEngine output)

Case Year Line 4a Line 12 NII Line 13 MAGI Line 15 Line 17 NIIT main
Single, wages 190,000, Form 4835 30,000 2025 30,000 30,000 220,000 20,000 760 0
Single, wages 250,000, Schedule E line 26 40,000, Form 4835 loss −10,000 2025 30,000 30,000 280,000 80,000 1,140 1,520
Joint, head wages 240,000, spouse Form 4835 35,000 2024 35,000 35,000 275,000 25,000 950 0
Parent wages 210,000 + interest 5,000; dependent child Form 4835 10,000 2025 0 (child's own return) 5,000 215,000 15,000 190 190
Minnesota, interest 800,000 + Form 4835 300,000 2025 n/a 1,100,000 n/a n/a MN NIIT 1% × 100,000 = 1,000 0
Single, wages 300,000, interest 500,000, Form 4835 loss −600,000 (§461(l) allows 313,000) 2025 −313,000 187,000 487,000 287,000 7,106 0
Same with a Schedule E rental loss −600,000 2025 −313,000 187,000 487,000 287,000 7,106 0
Wages 600,000, interest 200,000, Schedule C −300,000, Form 4835 −300,000 (provisional proportional split) 2025 −156,500 43,500 487,000 287,000 1,653 0
Wages 300,000, interest 500,000, Schedule E Part III −600,000, code H +600,000 (CFC distribution) 2025 −313,000 787,000 1,087,000 887,000 29,906 19,000

Minnesota: Minn. Stat. 290.033(a) gives "net investment income" "the meaning given in section 1411(c) of the Internal Revenue Code, excluding the net gain attributable to the disposition of property classified as class 2a". That exclusion covers gain, not rent.

Before the fix. I ran the new cases against main first. Four failed:

  • net_investment_income 0 vs 30,000
  • 40,000 vs 30,000
  • 0 vs 35,000
  • 800,000 vs 1,100,000

The dependent case passed on both, as expected.

Snapshot update: PolicyBench scenario 120

policybench_ira.yaml scenario 120 (single, TY2026, Connecticut) has farm_rent_income −2,446.59. Its federal target is the policyengine-us 2.37.2 evidence value (#10032), not an outside oracle.

  • NII falls from 4,300 (interest 2,300 + rents 2,000) to 1,853.41.
  • MAGI is 234,414.20, and AGI already included the loss, so the MAGI limb does not bind.
  • NIIT falls from 163.40 to 70.43, and income_tax_before_refundable_credits from 40,423.18 to 40,330.21. The difference is 3.8% × 2,446.59, which is 92.97 in float32.
  • The Connecticut target is unchanged.

The YAML carries a comment with the old value and the reason.

Invariants

These hold for every input. Tests:

  1. Dollar for dollar while §461(l) doesn't bind. NII changes by exactly the change in a filer's farm_rent_income, of either sign. When the limit binds, NII takes only the allowed part of the loss, through the add-back in invariant 5. Covered by test_net_investment_income_matches_reference, an independent numpy sum over the head and spouse that includes farm rent and the §461(l) add-back. Also covered by test_estate_income_invariants.py property 2, which now expects the add-back on its cap-binding rows.
  2. Dependents. A dependent's farm rent never changes the filer's NII, AGI, MAGI or NIIT. Covered by test_dependents_income_stays_off_filer_form_8960.
  3. No dependents. For units without dependents, NII equals the all-member formula. Covered by test_units_without_dependents_match_all_member_formula.
  4. NIIT bounds. 0 ≤ NIIT = 3.8% × min(max(0, NII), max(0, MAGI − threshold)). Covered by test_niit_within_statutory_bounds.
  5. §461(l) add-back bounds. 0 ≤ net_investment_income_excess_business_loss ≤ min(excess_business_loss, NII losses). It equals the excess when NII losses are the only business losses. Covered by test_section_461l_addback_bounds, which also checks both new variables against an independent numpy computation from leaf inputs. Invariants 1 and 3 include the add-back in their reference.

These are the file's existing property tests: a seeded random population of 300 tax units × 2 years plus edge rows, one vectorized simulation per scenario. Farm rent is now drawn signed for every member, dependents included. Three edge rows make §461(l) bind:

  • a single filer with only a Form 4835 loss;
  • a joint return with a nonpassive partnership loss sharing the excess;
  • a dependent with a large loss.

The population size and number of simulations are unchanged. CI cost rises only by one input column, two output variables and one test function over the same simulations.

Population impact

Two full microsimulation runs, base and PR, compared record by record:

  • Period and data: TY2026 on the default dataset, populace_us_2024.h5@populace-us-2024-spm-20260909 (79,729 tax-unit records).
  • Base: main at the merge-base 12ea587.
  • PR: head 1def0db, farm rent plus the §461(l) limit.
Variable Base PR Change
net_investment_income $2,646.18bn $2,650.77bn +$4.60bn
net_investment_income_tax $73.268bn $73.413bn +$145.1m (+0.20%)
income_tax $2,593.317bn $2,593.462bn +$145.1m
household_net_income $17,170.230bn $17,170.085bn −$145.1m
state_income_tax $576.666bn $576.666bn +$0.04
mn_niit $6.84 $6.84 0
  • NIIT. 79 records change, representing 119,000 weighted tax units:

    • 80,000 pay more, +$153.7m in total;
    • 39,000 pay less, −$8.6m in total;
    • the largest change for one tax unit is $7,865.

    The estimate rests on those 79 records, so it is noisy.

  • Farm rent (an earlier pair at 32b77d3). Filers' Form 4835 income adds $8.32bn to NII and their losses subtract $4.06bn. NIIT rises by $145,092,554 on its own.

  • The §461(l) limit adds very little:

    • excess_business_loss is $26.9bn on 144 records (286,000 weighted tax units);
    • the NII add-back is material on 17 records (32,000 weighted tax units) and adds $0.34bn to NII;
    • NIIT moves by only $136 more, on 2 records with near-zero weight. Where the limit binds, the MAGI limb or a still-negative NII usually decides the tax.
  • States. One record moves, by $12.37.

  • Minnesota. No Minnesota record crosses $1,000,000 either way.

Later commits. 251b87f and 215bfa5 change only tests and the code H rule. The dataset's 318 person columns include no estate_income_net_investment_income_adjustment, so it is 0 for every record and these figures hold at the current head.

Run outputs: ~/reviews/niit-farm-rent-2026-10/impact/ (compare.2026.json, and compare.2026.r1.json for the farm-rent-only pair).

Verification (local, macOS, Python 3.13, policyengine-core 3.32.20; head 251b87f, rerun at 215bfa5 below)

  • New and changed YAML: excess_business_loss.yaml, net_investment_income_excess_business_loss.yaml and net_investment_income_tax.yaml. 42 passed.
  • Neighbouring YAML: loss_ald.yaml, dependent_losses.yaml, loss_thresholds.yaml, dependent_net_investment_income.yaml, estate_net_investment_income.yaml, mn_niit.yaml, policybench_ira.yaml and niit_magi.yaml. 86 passed.
  • The 31 YAML files that set farm_rent_income, in batches of 8: 418 passed.
  • Python:
    • test_dependent_net_investment_income_invariants.py, test_loss_ald_extraction_parity.py, test_dependent_losses_agi_invariants.py and test_az_property_tax_credit_income.py: 36 passed.
    • test_estate_income_invariants.py: 22 passed. Its two cap-binding edge rows now expect the §461(l) add-back; CI caught this at 1def0db.
  • Rerun at 215bfa5, after the code H fix:
    • YAML (excess_business_loss.yaml, net_investment_income_excess_business_loss.yaml, net_investment_income_tax.yaml, estate_net_investment_income.yaml, niit_magi.yaml): 58 passed.
    • test_estate_income_invariants.py and test_dependent_net_investment_income_invariants.py: 36 passed.
  • CI. The Rest suite also fails test_no_group_variables_in_person_adds.py::test_known_violations_only_shrink on the Illinois AABD entry. That failure comes from main (Count only a person's own withholding in the Illinois AABD expense exemption #9902 fixed the edge after Guard against person variables that add group variables (every member gets the whole group amount) #9897 listed it), and Drop the fixed Illinois AABD entry from the person-adds ratchet #10092 removes the entry.

axiom: TheAxiomFoundation/rulespec-us#1643 queued

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits October 10, 2026 18:36
Form 8960 line 4a takes Schedule 1 line 5, which includes Schedule E line 40
(Form 4835 net farm rental income or loss). Form 4835 is only for a rental
activity under the passive activity rules, so it is rent under
26 USC 1411(c)(1)(A)(i). Add farm_rent_income to the NII sources, with
worked Form 8960 tests and the dependent invariants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its federal target was the policyengine-us 2.37.2 evidence value. The
-2,446.59 Form 4835 loss now reduces net investment income as it already
reduced AGI, so NIIT falls by 3.8% x 2,446.59.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 3 commits October 11, 2026 11:34
Section 1411(c)(1)(B) allows only deductions allowed by chapter 1, and
section 461(l) disallows business losses beyond business income plus the
threshold. NII added Schedule E rental, Form 4835, estate and passive
pass-through losses in full while AGI capped them. Add excess_business_loss
(Form 461 line 16) and net_investment_income_excess_business_loss, the part
of it that falls on losses NII counts (all of it when they are the only
business losses, a proportional share otherwise), and add it back in NII.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis changed the title Count Form 4835 farm rental income in net investment income (Form 8960 line 4a) Count Form 4835 farm rent in net investment income, and limit its losses under section 461(l) Oct 11, 2026
MaxGhenis and others added 3 commits October 11, 2026 13:35
The NII-follows-estate-income property now subtracts the estate losses that
section 461(l) disallows, computed independently from the leaf inputs; the
two edge rows with a 400,000 estate loss exercise it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Schedule K-1 (Form 1041) box 14 code H adjustment is positive only for
section 1291 fund, CFC and QEF distributions that are NII but not taxable
income (2025 Form 1041 instructions, Beneficiary reporting), so it is
separate line 7 income and never takes a Part III loss out of NII. Count the
whole Part III loss as an NII loss, add the review's counterexample (NIIT
29,906), and label the mixed-loss split provisional.

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

Net investment income leaves out Form 4835 farm rental income (Schedule E line 40)

1 participant