Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/lpl-income-tax-rules.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add federal early-distribution tax, missed-RMD excise, California 2.5% early-distribution tax, section 1256 60/40, home sale exclusion, savings bond education exclusion, long-term care per diem limit, annuity exclusion ratio and Simplified Method, and lot-level holding-period, wash-sale, RIC loss and bond discount rules.
1 change: 1 addition & 0 deletions changelog.d/state-govt-fund-dividends.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add California, Connecticut and New York subtractions for mutual fund dividends attributable to U.S. government obligations, with per-fund quarterly 50% asset tests.
2 changes: 2 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ parts:
- file: usage/microsimulation
- file: usage/chunked-calculations
- file: usage/parameter-discovery
- file: usage/us-govt-fund-dividends
- file: usage/lpl-income-tax-rules
- file: usage/social-security-calculator
sections:
- file: usage/social-security/RULINGS
Expand Down
148 changes: 148 additions & 0 deletions docs/usage/lpl-income-tax-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Retirement, capital gain and lot-level income tax rules

These rules were added for portfolio simulations that compute 2026 individual
income tax. Every new input defaults to zero or false, so callers that omit
them get the same results as before.

## How results reach the tax calculation

| Result | Reaches the tax calculation |
|---|---|
| Early-distribution tax, missed-RMD excise | `form_5329_additional_taxes`, added beside `qualified_retirement_penalty` in federal tax (and in Iowa's federal tax deduction) |
| California 2.5% / 6% | `ca_early_distribution_additional_tax`, added to California tax before refundable credits |
| Long-term gains (60% of §1256, home sale gain, long-term lot results) | `long_term_capital_gain_adjustments`, part of `long_term_capital_gains` |
| Annuities, Simplified Method, LTC per diem | new federal gross income sources |
| Savings bond exclusion | formula for the existing `us_bonds_for_higher_ed` deduction |
| Short-term gains, dividend reclassification, bond interest | `apply_investment_lot_adjustments` (see below) |

`short_term_capital_gains`, the dividend inputs and `taxable_interest_income`
are plain inputs that datasets uprate, so a formula cannot add to them. Call
`policyengine_us.tools.investment_lots.apply_investment_lot_adjustments(situation, year)`
before `Simulation(situation=...)`; it computes `short_term_capital_gain_adjustments`,
`investment_lot_interest_adjustment`, `dividends_failing_qualified_holding_period`
and `section_199a_dividends_failing_holding_period` and folds them into those
inputs.

A caller that sets `long_term_capital_gains` directly replaces its formula,
including the adjustments; set `long_term_capital_gains_before_response`
instead. A caller that sets `qualified_retirement_penalty` should leave the
Form 5329 inputs empty.

## Rules

**Early distributions (IRC 72(t), 72(q); Form 5329 Part I).** 10% of early
plan and IRA distributions, 25% for SIMPLE IRA distributions in the first two
years, 10% of premature annuity distributions, less exceptions. The simulator
decides which exception applies; PolicyEngine applies the caps: first-time
homebuyer $10,000 lifetime, birth or adoption $5,000 per child, emergency
$1,000 a year, domestic abuse $10,500 (2026, Notice 2025-67), disaster
$22,000 per disaster, medical expenses above the AGI floor. Inputs:
`early_distributions_from_retirement_plans`,
`early_distributions_from_simple_ira_first_two_years`,
`early_distributions_from_annuity_contracts` and the `early_distribution_*`
exception fields. These are memo amounts already in the retirement income
inputs. `early_withdrawal_penalty` remains the CD penalty deduction only.

**California (R&TC 17085(c); FTB 3805P).** 2.5% of the federal base, and 6% of
the SIMPLE two-year base. `ca_early_distributions_not_excepted_in_california`
carries amounts California does not except (529-to-Roth, IRA-to-HSA,
qualified recovery assistance distributions).

**Required minimum distributions (IRC 401(a)(9), 4974).** Applicable age
73 for people born 1951–1959 and 75 from 1960 (IRC 401(a)(9)(C)(v)). The
divisor is the Uniform Lifetime Table (Treas. Reg. 1.401(a)(9)-9(c)) or an
override for the Joint and Last Survivor Table. QLACs are excluded if total
premiums are within $210,000 (2026). The first year can be deferred to
April 1, and the still-working exception applies to employer plans. IRA and
employer-plan shortfalls are measured separately. The excise is 25% of the
shortfall, or 10% if corrected timely, less any waiver. Beneficiary RMDs
come in as amounts (`rmd_inherited_*`).

**Section 1256 contracts.** `section_1256_net_gain` (Form 6781 line 7,
including year-end mark-to-market) is split 60% long-term and 40% short-term.

**Home sale (IRC 121).** $250,000 exclusion, or $500,000 for a married couple
when the spouse meets the use test. Other features:
- ownership and use of 24 of the last 60 months each;
- the two-year bar on a second exclusion;
- the reduced exclusion for job, health or unforeseen-circumstance moves;
- no exclusion for the nonqualified-use share or for depreciation after
May 6, 1997.

The depreciation part should also go in
`unrecaptured_section_1250_gain_before_losses`.

**Savings bonds (IRC 135; Form 8815).** Interest × (qualified expenses ÷
proceeds), phased out over $101,800–$116,800 of modified AGI ($152,650–$182,650
joint) in 2026, and none on separate returns. Modified AGI leaves out taxable
Social Security, which PolicyEngine computes from an AGI that already includes
the exclusion. `savings_bond_education_exclusion_magi_override` supplies an
exact figure. Treasury parameters record the $10,000 annual purchase limit and
the 3-month interest forfeiture before 5 years. Interest deferral is the
simulator's choice of when to report interest. Excluded bond interest should
be removed from `us_govt_interest_person`, so states do not subtract it again.

**Long-term care per diem (IRC 7702B(d); Form 8853 Section C).** Per diem
benefits above the greater of $430 × days (2026) and actual costs, less
reimbursements, are taxable.

**Annuity contracts (IRC 72(b), (c), (e)).** Three slots per person,
`annuity_contract_<n>_*`:
- exclusion ratio of investment ÷ expected return;
- the exclusion stops once the investment is recovered, for starting dates
after 1986;
- withdrawals are taxed income first, after any pre-August 14, 1982
investment;
- partial annuitization splits the investment.

Contracts aggregated under IRC 72(e)(12) go in one slot. A 1035 exchange is
not a taxable event: carry the investment into the new slot. The Simplified
Method (IRC 72(d)) covers qualified-plan annuities with after-tax cost. Neither
may also be reported in `taxable_pension_income`.

**Lot-level rules.** Five slots of each kind per person. Sales and bond
gains entered here must be left out of the aggregate gain inputs. Dividend
lots describe dividends already in the dividend inputs.
- Qualified dividend holding period: more than 60 days in the 121-day window
(90 days of 181 for long-period preferred). For section 199A REIT
dividends, more than 45 days of 91. Days held must exclude hedged days.
- Wash sales (IRC 1091): substantially identical purchases within 30 days
before or after a loss sale disallow the matching share of the loss. An
IRA purchase disallows it permanently (Rev. Rul. 2008-5). The deferred
amount (`wash_sale_disallowed_loss_deferred`) must be added to the
replacement basis by the simulator.
- RIC shares held six months or less (IRC 852(b)(4)): the loss is disallowed
up to exempt-interest dividends (not for daily-dividend funds), then is
long-term up to capital gain dividends.
- Bonds: OID under the constant-yield method (zero if de minimis), reduced by
any acquisition premium fraction; ratable market discount, as interest at
sale or currently by election; and bond premium amortization under IRC 171.

## Not modeled

- **Federal 10% tax:** whether a distribution meets an exception is the
simulator's decision; the domestic-abuse 50%-of-balance limit is also left
to it.
- **California exceptions:** which SECURE Act exceptions California has
adopted (birth or adoption, for example) is not certain; amounts California
does not except go in the California-only input.
- **Required minimum distributions:**
- beneficiary RMD computation;
- the pre-2022 Uniform Lifetime Table (earlier years use the 2022 table);
- 403(b) aggregation beyond one combined group.
- **Annuities:**
- expected return from the Treas. Reg. 1.72-9 tables;
- the deduction for unrecovered investment at death;
- the IRC 72(s) distribution-at-death rules.
- **Bonds:**
- constant-yield market discount;
- premium amortization computation;
- tax-exempt bond premium;
- short-term obligations.
- **Lot rules:** straddles, constructive sales, and wash sales across spouses.
- **Not income tax (left out):**
- state annuity premium taxes;
- estate, inheritance and gift taxes;
- crypto broker reporting;
- withholding, MEC 7-pay and Table V;
- product charges.
96 changes: 96 additions & 0 deletions docs/usage/us-govt-fund-dividends.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Fund dividends from U.S. government obligations

Federal law bars states from taxing interest on U.S. government obligations
(31 U.S.C. § 3124). A shareholder who receives that interest through a
regulated investment company (a mutual fund, ETF or money market fund) gets
the exemption only as each state's law passes it through. California,
Connecticut and New York pass it through only for a fund that holds at least
50% of the value of its total assets in qualifying obligations **at the close
of each quarter of the fund's taxable year**. PolicyEngine models that test
fund by fund.

## Rules modeled

| State | Subtraction | Asset test | Line |
|---|---|---|---|
| California | `ca_us_govt_fund_dividend_subtraction` | ≥ 50% of total assets in obligations exempt from California tax at each quarter-end; a qualified fund of funds (IRC 852(g)(2)) is exempt from the test from 2011 | Schedule CA (540), line 2, column B |
| Connecticut | `ct_us_govt_fund_dividend_subtraction` | ≥ 50% of total assets (IRC 851(c)(4)) in obligations that federal law bars states from taxing, at each quarter-end | CT-1040, line 40 |
| New York | `ny_us_govt_fund_dividend_subtraction` | ≥ 50% of total assets in U.S. obligations at each quarter-end | IT-201, line 28 |

Sources: Cal. Rev. & Tax. Code § 17145; Conn. Gen. Stat. § 12-718 and Conn.
Agencies Regs. § 12-701(a)(20)-3; N.Y. Tax Law § 612(c)(1) and TSB-M-92(4)I.

Direct holdings of U.S. obligations stay on `us_govt_interest_person` (or
`us_govt_interest`), which every state already subtracts. Do not put fund
dividends there: each subtraction is counted once, from its own input.

## Inputs per fund

Each person has 10 fund slots, `us_govt_fund_1_*` to `us_govt_fund_10_*`.
Use one slot per fund held in a taxable account and never merge funds.

| Field | Type | Meaning |
|---|---|---|
| `us_govt_fund_<n>_ordinary_dividends` | USD | Ordinary dividends from the fund (Form 1099-DIV box 1a; no capital gain distributions). A memo of dividends already in `qualified_dividend_income` / `non_qualified_dividend_income`; it adds no income. |
| `us_govt_fund_<n>_govt_income_share` | 0–1 | Share of the fund's ordinary dividends from U.S. government obligations, from the issuer's annual tax supplement. Sets the amount only. |
| `us_govt_fund_<n>_govt_asset_share_q1` … `_q4` | 0–1 | Share of total assets in qualifying U.S. government obligations at the close of each quarter of the fund's taxable year. Sets eligibility only. |
| `us_govt_fund_<n>_asset_test_evidence` | enum | `QUARTERLY_ASSET_SHARES` (default), `ISSUER_CONFIRMED_MET` or `ISSUER_CONFIRMED_NOT_MET`. |
| `us_govt_fund_<n>_qualified_fund_of_funds` | bool | Qualified fund of funds; used only by California. |

Subtraction per fund = `ordinary_dividends × govt_income_share` if the fund
passes the state's test, else 0. The person's total is capped at
`ordinary_dividend_income`, and dependents' amounts stay off the filer's
return.

### Using an issuer's annual tax supplement

Issuers publish a "percentage of income from U.S. government obligations"
table each January or February. Use it this way:

1. `govt_income_share` = the fund's percentage for the calendar year, as a
fraction (98.67% → `0.9867`).
2. If the supplement states that the fund met the California, Connecticut
and New York 50% requirement, set `asset_test_evidence` to
`ISSUER_CONFIRMED_MET`. If it marks the fund as not meeting it (often an
asterisk), set `ISSUER_CONFIRMED_NOT_MET`.
3. If the supplement says nothing about the test, supply the four quarter-end
asset shares from the fund's holdings reports (N-PORT, N-MFP or annual and
semi-annual reports) and leave the evidence at `QUARTERLY_ASSET_SHARES`.

