From 42810775b6291955223e68ed1f846f090dea87bd Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 21 Nov 2026 20:51:04 +0100 Subject: [PATCH 1/2] Count Form 2441 lines 13 and 14 in employer dependent care benefits Form 2441 line 15 is line 12 plus grace-period carryovers used this year (line 13) less amounts forfeited or carried forward (line 14). The model used line 12 alone, so it taxed forfeited benefits and ignored carryovers. Two per-person inputs, both zero by default, carry lines 13 and 14; the federal exclusion, taxable_dependent_care_benefits and California's exclusion read the resulting line 15. A parameter keeps 2021 and 2022 as main computes them, since those years' relief rules are not modeled. Co-Authored-By: Claude Opus 5.5 --- .../fix-form-2441-carryover-forfeit.added.md | 1 + .../fix-form-2441-carryover-forfeit.fixed.md | 1 + docs/gov/irs/historical-validation.md | 8 +- .../prior_year_carryover_omitted.yaml | 24 +++ ...ndent_care_benefits_received_invariants.py | 189 ++++++++++++++++++ .../dependent_care_assistance_exclusion.yaml | 185 ++++++++++++++++- .../taxable_dependent_care_benefits.yaml | 172 ++++++++++++++++ .../al_federal_income_tax_deduction.yaml | 48 +++++ ...a_dependent_care_assistance_exclusion.yaml | 98 ++++++++- .../dependent_care_assistance_exclusion.py | 11 +- .../taxable_dependent_care_benefits.py | 15 +- .../ca_dependent_care_assistance_exclusion.py | 15 +- .../dependent_care_employer_benefits.py | 47 ++++- ...r_benefits_forfeited_or_carried_forward.py | 32 +++ ..._employer_benefits_prior_year_carryover.py | 28 +++ 15 files changed, 858 insertions(+), 16 deletions(-) create mode 100644 changelog.d/fix-form-2441-carryover-forfeit.added.md create mode 100644 changelog.d/fix-form-2441-carryover-forfeit.fixed.md create mode 100644 policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml create mode 100644 policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py create mode 100644 policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py create mode 100644 policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py diff --git a/changelog.d/fix-form-2441-carryover-forfeit.added.md b/changelog.d/fix-form-2441-carryover-forfeit.added.md new file mode 100644 index 00000000000..4f6d5f89a52 --- /dev/null +++ b/changelog.d/fix-form-2441-carryover-forfeit.added.md @@ -0,0 +1 @@ +Add the person-level inputs `dependent_care_employer_benefits_prior_year_carryover` (Form 2441 line 13, prior-year benefits used in the grace period) and `dependent_care_employer_benefits_forfeited_or_carried_forward` (Form 2441 line 14), and the parameter `gov.irs.gross_income.dependent_care_assistance_programs.prior_year_carryover_omitted`. diff --git a/changelog.d/fix-form-2441-carryover-forfeit.fixed.md b/changelog.d/fix-form-2441-carryover-forfeit.fixed.md new file mode 100644 index 00000000000..51bd7079ed5 --- /dev/null +++ b/changelog.d/fix-form-2441-carryover-forfeit.fixed.md @@ -0,0 +1 @@ +Compute the federal and California dependent care assistance exclusions and taxable dependent care benefits from Form 2441 line 15 (FTB 3506 line 16): the line 12 benefits in `dependent_care_employer_benefits`, plus grace-period carryovers, less amounts forfeited or carried forward. Forfeited and carried-forward benefits are no longer taxed. Grace-period carryovers count, except that the federal calculation leaves them out in 2021 and 2022, as before; California counts them in every year, and Alabama's 2021 recompute under the 2020 Code counts them. diff --git a/docs/gov/irs/historical-validation.md b/docs/gov/irs/historical-validation.md index acb83d6a5f6..51d40a27eb3 100644 --- a/docs/gov/irs/historical-validation.md +++ b/docs/gov/irs/historical-validation.md @@ -79,15 +79,17 @@ Every path below has the prefix `gov.irs.`. “Explicit 2017” means the parame ## Additional rule tests and limits -Focused tests also cover the [personal-exemption phaseout](../../../policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml): a partial step triggers the full 2% reduction, as the [2017 worksheet, p. 41][instructions-1040] requires. [Dependent-care tests](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml) cover the actual qualified-expense ceiling and prevent reuse of excluded employer benefits for the child and dependent care credit, following [Form 2441, Part III][dcap]. [Traditional IRA tests](../../../policyengine_us/tests/policy/baseline/household/expense/retirement/traditional_ira_contributions.yaml) cover the age-70.5 restriction through 2019 and its removal from 2020, following [Publication 590-A][ira-contributions] and [P.L. 116-94, Division O, §107][secure]. +Focused tests also cover the [personal-exemption phaseout](../../../policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml): a partial step triggers the full 2% reduction, as the [2017 worksheet, p. 41][instructions-1040] requires. [Dependent-care tests](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml) cover the actual qualified-expense ceiling, grace-period carryovers and forfeited benefits, and prevent reuse of excluded employer benefits for the child and dependent care credit, following [Form 2441, Part III][dcap]. [Traditional IRA tests](../../../policyengine_us/tests/policy/baseline/household/expense/retirement/traditional_ira_contributions.yaml) cover the age-70.5 restriction through 2019 and its removal from 2020, following [Publication 590-A][ira-contributions] and [P.L. 116-94, Division O, §107][secure]. Employer dependent care assistance requires an independently supplied annual tax-unit input, `dependent_care_assistance_qualified_expenses`. It represents employment-related expenses for qualifying care incurred during the tax year, regardless of when paid, before employer benefits and statutory dollar or earnings limits. Include eligible employer-paid care and care for a qualifying disabled adult or spouse; exclude costs for ineligible people, purposes or providers and reimbursements disallowed under the applicable year's rules. The [2017 instructions, p. 1](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=1) retain state reimbursements included in income; the shorter reimbursement wording in the [2025 instructions, p. 2](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=2) does not by itself establish a legal change. The input must reflect the applicable treatment. -When callers omit the expense input, the model uses zero and treats all positive employer benefits as taxable. That reporting assumption does not establish that the household incurred no qualified costs. An informed household or population calculation requires an independently established qualified amount; W-2 box 10, gross childcare bills and modeled public subsidies do not supply it. Both the [2017](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=5) and [2025 instructions](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) illustrate $2,000 in benefits but only $900 in qualified expenses. This correction adds no dataset imputation, reporting-status input or missing-information validation. Carryovers, forfeitures and self-employment plan deductions remain outside this employer-benefit calculation. +When callers omit the expense input, the model uses zero and treats all positive employer benefits as taxable. That reporting assumption does not establish that the household incurred no qualified costs. An informed household or population calculation requires an independently established qualified amount; W-2 box 10, gross childcare bills and modeled public subsidies do not supply it. Both the [2017](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=5) and [2025 instructions](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) illustrate $2,000 in benefits but only $900 in qualified expenses. This correction adds no dataset imputation, reporting-status input or missing-information validation. Self-employment plan deductions (Form 2441 lines 22 and 24) remain outside this employer-benefit calculation. + +Two optional person-level inputs complete [Form 2441 line 15](https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2), which the [2025 instructions, p. 5](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) define as lines 12 and 13 less line 14. `dependent_care_employer_benefits` is line 12: box 10, not counting any amount above the plan's exclusion, which the employer includes in boxes 1, 3 and 5 ([W-2 instructions, p. 19](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=19)). `dependent_care_employer_benefits_prior_year_carryover` is line 13: unused benefits from the prior plan year used during this year's grace period. `dependent_care_employer_benefits_forfeited_or_carried_forward` is line 14: the part of line 12 forfeited or carried forward to the next year (on the 2021 to 2024 forms, the part of line 12 or 13). Box 10 reports benefits "regardless of any employee forfeitures" ([W-2 instructions, p. 18](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=18)), so `dependent_care_employer_benefits` keeps that part. Both inputs default to zero, so omitting them leaves line 15 equal to line 12. Each person's line 14 reduces only their own line 12 and line 13. The exclusion is limited by line 15, taxable benefits are line 15 less the exclusion (line 26), and that amount is split among members by their own line 15 amounts. For 2021 and 2022, the [2021](https://www.irs.gov/pub/irs-prior/f2441--2021.pdf#page=2) and [2022](https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2) forms add line 13 to the line 21 cap under temporary relief rules. The federal calculation leaves line 13 out of both line 15 and the cap in those years, through `gov.irs.gross_income.dependent_care_assistance_programs.prior_year_carryover_omitted`, still subtracts all of line 14, and does not model the other relief rules. Alabama's 2021 recompute under the 2020 Code counts line 13 against the 2020 cap of $5,000, as the 2020 form does. Supply this input separately from `cdcc_qualified_care_expenses`, which remains the computed expense helper for the later credit; overriding that helper does not establish the employer-assistance expense amount. The model retains its qualifying-person checks and subtracts excluded benefits once from creditable costs. The model keeps the existing employer-benefit payroll input convention. Keeping the assistance expense input independent also avoids a cycle through modeled childcare subsidies and adjusted gross income. -California applies its own earnings and dollar limits directly to the independently supplied qualified amount, as [FTB 3506 Part IV](https://www.ftb.ca.gov/forms/2017/17_3506.pdf#page=2) requires. Higher California earnings, including its different HSA treatment, cannot override the qualified-expense ceiling. The model adds the positive federal-minus-California exclusion difference back to California adjusted gross income. When California's exclusion exceeds the federal exclusion, the current addback returns zero. The model does not calculate a California subtraction for that difference. This correction leaves that adjustment route unverified and does not establish complete historical validation of California taxes. +California applies its own earnings and dollar limits directly to the independently supplied qualified amount, as [FTB 3506 Part IV](https://www.ftb.ca.gov/forms/2017/17_3506.pdf#page=2) requires. California's benefits amount, [FTB 3506 line 16](https://www.ftb.ca.gov/forms/2025/2025-3506.pdf#page=2), combines the same lines as Form 2441 line 15 and uses the same two inputs. FTB 3506 line 14 is "the amount from federal Form 2441, line 13" ([2021 instructions](https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html)), and line 22 never adds it to California's $5,000 cap, so California counts the carryover in every year, including 2021 and 2022. Higher California earnings, including its different HSA treatment, cannot override the qualified-expense ceiling. The model adds the positive federal-minus-California exclusion difference back to California adjusted gross income. When California's exclusion exceeds the federal exclusion, the current addback returns zero. The model does not calculate a California subtraction for that difference. This correction leaves that adjustment route unverified and does not establish complete historical validation of California taxes. [Saver's Credit examples](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/retirement_saving/savers_credit_person.yaml) check the published inclusive AGI ceilings and fractional income above them. [Generated populations](../../../policyengine_us/tests/core/test_federal_2017_tax_history_properties.py) repeat these checks for all five filing statuses in every year from 2017 through 2026. diff --git a/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml b/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml new file mode 100644 index 00000000000..ecde41821de --- /dev/null +++ b/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml @@ -0,0 +1,24 @@ +description: PolicyEngine leaves dependent care benefits carried over from the prior plan year (Form 2441 line 13) out of the benefits counted toward the federal dependent care assistance exclusion and taxable dependent care benefits, if this is true. +values: + 2017-01-01: false + # Section 214 of the Taxpayer Certainty and Disaster Tax Relief Act of + # 2020 let plans carry over unused benefits from plan years ending in 2020 + # and 2021; Notice 2021-26 disregards them for the section 129 limits of + # 2021 and 2022, and the 2021 and 2022 Forms 2441 add line 13 to the line + # 21 cap. The model does not apply that relief, so in these years it leaves + # line 13 out of both line 15 and the cap. + 2021-01-01: true + 2023-01-01: false +metadata: + unit: bool + period: year + label: Dependent care assistance prior-year carryover omitted + reference: + - title: 2021 Form 2441, Part III, line 21 + href: https://www.irs.gov/pub/irs-prior/f2441--2021.pdf#page=2 + - title: 2022 Form 2441, Part III, line 21 + href: https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2 + - title: 2023 Form 2441, Part III, line 21 + href: https://www.irs.gov/pub/irs-prior/f2441--2023.pdf#page=2 + - title: IRS Notice 2021-26 + href: https://www.irs.gov/pub/irs-drop/n-21-26.pdf#page=3 diff --git a/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py b/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py new file mode 100644 index 00000000000..d9e051f0111 --- /dev/null +++ b/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py @@ -0,0 +1,189 @@ +"""Form 2441 line 15 properties for grace-period carryovers and forfeitures. + +Form 2441 line 15 adds line 13 (prior-year benefits used in this year's grace +period) to line 12 and subtracts line 14 (amounts forfeited or carried +forward). Line 12 is dependent_care_employer_benefits: W-2 box 10, not +counting any amount above the plan's exclusion, which box 1 already includes +as wages. Line 25 excludes the smallest of line 15, line 16 qualified +expenses, earned income and the line 21 cap, and line 26 taxes the rest of +line 15. FTB 3506 lines 14 to 16 repeat lines 13 to 15 for California, with +California's own cap, and count line 13 in every year. For 2021 and 2022, +when line 21 adds line 13 to the cap under temporary relief rules, the federal +calculation leaves line 13 out of both line 15 and the cap, so those years' +federal results must match a return without the carryover. + +Each seeded filer has line 12 benefits (above $5,000 only when they come from +more than one employer's plan), an optional forfeiture of part of them and an +optional carryover. Wages other than line 12 benefits are fixed, and the +benefits sit inside employment_income as a pre-tax deduction. Qualified +expenses are an explicit tax-unit fact, as Form 2441 line 16 is. + +https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2 +https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5 +https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2 +https://www.ftb.ca.gov/forms/2025/2025-3506.pdf#page=2 +https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html +""" + +import numpy as np +import pytest + +from policyengine_us import Simulation + +TOLERANCE = 0.01 # dollars +SEED = 20261121 +# Form 2441 line 21 cap (joint or unmarried, ordinary separate), by year. +FEDERAL_CAP = { + 2020: (5_000, 2_500), + 2021: (10_500, 5_250), + 2022: (5_000, 2_500), + 2023: (5_000, 2_500), + 2025: (5_000, 2_500), + 2026: (7_500, 3_750), +} +# FTB 3506 Part IV line 22. +CALIFORNIA_CAP = (5_000, 2_500) +RELIEF_YEARS = {2021, 2022} +FILING_STATUSES = ["SINGLE", "JOINT", "HEAD_OF_HOUSEHOLD", "SEPARATE"] + + +def _units(n=120): + rng = np.random.default_rng(SEED) + + def filer(): + line_12 = float( + [0, rng.integers(1, 5_001), rng.integers(5_000, 9_001)][rng.integers(0, 3)] + ) + forfeited = float(rng.integers(0, line_12 + 1)) if rng.random() < 0.5 else 0.0 + return { + "wages": float(rng.integers(0, 120_001)), + "line_12": line_12, + "carryover": float(rng.integers(1, 3_001)) if rng.random() < 0.5 else 0.0, + "forfeited": forfeited, + } + + units = [] + for _ in range(n): + filing_status = str(rng.choice(FILING_STATUSES)) + units.append( + { + "filing_status": filing_status, + "filers": [filer()] + ([filer()] if filing_status == "JOINT" else []), + "children": int(rng.integers(1, 3)), + "expenses": float(rng.integers(0, 12_001)), + } + ) + return units + + +def _situation(units, year, with_carryover=True): + people, tax_units, households, marital_units = {}, {}, {}, {} + for i, unit in enumerate(units): + members = [] + for k, f in enumerate(unit["filers"]): + name = f"filer_{i}_{k}" + people[name] = { + "age": {year: 40}, + "is_tax_unit_head": {year: k == 0}, + "is_tax_unit_spouse": {year: k == 1}, + "employment_income": {year: f["wages"] + f["line_12"]}, + "dependent_care_employer_benefits": {year: f["line_12"]}, + "dependent_care_employer_benefits_forfeited_or_carried_forward": { + year: f["forfeited"] + }, + "dependent_care_employer_benefits_prior_year_carryover": { + year: f["carryover"] if with_carryover else 0.0 + }, + } + members.append(name) + marital_units[f"couple_{i}"] = {"members": list(members)} + for j in range(unit["children"]): + child = f"child_{i}_{j}" + people[child] = {"age": {year: 5}, "is_tax_unit_dependent": {year: True}} + members.append(child) + marital_units[f"single_{i}_{j}"] = {"members": [child]} + tax_units[f"tax_unit_{i}"] = { + "members": members, + "filing_status": {year: unit["filing_status"]}, + "dependent_care_assistance_qualified_expenses": {year: unit["expenses"]}, + # An isolated component input, as in the exclusion invariants test. + "ca_cdcc_min_head_spouse_earned": { + year: min(f["wages"] for f in unit["filers"]) + }, + } + households[f"household_{i}"] = { + "members": members, + "state_code": {year: "CA"}, + } + return { + "people": people, + "tax_units": tax_units, + "households": households, + "marital_units": marital_units, + } + + +def _line_15(filer, count_line_13): + carryover = filer["carryover"] if count_line_13 else 0.0 + return max(filer["line_12"] + carryover - filer["forfeited"], 0.0) + + +def _expected_exclusion(unit, caps, count_line_13): + line_15 = sum(_line_15(f, count_line_13) for f in unit["filers"]) + cap = caps[1] if unit["filing_status"] == "SEPARATE" else caps[0] + earned = min(f["wages"] for f in unit["filers"]) + return min(line_15, unit["expenses"], cap, earned) + + +@pytest.mark.parametrize("year", sorted(FEDERAL_CAP)) +def test_line_15_carryovers_and_forfeitures(year): + units = _units() + sim = Simulation(situation=_situation(units, year)) + exclusion = sim.calculate("dependent_care_assistance_exclusion", year) + california = sim.calculate("ca_dependent_care_assistance_exclusion", year) + taxable = sim.calculate("taxable_dependent_care_benefits", year) + income_tax_wages = sim.calculate("irs_employment_income", year) + payroll_tax_wages = sim.calculate("payroll_tax_gross_wages", year) + count_line_13 = year not in RELIEF_YEARS + + i = 0 + for u, unit in enumerate(units): + # 1. Line 25 and FTB 3506 line 26 from line 15 (FTB line 16), with + # California counting line 13 in every year. + expected = _expected_exclusion(unit, FEDERAL_CAP[year], count_line_13) + assert exclusion[u] == pytest.approx(expected, abs=TOLERANCE) + assert california[u] == pytest.approx( + _expected_exclusion(unit, CALIFORNIA_CAP, True), abs=TOLERANCE + ) + line_15 = [_line_15(f, count_line_13) for f in unit["filers"]] + unit_taxable = max(sum(line_15) - expected, 0.0) + for k, f in enumerate(unit["filers"]): + # 2. Line 26, split by each filer's own line 15 amount. + share = line_15[k] / sum(line_15) if sum(line_15) > 0 else 0.0 + assert taxable[i] == pytest.approx(unit_taxable * share, abs=TOLERANCE) + # 3. Lines 13 and 14 leave income tax and FICA wages unchanged. + assert income_tax_wages[i] == pytest.approx(f["wages"], abs=TOLERANCE) + assert payroll_tax_wages[i] == pytest.approx(f["wages"], abs=TOLERANCE) + i += 1 + # Children have no line 15 and no taxable benefits. + for _ in range(unit["children"]): + assert taxable[i] == 0 + i += 1 + + +@pytest.mark.parametrize("year", sorted(RELIEF_YEARS)) +def test_relief_years_ignore_line_13(year): + # 4. In 2021 and 2022 the carryover changes no federal result, as on + # main. California counts it (checked above). + units = _units() + with_carryover = Simulation(situation=_situation(units, year)) + without = Simulation(situation=_situation(units, year, with_carryover=False)) + for variable in [ + "dependent_care_assistance_exclusion", + "taxable_dependent_care_benefits", + "cdcc_limit", + ]: + np.testing.assert_array_equal( + with_carryover.calculate(variable, year), + without.calculate(variable, year), + ) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml b/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml index 33ac635994e..ac376aab9f6 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml @@ -1,9 +1,12 @@ # IRC section 129 dependent care assistance exclusion, as reconciled on # Form 2441 Part III. Dollar/earnings-limit unit cases explicitly supply # sufficient qualified expenses; the full-household cases also test that limit. -# The exclusion is the lesser of qualified expenses, employer benefits, -# the section 129(a)(2)(A) dollar cap (by filing status), and the section -# 129(b) earned-income limit. +# The exclusion is the lesser of qualified expenses, employer benefits +# (Form 2441 line 15: line 12, plus grace-period carryovers, less amounts +# forfeited or carried forward), the section 129(a)(2)(A) dollar cap (by +# filing status), and the section 129(b) earned-income limit. Line 12 is +# dependent_care_employer_benefits: W-2 box 10, not counting any amount +# above the plan's exclusion, which box 1 already includes as wages. - name: No employer dependent care benefits gives no exclusion period: 2024 @@ -940,3 +943,179 @@ # The omitted input defaults0; this does not establish actual costs0. dependent_care_assistance_exclusion: 0 taxable_dependent_care_benefits: [2_000, 0] + +- name: IRS 2025 line 14 example, $5,000 set aside and $50 forfeited. + period: 2025 + input: + people: + head: + age: 35 + employment_income: 45_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: 50 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_950 + tax_unit_childcare_expenses: 4_950 + households: + household: + members: [head, child] + state_code: TX + output: + # 2025 Form 2441 instructions, line 14: $5,000 on line 12 and $50 on + # line 14, after $4,950 of qualified expenses was incurred and + # reimbursed. Line 15 is $4,950, all excluded; line 26 is $0. + dependent_care_assistance_exclusion: 4_950 + taxable_dependent_care_benefits: [0, 0] + +- name: A grace-period carryover supports an exclusion without box 10 benefits. + period: 2025 + input: + people: + head: + age: 35 + employment_income: 50_000 + dependent_care_employer_benefits_prior_year_carryover: 1_000 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 1_000 + tax_unit_childcare_expenses: 1_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Line 15 is the $1,000 carryover (line 13), all excluded. Section + # 21(c) reduces the $3,000 credit limit by it. + dependent_care_assistance_exclusion: 1_000 + taxable_dependent_care_benefits: [0, 0] + cdcc_limit: 2_000 + +- name: For 2022 a line 13 carryover adds nothing to taxable benefits. + period: 2022 + input: + people: + head: + age: 35 + employment_income: 55_000 + dependent_care_employer_benefits: 5_000 + # Unused 2021 plan-year benefits used in 2022 (line 13). + dependent_care_employer_benefits_prior_year_carryover: 1_500 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 7_000 + tax_unit_childcare_expenses: 7_000 + households: + household: + members: [head, child] + state_code: TX + output: + # 2022 Form 2441: line 15 is $5,000 + $1,500 = $6,500, and line 21 adds + # the $1,500 on line 13 to the $5,000 cap, so line 25 is $6,500 and line + # 26 is $0. Temporary relief rules govern such carryovers, so the model + # leaves line 13 out of both line 15 and the cap for 2021 and 2022 + # (prior_year_carryover_omitted). That gives the same line 26 of $0 but + # an exclusion of $5,000 rather than the form's $6,500, so this case + # asserts only line 26 and AGI. + taxable_dependent_care_benefits: [0, 0] + adjusted_gross_income: 50_000 + +- name: For 2021 a line 13 carryover above the $10,500 cap adds nothing to taxable benefits. + period: 2021 + input: + people: + head: + age: 35 + # Box 1 wages of $70,000 plus $10,500 of box 10 benefits under a plan + # that adopted the 2021 limit. + employment_income: 80_500 + dependent_care_employer_benefits: 10_500 + # Unused 2020 plan-year benefits used in 2021 (line 13). + dependent_care_employer_benefits_prior_year_carryover: 1_500 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 13_000 + tax_unit_childcare_expenses: 13_000 + households: + household: + members: [head, child] + state_code: TX + output: + # 2021 Form 2441: line 15 is $10,500 + $1,500 = $12,000, and line 21 + # adds the $1,500 on line 13 to the $10,500 cap, so line 25 is $12,000 + # and line 26 is $0. The model leaves line 13 out of both line 15 and + # the cap (prior_year_carryover_omitted): the same line 26 of $0, with an + # exclusion of $10,500 rather than $12,000, so this case asserts only + # line 26 and AGI. Counting line 13 without raising the cap would tax + # $1,500. + taxable_dependent_care_benefits: [0, 0] + adjusted_gross_income: 70_000 + +- name: The 2023 cap does not add the line 13 carryover. + period: 2023 + input: + people: + head: + age: 35 + employment_income: 55_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_prior_year_carryover: 1_500 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 7_000 + tax_unit_childcare_expenses: 7_000 + households: + household: + members: [head, child] + state_code: TX + output: + # 2023 Form 2441 line 21 is $5,000. Line 15 is $6,500; line 26 is $1,500. + dependent_care_assistance_exclusion: 5_000 + taxable_dependent_care_benefits: [1_500, 0] + +- name: Negative line 13 and line 14 entries count as zero. + period: 2025 + input: + people: + head: + age: 35 + employment_income: 50_000 + dependent_care_employer_benefits: 3_000 + dependent_care_employer_benefits_prior_year_carryover: -500 + dependent_care_employer_benefits_forfeited_or_carried_forward: -2_000 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Line 15 is the $3,000 on line 12; neither entry can lower or raise it. + dependent_care_assistance_exclusion: 3_000 + taxable_dependent_care_benefits: [0, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml index 384432710bf..336ad4458f5 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml @@ -188,3 +188,175 @@ irs_employment_income: 30_000 payroll_tax_gross_wages: 30_000 taxable_dependent_care_benefits: 0 + +# Form 2441 line 15 adds prior-year benefits used in this year's grace period +# (line 13) to the line 12 benefits and subtracts amounts forfeited or +# carried forward (line 14). Line 12 is dependent_care_employer_benefits: W-2 +# box 10, not counting any amount above the plan's exclusion, which box 1 +# already includes as wages. Line 26 is line 15 less the line 25 exclusion. + +- name: Forfeited benefits are neither excluded nor taxable, 2025 + period: 2025 + input: + people: + head: + age: 45 + # Box 1 wages of $23,000 plus $5,000 of box 10 benefits. + employment_income: 28_000 + # Box 10 reports benefits regardless of employee forfeitures. + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + # The filer set aside $5,000, incurred $4,000 of qualified expenses and + # forfeited $1,000. Line 15: $5,000 - $1,000 = $4,000. Line 25: the + # smallest of $4,000, $4,000 of qualified expenses (line 16), $23,000 of + # earned income and the $5,000 cap. Line 26: $0. Without line 14, line + # 26 would be $1,000 and AGI $24,000. + irs_employment_income: [23_000, 0] + dependent_care_assistance_exclusion: 4_000 + taxable_dependent_care_benefits: [0, 0] + adjusted_gross_income: 23_000 + +- name: Box 10 above the plan's exclusion stays in wages when part is forfeited, 2025 + period: 2025 + input: + people: + head: + age: 45 + # One W-2 reports $6,000 in box 10 under a plan with a $5,000 + # exclusion. The $1,000 above it is in box 1 (W-2 instructions, + # p. 19) and not on line 12, so box 1 is $24,000 and line 12 is + # $5,000. + employment_income: 29_000 + dependent_care_employer_benefits: 5_000 + # The filer incurred $5,000 of expenses and forfeited $1,000; line 14 + # enters the forfeited amount included on line 12. + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 5_000 + tax_unit_childcare_expenses: 5_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Line 15: $5,000 - $1,000 = $4,000. Line 25: $4,000. Line 26: $0. The + # $1,000 above the plan's exclusion stays in box 1, so AGI is $24,000. + irs_employment_income: [24_000, 0] + dependent_care_assistance_exclusion: 4_000 + taxable_dependent_care_benefits: [0, 0] + adjusted_gross_income: 24_000 + +- name: Grace-period carryover adds to the benefits, 2025 + period: 2025 + input: + people: + head: + age: 35 + employment_income: 44_000 + dependent_care_employer_benefits: 4_000 + # Unused 2024 benefits used in the 2025 grace period (line 13). + dependent_care_employer_benefits_prior_year_carryover: 1_500 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 6_000 + tax_unit_childcare_expenses: 6_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Line 15: $4,000 + $1,500 = $5,500. Line 25: $5,000 cap. Line 26: $500. + irs_employment_income: [40_000, 0] + dependent_care_assistance_exclusion: 5_000 + taxable_dependent_care_benefits: [500, 0] + adjusted_gross_income: 40_500 + +- name: Joint return splits the taxable part by each spouse's line 15 amount, 2025 + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + spouse: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Line 15: $4,000 + $5,000 = $9,000. Line 25: $5,000 cap. Line 26: + # $4,000, split 4:5. + dependent_care_assistance_exclusion: 5_000 + taxable_dependent_care_benefits: [1_777.78, 2_222.22, 0] + irs_employment_income: [55_000, 55_000, 0] + adjusted_gross_income: 114_000 + +- name: One spouse's line 14 cannot reduce the other spouse's line 15, 2025 + period: 2025 + input: + people: + head: + age: 40 + employment_income: 60_000 + # A forfeiture entered for a spouse with no benefits of their own. + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + spouse: + age: 40 + employment_income: 65_000 + dependent_care_employer_benefits: 5_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 3_000 + tax_unit_childcare_expenses: 3_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Each person's line 14 comes from their own line 12 and line 13, so the + # head's part of line 15 is floored at $0 and the spouse's stays $5,000. + # Line 25: $3,000 of qualified expenses. Line 26: $2,000, all the + # spouse's. + dependent_care_assistance_exclusion: 3_000 + taxable_dependent_care_benefits: [0, 2_000, 0] + adjusted_gross_income: 122_000 diff --git a/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml index bef9d6103ed..107508bbae7 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml @@ -293,6 +293,54 @@ cdcc: 3_500 al_federal_income_tax_deduction: 4_390 +- name: 2021 head of household, two children, $2,000 grace-period carryover - the 2020-rule CDCC counts Form 2441 line 13 + # 2021 worksheet Part II recomputes lines 3, 4, 8b and 9e "based on 2020 + # calculations using 2021 information"; line 4 enters the CDCC "based on + # 2020 Form 2441 Line 11". On the 2020 form, line 15 combines lines 12 + # through 14, so it includes the $2,000 carried over from the 2020 plan year + # and used in the 2021 grace period (line 13), and line 21 is $5,000 with no + # line 13 addition. + # Actual 2021: the 2021 form adds line 13 to the $10,500 cap and excludes + # $5,000, so its CDCC is 50% x min(16,000 - 5,000, 9,000 - 5,000) = + # 2,000. The model leaves line 13 out for 2021 (exclusion 3,000, CDCC + # 3,000), so this case asserts no federal 2021 value. Either way the + # CDCC is refundable. Taxable income 60,000 - 18,800 = 41,200; tax + # 1,420 + 12% x 27,000 = 4,660. CTC 3,600 + 3,000 = 6,600, all + # refundable, so Part I is 0. + # Part II, 2020 rules: line 15 = 3,000 + 2,000 = 5,000; exclusion + # min(5,000, 9,000, 5,000) = 5,000; limit 6,000 - 5,000 = 1,000; rate 20%; + # CDCC 200. CTC 4,000, all non-refundable. Line 6 = 4,660 - 4,000 - 200 = + # 460. Without the carryover the 2020-rule CDCC is 20% x 3,000 = 600 and + # the deduction is 60. + absolute_error_margin: 1 + period: 2021 + input: + people: + head: + age: 35 + # Box 1 wages are $60,000 ($63,000 - $3,000 of box 10 benefits). + employment_income: 63_000 + dependent_care_employer_benefits: 3_000 + dependent_care_employer_benefits_prior_year_carryover: 2_000 + child1: + age: 3 + is_tax_unit_dependent: true + child2: + age: 6 + is_tax_unit_dependent: true + tax_units: + tax_unit: + members: [head, child1, child2] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, child1, child2] + state_code: AL + output: + al_federal_income_tax_deduction: 460 + - name: Alabama subtracts payment credits and only refundable AOC # Ala. Admin. Code r. 810-3-15-.20(1)(d)2 requires all payment credits. # Federal tax already reflects the nonrefundable $1,500 of the total AOC. diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml index 05368eac099..e49a05b0a79 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml @@ -1,5 +1,6 @@ -# Component arithmetic assumes no carryovers, forfeitures or disallowed -# public reimbursement. Costs are independent IRC 129/FTB 3506 line 17 facts. +# Unless a case says otherwise, component arithmetic assumes no carryovers, +# forfeitures or disallowed public reimbursement. Costs are independent IRC +# 129/FTB 3506 line 17 facts. # FTB 3506 Part IV line 22 caps California's excluded dependent care benefits # at $5,000 ($2,500 for a separate return). California did not adopt the 2021 # federal cap of $10,500 ($5,250) (ARPA section 9632) or the 2026 federal cap @@ -240,3 +241,96 @@ # Independent costs bind despite the1,000 California earnings increase. dependent_care_assistance_exclusion: 0 ca_dependent_care_assistance_exclusion: 0 + +- name: California counts a grace-period carryover as the federal exclusion does, 2025 + period: 2025 + input: + people: + head: + age: 35 + employment_income: 50_000 + # FTB 3506 line 14, as Form 2441 line 13. + dependent_care_employer_benefits_prior_year_carryover: 1_000 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 1_000 + tax_unit_childcare_expenses: 1_000 + households: + household: + members: [head, child] + state_code: CA + output: + # FTB 3506 line 16 and Form 2441 line 15 are both $1,000, all excluded, + # so nothing returns to California AGI. + dependent_care_assistance_exclusion: 1_000 + ca_dependent_care_assistance_exclusion: 1_000 + ca_dependent_care_assistance_addition: 0 + +- name: California nets forfeited benefits as the federal exclusion does, 2025 + period: 2025 + input: + people: + head: + age: 35 + employment_income: 55_000 + # FTB 3506 line 13, as Form 2441 line 12. + dependent_care_employer_benefits: 5_000 + # FTB 3506 line 15, as Form 2441 line 14. + dependent_care_employer_benefits_forfeited_or_carried_forward: 2_000 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: CA + output: + # Line 16 (FTB) and line 15 (federal): $5,000 - $2,000 = $3,000, below + # the $4,000 of qualified expenses and the $5,000 cap, so it limits both + # exclusions. Without line 14 (FTB line 15) both would be $4,000. + dependent_care_assistance_exclusion: 3_000 + ca_dependent_care_assistance_exclusion: 3_000 + ca_dependent_care_assistance_addition: 0 + taxable_dependent_care_benefits: [0, 0] + +- name: California counts a grace-period carryover in 2021, when the federal calculation leaves it out + period: 2021 + input: + people: + head: + age: 35 + employment_income: 63_000 + dependent_care_employer_benefits: 3_000 + # Unused 2020 plan-year benefits used in 2021 (Form 2441 line 13). + dependent_care_employer_benefits_prior_year_carryover: 2_000 + child: + age: 5 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, child] + state_code: CA + output: + # 2021 FTB 3506 instructions, line 14: "Enter the amount from federal + # Form 2441, line 13." Line 16: $3,000 + $2,000 = $5,000. Line 22 is a + # flat $5,000, with no line 14 addition. Line 26: the smallest of + # $5,000, $9,000 of qualified expenses and $60,000 of earned income, so + # $5,000. The 2021 Form 2441 also excludes $5,000 (line 21 adds line 13 + # to the $10,500 cap), so nothing returns to California AGI. The model's + # federal exclusion leaves line 13 out in 2021 and is not asserted here. + ca_dependent_care_assistance_exclusion: 5_000 + ca_dependent_care_assistance_addition: 0 diff --git a/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py b/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py index 9816bd65a67..70422a77a03 100644 --- a/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py +++ b/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.household.income.person.dependent_care_employer_benefits import ( + form_2441_line_15, +) class dependent_care_assistance_exclusion(Variable): @@ -27,9 +30,11 @@ class dependent_care_assistance_exclusion(Variable): ) def formula(tax_unit, period, parameters): - # Total employer-provided dependent care benefits (Form 2441 line 12, - # W-2 box 10). - benefits = add(tax_unit, period, ["dependent_care_employer_benefits"]) + # Form 2441 line 15: employer-provided dependent care benefits (line + # 12, W-2 box 10 less any amount above the plan's exclusion), plus + # prior-year benefits used in this year's grace period (line 13), less + # benefits forfeited or carried forward (line 14). + benefits = tax_unit.sum(form_2441_line_15(tax_unit.members, period, parameters)) if not np.any(benefits > 0): return np.zeros_like(benefits) p = parameters(period).gov.irs.gross_income.dependent_care_assistance_programs diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py b/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py index a63de47a527..d39cefa1dd6 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.household.income.person.dependent_care_employer_benefits import ( + form_2441_line_15, +) class taxable_dependent_care_benefits(Variable): @@ -9,8 +12,10 @@ class taxable_dependent_care_benefits(Variable): "Employer dependent care benefits above the IRC 129 exclusion (Form " "2441 line 26, reported on Form 1040 line 1e). Box 1 wages leave out " "all of dependent_care_employer_benefits, so this adds back the part " - "the filer cannot exclude. The tax unit's amount is split among its " - "members in proportion to their benefits." + "the filer received and cannot exclude: Form 2441 line 15 (line 12 " + "benefits plus grace-period carryovers, less amounts forfeited or " + "carried forward) less the exclusion. The tax unit's amount is split " + "among its members in proportion to their line 15 amounts." ) unit = USD definition_period = YEAR @@ -24,10 +29,14 @@ class taxable_dependent_care_benefits(Variable): def formula(person, period, parameters): tax_unit = person.tax_unit - benefits = person("dependent_care_employer_benefits", period) + # Each person's part of Form 2441 line 15: line 12 benefits plus + # grace-period carryovers, less amounts forfeited or carried forward. + benefits = form_2441_line_15(person, period, parameters) # The tax_unit projector returns each member's unit-level value. unit_benefits = tax_unit.sum(benefits) exclusion = tax_unit("dependent_care_assistance_exclusion", period) + # Line 26: line 15 less the line 25 exclusion. Line 22 (benefits from + # the filer's own business) is zero for employee benefits. unit_taxable = max_(unit_benefits - exclusion, 0) share = np.divide( benefits, diff --git a/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py b/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py index b9bf665ff95..9f4f6e4053a 100644 --- a/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py +++ b/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py @@ -1,4 +1,7 @@ from policyengine_us.model_api import * +from policyengine_us.variables.household.income.person.dependent_care_employer_benefits import ( + form_2441_line_15, +) class ca_dependent_care_assistance_exclusion(Variable): @@ -23,7 +26,17 @@ class ca_dependent_care_assistance_exclusion(Variable): defined_for = StateCode.CA def formula(tax_unit, period, parameters): - benefits = add(tax_unit, period, ["dependent_care_employer_benefits"]) + # FTB 3506 line 16: employer benefits (line 13, as Form 2441 line + # 12), plus grace-period carryovers (line 14, "the amount from federal + # Form 2441, line 13" in the 2021 instructions), less amounts + # forfeited or carried forward (line 15). Line 22 never adds line 14 + # to California's cap, so line 14 counts in every year, including + # 2021 and 2022. + benefits = tax_unit.sum( + form_2441_line_15( + tax_unit.members, period, parameters, always_count_line_13=True + ) + ) if not np.any(benefits > 0): return np.zeros_like(benefits) p = parameters(period).gov.states.ca.tax.income.credits.child_dependent_care diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py index 5325606891c..64ca4173bcc 100644 --- a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py +++ b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py @@ -1,6 +1,47 @@ from policyengine_us.model_api import * +def form_2441_line_15(person, period, parameters, always_count_line_13=False): + """Each person's part of Form 2441 line 15 (FTB 3506 line 16). + + Line 12 is dependent_care_employer_benefits: W-2 box 10 benefits, not + counting any box 10 amount above the plan's exclusion, which the employer + already reports as box 1 wages. Line 15 adds prior-year benefits used in + this year's grace period (line 13) and subtracts amounts forfeited or + carried forward to the next year (line 14). Line 14 amounts come from + line 12 (on the 2021-2024 forms, line 12 or 13), and each person's come + from their own benefits, so the result is floored at zero for each + person. A negative line 13 or line 14 entry counts as zero. + + For 2021 and 2022, Form 2441 line 21 adds line 13 to the cap, and + temporary relief rules govern carryovers from plan years ending in 2020 + and 2021. The model doesn't apply those rules, so in those years the + federal calculation leaves line 13 out of line 15, as it does out of the + cap (prior_year_carryover_omitted). Alabama's 2021 recompute pins that + parameter to its 2020 value, false, so it counts line 13, as the 2020 + form does. FTB 3506 line 22 never adds line 13 to California's cap, and + FTB 3506 line 14 enters the Form 2441 line 13 amount, so California + passes always_count_line_13 and counts it in every year. + """ + line_12 = person("dependent_care_employer_benefits", period) + line_13 = max_( + person("dependent_care_employer_benefits_prior_year_carryover", period), 0 + ) + line_14 = max_( + person( + "dependent_care_employer_benefits_forfeited_or_carried_forward", + period, + ), + 0, + ) + # Only a carryover needs the relief-year switch, so a return without one + # never reads it, as in years before the parameter's first value. + if not always_count_line_13 and np.any(line_13 > 0): + p = parameters(period).gov.irs.gross_income.dependent_care_assistance_programs + line_13 = where(p.prior_year_carryover_omitted, 0, line_13) + return max_(line_12 + line_13 - line_14, 0) + + class dependent_care_employer_benefits(Variable): value_type = float entity = Person @@ -13,7 +54,11 @@ class dependent_care_employer_benefits(Variable): "spending account salary reduction: it is subtracted from income tax " "wages (irs_employment_income) and from FICA and FUTA wages " "(payroll_tax_gross_wages), and any part above the filer's IRC 129 " - "exclusion returns as taxable_dependent_care_benefits." + "exclusion returns as taxable_dependent_care_benefits. Report " + "amounts later forfeited or carried forward here too, as box 10 " + "does, and also in " + "dependent_care_employer_benefits_forfeited_or_carried_forward " + "(Form 2441 line 14)." ) unit = USD definition_period = YEAR diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py new file mode 100644 index 00000000000..bd459d857ac --- /dev/null +++ b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py @@ -0,0 +1,32 @@ +from policyengine_us.model_api import * + + +class dependent_care_employer_benefits_forfeited_or_carried_forward(Variable): + value_type = float + entity = Person + label = "Dependent care benefits forfeited or carried forward to the next year" + documentation = ( + "Form 2441 line 14: the part of this person's " + "dependent_care_employer_benefits (line 12) that they did not " + "receive this year, either forfeited because no expense was incurred " + "or carried forward to next year's grace period. On the 2021-2024 " + "forms line 14 can also come from line 13. W-2 box 10 includes these " + "amounts and box 1 leaves them out, as it leaves out all of line 12, " + "so they are neither wages nor taxable dependent care benefits. Box " + "10 amounts above the plan's exclusion are box 1 wages, not line 12, " + "and do not go here. Enter each person's own amount: it reduces only " + "that person's line 12 and line 13, and any amount beyond them counts " + "as zero. In 2021 and 2022, when the federal calculation leaves line " + "13 out, it subtracts all of this amount from line 12." + ) + unit = USD + definition_period = YEAR + default_value = 0 + reference = ( + "https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2", + "https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5", + # Box 10 reports amounts "regardless of any employee forfeitures". + "https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=18", + # Box 10 amounts "over your plan's exclusion" go in boxes 1, 3 and 5. + "https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=19", + ) diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py new file mode 100644 index 00000000000..0dc3f881af1 --- /dev/null +++ b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py @@ -0,0 +1,28 @@ +from policyengine_us.model_api import * + + +class dependent_care_employer_benefits_prior_year_carryover(Variable): + value_type = float + entity = Person + label = "Prior-year dependent care benefits used in this year's grace period" + documentation = ( + "Unused employer dependent care benefits from the prior year's plan " + "that the employee used during this year's grace period (Form 2441 " + "line 13, FTB 3506 line 14). The prior year's W-2 box 10 reported " + "them, so this year's dependent_care_employer_benefits leaves them " + "out. They count toward this year's IRC 129 exclusion and taxable " + "benefits. For 2021 and 2022, when Form 2441 line 21 adds line 13 to " + "the cap under temporary relief rules, the federal calculation leaves " + "this amount out of both (prior_year_carryover_omitted). California " + "counts it in every year, and Alabama's 2021 recompute under 2020 " + "rules counts it." + ) + unit = USD + definition_period = YEAR + default_value = 0 + reference = ( + "https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2", + "https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5", + # FTB 3506 line 14: "Enter the amount from federal Form 2441, line 13." + "https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html", + ) From fce047b4b2f97299f98548fbc96317174b148733 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sun, 22 Nov 2026 08:05:35 +0100 Subject: [PATCH 2/2] Subtract Form 2441 line 14 and take a supplied line 26 Drop the line 13 carryover input, the prior_year_carryover_omitted parameter and California's always-count-line-13 branch. Form 2441 line 15 is now each person's line 12 less their line 14, floored at zero, read by the federal exclusion, taxable dependent care benefits and California's exclusion. Add taxable_dependent_care_benefits_reported, an optional per-person line 26 amount that replaces the computed share when zero or more. Give both inputs a formula returning the not-supplied value so an entry applies only to the year entered. Replace the seeded Python invariant test with YAML cases and revert the Alabama YAML to main. Co-Authored-By: Claude Opus 5.5 --- .../fix-form-2441-carryover-forfeit.added.md | 2 +- .../fix-form-2441-carryover-forfeit.fixed.md | 2 +- docs/gov/irs/historical-validation.md | 8 +- .../prior_year_carryover_omitted.yaml | 24 - ...ndent_care_benefits_received_invariants.py | 189 -------- .../dependent_care_assistance_exclusion.yaml | 141 +----- .../taxable_dependent_care_benefits.yaml | 455 ++++++++++++++++-- .../al_federal_income_tax_deduction.yaml | 48 -- ...a_dependent_care_assistance_exclusion.yaml | 67 +-- .../dependent_care_assistance_exclusion.py | 8 +- .../taxable_dependent_care_benefits.py | 31 +- .../ca_dependent_care_assistance_exclusion.py | 14 +- .../dependent_care_employer_benefits.py | 37 +- ...r_benefits_forfeited_or_carried_forward.py | 38 +- ..._employer_benefits_prior_year_carryover.py | 28 -- ...axable_dependent_care_benefits_reported.py | 42 ++ 16 files changed, 560 insertions(+), 574 deletions(-) delete mode 100644 policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml delete mode 100644 policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py delete mode 100644 policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py create mode 100644 policyengine_us/variables/household/income/person/taxable_dependent_care_benefits_reported.py diff --git a/changelog.d/fix-form-2441-carryover-forfeit.added.md b/changelog.d/fix-form-2441-carryover-forfeit.added.md index 4f6d5f89a52..94d7c7f38e8 100644 --- a/changelog.d/fix-form-2441-carryover-forfeit.added.md +++ b/changelog.d/fix-form-2441-carryover-forfeit.added.md @@ -1 +1 @@ -Add the person-level inputs `dependent_care_employer_benefits_prior_year_carryover` (Form 2441 line 13, prior-year benefits used in the grace period) and `dependent_care_employer_benefits_forfeited_or_carried_forward` (Form 2441 line 14), and the parameter `gov.irs.gross_income.dependent_care_assistance_programs.prior_year_carryover_omitted`. +Add the person-level amounts a caller can supply: `dependent_care_employer_benefits_forfeited_or_carried_forward` (Form 2441 line 14) and `taxable_dependent_care_benefits_reported` (a supplied Form 2441 line 26 amount, used in place of the computed share of taxable dependent care benefits). Each applies only to the year entered. diff --git a/changelog.d/fix-form-2441-carryover-forfeit.fixed.md b/changelog.d/fix-form-2441-carryover-forfeit.fixed.md index 51bd7079ed5..780aa413b90 100644 --- a/changelog.d/fix-form-2441-carryover-forfeit.fixed.md +++ b/changelog.d/fix-form-2441-carryover-forfeit.fixed.md @@ -1 +1 @@ -Compute the federal and California dependent care assistance exclusions and taxable dependent care benefits from Form 2441 line 15 (FTB 3506 line 16): the line 12 benefits in `dependent_care_employer_benefits`, plus grace-period carryovers, less amounts forfeited or carried forward. Forfeited and carried-forward benefits are no longer taxed. Grace-period carryovers count, except that the federal calculation leaves them out in 2021 and 2022, as before; California counts them in every year, and Alabama's 2021 recompute under the 2020 Code counts them. +Compute the federal and California dependent care assistance exclusions and taxable dependent care benefits from Form 2441 line 15 (FTB 3506 line 16), without line 13, which is not modeled: the line 12 benefits in `dependent_care_employer_benefits` less amounts forfeited or carried forward, entered in `dependent_care_employer_benefits_forfeited_or_carried_forward`, so those amounts are no longer taxed. diff --git a/docs/gov/irs/historical-validation.md b/docs/gov/irs/historical-validation.md index 51d40a27eb3..6f9b06e12bc 100644 --- a/docs/gov/irs/historical-validation.md +++ b/docs/gov/irs/historical-validation.md @@ -79,17 +79,17 @@ Every path below has the prefix `gov.irs.`. “Explicit 2017” means the parame ## Additional rule tests and limits -Focused tests also cover the [personal-exemption phaseout](../../../policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml): a partial step triggers the full 2% reduction, as the [2017 worksheet, p. 41][instructions-1040] requires. [Dependent-care tests](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml) cover the actual qualified-expense ceiling, grace-period carryovers and forfeited benefits, and prevent reuse of excluded employer benefits for the child and dependent care credit, following [Form 2441, Part III][dcap]. [Traditional IRA tests](../../../policyengine_us/tests/policy/baseline/household/expense/retirement/traditional_ira_contributions.yaml) cover the age-70.5 restriction through 2019 and its removal from 2020, following [Publication 590-A][ira-contributions] and [P.L. 116-94, Division O, §107][secure]. +Focused tests also cover the [personal-exemption phaseout](../../../policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/exemptions/exemptions.yaml): a partial step triggers the full 2% reduction, as the [2017 worksheet, p. 41][instructions-1040] requires. [Dependent-care tests](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml) cover the actual qualified-expense ceiling and benefits forfeited or carried forward (Form 2441 line 14), and prevent reuse of excluded employer benefits for the child and dependent care credit, following [Form 2441, Part III][dcap]. [Traditional IRA tests](../../../policyengine_us/tests/policy/baseline/household/expense/retirement/traditional_ira_contributions.yaml) cover the age-70.5 restriction through 2019 and its removal from 2020, following [Publication 590-A][ira-contributions] and [P.L. 116-94, Division O, §107][secure]. Employer dependent care assistance requires an independently supplied annual tax-unit input, `dependent_care_assistance_qualified_expenses`. It represents employment-related expenses for qualifying care incurred during the tax year, regardless of when paid, before employer benefits and statutory dollar or earnings limits. Include eligible employer-paid care and care for a qualifying disabled adult or spouse; exclude costs for ineligible people, purposes or providers and reimbursements disallowed under the applicable year's rules. The [2017 instructions, p. 1](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=1) retain state reimbursements included in income; the shorter reimbursement wording in the [2025 instructions, p. 2](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=2) does not by itself establish a legal change. The input must reflect the applicable treatment. -When callers omit the expense input, the model uses zero and treats all positive employer benefits as taxable. That reporting assumption does not establish that the household incurred no qualified costs. An informed household or population calculation requires an independently established qualified amount; W-2 box 10, gross childcare bills and modeled public subsidies do not supply it. Both the [2017](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=5) and [2025 instructions](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) illustrate $2,000 in benefits but only $900 in qualified expenses. This correction adds no dataset imputation, reporting-status input or missing-information validation. Self-employment plan deductions (Form 2441 lines 22 and 24) remain outside this employer-benefit calculation. +When callers omit the expense input, the model uses zero and treats all positive employer benefits as taxable. That reporting assumption does not establish that the household incurred no qualified costs. An informed household or population calculation requires an independently established qualified amount; W-2 box 10, gross childcare bills and modeled public subsidies do not supply it. Both the [2017](https://www.irs.gov/pub/irs-prior/i2441--2017.pdf#page=5) and [2025 instructions](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) illustrate $2,000 in benefits but only $900 in qualified expenses. This correction adds no dataset imputation, reporting-status input or missing-information validation. Grace-period carryovers (Form 2441 line 13) and self-employment plan deductions (lines 22 and 24) remain outside this employer-benefit calculation. -Two optional person-level inputs complete [Form 2441 line 15](https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2), which the [2025 instructions, p. 5](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) define as lines 12 and 13 less line 14. `dependent_care_employer_benefits` is line 12: box 10, not counting any amount above the plan's exclusion, which the employer includes in boxes 1, 3 and 5 ([W-2 instructions, p. 19](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=19)). `dependent_care_employer_benefits_prior_year_carryover` is line 13: unused benefits from the prior plan year used during this year's grace period. `dependent_care_employer_benefits_forfeited_or_carried_forward` is line 14: the part of line 12 forfeited or carried forward to the next year (on the 2021 to 2024 forms, the part of line 12 or 13). Box 10 reports benefits "regardless of any employee forfeitures" ([W-2 instructions, p. 18](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=18)), so `dependent_care_employer_benefits` keeps that part. Both inputs default to zero, so omitting them leaves line 15 equal to line 12. Each person's line 14 reduces only their own line 12 and line 13. The exclusion is limited by line 15, taxable benefits are line 15 less the exclusion (line 26), and that amount is split among members by their own line 15 amounts. For 2021 and 2022, the [2021](https://www.irs.gov/pub/irs-prior/f2441--2021.pdf#page=2) and [2022](https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2) forms add line 13 to the line 21 cap under temporary relief rules. The federal calculation leaves line 13 out of both line 15 and the cap in those years, through `gov.irs.gross_income.dependent_care_assistance_programs.prior_year_carryover_omitted`, still subtracts all of line 14, and does not model the other relief rules. Alabama's 2021 recompute under the 2020 Code counts line 13 against the 2020 cap of $5,000, as the 2020 form does. +An optional person-level input brings line 14 into [Form 2441 line 15](https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2), which the [2025 instructions, p. 5](https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5) define as lines 12 and 13 less line 14. `dependent_care_employer_benefits` is line 12: box 10, not counting any amount above the plan's exclusion, which the employer includes in boxes 1, 3 and 5 ([W-2 instructions, p. 19](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=19)). Box 10 reports benefits "regardless of any employee forfeitures" ([W-2 instructions, p. 18](https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=18)), so `dependent_care_employer_benefits` keeps the forfeited part, and `dependent_care_employer_benefits_forfeited_or_carried_forward` is line 14: the part of line 12 forfeited or carried forward to the next year. Line 14 appears on every Form 2441 from 2017 to 2025; on the 2021 to 2024 forms it also takes amounts from line 13 that were forfeited or carried over, which the model leaves out. The input defaults to zero and applies only to the year entered, so omitting it leaves line 15 equal to a nonnegative line 12. Each person's line 14 reduces only their own line 12, and each person's part of line 15 is floored at zero, so a negative line 12 entry counts as zero. The exclusion is limited by line 15, taxable benefits are line 15 less the exclusion (line 26), and that amount is split among members by their own line 15 amounts. Line 13, prior-year benefits used this year (in the grace period, and in 2021 and 2022 under the relief rules), is not modeled, nor are a plan maximum below the statutory cap on line 21 and the 2021 and 2022 relief rules. For such returns, `taxable_dependent_care_benefits_reported` takes each person's part of line 26 as supplied, including zero, in place of the computed share; the exclusion and the child and dependent care credit stay computed, though the credit's rate follows adjusted gross income, which includes the supplied amount. Supply this input separately from `cdcc_qualified_care_expenses`, which remains the computed expense helper for the later credit; overriding that helper does not establish the employer-assistance expense amount. The model retains its qualifying-person checks and subtracts excluded benefits once from creditable costs. The model keeps the existing employer-benefit payroll input convention. Keeping the assistance expense input independent also avoids a cycle through modeled childcare subsidies and adjusted gross income. -California applies its own earnings and dollar limits directly to the independently supplied qualified amount, as [FTB 3506 Part IV](https://www.ftb.ca.gov/forms/2017/17_3506.pdf#page=2) requires. California's benefits amount, [FTB 3506 line 16](https://www.ftb.ca.gov/forms/2025/2025-3506.pdf#page=2), combines the same lines as Form 2441 line 15 and uses the same two inputs. FTB 3506 line 14 is "the amount from federal Form 2441, line 13" ([2021 instructions](https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html)), and line 22 never adds it to California's $5,000 cap, so California counts the carryover in every year, including 2021 and 2022. Higher California earnings, including its different HSA treatment, cannot override the qualified-expense ceiling. The model adds the positive federal-minus-California exclusion difference back to California adjusted gross income. When California's exclusion exceeds the federal exclusion, the current addback returns zero. The model does not calculate a California subtraction for that difference. This correction leaves that adjustment route unverified and does not establish complete historical validation of California taxes. +California applies its own earnings and dollar limits directly to the independently supplied qualified amount, as [FTB 3506 Part IV](https://www.ftb.ca.gov/forms/2017/17_3506.pdf#page=2) requires. California's benefits amount, [FTB 3506 line 16](https://www.ftb.ca.gov/forms/2025/2025-3506.pdf#page=2), combines the same lines as Form 2441 line 15. Its line 15 enters the amount "forfeited or carried forward" on every form from 2015 to 2025, so California's exclusion reads the same line 14 input. Its line 14, grace-period carryovers ("the amount from federal Form 2441, line 13" in the [2021 instructions](https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html)), is not modeled, as on the federal form. Higher California earnings, including its different HSA treatment, cannot override the qualified-expense ceiling. The model adds the positive federal-minus-California exclusion difference back to California adjusted gross income. When California's exclusion exceeds the federal exclusion, the current addback returns zero. The model does not calculate a California subtraction for that difference. This correction leaves that adjustment route unverified and does not establish complete historical validation of California taxes. [Saver's Credit examples](../../../policyengine_us/tests/policy/baseline/gov/irs/credits/retirement_saving/savers_credit_person.yaml) check the published inclusive AGI ceilings and fractional income above them. [Generated populations](../../../policyengine_us/tests/core/test_federal_2017_tax_history_properties.py) repeat these checks for all five filing statuses in every year from 2017 through 2026. diff --git a/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml b/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml deleted file mode 100644 index ecde41821de..00000000000 --- a/policyengine_us/parameters/gov/irs/gross_income/dependent_care_assistance_programs/prior_year_carryover_omitted.yaml +++ /dev/null @@ -1,24 +0,0 @@ -description: PolicyEngine leaves dependent care benefits carried over from the prior plan year (Form 2441 line 13) out of the benefits counted toward the federal dependent care assistance exclusion and taxable dependent care benefits, if this is true. -values: - 2017-01-01: false - # Section 214 of the Taxpayer Certainty and Disaster Tax Relief Act of - # 2020 let plans carry over unused benefits from plan years ending in 2020 - # and 2021; Notice 2021-26 disregards them for the section 129 limits of - # 2021 and 2022, and the 2021 and 2022 Forms 2441 add line 13 to the line - # 21 cap. The model does not apply that relief, so in these years it leaves - # line 13 out of both line 15 and the cap. - 2021-01-01: true - 2023-01-01: false -metadata: - unit: bool - period: year - label: Dependent care assistance prior-year carryover omitted - reference: - - title: 2021 Form 2441, Part III, line 21 - href: https://www.irs.gov/pub/irs-prior/f2441--2021.pdf#page=2 - - title: 2022 Form 2441, Part III, line 21 - href: https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2 - - title: 2023 Form 2441, Part III, line 21 - href: https://www.irs.gov/pub/irs-prior/f2441--2023.pdf#page=2 - - title: IRS Notice 2021-26 - href: https://www.irs.gov/pub/irs-drop/n-21-26.pdf#page=3 diff --git a/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py b/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py deleted file mode 100644 index d9e051f0111..00000000000 --- a/policyengine_us/tests/core/test_dependent_care_benefits_received_invariants.py +++ /dev/null @@ -1,189 +0,0 @@ -"""Form 2441 line 15 properties for grace-period carryovers and forfeitures. - -Form 2441 line 15 adds line 13 (prior-year benefits used in this year's grace -period) to line 12 and subtracts line 14 (amounts forfeited or carried -forward). Line 12 is dependent_care_employer_benefits: W-2 box 10, not -counting any amount above the plan's exclusion, which box 1 already includes -as wages. Line 25 excludes the smallest of line 15, line 16 qualified -expenses, earned income and the line 21 cap, and line 26 taxes the rest of -line 15. FTB 3506 lines 14 to 16 repeat lines 13 to 15 for California, with -California's own cap, and count line 13 in every year. For 2021 and 2022, -when line 21 adds line 13 to the cap under temporary relief rules, the federal -calculation leaves line 13 out of both line 15 and the cap, so those years' -federal results must match a return without the carryover. - -Each seeded filer has line 12 benefits (above $5,000 only when they come from -more than one employer's plan), an optional forfeiture of part of them and an -optional carryover. Wages other than line 12 benefits are fixed, and the -benefits sit inside employment_income as a pre-tax deduction. Qualified -expenses are an explicit tax-unit fact, as Form 2441 line 16 is. - -https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2 -https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5 -https://www.irs.gov/pub/irs-prior/f2441--2022.pdf#page=2 -https://www.ftb.ca.gov/forms/2025/2025-3506.pdf#page=2 -https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html -""" - -import numpy as np -import pytest - -from policyengine_us import Simulation - -TOLERANCE = 0.01 # dollars -SEED = 20261121 -# Form 2441 line 21 cap (joint or unmarried, ordinary separate), by year. -FEDERAL_CAP = { - 2020: (5_000, 2_500), - 2021: (10_500, 5_250), - 2022: (5_000, 2_500), - 2023: (5_000, 2_500), - 2025: (5_000, 2_500), - 2026: (7_500, 3_750), -} -# FTB 3506 Part IV line 22. -CALIFORNIA_CAP = (5_000, 2_500) -RELIEF_YEARS = {2021, 2022} -FILING_STATUSES = ["SINGLE", "JOINT", "HEAD_OF_HOUSEHOLD", "SEPARATE"] - - -def _units(n=120): - rng = np.random.default_rng(SEED) - - def filer(): - line_12 = float( - [0, rng.integers(1, 5_001), rng.integers(5_000, 9_001)][rng.integers(0, 3)] - ) - forfeited = float(rng.integers(0, line_12 + 1)) if rng.random() < 0.5 else 0.0 - return { - "wages": float(rng.integers(0, 120_001)), - "line_12": line_12, - "carryover": float(rng.integers(1, 3_001)) if rng.random() < 0.5 else 0.0, - "forfeited": forfeited, - } - - units = [] - for _ in range(n): - filing_status = str(rng.choice(FILING_STATUSES)) - units.append( - { - "filing_status": filing_status, - "filers": [filer()] + ([filer()] if filing_status == "JOINT" else []), - "children": int(rng.integers(1, 3)), - "expenses": float(rng.integers(0, 12_001)), - } - ) - return units - - -def _situation(units, year, with_carryover=True): - people, tax_units, households, marital_units = {}, {}, {}, {} - for i, unit in enumerate(units): - members = [] - for k, f in enumerate(unit["filers"]): - name = f"filer_{i}_{k}" - people[name] = { - "age": {year: 40}, - "is_tax_unit_head": {year: k == 0}, - "is_tax_unit_spouse": {year: k == 1}, - "employment_income": {year: f["wages"] + f["line_12"]}, - "dependent_care_employer_benefits": {year: f["line_12"]}, - "dependent_care_employer_benefits_forfeited_or_carried_forward": { - year: f["forfeited"] - }, - "dependent_care_employer_benefits_prior_year_carryover": { - year: f["carryover"] if with_carryover else 0.0 - }, - } - members.append(name) - marital_units[f"couple_{i}"] = {"members": list(members)} - for j in range(unit["children"]): - child = f"child_{i}_{j}" - people[child] = {"age": {year: 5}, "is_tax_unit_dependent": {year: True}} - members.append(child) - marital_units[f"single_{i}_{j}"] = {"members": [child]} - tax_units[f"tax_unit_{i}"] = { - "members": members, - "filing_status": {year: unit["filing_status"]}, - "dependent_care_assistance_qualified_expenses": {year: unit["expenses"]}, - # An isolated component input, as in the exclusion invariants test. - "ca_cdcc_min_head_spouse_earned": { - year: min(f["wages"] for f in unit["filers"]) - }, - } - households[f"household_{i}"] = { - "members": members, - "state_code": {year: "CA"}, - } - return { - "people": people, - "tax_units": tax_units, - "households": households, - "marital_units": marital_units, - } - - -def _line_15(filer, count_line_13): - carryover = filer["carryover"] if count_line_13 else 0.0 - return max(filer["line_12"] + carryover - filer["forfeited"], 0.0) - - -def _expected_exclusion(unit, caps, count_line_13): - line_15 = sum(_line_15(f, count_line_13) for f in unit["filers"]) - cap = caps[1] if unit["filing_status"] == "SEPARATE" else caps[0] - earned = min(f["wages"] for f in unit["filers"]) - return min(line_15, unit["expenses"], cap, earned) - - -@pytest.mark.parametrize("year", sorted(FEDERAL_CAP)) -def test_line_15_carryovers_and_forfeitures(year): - units = _units() - sim = Simulation(situation=_situation(units, year)) - exclusion = sim.calculate("dependent_care_assistance_exclusion", year) - california = sim.calculate("ca_dependent_care_assistance_exclusion", year) - taxable = sim.calculate("taxable_dependent_care_benefits", year) - income_tax_wages = sim.calculate("irs_employment_income", year) - payroll_tax_wages = sim.calculate("payroll_tax_gross_wages", year) - count_line_13 = year not in RELIEF_YEARS - - i = 0 - for u, unit in enumerate(units): - # 1. Line 25 and FTB 3506 line 26 from line 15 (FTB line 16), with - # California counting line 13 in every year. - expected = _expected_exclusion(unit, FEDERAL_CAP[year], count_line_13) - assert exclusion[u] == pytest.approx(expected, abs=TOLERANCE) - assert california[u] == pytest.approx( - _expected_exclusion(unit, CALIFORNIA_CAP, True), abs=TOLERANCE - ) - line_15 = [_line_15(f, count_line_13) for f in unit["filers"]] - unit_taxable = max(sum(line_15) - expected, 0.0) - for k, f in enumerate(unit["filers"]): - # 2. Line 26, split by each filer's own line 15 amount. - share = line_15[k] / sum(line_15) if sum(line_15) > 0 else 0.0 - assert taxable[i] == pytest.approx(unit_taxable * share, abs=TOLERANCE) - # 3. Lines 13 and 14 leave income tax and FICA wages unchanged. - assert income_tax_wages[i] == pytest.approx(f["wages"], abs=TOLERANCE) - assert payroll_tax_wages[i] == pytest.approx(f["wages"], abs=TOLERANCE) - i += 1 - # Children have no line 15 and no taxable benefits. - for _ in range(unit["children"]): - assert taxable[i] == 0 - i += 1 - - -@pytest.mark.parametrize("year", sorted(RELIEF_YEARS)) -def test_relief_years_ignore_line_13(year): - # 4. In 2021 and 2022 the carryover changes no federal result, as on - # main. California counts it (checked above). - units = _units() - with_carryover = Simulation(situation=_situation(units, year)) - without = Simulation(situation=_situation(units, year, with_carryover=False)) - for variable in [ - "dependent_care_assistance_exclusion", - "taxable_dependent_care_benefits", - "cdcc_limit", - ]: - np.testing.assert_array_equal( - with_carryover.calculate(variable, year), - without.calculate(variable, year), - ) diff --git a/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml b/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml index ac376aab9f6..6a8998d5f7d 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.yaml @@ -2,11 +2,12 @@ # Form 2441 Part III. Dollar/earnings-limit unit cases explicitly supply # sufficient qualified expenses; the full-household cases also test that limit. # The exclusion is the lesser of qualified expenses, employer benefits -# (Form 2441 line 15: line 12, plus grace-period carryovers, less amounts -# forfeited or carried forward), the section 129(a)(2)(A) dollar cap (by -# filing status), and the section 129(b) earned-income limit. Line 12 is +# (Form 2441 line 15: line 12 less amounts forfeited or carried forward on +# line 14), the section 129(a)(2)(A) dollar cap (by filing status), and the +# section 129(b) earned-income limit. Line 12 is # dependent_care_employer_benefits: W-2 box 10, not counting any amount -# above the plan's exclusion, which box 1 already includes as wages. +# above the plan's exclusion, which box 1 already includes as wages. Line 13 +# (grace-period carryovers used) is not modeled. - name: No employer dependent care benefits gives no exclusion period: 2024 @@ -972,150 +973,60 @@ dependent_care_assistance_exclusion: 4_950 taxable_dependent_care_benefits: [0, 0] -- name: A grace-period carryover supports an exclusion without box 10 benefits. +- name: A negative line 14 entry counts as zero. period: 2025 input: people: head: age: 35 employment_income: 50_000 - dependent_care_employer_benefits_prior_year_carryover: 1_000 - child: - age: 5 - tax_units: - tax_unit: - members: [head, child] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 1_000 - tax_unit_childcare_expenses: 1_000 - households: - household: - members: [head, child] - state_code: TX - output: - # Line 15 is the $1,000 carryover (line 13), all excluded. Section - # 21(c) reduces the $3,000 credit limit by it. - dependent_care_assistance_exclusion: 1_000 - taxable_dependent_care_benefits: [0, 0] - cdcc_limit: 2_000 - -- name: For 2022 a line 13 carryover adds nothing to taxable benefits. - period: 2022 - input: - people: - head: - age: 35 - employment_income: 55_000 - dependent_care_employer_benefits: 5_000 - # Unused 2021 plan-year benefits used in 2022 (line 13). - dependent_care_employer_benefits_prior_year_carryover: 1_500 - child: - age: 5 - tax_units: - tax_unit: - members: [head, child] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 7_000 - tax_unit_childcare_expenses: 7_000 - households: - household: - members: [head, child] - state_code: TX - output: - # 2022 Form 2441: line 15 is $5,000 + $1,500 = $6,500, and line 21 adds - # the $1,500 on line 13 to the $5,000 cap, so line 25 is $6,500 and line - # 26 is $0. Temporary relief rules govern such carryovers, so the model - # leaves line 13 out of both line 15 and the cap for 2021 and 2022 - # (prior_year_carryover_omitted). That gives the same line 26 of $0 but - # an exclusion of $5,000 rather than the form's $6,500, so this case - # asserts only line 26 and AGI. - taxable_dependent_care_benefits: [0, 0] - adjusted_gross_income: 50_000 - -- name: For 2021 a line 13 carryover above the $10,500 cap adds nothing to taxable benefits. - period: 2021 - input: - people: - head: - age: 35 - # Box 1 wages of $70,000 plus $10,500 of box 10 benefits under a plan - # that adopted the 2021 limit. - employment_income: 80_500 - dependent_care_employer_benefits: 10_500 - # Unused 2020 plan-year benefits used in 2021 (line 13). - dependent_care_employer_benefits_prior_year_carryover: 1_500 + dependent_care_employer_benefits: 3_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: -2_000 child: age: 5 tax_units: tax_unit: members: [head, child] filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 13_000 - tax_unit_childcare_expenses: 13_000 + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 households: household: members: [head, child] state_code: TX output: - # 2021 Form 2441: line 15 is $10,500 + $1,500 = $12,000, and line 21 - # adds the $1,500 on line 13 to the $10,500 cap, so line 25 is $12,000 - # and line 26 is $0. The model leaves line 13 out of both line 15 and - # the cap (prior_year_carryover_omitted): the same line 26 of $0, with an - # exclusion of $10,500 rather than $12,000, so this case asserts only - # line 26 and AGI. Counting line 13 without raising the cap would tax - # $1,500. + # Line 15 is the $3,000 on line 12; the negative entry cannot raise it. + dependent_care_assistance_exclusion: 3_000 taxable_dependent_care_benefits: [0, 0] - adjusted_gross_income: 70_000 - -- name: The 2023 cap does not add the line 13 carryover. - period: 2023 - input: - people: - head: - age: 35 - employment_income: 55_000 - dependent_care_employer_benefits: 5_000 - dependent_care_employer_benefits_prior_year_carryover: 1_500 - child: - age: 5 - tax_units: - tax_unit: - members: [head, child] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 7_000 - tax_unit_childcare_expenses: 7_000 - households: - household: - members: [head, child] - state_code: TX - output: - # 2023 Form 2441 line 21 is $5,000. Line 15 is $6,500; line 26 is $1,500. - dependent_care_assistance_exclusion: 5_000 - taxable_dependent_care_benefits: [1_500, 0] -- name: Negative line 13 and line 14 entries count as zero. +- name: Benefits carried forward on line 14 limit the exclusion below qualified expenses. period: 2025 input: people: head: age: 35 - employment_income: 50_000 - dependent_care_employer_benefits: 3_000 - dependent_care_employer_benefits_prior_year_carryover: -500 - dependent_care_employer_benefits_forfeited_or_carried_forward: -2_000 + employment_income: 45_000 + dependent_care_employer_benefits: 5_000 + # The filer incurred $5,000 of 2025 expenses but claimed only $4,000 + # from the plan; the $1,000 balance carries forward to the plan's + # 2026 grace period. Line 14 enters it: "Any amount you didn't + # receive but are permitted by your employer to carry forward". + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 child: age: 5 tax_units: tax_unit: members: [head, child] filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 9_000 - tax_unit_childcare_expenses: 9_000 + dependent_care_assistance_qualified_expenses: 5_000 + tax_unit_childcare_expenses: 5_000 households: household: members: [head, child] state_code: TX output: - # Line 15 is the $3,000 on line 12; neither entry can lower or raise it. - dependent_care_assistance_exclusion: 3_000 + # Line 15: $5,000 - $1,000 = $4,000, below the $5,000 of qualified + # expenses (line 16) and the $5,000 cap, so line 25 is $4,000. Without + # line 14 it would be $5,000. Line 26: $0. + dependent_care_assistance_exclusion: 4_000 taxable_dependent_care_benefits: [0, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml index 336ad4458f5..a1ea1ed02a8 100644 --- a/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml +++ b/policyengine_us/tests/policy/baseline/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.yaml @@ -189,11 +189,13 @@ payroll_tax_gross_wages: 30_000 taxable_dependent_care_benefits: 0 -# Form 2441 line 15 adds prior-year benefits used in this year's grace period -# (line 13) to the line 12 benefits and subtracts amounts forfeited or -# carried forward (line 14). Line 12 is dependent_care_employer_benefits: W-2 -# box 10, not counting any amount above the plan's exclusion, which box 1 +# Form 2441 line 15 subtracts the amounts forfeited or carried forward (line +# 14) from the line 12 benefits. Line 12 is dependent_care_employer_benefits: +# W-2 box 10, not counting any amount above the plan's exclusion, which box 1 # already includes as wages. Line 26 is line 15 less the line 25 exclusion. +# Line 13 (grace-period carryovers used) is not modeled; +# taxable_dependent_care_benefits_reported supplies a line 26 amount, and a +# negative amount (the default -1) means not supplied. - name: Forfeited benefits are neither excluded nor taxable, 2025 period: 2025 @@ -223,13 +225,15 @@ # forfeited $1,000. Line 15: $5,000 - $1,000 = $4,000. Line 25: the # smallest of $4,000, $4,000 of qualified expenses (line 16), $23,000 of # earned income and the $5,000 cap. Line 26: $0. Without line 14, line - # 26 would be $1,000 and AGI $24,000. + # 26 would be $1,000 and AGI $24,000. Line 14 leaves income tax and FICA + # wages at box 1. irs_employment_income: [23_000, 0] + payroll_tax_gross_wages: [23_000, 0] dependent_care_assistance_exclusion: 4_000 taxable_dependent_care_benefits: [0, 0] adjusted_gross_income: 23_000 -- name: Box 10 above the plan's exclusion stays in wages when part is forfeited, 2025 +- name: Box 10 above the plan's exclusion stays in wages when part is carried forward, 2025 period: 2025 input: people: @@ -241,8 +245,10 @@ # $5,000. employment_income: 29_000 dependent_care_employer_benefits: 5_000 - # The filer incurred $5,000 of expenses and forfeited $1,000; line 14 - # enters the forfeited amount included on line 12. + # The filer incurred $5,000 of 2025 expenses but claimed only $4,000 + # from the plan; the $1,000 balance carries forward to the plan's + # 2026 grace period. Line 14 enters it: "Any amount you didn't + # receive but are permitted by your employer to carry forward". dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 child: age: 3 @@ -264,7 +270,142 @@ taxable_dependent_care_benefits: [0, 0] adjusted_gross_income: 24_000 -- name: Grace-period carryover adds to the benefits, 2025 +- name: Joint return splits the taxable part by each spouse's line 15 amount, 2025 + period: 2025 + absolute_error_margin: 0.01 + input: + people: + head: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + spouse: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Line 15: $4,000 + $5,000 = $9,000. Line 25: $5,000 cap. Line 26: + # $4,000, split 4:5. + dependent_care_assistance_exclusion: 5_000 + taxable_dependent_care_benefits: [1_777.78, 2_222.22, 0] + irs_employment_income: [55_000, 55_000, 0] + adjusted_gross_income: 114_000 + +- name: One spouse's line 14 cannot reduce the other spouse's line 15, 2025 + period: 2025 + input: + people: + head: + age: 40 + employment_income: 60_000 + # A forfeiture entered for a spouse with no benefits of their own. + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + spouse: + age: 40 + employment_income: 65_000 + dependent_care_employer_benefits: 5_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 3_000 + tax_unit_childcare_expenses: 3_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Each person's line 14 comes from their own line 12, so the head's part + # of line 15 is floored at $0 and the spouse's stays $5,000. Line 25: + # $3,000 of qualified expenses. Line 26: $2,000, all the spouse's. + dependent_care_assistance_exclusion: 3_000 + taxable_dependent_care_benefits: [0, 2_000, 0] + adjusted_gross_income: 122_000 + +- name: A dependent's line 14 lowers only the dependent's own line 15, 2025 + period: 2025 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + child: + age: 3 + dependent: + age: 19 + is_tax_unit_dependent: true + employment_income: 6_000 + dependent_care_employer_benefits: 300 + # More than the dependent's own $300 of line 12. + dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + tax_units: + tax_unit: + members: [head, child, dependent] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child, dependent] + state_code: TX + output: + # The dependent's part of line 15 is max($300 - $1,000, 0) = $0; the + # head's stays $5,000. Line 25: $4,000 of qualified expenses. Line 26: + # $1,000, all the head's. The model sums every member's line 15, as it + # sums line 12 on main, so without the entry line 15 would be $5,300. + dependent_care_assistance_exclusion: 4_000 + taxable_dependent_care_benefits: [1_000, 0, 0] + +- name: A negative line 12 entry counts as zero in line 15, 2025 + period: 2025 + input: + people: + head: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + spouse: + age: 40 + employment_income: 60_000 + # Box 10 cannot be negative; this pins how the model treats one. + dependent_care_employer_benefits: -1_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 3_000 + tax_unit_childcare_expenses: 3_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Line 15 parts: $5,000 and $0. Line 25: $3,000 of qualified expenses. + # Line 26: $2,000, all the head's. Before line 14 was modeled, the -$1,000 + # netted against the head's $5,000: line 26 was $1,000, split $1,250 and + # -$250. + dependent_care_assistance_exclusion: 3_000 + taxable_dependent_care_benefits: [2_000, 0, 0] + +- name: A supplied line 26 amount replaces the computed share, and the exclusion stays computed, 2025 period: 2025 input: people: @@ -272,28 +413,65 @@ age: 35 employment_income: 44_000 dependent_care_employer_benefits: 4_000 - # Unused 2024 benefits used in the 2025 grace period (line 13). - dependent_care_employer_benefits_prior_year_carryover: 1_500 - child: + # The filer also used $1,500 of 2024 benefits in the 2025 grace + # period (line 13, not modeled). Form 2441: line 15 $5,500, line 25 + # the $5,000 cap, line 26 $500. + taxable_dependent_care_benefits_reported: 500 + child_1: age: 3 + child_2: + age: 6 tax_units: tax_unit: - members: [head, child] + members: [head, child_1, child_2] filing_status: HEAD_OF_HOUSEHOLD dependent_care_assistance_qualified_expenses: 6_000 tax_unit_childcare_expenses: 6_000 households: household: - members: [head, child] + members: [head, child_1, child_2] state_code: TX output: - # Line 15: $4,000 + $1,500 = $5,500. Line 25: $5,000 cap. Line 26: $500. - irs_employment_income: [40_000, 0] - dependent_care_assistance_exclusion: 5_000 - taxable_dependent_care_benefits: [500, 0] + # Line 26 is used as entered. The exclusion stays computed from line 15 + # without line 13: $4,000, where the form's is $5,000. The credit limit + # follows the computed exclusion: $6,000 - $4,000 = $2,000 (the form's + # line 29 is $6,000 - $5,000 = $1,000). + taxable_dependent_care_benefits: [500, 0, 0] + dependent_care_assistance_exclusion: 4_000 + cdcc_limit: 2_000 + irs_employment_income: [40_000, 0, 0] adjusted_gross_income: 40_500 -- name: Joint return splits the taxable part by each spouse's line 15 amount, 2025 +- name: A supplied line 26 of zero is used as entered, 2025 + period: 2025 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + # The $1,000 forfeiture is not entered on line 14, but the filer's + # Form 2441 shows line 26 of $0. + taxable_dependent_care_benefits_reported: 0 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + # The computed share would be $5,000 - $4,000 = $1,000. + taxable_dependent_care_benefits: [0, 0] + dependent_care_assistance_exclusion: 4_000 + adjusted_gross_income: 23_000 + +- name: One spouse's supplied line 26 leaves the other spouse's computed share, 2025 period: 2025 absolute_error_margin: 0.01 input: @@ -303,6 +481,7 @@ employment_income: 60_000 dependent_care_employer_benefits: 5_000 dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + taxable_dependent_care_benefits_reported: 0 spouse: age: 40 employment_income: 60_000 @@ -320,43 +499,245 @@ members: [head, spouse, child] state_code: TX output: - # Line 15: $4,000 + $5,000 = $9,000. Line 25: $5,000 cap. Line 26: - # $4,000, split 4:5. + # The computed line 26 of $4,000 splits 4:5 as $1,777.78 and $2,222.22. + # The head's $0 replaces only the head's share. dependent_care_assistance_exclusion: 5_000 - taxable_dependent_care_benefits: [1_777.78, 2_222.22, 0] - irs_employment_income: [55_000, 55_000, 0] - adjusted_gross_income: 114_000 + taxable_dependent_care_benefits: [0, 2_222.22, 0] -- name: One spouse's line 14 cannot reduce the other spouse's line 15, 2025 +- name: A supplied line 26 above this year's line 12 is used as entered, 2025 + period: 2025 + input: + people: + head: + age: 35 + employment_income: 30_000 + # No 2025 benefits (line 12 $0). The filer used $3,000 of 2024 + # benefits in the 2025 grace period (line 13, not modeled). Form + # 2441: line 15 $3,000, line 25 the $2,000 of qualified expenses, + # line 26 $1,000. + taxable_dependent_care_benefits_reported: 1_000 + child: + age: 4 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 2_000 + tax_unit_childcare_expenses: 2_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Line 26 is used as entered though the model's line 15 is $0; the + # exclusion stays computed at $0 (the form's is $2,000). + taxable_dependent_care_benefits: [1_000, 0] + dependent_care_assistance_exclusion: 0 + adjusted_gross_income: 31_000 + +- name: A negative supplied line 26 means not supplied, 2025 period: 2025 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + taxable_dependent_care_benefits_reported: -500 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + # Any negative amount, not only the default -1, means not supplied, so + # the computed share applies: $5,000 - $4,000 = $1,000. + taxable_dependent_care_benefits: [1_000, 0] + +# Each input below has a formula that returns its not-supplied value, so Core +# neither carries an entry into a later year nor uprates it: a year without +# an entry uses zero on line 14 and the computed share of line 26. + +- name: A line 14 entry for 2025 does not reach 2026 + period: 2026 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: + 2025: 1_000 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + # 2026 line 15: $5,000. Line 25: $4,000 of qualified expenses (the 2026 + # cap is $7,500). Line 26: $1,000. Carrying the 2025 entry forward, + # uprated, would leave line 26 at $0. + dependent_care_assistance_exclusion: 4_000 + taxable_dependent_care_benefits: [1_000, 0] + +- name: An explicit zero line 14 entry for 2026 after a 2025 entry + period: 2026 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: + 2025: 1_000 + 2026: 0 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + dependent_care_assistance_exclusion: 4_000 + taxable_dependent_care_benefits: [1_000, 0] + +- name: One spouse's 2025 line 14 and the other's 2026 line 14 + period: 2026 + absolute_error_margin: 0.01 input: people: head: age: 40 employment_income: 60_000 - # A forfeiture entered for a spouse with no benefits of their own. - dependent_care_employer_benefits_forfeited_or_carried_forward: 1_000 + dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: + 2025: 1_000 spouse: age: 40 - employment_income: 65_000 + employment_income: 60_000 dependent_care_employer_benefits: 5_000 + dependent_care_employer_benefits_forfeited_or_carried_forward: + 2026: 500 child: age: 4 tax_units: tax_unit: members: [head, spouse, child] filing_status: JOINT - dependent_care_assistance_qualified_expenses: 3_000 - tax_unit_childcare_expenses: 3_000 + # The $9,500 of 2026 benefits received pays $9,500 of expenses. + dependent_care_assistance_qualified_expenses: 9_500 + tax_unit_childcare_expenses: 9_500 households: household: members: [head, spouse, child] state_code: TX output: - # Each person's line 14 comes from their own line 12 and line 13, so the - # head's part of line 15 is floored at $0 and the spouse's stays $5,000. - # Line 25: $3,000 of qualified expenses. Line 26: $2,000, all the - # spouse's. - dependent_care_assistance_exclusion: 3_000 - taxable_dependent_care_benefits: [0, 2_000, 0] - adjusted_gross_income: 122_000 + # 2026 line 15: the head's $5,000 (no 2026 entry) plus the spouse's + # $4,500. Line 25: the $7,500 cap. Line 26: $2,000, split 50:45. + dependent_care_assistance_exclusion: 7_500 + taxable_dependent_care_benefits: [1_052.63, 947.37, 0] + +- name: A supplied line 26 for 2025 does not reach 2026 + period: 2026 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + taxable_dependent_care_benefits_reported: + 2025: 0 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + # 2026 uses the computed share: $5,000 - $4,000 = $1,000. + taxable_dependent_care_benefits: [1_000, 0] + +- name: An explicit zero line 26 for 2026 after a 2025 entry + period: 2026 + input: + people: + head: + age: 45 + employment_income: 28_000 + dependent_care_employer_benefits: 5_000 + taxable_dependent_care_benefits_reported: + 2025: 300 + 2026: 0 + child: + age: 3 + tax_units: + tax_unit: + members: [head, child] + filing_status: HEAD_OF_HOUSEHOLD + dependent_care_assistance_qualified_expenses: 4_000 + tax_unit_childcare_expenses: 4_000 + households: + household: + members: [head, child] + state_code: TX + output: + taxable_dependent_care_benefits: [0, 0] + +- name: One spouse's 2025 line 26 and the other's 2026 line 26 + period: 2026 + input: + people: + head: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + taxable_dependent_care_benefits_reported: + 2025: 0 + spouse: + age: 40 + employment_income: 60_000 + dependent_care_employer_benefits: 5_000 + taxable_dependent_care_benefits_reported: + 2026: 0 + child: + age: 4 + tax_units: + tax_unit: + members: [head, spouse, child] + filing_status: JOINT + dependent_care_assistance_qualified_expenses: 9_000 + tax_unit_childcare_expenses: 9_000 + households: + household: + members: [head, spouse, child] + state_code: TX + output: + # Computed 2026 line 26: $10,000 - $7,500 = $2,500, split equally. The + # head has no 2026 entry and keeps $1,250; the spouse's $0 is used. + taxable_dependent_care_benefits: [1_250, 0, 0] diff --git a/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml b/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml index 107508bbae7..bef9d6103ed 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/al/tax/income/deductions/al_federal_income_tax_deduction.yaml @@ -293,54 +293,6 @@ cdcc: 3_500 al_federal_income_tax_deduction: 4_390 -- name: 2021 head of household, two children, $2,000 grace-period carryover - the 2020-rule CDCC counts Form 2441 line 13 - # 2021 worksheet Part II recomputes lines 3, 4, 8b and 9e "based on 2020 - # calculations using 2021 information"; line 4 enters the CDCC "based on - # 2020 Form 2441 Line 11". On the 2020 form, line 15 combines lines 12 - # through 14, so it includes the $2,000 carried over from the 2020 plan year - # and used in the 2021 grace period (line 13), and line 21 is $5,000 with no - # line 13 addition. - # Actual 2021: the 2021 form adds line 13 to the $10,500 cap and excludes - # $5,000, so its CDCC is 50% x min(16,000 - 5,000, 9,000 - 5,000) = - # 2,000. The model leaves line 13 out for 2021 (exclusion 3,000, CDCC - # 3,000), so this case asserts no federal 2021 value. Either way the - # CDCC is refundable. Taxable income 60,000 - 18,800 = 41,200; tax - # 1,420 + 12% x 27,000 = 4,660. CTC 3,600 + 3,000 = 6,600, all - # refundable, so Part I is 0. - # Part II, 2020 rules: line 15 = 3,000 + 2,000 = 5,000; exclusion - # min(5,000, 9,000, 5,000) = 5,000; limit 6,000 - 5,000 = 1,000; rate 20%; - # CDCC 200. CTC 4,000, all non-refundable. Line 6 = 4,660 - 4,000 - 200 = - # 460. Without the carryover the 2020-rule CDCC is 20% x 3,000 = 600 and - # the deduction is 60. - absolute_error_margin: 1 - period: 2021 - input: - people: - head: - age: 35 - # Box 1 wages are $60,000 ($63,000 - $3,000 of box 10 benefits). - employment_income: 63_000 - dependent_care_employer_benefits: 3_000 - dependent_care_employer_benefits_prior_year_carryover: 2_000 - child1: - age: 3 - is_tax_unit_dependent: true - child2: - age: 6 - is_tax_unit_dependent: true - tax_units: - tax_unit: - members: [head, child1, child2] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 9_000 - tax_unit_childcare_expenses: 9_000 - households: - household: - members: [head, child1, child2] - state_code: AL - output: - al_federal_income_tax_deduction: 460 - - name: Alabama subtracts payment credits and only refundable AOC # Ala. Admin. Code r. 810-3-15-.20(1)(d)2 requires all payment credits. # Federal tax already reflects the nonrefundable $1,500 of the total AOC. diff --git a/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml b/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml index e49a05b0a79..4ec733c4fa9 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/ca/tax/income/credits/child_dependent_care/ca_dependent_care_assistance_exclusion.yaml @@ -242,35 +242,7 @@ dependent_care_assistance_exclusion: 0 ca_dependent_care_assistance_exclusion: 0 -- name: California counts a grace-period carryover as the federal exclusion does, 2025 - period: 2025 - input: - people: - head: - age: 35 - employment_income: 50_000 - # FTB 3506 line 14, as Form 2441 line 13. - dependent_care_employer_benefits_prior_year_carryover: 1_000 - child: - age: 5 - tax_units: - tax_unit: - members: [head, child] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 1_000 - tax_unit_childcare_expenses: 1_000 - households: - household: - members: [head, child] - state_code: CA - output: - # FTB 3506 line 16 and Form 2441 line 15 are both $1,000, all excluded, - # so nothing returns to California AGI. - dependent_care_assistance_exclusion: 1_000 - ca_dependent_care_assistance_exclusion: 1_000 - ca_dependent_care_assistance_addition: 0 - -- name: California nets forfeited benefits as the federal exclusion does, 2025 +- name: California nets carried-forward benefits as the federal exclusion does, 2025 period: 2025 input: people: @@ -279,7 +251,9 @@ employment_income: 55_000 # FTB 3506 line 13, as Form 2441 line 12. dependent_care_employer_benefits: 5_000 - # FTB 3506 line 15, as Form 2441 line 14. + # FTB 3506 line 15, as Form 2441 line 14. The filer incurred $4,000 + # of 2025 expenses but claimed only $3,000 from the plan; the $2,000 + # balance carries forward to the plan's 2026 grace period. dependent_care_employer_benefits_forfeited_or_carried_forward: 2_000 child: age: 5 @@ -301,36 +275,3 @@ ca_dependent_care_assistance_exclusion: 3_000 ca_dependent_care_assistance_addition: 0 taxable_dependent_care_benefits: [0, 0] - -- name: California counts a grace-period carryover in 2021, when the federal calculation leaves it out - period: 2021 - input: - people: - head: - age: 35 - employment_income: 63_000 - dependent_care_employer_benefits: 3_000 - # Unused 2020 plan-year benefits used in 2021 (Form 2441 line 13). - dependent_care_employer_benefits_prior_year_carryover: 2_000 - child: - age: 5 - tax_units: - tax_unit: - members: [head, child] - filing_status: HEAD_OF_HOUSEHOLD - dependent_care_assistance_qualified_expenses: 9_000 - tax_unit_childcare_expenses: 9_000 - households: - household: - members: [head, child] - state_code: CA - output: - # 2021 FTB 3506 instructions, line 14: "Enter the amount from federal - # Form 2441, line 13." Line 16: $3,000 + $2,000 = $5,000. Line 22 is a - # flat $5,000, with no line 14 addition. Line 26: the smallest of - # $5,000, $9,000 of qualified expenses and $60,000 of earned income, so - # $5,000. The 2021 Form 2441 also excludes $5,000 (line 21 adds line 13 - # to the $10,500 cap), so nothing returns to California AGI. The model's - # federal exclusion leaves line 13 out in 2021 and is not asserted here. - ca_dependent_care_assistance_exclusion: 5_000 - ca_dependent_care_assistance_addition: 0 diff --git a/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py b/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py index 70422a77a03..0d12125e708 100644 --- a/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py +++ b/policyengine_us/variables/gov/irs/credits/cdcc/dependent_care_assistance_exclusion.py @@ -31,10 +31,10 @@ class dependent_care_assistance_exclusion(Variable): def formula(tax_unit, period, parameters): # Form 2441 line 15: employer-provided dependent care benefits (line - # 12, W-2 box 10 less any amount above the plan's exclusion), plus - # prior-year benefits used in this year's grace period (line 13), less - # benefits forfeited or carried forward (line 14). - benefits = tax_unit.sum(form_2441_line_15(tax_unit.members, period, parameters)) + # 12, W-2 box 10 less any amount above the plan's exclusion), less + # benefits forfeited or carried forward (line 14). Line 13 (grace-period + # carryovers used) is not modeled. + benefits = tax_unit.sum(form_2441_line_15(tax_unit.members, period)) if not np.any(benefits > 0): return np.zeros_like(benefits) p = parameters(period).gov.irs.gross_income.dependent_care_assistance_programs diff --git a/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py b/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py index d39cefa1dd6..13a8c7115b5 100644 --- a/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py +++ b/policyengine_us/variables/gov/irs/income/taxable_income/adjusted_gross_income/irs_gross_income/taxable_dependent_care_benefits.py @@ -10,12 +10,19 @@ class taxable_dependent_care_benefits(Variable): label = "Taxable dependent care benefits" documentation = ( "Employer dependent care benefits above the IRC 129 exclusion (Form " - "2441 line 26, reported on Form 1040 line 1e). Box 1 wages leave out " - "all of dependent_care_employer_benefits, so this adds back the part " - "the filer received and cannot exclude: Form 2441 line 15 (line 12 " - "benefits plus grace-period carryovers, less amounts forfeited or " - "carried forward) less the exclusion. The tax unit's amount is split " - "among its members in proportion to their line 15 amounts." + "2441 line 26, reported on Form 1040 line 1e from 2022). Box 1 wages " + "leave out all of dependent_care_employer_benefits, so this adds back " + "the part the filer received and cannot exclude: Form 2441 line 15 " + "(line 12 benefits less amounts forfeited or carried forward) less " + "the exclusion. The tax unit's amount is split among its members in " + "proportion to their line 15 amounts. A person's supplied " + "taxable_dependent_care_benefits_reported of zero or more replaces " + "their computed share; the exclusion and the child and dependent " + "care credit stay computed, though the credit's rate follows " + "adjusted gross income, which includes this amount. Supply " + "taxable_dependent_care_benefits_reported rather than setting this " + "variable: an input here replaces the formula for every person in " + "the simulation that year, and people without a value get zero." ) unit = USD definition_period = YEAR @@ -29,9 +36,9 @@ class taxable_dependent_care_benefits(Variable): def formula(person, period, parameters): tax_unit = person.tax_unit - # Each person's part of Form 2441 line 15: line 12 benefits plus - # grace-period carryovers, less amounts forfeited or carried forward. - benefits = form_2441_line_15(person, period, parameters) + # Each person's part of Form 2441 line 15: line 12 benefits less + # amounts forfeited or carried forward (line 14). + benefits = form_2441_line_15(person, period) # The tax_unit projector returns each member's unit-level value. unit_benefits = tax_unit.sum(benefits) exclusion = tax_unit("dependent_care_assistance_exclusion", period) @@ -44,4 +51,8 @@ def formula(person, period, parameters): out=np.zeros_like(benefits), where=unit_benefits > 0, ) - return unit_taxable * share + # A supplied line 26 amount of zero or more replaces this person's + # computed share; a negative amount, such as the default -1, means + # not supplied. + reported = person("taxable_dependent_care_benefits_reported", period) + return where(reported >= 0, reported, unit_taxable * share) diff --git a/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py b/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py index 9f4f6e4053a..fad405babb5 100644 --- a/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py +++ b/policyengine_us/variables/gov/states/ca/tax/income/credits/ca_dependent_care_assistance_exclusion.py @@ -27,16 +27,10 @@ class ca_dependent_care_assistance_exclusion(Variable): def formula(tax_unit, period, parameters): # FTB 3506 line 16: employer benefits (line 13, as Form 2441 line - # 12), plus grace-period carryovers (line 14, "the amount from federal - # Form 2441, line 13" in the 2021 instructions), less amounts - # forfeited or carried forward (line 15). Line 22 never adds line 14 - # to California's cap, so line 14 counts in every year, including - # 2021 and 2022. - benefits = tax_unit.sum( - form_2441_line_15( - tax_unit.members, period, parameters, always_count_line_13=True - ) - ) + # 12) less amounts forfeited or carried forward (line 15, as Form 2441 + # line 14). Line 14, grace-period carryovers used, is not modeled, as + # on the federal form. + benefits = tax_unit.sum(form_2441_line_15(tax_unit.members, period)) if not np.any(benefits > 0): return np.zeros_like(benefits) p = parameters(period).gov.states.ca.tax.income.credits.child_dependent_care diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py index 64ca4173bcc..57aa79e00f9 100644 --- a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py +++ b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits.py @@ -1,32 +1,22 @@ from policyengine_us.model_api import * -def form_2441_line_15(person, period, parameters, always_count_line_13=False): +def form_2441_line_15(person, period): """Each person's part of Form 2441 line 15 (FTB 3506 line 16). Line 12 is dependent_care_employer_benefits: W-2 box 10 benefits, not counting any box 10 amount above the plan's exclusion, which the employer - already reports as box 1 wages. Line 15 adds prior-year benefits used in - this year's grace period (line 13) and subtracts amounts forfeited or - carried forward to the next year (line 14). Line 14 amounts come from - line 12 (on the 2021-2024 forms, line 12 or 13), and each person's come - from their own benefits, so the result is floored at zero for each - person. A negative line 13 or line 14 entry counts as zero. - - For 2021 and 2022, Form 2441 line 21 adds line 13 to the cap, and - temporary relief rules govern carryovers from plan years ending in 2020 - and 2021. The model doesn't apply those rules, so in those years the - federal calculation leaves line 13 out of line 15, as it does out of the - cap (prior_year_carryover_omitted). Alabama's 2021 recompute pins that - parameter to its 2020 value, false, so it counts line 13, as the 2020 - form does. FTB 3506 line 22 never adds line 13 to California's cap, and - FTB 3506 line 14 enters the Form 2441 line 13 amount, so California - passes always_count_line_13 and counts it in every year. + already reports as box 1 wages. Line 15 subtracts the amounts forfeited + or carried forward to the next year (line 14). Line 13, prior-year + benefits used this year (in the grace period; in 2021 and 2022, also + carryovers under the relief rules), is not modeled and counts as zero; + taxable_dependent_care_benefits_reported takes a line 26 amount for + returns that have one. Each person's line 14 comes from their own line + 12, so the result is floored at zero for each person: a line 14 entry + above the person's own line 12 reduces nothing else, and a negative line + 12 or line 14 entry counts as zero. """ line_12 = person("dependent_care_employer_benefits", period) - line_13 = max_( - person("dependent_care_employer_benefits_prior_year_carryover", period), 0 - ) line_14 = max_( person( "dependent_care_employer_benefits_forfeited_or_carried_forward", @@ -34,12 +24,7 @@ def form_2441_line_15(person, period, parameters, always_count_line_13=False): ), 0, ) - # Only a carryover needs the relief-year switch, so a return without one - # never reads it, as in years before the parameter's first value. - if not always_count_line_13 and np.any(line_13 > 0): - p = parameters(period).gov.irs.gross_income.dependent_care_assistance_programs - line_13 = where(p.prior_year_carryover_omitted, 0, line_13) - return max_(line_12 + line_13 - line_14, 0) + return max_(line_12 - line_14, 0) class dependent_care_employer_benefits(Variable): diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py index bd459d857ac..b25449ec533 100644 --- a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py +++ b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_forfeited_or_carried_forward.py @@ -6,18 +6,24 @@ class dependent_care_employer_benefits_forfeited_or_carried_forward(Variable): entity = Person label = "Dependent care benefits forfeited or carried forward to the next year" documentation = ( - "Form 2441 line 14: the part of this person's " + "Form 2441 line 14 (FTB 3506 line 15): the part of this person's " "dependent_care_employer_benefits (line 12) that they did not " - "receive this year, either forfeited because no expense was incurred " - "or carried forward to next year's grace period. On the 2021-2024 " - "forms line 14 can also come from line 13. W-2 box 10 includes these " - "amounts and box 1 leaves them out, as it leaves out all of line 12, " - "so they are neither wages nor taxable dependent care benefits. Box " - "10 amounts above the plan's exclusion are box 1 wages, not line 12, " - "and do not go here. Enter each person's own amount: it reduces only " - "that person's line 12 and line 13, and any amount beyond them counts " - "as zero. In 2021 and 2022, when the federal calculation leaves line " - "13 out, it subtracts all of this amount from line 12." + "receive this year, either forfeited because they did not incur the " + "expense or carried forward to use in the next year. W-2 box 10 " + "includes these amounts and box 1 leaves them out, as it leaves out " + "all of line 12, so they are neither wages nor taxable dependent care " + "benefits. Box 10 amounts above the plan's exclusion are box 1 wages, " + "not line 12, and do not go here. On the 2021 to 2024 forms line 14 " + "also takes amounts from line 13 (prior-year benefits used this year) " + "that were forfeited or carried over, which the model does not " + "include; enter only the part from line 12. Enter each person's own " + "amount: it reduces only that person's line 12, and any amount beyond " + "it, or a negative amount, counts as zero. An entry applies only to " + "the year entered; a year without one uses zero. Because of its " + "formula, Core does not count this as an input variable, so " + "Simulation.to_input_dict() and to_input_dataframe() leave a supplied " + "amount out unless include_computed_variables=True; supply it in the " + "situation or with set_input." ) unit = USD definition_period = YEAR @@ -25,8 +31,12 @@ class dependent_care_employer_benefits_forfeited_or_carried_forward(Variable): reference = ( "https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2", "https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5", - # Box 10 reports amounts "regardless of any employee forfeitures". + # PDF pages 18-19. Box 10 reports amounts "regardless of any employee + # forfeitures"; amounts "over your plan's exclusion" go in boxes 1, 3 + # and 5. "https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=18", - # Box 10 amounts "over your plan's exclusion" go in boxes 1, 3 and 5. - "https://www.irs.gov/pub/irs-prior/iw2w3--2025.pdf#page=19", ) + + def formula(person, period, parameters): + # A formula stops Core carrying an entry into later years and uprating it. + return person.empty_array() diff --git a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py b/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py deleted file mode 100644 index 0dc3f881af1..00000000000 --- a/policyengine_us/variables/household/income/person/dependent_care_employer_benefits_prior_year_carryover.py +++ /dev/null @@ -1,28 +0,0 @@ -from policyengine_us.model_api import * - - -class dependent_care_employer_benefits_prior_year_carryover(Variable): - value_type = float - entity = Person - label = "Prior-year dependent care benefits used in this year's grace period" - documentation = ( - "Unused employer dependent care benefits from the prior year's plan " - "that the employee used during this year's grace period (Form 2441 " - "line 13, FTB 3506 line 14). The prior year's W-2 box 10 reported " - "them, so this year's dependent_care_employer_benefits leaves them " - "out. They count toward this year's IRC 129 exclusion and taxable " - "benefits. For 2021 and 2022, when Form 2441 line 21 adds line 13 to " - "the cap under temporary relief rules, the federal calculation leaves " - "this amount out of both (prior_year_carryover_omitted). California " - "counts it in every year, and Alabama's 2021 recompute under 2020 " - "rules counts it." - ) - unit = USD - definition_period = YEAR - default_value = 0 - reference = ( - "https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2", - "https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=5", - # FTB 3506 line 14: "Enter the amount from federal Form 2441, line 13." - "https://www.ftb.ca.gov/forms/2021/2021-3506-instructions.html", - ) diff --git a/policyengine_us/variables/household/income/person/taxable_dependent_care_benefits_reported.py b/policyengine_us/variables/household/income/person/taxable_dependent_care_benefits_reported.py new file mode 100644 index 00000000000..46661aa6cf6 --- /dev/null +++ b/policyengine_us/variables/household/income/person/taxable_dependent_care_benefits_reported.py @@ -0,0 +1,42 @@ +from policyengine_us.model_api import * + + +class taxable_dependent_care_benefits_reported(Variable): + value_type = float + entity = Person + label = "Reported taxable dependent care benefits" + documentation = ( + "This person's part of Form 2441 line 26, taxable dependent care " + "benefits (Form 1040 line 1e from 2022), as supplied, for returns the " + "model does not compute: grace-period carryovers used (line 13), a " + "plan maximum below the statutory cap (line 21), or the 2021 and " + "2022 relief rules. An amount of zero or more is used as entered, " + "including zero. A negative amount, such as the default -1, means " + "not supplied: taxable_dependent_care_benefits then uses this " + "person's computed share of line 26, whatever other people report. " + "The amount changes only taxable_dependent_care_benefits and its " + "readers; the exclusion (dependent_care_assistance_exclusion, line " + "25) and the child and dependent care credit stay computed, though " + "the credit's rate follows adjusted gross income, which includes the " + "supplied amount. On a joint return, a spouse without a supplied " + "amount keeps their computed share, so supply an amount for each " + "spouse with benefits, the amounts adding to line 26. An entry " + "applies only to the year entered. Because of its formula, Core does " + "not count this as an input variable, so Simulation.to_input_dict() " + "and to_input_dataframe() leave a supplied amount out unless " + "include_computed_variables=True; supply it in the situation or with " + "set_input." + ) + unit = USD + definition_period = YEAR + default_value = -1 + reference = ( + # Line 26: "Taxable benefits. Subtract line 25 from line 23." + "https://www.irs.gov/pub/irs-prior/f2441--2025.pdf#page=2", + # Line 26: "Enter this amount on Form 1040, 1040-SR, or 1040-NR, line 1e." + "https://www.irs.gov/pub/irs-prior/i2441--2025.pdf#page=6", + ) + + def formula(person, period, parameters): + # A formula stops Core carrying an entry into later years and uprating it. + return person.empty_array() - 1