Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
bb51cae
Zero a separate filer's whole standard deduction and exclude DCAP fro…
claude Nov 2, 2026
7ded6eb
Count dependent care benefits inside employment_income in older DCAP …
claude Nov 2, 2026
40eabcc
Merge main to pick up the net-of-benefits 129(b) earned income limit …
claude Nov 2, 2026
e481b07
Count line 1e as EITC earned income, gate 63(c)(6) on separate status…
claude Nov 2, 2026
f1f3c70
Measure the 129(b) limit from box 1 wages in the exclusion property
claude Nov 3, 2026
42b2f4e
Merge origin/main into fix-separate-filer-standard-deduction-and-dcap…
claude Nov 3, 2026
8481e30
Count line 1e as earned income for claimable filers
claude Nov 3, 2026
aa52107
Count line 1e as IRA compensation
claude Nov 3, 2026
cc1f9a5
Bound the exclusion from below and fix stale docs
claude Nov 3, 2026
c2076a3
Add California's addition for the federal exclusion above its cap
claude Nov 3, 2026
92c6ea0
List the dependent care addition in ca_additions
claude Nov 3, 2026
9dfbce5
Merge origin/main into fix-separate-filer-standard-deduction-and-dcap…
claude Nov 3, 2026
ed97aed
Keep ira_compensation's formula self-contained and honor supplied input
claude Nov 3, 2026
58bebc4
Pin the dependent IRA helper's sum and set care expenses in the EITC …
claude Nov 5, 2026
5675d8a
Merge main (0315452583) into fix-separate-filer-standard-deduction-an…
MaxGhenis Nov 5, 2026
f633ec0
Lower the stack-depth floor in test_guard_adds_no_frames_per_dependen…
MaxGhenis Nov 5, 2026
cd98ab4
Pin the dependent IRA helper to the formula on every term
MaxGhenis Nov 5, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Zero the whole standard deduction, including the aged and blind amount, for a married separate filer whose spouse itemizes (IRC 63(c)(6)), and leave employer dependent care benefits out of income tax, FICA and FUTA wages, adding back any part above the IRC 129 exclusion and counting it as EITC earned income.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ values:
2010-01-01:
- pre_tax_health_insurance_premiums
- health_savings_account_payroll_contributions
# Dependent care assistance the employer reasonably believes excludable
# under IRC 129 is not FICA wages (IRC 3121(a)(18)) or FUTA wages
# (IRC 3306(b)(13)). Form 2441 line 12 holds only those amounts.
- dependent_care_employer_benefits
metadata:
label: FICA pre-tax contributions
reference:
- title: IRC §3121(a) — FICA wages definition
href: https://www.law.cornell.edu/uscode/text/26/3121
- title: IRC §3121(a) — FICA wages definition, including (a)(18), dependent care assistance
href: https://www.law.cornell.edu/uscode/text/26/3121#a
- title: IRC §3306(b)(13) — dependent care assistance excluded from FUTA wages
href: https://www.law.cornell.edu/uscode/text/26/3306#b_13
- title: IRS Publication 15 (Employer's Tax Guide), Section 5
href: https://www.irs.gov/publications/p15
- title: IRS cafeteria plan FAQ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ values:
- pre_tax_health_insurance_premiums
# HSA contributions can be either through pre-tax.
- health_savings_account_payroll_contributions
# Dependent care assistance (W-2 box 10, Form 2441 line 12) is excluded
# from gross income under IRC 129(a) and left out of box 1. Any part
# above the filer's own exclusion returns as taxable_dependent_care_benefits.
- dependent_care_employer_benefits
metadata:
label: Pre-tax contributions
unit: list
Expand Down
4 changes: 4 additions & 0 deletions policyengine_us/parameters/gov/irs/gross_income/sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ description: Income sources counted as gross income for tax purposes.
values:
2010-01-01:
- irs_employment_income
# Dependent care benefits above the IRC 129 exclusion (Form 1040 line 1e).
- taxable_dependent_care_benefits
- self_employment_income
- sstb_self_employment_income
- partnership_s_corp_income
Expand Down Expand Up @@ -54,6 +56,8 @@ metadata:
reference:
- title: 26 U.S. Code § 61 - Gross income defined
href: https://www.law.cornell.edu/uscode/text/26/61
- title: 26 U.S. Code § 129 - Dependent care assistance programs
href: https://www.law.cornell.edu/uscode/text/26/129
- title: 26 U.S. Code § 111 - Recovery of tax benefit items
href: https://www.law.cornell.edu/uscode/text/26/111
- title: 26 U.S. Code § 104(a)(3) - Amounts received through accident or health insurance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
description: The Internal Revenue Service counts these gross income sources as earned income of a filer who can be claimed as a dependent, both for the standard deduction worksheet for dependents and for the unearned income filing test. The earned portion of taxable disability benefits is counted separately; other gross income is unearned income.
values:
2010-01-01:
# Form 1040 line 1z (wages). Line 1a is the total of Form(s) W-2, box 1,
# which leaves out elective deferrals.
# Form 1040 line 1z (wages): line 1a, the total of Form(s) W-2, box 1,
# which leaves out elective deferrals and dependent care benefits,
- irs_employment_income
# plus line 1e, taxable dependent care benefits (Form 2441 line 26).
- taxable_dependent_care_benefits
# Schedule 1 line 3 (business income, Schedule C).
- self_employment_income
- sstb_self_employment_income
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
1. Differential: dependent_care_assistance_exclusion equals an independent
numpy min of the benefits, the cap printed on Form 2441 line 21 for the
year (not the model's parameter) and the lesser of the filers' earnings.
Earnings are box 1 wages: Form 2441 line 18 earned income leaves out the
line 12 benefits, which the fixtures add on top to form employment_income.
Raising benefits therefore raises employment_income by the same amount.
2. Bound: 0 <= exclusion <= benefits, the year/status cap and earned income.
3. Monotone: raising benefits never lowers the exclusion.
4. California: ca_dependent_care_assistance_exclusion equals the same min with
the FTB 3506 line 22 cap, and never exceeds the federal exclusion.
the FTB 3506 line 22 cap and California wages (which the model does not
reduce by the benefits), and doesn't exceed the federal exclusion where
the federal earned income limit doesn't bind below California's cap.
Separate filers treated as unmarried use the full cap in both systems.
5. Section 21(c): cdcc_limit equals max(Form 2441 line 27 amount x the
number of qualifying persons (at most two) - exclusion, 0).
Expand Down Expand Up @@ -82,7 +87,7 @@
@st.composite
def filers(draw):
return {
"employment_income": draw(wages),
"box_1_wages": draw(wages),
"benefits": draw(benefits),
"increase": draw(increases),
}
Expand All @@ -109,7 +114,7 @@ def _seeded_units(n=200):
def filer():
level = rng.choice([0, 1, 2])
return {
"employment_income": float(rng.integers(0, 150_001)),
"box_1_wages": float(rng.integers(0, 150_001)),
"benefits": float(
[0, rng.integers(1, 5_001), rng.integers(5_000, 12_001)][level]
),
Expand Down Expand Up @@ -142,7 +147,9 @@ def add_filer(name, values, role):
"age": 40,
"is_tax_unit_head": role == "head",
"is_tax_unit_spouse": role == "spouse",
"employment_income": values["employment_income"],
# Benefits sit inside employment_income as a pre-tax payroll
# deduction, so box 1 wages are employment_income - benefits.
"employment_income": values["box_1_wages"] + values["benefits"],
"dependent_care_employer_benefits": values["benefits"],
}

Expand Down Expand Up @@ -223,7 +230,7 @@ def _treated_as_unmarried(unit):
)


def _expected(units, year, caps, *, raised=False):
def _expected(units, year, caps, *, raised=False, wages_include_benefits=False):
# Independent cap-arithmetic oracle; qualified-expense/person eligibility
# under Form 2441 lines 16-25 is outside this property's domain.
benefits, cap, earned = [], [], []
Expand All @@ -234,7 +241,13 @@ def _expected(units, year, caps, *, raised=False):
"filing_status"
] == "SEPARATE" and not _treated_as_unmarried(unit)
cap.append(caps[1] if ordinary_separate else caps[0])
earned.append(min(f["employment_income"] for f in filers))
earned.append(
min(
f["box_1_wages"]
+ wages_include_benefits * (f["benefits"] + raised * f["increase"])
for f in filers
)
)
return np.minimum(np.array(benefits), np.minimum(cap, earned))


