Skip to content

Leave dependents' capital income out of state lines on the filers' return - #9894

Open
MaxGhenis wants to merge 9 commits into
mainfrom
dependent-capital-income-state-lines
Open

MaxGhenis wants to merge 9 commits into
mainfrom
dependent-capital-income-state-lines

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

irs_gross_income multiplies every income source by ~is_tax_unit_dependent, so a tax unit dependent's interest, dividends and capital gains never enter the filer's federal AGI or taxable income. The dependent reports them on their own return (2025 Form 8814, line 4; the model does not implement the Form 8814 election, 26 U.S.C. 1(g)(7)).

Many state lines that adjust the filers' federal AGI or taxable income summed a capital-income input over every tax unit member (add(tax_unit, ...) or adds = [...]). So a child's dividends, gains or interest moved the parents' state tax.

The two reported cases, on main:

TY2025 Without the child's income With it, main With it, this PR
ND. Head: wages 50,000, qualified dividends 1,000. Child: qualified dividends 5,000. nd_qdiv_subtraction 400 2,400 400
VT. Head: wages 150,000, long-term gain 10,000. Child: long-term gain 100,000, all VT-eligible. vt_percentage_capital_gains_exclusion 0 40,000 0
VT vt_capital_gains_exclusion 5,000 40,000 5,000
VT vt_income_tax (federal AGI 160,000 in every column) 6,623.20 4,800.00 6,623.20

How the leaks were found

  1. Static scan. Every add, aggr and adds/subtracts aggregator over a tax unit in variables/gov/states, with parameter-driven source lists resolved over all their dated values. 50 tax-unit sums include a person-level capital-income input. Child-care and TANF spm_unit sums count family income by design and are out of scope.

  2. Household sweep (every state, TY2021–2026). Five filer profiles: single worker at 60,000, a 70-year-old with Social Security and a pension, a 400,000 earner, an 82-year-old, and a 22,000 earner. Each has a dependent child aged 15 with 50,000 (300,000 for long-term gains) of one input:

    • qualified or other dividends;
    • long- or short-term gains;
    • collectibles gains;
    • capital gain distributions;
    • taxable, tax-exempt or U.S. government interest;
    • VT-eligible gains;
    • or wages, as a control.

    The sweep compares the filer's state_income_tax with and without the child's income, alongside federal AGI and federal tax. It ran on Use the filers' Schedule D for the tax on net capital gain #9855's head so the federal Schedule D leak Use the filers' Schedule D for the tax on net capital gain #9855 fixes stays out. A drill-down then listed every state variable that moved. Every change below was found this way. The same sweep, re-run on Use the filers' Schedule D for the tax on net capital gain #9855's head plus this PR, leaves only the cases under "Not in this PR".

What changes

All fixes count only the head and spouse, using tax_unit_non_dep_add for tax-unit sums and a dependent mask for per-person lines.