The income percentage never establishes the asset test. A fund can report
more than 50% of income from U.S. obligations and still fail a quarter.

### What counts toward the asset share

Count U.S. Treasury bills, notes, bonds and savings bonds, and obligations of
agencies whose interest federal law exempts from state tax (for example
Federal Farm Credit Banks, Federal Home Loan Banks and the Tennessee Valley
Authority). Do not count repurchase agreements, even when Treasuries
collateralize them (NY TSB-M-88(5)I; Appeal of H. Lon Henry, Cal. SBE), or
Ginnie Mae, Fannie Mae and Freddie Mac securities (Conn. Agencies Regs.
§ 12-701(a)(20)-3). Measure at the close of each quarter of the **fund's**
taxable year, which need not be the calendar year.

California's asset base also counts California municipal obligations, and
Connecticut's counts territorial obligations. The slots carry U.S. government
obligations only, so for a fund that reaches 50% only with those holdings,
use the issuer's statement.

### Missing data

Every quarterly share defaults to 0, which fails the test. A fund with fewer
than four quarter-end shares, or with only an income share, gets no
subtraction. Supply the issuer's statement instead for a fund whose first
taxable year was shorter than four quarters.

## Example

`scripts/us_govt_fund_dividends_household.py` runs a New York household
through `Simulation` with two funds, one passing and one failing.