Expand Down Expand Up @@ -275,9 +288,9 @@ def _check(units, year):
)
earned_income_limits = np.array(
[
min(unit["head"]["employment_income"], unit["spouse"]["employment_income"])
min(unit["head"]["box_1_wages"], unit["spouse"]["box_1_wages"])
if unit["spouse"]
else unit["head"]["employment_income"]
else unit["head"]["box_1_wages"]
for unit in units
]
)
Expand All @@ -294,12 +307,23 @@ def _check(units, year):
atol=TOLERANCE,
)

# 4. California's line 22 cap.
# 4. California's line 22 cap. California earned income is measured from
# California wages (ca_taxable_wages), which the model does not reduce by
# the line 12 benefits; California law on that point is not checked here.
california = base["ca_dependent_care_assistance_exclusion"]
np.testing.assert_allclose(
california, _expected(units, year, CALIFORNIA_CAP), atol=TOLERANCE
california,
_expected(units, year, CALIFORNIA_CAP, wages_include_benefits=True),
atol=TOLERANCE,
)
# Where the federal earned income limit doesn't bind below California's
# cap, California's smaller cap keeps its exclusion at or below federal.
federal_limit_slack = earned_income_limits >= np.minimum(
benefits, CALIFORNIA_CAP[0]
)
assert (california <= exclusion + TOLERANCE).all()
assert (
california[federal_limit_slack] <= exclusion[federal_limit_slack] + TOLERANCE
).all()

