Skip to content

Use loss-limited net capital gain in Delaware pension exclusion basket#8852

Open
PavelMakarchuk wants to merge 2 commits into
mainfrom
fix-de-pension-exclusion-loss-limit
Open

Use loss-limited net capital gain in Delaware pension exclusion basket#8852
PavelMakarchuk wants to merge 2 commits into
mainfrom
fix-de-pension-exclusion-loss-limit

Conversation

@PavelMakarchuk

Copy link
Copy Markdown
Collaborator

Summary

The Delaware pension exclusion eligible-retirement-income basket
(de_pension_exclusion_income, via
gov.states.de.tax.income.subtractions.exclusions.pension.income_sources)
summed the raw, unlimited capital_gains variable (short-term + long-term
net, with no loss limit). A large capital loss flowed in at full magnitude,
drove each spouse's basket sharply negative, and min(cap, max(0, eligible_income))
in de_pension_exclusion then clamped the whole exclusion to $0 — even for a
60+ filer with far more than $12,500 of otherwise-eligible interest/dividends/pensions.

This PR replaces capital_gains with the person-level, federally loss-limited
variable loss_limited_net_capital_gains_person.

Why raw capital gains is wrong here

Delaware taxable income begins with federal AGI. By IRC § 1211(b) a joint
filer's deductible net capital loss is capped at −$3,000/year (excess carries
forward), so no Delaware PIT-RES return ever reflects a multi-million-dollar loss.

The 2025 Form PIT-RES, Line 6 pension-exclusion worksheet defines eligible
retirement income to include "capital gains net of capital losses" — the figure
as it appears on the return, i.e. the federal Schedule D loss-limited net, not the
raw unlimited sum of transactions. Delaware does not decouple from the § 1211 limit.
A capital loss can therefore reduce the basket by at most $3,000 and cannot wipe out
an otherwise-eligible balance exceeding $12,500.

Statutory / form basis:

  • 30 Del. C. § 1106(b)(3) — up to $12,500 exclusion for age 60+ on pensions and
    eligible retirement income (dividends, capital gains, interest, rental income,
    qualified plans).
  • 2025 Form PIT-RES, Line 6 worksheet — "capital gains net of capital losses."
  • IRC § 1211(b) — −$3,000 net capital loss limit for a joint filer.

PR #8502 (issue #8501) fixed only the bleed of a negative exclusion into other DE
subtractions; it left the raw, unlimited capital_gains in the basket. This PR
addresses that residual.

Impact (originating TAXSIM case, out2psl/916)

DE joint, primary age 75, spouse age 40, TY 2025: ~$85,793 interest, a large net
capital loss, spouse $10,000 wages.

System DE income tax Head pension exclusion
PolicyEngine (before) $3,547.51 $0
PolicyEngine (after) $2,860.25 $12,500
TAXSIM-35 $2,885.17 $12,500
TaxAct ≈$2,851 $12,500

§ 1211 limits the joint net capital loss to −$3,000, so the basket
(≈$85,793 interest − $3,000) is well above the $12,500 cap and the filer keeps the
full exclusion.

Tests

  • Corrected the existing de_pension_exclusion.yaml test that encoded the buggy
    $0 behavior from a raw −$1.4M loss (a loss that cannot appear on a DE return) to
    the loss-limited treatment (full $12,500 exclusion).
  • Added an integration test: DE 60+ filer with a large capital loss and interest
    above the cap → de_pension_exclusion: [12_500, 0].
  • policyengine-core test .../de_pension_exclusion.yaml -c policyengine_us: 8 passed.

Originating TAXSIM issue: PolicyEngine/policyengine-taxsim#916

Fixes #8836.

🤖 Generated with Claude Code

The Delaware pension exclusion eligible-retirement-income basket summed
the raw, unlimited capital_gains variable. A large capital loss could
therefore drive each spouse's basket sharply negative and clamp the
exclusion to $0, even with ample eligible interest/dividends/pensions.

Delaware taxable income begins with federal AGI, where IRC 1211(b) caps
a joint filer's deductible net capital loss at -$3,000. PIT-RES Line 6
counts "capital gains net of capital losses" as it appears on the return,
i.e. the federally loss-limited figure. Swap capital_gains for the
person-level loss_limited_net_capital_gains_person.

Fixes #8836.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI requires the newly-added fragment to be a flat changelog.d/<name>.<type>.md
file, not a changelog.d/fixed/<n>.md subdirectory path.

Co-Authored-By: Claude Opus 4.8 <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.

Delaware pension exclusion: eligible-retirement-income basket uses raw (unlimited) capital gains instead of the federally loss-limited net capital gain

1 participant