State Dependent's income that moved the filer's tax Where
Most states U.S. government interest us_govt_interest, which most states subtract. It was adds = ["us_govt_interest_person"] over every member; tax-unit lists (incl. #9699's) add it as is. In the sweep a dependent's U.S. government interest moved the filer's tax in 38 states; after this PR it moves none except AL and IA before 2023 (structural), KY (#9699), and the MN, NM and OK credit paths under "Not in this PR".
VA U.S. government interest, plus the rest of the list va_subtractions (whole list) and va_subtractions_person (dependents get none). The list's other person items are already head/spouse-masked or AGI-prorated; a dependent's unemployment, railroad benefits and state tax refunds also stop being subtracted.
DC, DE, OH U.S. government interest dc_income_subtractions, de_subtractions, oh_deductions (per-person, summed into the filers' state AGI). Only the dependent's U.S. government interest is dropped; see "Not in this PR".
ND Qualified dividends; long-term gains; a short-term loss nd_qdiv_subtraction, nd_ltcg_subtraction
VT VT-eligible gains; non-Vermont municipal interest vt_percentage_capital_gains_exclusion, vt_additions
AZ Long-term gains; a short-term loss wiped the filer's subtraction az_long_term_capital_gains_subtraction
SC Gains sc_net_capital_gain_deduction
WI Gains and losses; tax-exempt interest wi_capital_gain_loss_subtraction, wi_capital_loss, wi_additions
MD Gains, triggering the 2% surtax md_capital_gains_surtax
WA Long-term gains (capital gains excise tax) wa_capital_gains_tax, wa_millionaires_tax_base_income
MT Gains (2024+ rates); 2021–23 capital gain credit, interest exemption shares, U.S. government interest and Social Security worksheet mt_capital_gains_tax_joint, ..._applicable_threshold_joint, mt_regular_income_tax_joint, mt_capital_gain_credit, mt_interest_exemption_person, mt_agi_joint, mt_taxable_social_security_joint
MA Dividends, interest and gains in Parts A and C. Part B starts from filer-only gross income, so a child's Part A income came off the parent's Part B. ma_part_a_gross_income, ma_part_a_agi, ma_part_c_gross_income, the four Part A dividend and exemption lines, the bank interest exemption
IL Tax-exempt interest il_base_income_additions
NH (through 2024) Interest and dividends nh_taxable_income
IA (2021–22) Tax-exempt interest and benefits in the Social Security worksheet ia_reportable_social_security
MN Tax-exempt interest and benefits in the Social Security worksheet mn_social_security_subtraction
UT Tax-exempt interest in the Social Security and retirement credits and the child tax credit ut_ss_benefits_credit_max, ut_retirement_credit_max, ut_ctc_potential
WV Tax-exempt interest in the low-income family credit wv_low_income_family_tax_credit_agi
ME Tax-exempt interest in the sales and property tax fairness credits me_sales_and_property_tax_fairness_credit_income
PA Tax-exempt interest in Tax Forgiveness eligibility income pa_eligibility_income

Where one of these formulas also summed a dependent's other amounts on the same line, they get the same rule:

  • Social Security benefits in the IA, MN and MT worksheets. A child's survivor benefits are the child's.
  • Student loan interest in MN's worksheet.
  • MT's other additions and subtractions in the joint AGI pool.

Three fixes in formulas edited anyway:

  • ND nd_ltcg_subtraction floors at zero and includes capital gain distributions. The Form ND-1 line 6 worksheet says "If zero or less, stop here; no exclusion is allowed", and puts distributions without Schedule D on line 3. Before, a filer's net long-term loss made a negative subtraction.
  • UT ut_retirement_credit_max counts only the head and spouse as claimants. An elderly dependent no longer adds a credit.
  • WV wv_low_income_family_tax_credit_agi now cites W. Va. Code 11-21-22a(d), the definition it implements, instead of 11-21-12(b).

Legal basis

Each line adjusts the individual's own federal AGI or taxable income, or the claimant's and spouse's own income. I read these sources this session:

  • ND. N.D.C.C. 57-38-30.3(2) defines North Dakota taxable income as "the federal taxable income of an individual". It is reduced by interest on U.S. obligations ((a)) and by forty percent of "the taxpayer's net long-term capital gain" ((d)(1)) and of qualified dividends ((d)(2)).
    • The task cited 57-38-01.33, which is an expired machinery credit.
    • 2025 ND-1 booklet, line 13: "multiply the qualified dividends from Form 1040 or 1040-SR, line 3a, by 40 percent". The line 6 worksheet takes Schedule D lines 15 and 16 (pp. 14–15).
  • VT. 32 V.S.A. 5811(21): "in the case of an individual, federal adjusted gross income"
    • increased by "interest income from non-Vermont state and local obligations" ((A)(i));
    • decreased, "to the extent such income is included in federal adjusted gross income", by income from U.S. government obligations ((B)(i));
    • and decreased by 40% of gain on "assets held by the taxpayer for more than three years" ((B)(ii); Schedule IN-153).
  • IA. 2022 IA 1040 instructions, Social Security worksheet:
    • line 1 "Box 5 of form(s) SSA-1099. If you filed a joint federal return, enter the totals for both spouses";
    • line 6 "Enter the amount from your federal 1040, line 2a".
  • ME. 36 M.R.S. 5213-A(1)(B) and 5219-KK(1)(D): "federal adjusted gross income increased by ... (2) Interest received to the extent not included in federal adjusted gross income".
  • WV. W. Va. Code 11-21-22a(d): "the federal adjusted gross income plus any applicable increasing West Virginia modifications plus any tax exempt interest income reported on the federal tax return".
  • PA. Personal Income Tax Guide, Tax Forgiveness: "For a single claimant, only the claimant's eligibility income is considered". A married claimant counts "both the claimant and the claimant's spouse". A dependent child claims forgiveness separately.
  • Other states. A read-only research lane checked the statutes for the remaining states: AZ 43-1022, SC 12-6-1150(A), WI 71.05(6), MD TB-58, WA RCW 82.87.040/.120, MT 15-30-2103 and former 15-30-2301, MA c.62 §2, IL 35 ILCS 5/203(a)(2)(A), NH Rev 906.02, MN 290.0132 subd. 26 (via IRC 86(b)(2)), UT 59-10-1019/1042/1047, and VA 58.1-322.02.
    • Each takes the taxpayer's own amounts ("included in federal adjusted gross income", "of the taxpayer", or spouses only).
    • None lets a parent include a child's income except through the federal Form 8814 election.
    • Its report: ~/reviews/pe-us-dep-capital-income-2026-10-06/legal_out.md.

Not in this PR

Tests

  • 46 YAML cases in 33 files.
    • 35 cases put a capital-income amount on a dependent child and expect the head-and-spouse value. Each of the 35 gives a different value on main.
    • 9 twin cases show the same household without the child's income gets the same value.
    • 2 cases cover the ND floor and distributions.
    • Every expected value was checked by hand against the law (for example 40% of the filer's 1,000 = 400; 25%, 44% and 30% of the filer's 10,000 in AZ, SC and WI; 2% of 10,000 = 200 for the MD surtax).
  • Property test policyengine_us/tests/core/test_dependent_capital_income_state_tax_invariants.py (Hypothesis, 5 derandomized examples of 10–30 ND and VT tax units, each run with and without its dependents' capital income).
    • nd_income_tax, vt_income_tax, federal AGI and federal taxable income match between the twins.
    • nd_qdiv_subtraction, nd_ltcg_subtraction (with its zero floor and distributions), vt_percentage_capital_gains_exclusion, vt_additions and us_govt_interest equal an independent reference over the filers' own amounts.
    • On main Hypothesis shrinks to a dependent with $1 of qualified dividends, giving a filer subtraction of $0.40.
    • Two documented restrictions keep out-of-scope paths out of the draws:
    • Cost (local, macOS arm64; not a Linux CI measurement): 3.8 s of test time in a 30 s process, about 20 s of which is the model load the core group already pays; 1.27 GB peak footprint.
  • Local runs (heavy_run.sh lock): 132 targeted YAML files, covering every file that names a changed variable, plus the touched states' integration tests and all us_govt_interest tests. Queued for the shared heavy lock; results will be added here.

Microsim impact

Pending: a real 2026 microsimulation on the default dataset, base 1da311383b against this PR (9ea8aac872), is queued under lockrun.sh. Results will be added here.

Invariants

For every tax unit, and any capital income its dependents have, as checked by the property test, the YAML twins and the sweep:

  • These state lines and the state income tax equal their values with the dependents' capital income set to zero.
  • Federal AGI and taxable income are unchanged by this PR.
  • Tax units without dependents get exactly what they got before. tax_unit_non_dep_add equals add when no member is a dependent.

axiom: TheAxiomFoundation/rulespec-us#1424 queued (extended with the state capital-income cases: TheAxiomFoundation/rulespec-us#1424 (comment)).

  • Where rulespec-us encodes these lines, the inputs are the return's or the individual's own amounts:
    • us-nd:policies/income_tax/resident_core_liability_pipeline (N.D.C.C. 57-38-30.3(2)(d); inputs nd_pit_2026_federal_net_long_term_capital_gain and nd_pit_2026_allocated_qualified_dividends_taxed_below_regular_rates; companion test federal capital loss offset precedes north dakota allocation cap).
    • us-wa:statutes/82/82.87/82/87/040#washington_capital_gains_excise_tax (entity Person).
  • So no module pools a dependent's income. Vermont's 32 V.S.A. 5811(21) is not encoded: us-vt:policies/income_tax/pilot_liability_pipeline takes completed normal tax.
  • The missing piece is 26 U.S.C. 1(g)(7), which California integration test #1424 queues.

🤖 Generated with Claude Code

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Overlap with #9898, which fixes the Maryland capital gains surtax base. It changes md_capital_gains_surtax to 2% of IRC 1222(11) net capital gain (via a new md_net_capital_gain), tests federal AGI against the threshold, and leaves dependents out of every input, as this PR does.

@MaxGhenis
MaxGhenis force-pushed the dependent-capital-income-state-lines branch 2 times, most recently from 7e433ee to b195db5 Compare October 12, 2026 11:55
MaxGhenis and others added 9 commits October 12, 2026 08:57
…turn

A tax unit dependent's interest, dividends and capital gains are on the
dependent's own return, and federal adjusted gross income (irs_gross_income)
leaves them out. State lines that adjust the filers' federal AGI or taxable
income summed them over every member, so a child's dividends, gains or
interest moved the parents' state tax.

Count only the head and spouse (tax_unit_non_dep_add, or a dependent mask on
per-person lines) in AZ, DC, DE, IA, IL, MA, MD, ME, MN, MT, ND, NH, OH, PA,
SC, UT, VA, VT, WA, WI and WV, and in us_govt_interest, which most states
subtract.

In formulas edited anyway: North Dakota's net long-term capital gain
exclusion is floored at zero and includes capital gain distributions (Form
ND-1 line 6 worksheet); Utah's retirement credit counts only the head and
spouse as claimants; the West Virginia low-income family credit cites W. Va.
Code 11-21-22a(d).

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

The Montana and Utah Social Security credit cases now carry the exact
half-cent amounts (1,765.725, 1,847.725 and 259.475) instead of values
rounded past the 0.001 margin.

In two existing Utah retirement credit cases person2 (age 64) is a tax unit
dependent, so their tax-exempt interest is on their own return and no longer
enters the modified AGI: 750 instead of 737.5, and 675 instead of 662.5.

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

From the independent review of the first commit:

- Alabama AGI sums every member's interest, so it now also subtracts
  dependents_us_govt_interest (new, next to us_govt_interest, for state
  income definitions that count dependents' income). Without it the
  filer-only us_govt_interest left a dependent's U.S. government interest
  taxed (parent wages 100,000, child 5,000 of Treasury interest: AL AGI
  105,000 instead of 100,000).
- Virginia's National Guard subtraction leaves a dependent's pay out of both
  the cap and the per-person shares, so the filer keeps the full amount.
- Michigan's senior interest, dividends and capital gains deduction counts
  only the head's and spouse's income (MCL 206.30(1)(p): "included in
  adjusted gross income").
- Missouri's capital gains subtraction takes a dependent's gains out of
  net_capital_gains, and its per-person split allocates among the head and
  spouse only.

The Utah retirement credit case with SINGLE status now names its roles
(one head, two dependents), and the property test drops the Vermont
restriction now that #9855 is on main.

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

From the second independent review:

- Iowa's reportable Social Security worksheet adds one-half of the benefits
  (line 2) before the base amount, as both the 2021 and 2022 IA 1040
  worksheets do. The first test's 4,000 came from the formula; the
  worksheet gives 14,000.
- Missouri subtracts the filers' positive Form 1040 line 7a
  (filer_loss_limited_net_capital_gains), so capital gain distributions
  count, a loss nets against them, and a supplied tax unit amount less the
  dependents' gains is kept and goes to the head.
- Vermont's percentage exclusion limits eligible gains to the filers' net
  gain (Schedule IN-153 line 15 starts from Part I line 4). The eligible
  gains input is now documented as part of long_term_capital_gains, and two
  cases that set it alone now set both.
- California's young child tax credit measures the filers' own net loss, so
  a child's capital loss no longer takes the parent's credit.
- Virginia caps National Guard pay per person (Va. Code 58.1-322.02(8),
  "received by any person"), so two qualifying spouses subtract up to
  $5,500 each.

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>
…E and MT lines

From the third independent review:

- Vermont's percentage exclusion nets eligible gains against Schedule
  IN-153 Part I line 4 built from the filers' Schedule D lines 15, 16, 18
  and 19, before the Form 4952 election, then takes off the election's
  share on gains (lines 5-7 and 16: line 4g x 4e / (4b + 4e)). A 100,000
  eligible gain with 100,000 of qualified dividends and a 100,000 election
  now gives 20,000, as the form does.
- Virginia's Guard subtraction defaults to each filer's capped pay summed,
  and the per-person split shares the unit amount by capped pay, so a
  supplied unit amount (such as the 39-day limit) is allocated again.
- New filer_loss_limited_net_capital_gains_person allocates the filers'
  loss-limited gains among the head and spouse only. Georgia's retirement
  exclusion and Delaware's pension exclusion use it, so a dependent's loss
  no longer reduces an eligible filer's gains (IT-511: "Income or losses
  should be allocated to the person who owns the item").
- Montana's separate-return AGI no longer adds a dependent's Montana amounts
  to the head's, as the joint branch already leaves them out; the two cases
  that expected that allocation now expect the head's own amounts.
- The Montana Social Security worksheet cases use wages instead of a
  pension, whose Montana exemption the worksheet does not apply.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the dependent-capital-income-state-lines branch from a0c05af to fa64576 Compare October 12, 2026 12:57
MaxGhenis added a commit that referenced this pull request Oct 13, 2026
…gelog

- ca_agi_subtractions: tax-unit-level items such as us_govt_interest are added
  as they are (#9894 makes that one filer-only).
- WI Schedule SB worksheet is on file page 3 in 2021 and page 2 in 2022; the
  RI reference is the individual 2022 Schedule M, not the RI-1041's.
- The changelog also names California's state tax refund subtraction.

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.

1 participant