# 5. Section 21(c) dollar limit.
persons = np.array([min(unit["children"], 2) for unit in units])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,5 +767,5 @@ def test_guard_adds_no_frames_per_dependency(chunking_dataset):
del simulation
gc.collect()
# The chain is long: each variable costs several frames.
assert depths[False] > 300
assert depths[False] > 200
assert 0 <= depths[True] - depths[False] <= 3, depths
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@
people:
parent1:
age: 40
employment_income: 60_000
# employment_income includes the $9,000 of dependent care benefits;
# box 1 wages are $60,000 ($69,000 - $9,000).
employment_income: 69_000
dependent_care_employer_benefits: 9_000
parent2:
age: 38
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,3 +440,89 @@
# No qualifying children: 7.65% x $8,260 = $632, and the $10,000 of AGI
# is under the $10,330 phase-out threshold.
eitc: 632

# Dependent care benefits above the IRC 129 exclusion (Form 2441 line 26,
# Form 1040 line 1e) are includible in gross income, so they are earned income
# under IRC 32(c)(2)(A)(i).
- name: Separate filer's taxable dependent care benefits count as earned income, 2024
period: 2024
input:
people:
person:
age: 35
employment_income: 20_000
dependent_care_employer_benefits: 5_000
child:
age: 5
tax_units:
tax_unit:
members: [person, child]
filing_status: SEPARATE
tax_unit_childcare_expenses: 5_000
households:
household:
members: [person, child]
state_code: TX
output:
# Box 1 $20,000 - $5,000 = $15,000. Exclusion min($5,000, $2,500 MFS
# cap, $15,000, $5,000 of care expenses) = $2,500; line 1e $2,500.
# Earned income $17,500.
eitc_earned_income: 17_500