## Not modeled

States without a 50% asset test (most others) let shareholders subtract the
U.S. government share of fund dividends. They are not wired to these slots
yet. New Jersey's separate 80% "qualified investment fund" rule
(N.J.S.A. 54A:6-14.1) is also not modeled.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: The IRS excludes up to this amount of gain on the sale of a main home for each qualifying individual.
values:
1997-05-07: 250_000
metadata:
unit: currency-USD
period: year
label: Home sale gain exclusion
reference:
- title: 26 U.S. Code § 121
href: https://www.law.cornell.edu/uscode/text/26/121
- title: IRS Publication 523, Selling Your Home
href: https://www.irs.gov/publications/p523
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: The IRS excludes up to this amount of gain on the sale of a main home on a joint return when either spouse meets the ownership test, both meet the use test and neither excluded gain on another home in the prior two years.
values:
1997-05-07: 500_000
metadata:
unit: currency-USD
period: year
label: Home sale gain exclusion, joint return
reference:
- title: 26 U.S. Code § 121
href: https://www.law.cornell.edu/uscode/text/26/121
- title: IRS Publication 523, Selling Your Home
href: https://www.irs.gov/publications/p523
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: A person must own and use the home as a main home for at least this many months in the lookback window.
values:
1997-05-07: 24
metadata:
unit: month
period: year
label: Home sale exclusion ownership and use months required
reference:
- title: 26 U.S. Code § 121
href: https://www.law.cornell.edu/uscode/text/26/121
- title: IRS Publication 523, Selling Your Home
href: https://www.irs.gov/publications/p523
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: The IRS treats this share of the gain or loss on section 1256 contracts as long-term, and the rest as short-term, regardless of holding period.
values:
1981-06-23: 0.6
metadata:
unit: /1
period: year
label: Section 1256 contract long-term share
reference:
- title: 26 U.S. Code § 1256(a)(3)
href: https://www.law.cornell.edu/uscode/text/26/1256
- title: Instructions for Form 6781
href: https://www.irs.gov/forms-pubs/about-form-6781
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
description: Under the Simplified Method the IRS divides the cost in a qualified plan annuity by this expected number of monthly payments, by age at the annuity starting date (single-life annuities).
brackets:
- threshold:
1998-01-01: 0
amount:
1998-01-01: 360
- threshold:
1998-01-01: 56
amount:
1998-01-01: 310
- threshold:
1998-01-01: 61
amount:
1998-01-01: 260
- threshold:
1998-01-01: 66
amount:
1998-01-01: 210
- threshold:
1998-01-01: 71
amount:
1998-01-01: 160
metadata:
type: single_amount
threshold_unit: year
amount_unit: month
period: year
label: Simplified Method expected payments, single life
reference:
- title: 26 U.S. Code § 72(d)(1)(B)(iii)
href: https://www.law.cornell.edu/uscode/text/26/72#d_1_B
- title: IRS Publication 575, Simplified Method Worksheet, Table 1
href: https://www.irs.gov/publications/p575
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
description: Under the Simplified Method the IRS divides the cost in a qualified plan annuity paid over more than one life by this expected number of monthly payments, by the annuitants' combined ages at the starting date.
brackets:
- threshold:
1998-01-01: 0
amount:
1998-01-01: 410
- threshold:
1998-01-01: 111
amount:
1998-01-01: 360
- threshold:
1998-01-01: 121
amount:
1998-01-01: 310
- threshold:
1998-01-01: 131
amount:
1998-01-01: 260
- threshold:
1998-01-01: 141
amount:
1998-01-01: 210
metadata:
type: single_amount
threshold_unit: year
amount_unit: month
period: year
label: Simplified Method expected payments, more than one life
reference:
- title: 26 U.S. Code § 72(d)(1)(B)(iv)
href: https://www.law.cornell.edu/uscode/text/26/72#d_1_B
- title: IRS Publication 575, Simplified Method Worksheet, Table 2
href: https://www.irs.gov/publications/p575
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
description: The IRS excludes per diem payments under qualified long-term care insurance contracts and accelerated death benefits up to this amount per day, or actual long-term care costs if greater.
# Years before 2022 are not entered; earlier years use the 2022 amount.
values:
1997-01-01: 390
2023-01-01: 420
2024-01-01: 410
2025-01-01: 420
2026-01-01: 430
metadata:
unit: currency-USD
period: year
label: Long-term care per diem exclusion limit
reference:
- title: 26 U.S. Code § 7702B(d)
href: https://www.law.cornell.edu/uscode/text/26/7702B#d
- title: Rev. Proc. 2025-32 section 4.62
href: "https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=35"
- title: Instructions for Form 8853, Section C
href: https://www.irs.gov/instructions/i8853
Loading