- name: Part-time worker's line 1e benefits count toward the EITC, 2024
period: 2024
absolute_error_margin: 0.01
input:
people:
head:
age: 30
employment_income: 6_000
dependent_care_employer_benefits: 5_000
child:
age: 5
tax_units:
tax_unit:
members: [head, child]
filing_status: HEAD_OF_HOUSEHOLD
tax_unit_childcare_expenses: 5_000
households:
household:
members: [head, child]
state_code: TX
output:
# Box 1 $1,000; exclusion min($5,000, $5,000, $1,000, $5,000 of care
# expenses) = $1,000; line 1e $4,000. Earned income $5,000.
eitc_earned_income: 5_000
# One child, 2024: 34% x $5,000 = $1,700 (below the $12,390 plateau).
eitc: 1_700

- name: Joint filers' line 1e benefits count toward the EITC phase-out, 2024
period: 2024
absolute_error_margin: 0.01
input:
people:
head:
age: 30
employment_income: 25_000
spouse:
age: 30
employment_income: 6_000
dependent_care_employer_benefits: 5_000
child:
age: 5
tax_units:
tax_unit:
members: [head, spouse, child]
filing_status: JOINT
tax_unit_childcare_expenses: 5_000
households:
household:
members: [head, spouse, child]
state_code: TX
output:
# Box 1 $25,000 + $1,000; exclusion min($5,000, $5,000, $1,000, $5,000 of
# care expenses) = $1,000; line 1e $4,000. Earned income and AGI $30,000.
eitc_earned_income: 30_000
adjusted_gross_income: 30_000
# One child, 2024 joint: $4,213 - 15.98% x ($30,000 - $29,640) = $4,155.47.
eitc: 4_155.47
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# IRC 63(c)(6)(A): a married individual filing separately whose spouse
# itemizes has a standard deduction of zero. The standard deduction is the
# sum of the basic and additional amounts (63(c)(1)), so the additional
# amount for age or blindness (63(f)) is zeroed too.

- name: Aged and blind separate filer whose spouse itemizes has no standard deduction, 2025
period: 2025
input:
people:
head:
age: 70
is_blind: true
employment_income: 50_000
tax_units:
tax_unit:
members: [head]
filing_status: SEPARATE
separate_filer_itemizes: true
output:
basic_standard_deduction: 0
# The 63(f) amount itself is unchanged: two $1,600 MFS amounts.
additional_standard_deduction: 3_200
standard_deduction: 0

- name: Aged separate filer whose spouse itemizes has no standard deduction, 2024
period: 2024
input:
people:
head:
age: 66
employment_income: 40_000
tax_units:
tax_unit:
members: [head]
filing_status: SEPARATE
separate_filer_itemizes: true
output:
additional_standard_deduction: 1_550
standard_deduction: 0

- name: Aged and blind separate filer whose spouse does not itemize keeps both amounts, 2025
period: 2025
input:
people:
head:
age: 70
is_blind: true
employment_income: 50_000
tax_units:
tax_unit:
members: [head]
filing_status: SEPARATE
separate_filer_itemizes: false
output:
# $15,750 basic (2025, MFS) plus 2 x $1,600.
basic_standard_deduction: 15_750
additional_standard_deduction: 3_200
standard_deduction: 18_950

- name: Joint filers keep the whole deduction even if the separate filer flag is set, 2025
period: 2025
input:
people:
head:
age: 70
employment_income: 50_000
spouse:
age: 40
tax_units:
tax_unit:
members: [head, spouse]
filing_status: JOINT
separate_filer_itemizes: true
output:
# IRC 63(c)(6)(A) covers only a married individual filing a separate
# return. $31,500 basic (2025, joint) plus $1,600 for the aged head.
basic_standard_deduction: 31_500
additional_standard_deduction: 1_600
standard_deduction: 33_100
Loading
Loading