Skip to content

Take the 2020 charitable deduction for non-itemizers above the line - #10186

Open
MaxGhenis wants to merge 15 commits into
mainfrom
fix-2020-charitable-ald
Open

MaxGhenis wants to merge 15 commits into
mainfrom
fix-2020-charitable-ald

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Sol reviews r1 to r4 addressed; Sol delta review r5 pending. Marked ready so CI runs the full suite (the host's heavy lock is reserved until 2026-10-21).

Summary

For taxable years beginning in 2020 only, CARES Act § 2204 added 26 U.S.C. § 62(a)(22) and § 62(f). They let an individual who does not itemize deduct up to $300 of cash gifts to § 170(b)(1)(A) organizations in arriving at AGI (2020 Form 1040 line 10b). The model took it below the line, with the 2021 § 170(p) deduction, so 2020 AGI was too high for non-itemizing donors. That fed through every AGI-based test, every MAGI built from the above-the-line list, and every state that starts from federal AGI.

This PR also fixes a related bug. Since 1d42fc4 (#5973), charitable_deduction no longer nets out the non-itemizer amount, but gov.irs.deductions.itemized_deductions still listed charitable_deduction_for_non_itemizers for 2020–2021. So itemizers counted up to $300 (2020) or $300/$600 (2021) of cash gifts twice. The double count also reached the state itemized deductions built on itemized_deductions_less_salt or total_itemized_taxable_income_deductions (DC, IA, ID, KS, KY, MD, ME, MN, MS, NE, NM, OK, OR, VA, the WI credit).

Law (verified against the primary sources)

  • P.L. 116-136 § 2204 (file p.65) adds § 62(a)(22), "the amount (not to exceed $300) of qualified charitable contributions made by an eligible individual". It also adds § 62(f): (1) an eligible individual does not elect to itemize; (2) gifts must be cash to a § 170(b)(1)(A) organization, not to a § 509(a)(3) organization or a donor-advised fund, and carryovers are excluded.
  • P.L. 116-260 div. EE § 212 (file pp.1888–1889):
    • (a) adds § 170(p) for 2021 ($300, $600 joint);
    • (b) adds § 63(b)(4), taking it from AGI;
    • (c) strikes § 62(a)(22) and (f) for years after 2020.
  • 2020 Form 1040: line 10c = 10a + 10b; line 11 = 9 − 10c. The 2020 instructions:
    • line 10b (p.30);
    • Social Security Benefits Worksheet line 6 (p.31), IRA Deduction Worksheet line 4 (p.94), Student Loan Interest Worksheet line 3 (p.96): each subtracts line 10b;
    • Unemployment Compensation Exclusion Worksheet line 5 (p.88): subtracts 10c;
    • 2020 Pub. 970 Worksheet 6-1 line 2 (tuition and fees MAGI) also subtracts line 10b.
  • The $300 cap applies to every return, married filing separately included. The 2020 instructions give "$150 if married filing separately", but § 62(a)(22) and (f) have no separate-return rule. Under PolicyEngine's statute-first rule (Max, 2026-10-19: the statute governs where it conflicts with forms, instructions or practice), the model follows the statute. A joint return keeps $300 per return, the reading that P.L. 116-260's explicit "$600 in the case of a joint return" for 2021 implies.
  • 2021 Form 1040: line 12b is below AGI (2021 instructions p.32).

Changes

Federal

  • charitable_contributions_ald (TaxUnit, 2020 block of gov.irs.ald.deductions): ~tax_unit_itemizes × min(head's and spouse's cash to 170(b)(1)(A) organizations, $300). The cap is gov.irs.ald.charitable_contributions.cap, $300 in 2020 and 0 otherwise. It uses resolved_charitable_cash_donations_50_pct from Model full 5-tier charitable deduction limits under IRC § 170(b) #10192, summed with tax_unit_non_dep_add, so a dependent's gifts stay on the dependent's own return. It returns 0 in years that don't list it.

  • charitable_contributions_ald_person: each filer's part, in proportion to their own gifts. above_the_line_deductions_person (Give each spouse their own above-the-line deductions in per-person AGI #9890) attributes the deduction by it.

  • Itemization choice. In 2020 AGI depends on the choice, so tax_unit_itemizes takes:

    • everything the itemizing branch deducts from AGI: Schedule A, wagering losses, and the QBI deduction it allows;
    • everything the not_itemizing branch deducts from AGI, plus what not itemizing takes off AGI (line 10b and its knock-ons, such as taxable Social Security).

    That makes the deduction comparison choose the lower taxable income. It matters without branching, which is how CI runs the YAML tests (update_itemization.sh), and in the tie fallback. A main-sim computation would be a cycle: AGI → ALD → choice → itemized deductions, and standard_deduction → bonus_guaranteed_deduction → AGI.

  • get_itemization_branch (tools/general.py) gives all three callers the same branch. Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 adds the same helper with a claim-of-right override; whichever lands second keeps Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038's version.

  • non_itemizers_amount (§ 170(p)) is 0 in 2020. charitable_deduction_for_non_itemizers is no longer in the 2020–2021 itemized list.

  • The tuition and fees MAGI subtracts line 10b. Every MAGI that iterates the above-the-line list now subtracts it too, as the 2020 worksheets require: SS, UC, IRA, student loan, person and Medicaid AGI.

States (2020): each line was verified from the state's own 2020 source.

State Treatment Source
CA add back (ca_additions) 2020 Schedule CA (540) instructions, Part I, Section C, line 22 col. B (p.48)
IN add back (in_add_backs) IC 6-3-1-3.5(a)(26), Information Bulletin 119 (p.2)
KY add back each filer's part (ky_additions) 2020 740 instructions, Schedule M line 5 (p.27)
MN add back (2020 additions.sources block); AMT income adds it back; the SS worksheet step 8 leaves it out M1NC line 6; M1MT line 4; M1M p.8 step 8
NC add back (nc_additions) 2020 D-400 Schedule S, Part A, line 16
NY, NYC New ny_recomputed_federal_agi (IT-201 line 19a = federal AGI + IT-558 A-003). Read by: NY AGI; the IT-196 floors and limitation; the NY household, Empire State child, child care and real property tax credits; the disability exclusion; the NYC household, school, child care and tax-elimination credits. get_ny_recomputed_branch sets federal AGI to line 19a and keeps the federal itemization choice; for the Empire State child credit it also keeps the federal tax and EITC as reported. From it, the NY and NYC EITC take the federal credit recomputed with line 19a (IT-215), and the child credit takes its pre-TCJA federal credit (IT-213 Worksheet A keeps Form 1040 line 18 as reported; Worksheet C line 7 carries Schedule 8812 line 13, which uses the EITC as reported) IT-201-I p.16–17, IT-558 A-003, IT-196 lines 2/17/26, IT-213-I p.2, IT-214, IT-215-I p.2, IT-216 line 9, IT-221
MA disallowed in Part B AGI TIR 20-9, B(6)
AZ subtracted from the 25% charitable standard deduction increase 2020 Form 140 worksheet line 5C (p.25)
MI off total household resources Michigan Treasury FAQ; 2020 book p.28

Other states that start from federal AGI conformed. In CA, IN, KY, MN and NC, an audit of every other 2020 reader of federal AGI found that each uses federal AGI as reported (line 11) and so needs no change. The exceptions are fixed here: CA's CVRP counts income before adjustments, and MN's AMT and Social Security worksheet differ as above (Minnesota's retroactive Laws 2023, ch. 1, sec. 22). The audit is at ~/reviews/charitable-ald-2020/state-agi-readers.md. The research table is at ~/reviews/charitable-ald-2020/state-conformity.md; rows inferred from conformity dates are labelled.

Follow-ups (not in this PR; chips):

  • South Carolina rejected both the 2020 and 2021 deductions (starts from federal taxable income, unchanged here).
  • OR/WI/MT itemized coordination and Iowa's equivalent deduction.
  • A 2021 § 170(p) state audit.
  • MN 2017–2020 SS constants are backdated from 2021.
  • Schedule A and § 170(p) still count dependents' gifts.

Invariants (tests/core/test_charitable_contributions_ald_invariants.py)

  1. The deduction is min(filers' cash, $300) for a non-itemizer, 0 for an itemizer, and 0 in 2021. Dependents' gifts are excluded.
  2. AGI equals gross income less the above-the-line deductions, which include it.
  3. No gift is deducted twice: Schedule A totals equal their components, in 2020 and 2021.
  4. Differential check: the simulation's income tax equals that of the chosen branch, and that is the lower of the two.
  5. CA adds it back, NY's line 19a adds it back, and MA Part B AGI keeps it.
  6. Without branching, the choice leaves the lower taxable income of the two branches. A seeded population includes New Hampshire households at the margin. Dropping the AGI reduction from the comparison makes this test fail (mutation-checked).

The tests use a seeded population and Hypothesis draws. Cost: 3 tests, 24.8 s, 2.65 GB peak RSS (local macOS, not a CI measurement).

Tests

  • charitable_contributions_ald.yaml: 12 cases, including $300 MFS and gifts to non-170(b)(1)(A) organizations.
  • integration.yaml: 14 cases worked line by line from the 2020 Form 1040:
    • AGI and tax for single, joint and MFS filers;
    • an itemizer counted once;
    • the choice the deduction flips, with and without branching, including wagering losses and a QBI deduction that differs between the choices;
    • the Social Security and UC exclusion worksheets;
    • a dependent's gifts;
    • the tuition MAGI;
    • 2021 itemizer and non-itemizer.
  • State cases in ny_eitc, nyc_eitc, ny_ctc_pre_2024, the NYC household, school and child care credits, ca_additions, in_add_backs, ky_additions, mn_additions, mn_amt_taxable_income, mn_social_security_subtraction (2020 worksheet constants inline), nc_additions, ny_recomputed_federal_agi, ma_part_b_agi, the AZ increase, and mi_household_resources.
  • Fails on main: at the first round, 8 of 9 integration cases failed on main on substance. Sol r1 reproduced each new case's failure before the fix.
  • Local runs: every changed YAML file passes, one file at a time. A local sweep of every 2020 file at the r1 head passed (194 files, 2,086 cases); the sweep at this head was withdrawn from the reserved heavy queue in favour of CI. The Python ALD tests pass, run one file at a time at e4d51ea: 32 tests across the new invariants, spouse and dependent ALD invariants (including the attribution audit), ALD determinism and Michigan line 30.

Impact

No change to any year with records in the default dataset (2020 and 2021 microsimulations read every input as zero). Household examples:

  • A 2020 single non-itemizer with $40,000 of wages and $500 of gifts: AGI $39,700 (was $40,000), taxable income unchanged.
  • A 2020 MFS filer: $300 instead of $150.
  • A 2021 itemizer with $500 of gifts: $500 on Schedule A (was $800).

Coordination

axiom: TheAxiomFoundation/rulespec-us#1725 queued (§ 62(a)(22)/(f) for 2020 with the $300 cap for every return, and the 2021 version of § 170(p); blocked on corpus ingest TheAxiomFoundation/axiom-corpus#843)

🤖 Generated with Claude Code

CI repair (2026-10-20): Merged current main (bda23eac4c) and reproduced the exact three-row failure with CI's branching-disabled setting. Main's comparison omitted the non-itemizer charitable deduction; removing its erroneous duplicate from Schedule A exposed this related bug. For rows 65–67, deductions of $12,699/$12,701/$12,800 beat the $12,550 standard deduction alone but lose to $12,850 including the $300 cash deduction, causing $33.22/$32.78/$11.00 excess tax. The model comparison now counts the capped charitable deduction, including the 2026 limitation path and equal-tax fallback. The invariant and its tolerances remain intact.

Validation: 32 ALD Python tests and the repair YAML's 12 cases passed locally, one file per foreground process; make format passed. CI confirmed all 32 ALD Python tests and all 213 cases in the full PR's 22 changed YAML files. The formerly failing Rest job is green; further Contrib checks remain in progress.

MaxGhenis and others added 3 commits October 12, 2026 19:09
CARES Act sec. 2204 added 26 U.S.C. 62(a)(22) for taxable years beginning
in 2020: up to $300 ($150 married filing separately) of cash charitable
contributions by an individual who does not itemize, deducted on 2020
Form 1040 line 10b in arriving at AGI. The model took it from AGI with
the 2021 170(p) deduction instead.

- New charitable_contributions_ald in the 2020 above-the-line list, so
  AGI and every MAGI built from the list (Social Security, UC exclusion,
  IRA and student loan worksheets, which all subtract line 10b) see it.
- tax_unit_itemizes takes the itemized and standard deductions it
  compares from the branch with each choice in 2020, since AGI now
  depends on the choice.
- non_itemizers_amount (170(p)) is zero in 2020.
- charitable_deduction_for_non_itemizers is no longer listed among
  itemized deductions for 2020 and 2021, where it was added on top of the
  full charitable deduction once charitable_deduction stopped netting it.

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

Unit cases for each filing status cap, itemizers, noncash gifts, 2019 and
2021; integration cases worked from Form 1040 lines 9-15, the Social
Security Benefits and Unemployment Compensation Exclusion worksheets, an
itemization choice the deduction flips, and the 2020 and 2021 itemizers
who no longer count the gifts twice.

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

Taking the deduction above the line moves it into every state AGI that
starts from federal AGI. States that did not adopt 62(a)(22) for 2020 add
it back:
- California: Schedule CA (540) Part I, Section C, line 22, column B.
- Indiana: IC 6-3-1-3.5(a)(26), Information Bulletin 119 (code 120).
- Kentucky: Schedule M line 5, by each spouse's share of federal AGI.
- Minnesota: Schedule M1NC line 6, through M1M line 16.
- North Carolina: D-400 Schedule S, Part A, line 16.
- New York: IT-558 addition A-003 (recomputed federal AGI).
Massachusetts Part B AGI, which subtracts the federal ALD list, disallows
it (TIR 20-9, B(6)). Arizona's 2020 standard deduction increase for
charitable contributions subtracts it (worksheet line 5C).

charitable_contributions_ald returns 0 in years that do not list it, so
these additions never reach the itemization choice outside 2020.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 12, 2026 19:56
Michigan Treasury: for 2020 the cash contribution deduction is a deduction
from AGI 'and therefore Total Household Resources as well'; for 2021 it is
not. Line 30 now lists charitable_contributions_ald in 2020.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeded and Hypothesis households in seven states, 2020 and 2021: the
deduction is min(cash gifts, Form 1040 line 10b cap) for non-itemizers and
zero otherwise; AGI is wages less it; Schedule A totals are exactly their
components; the simulation's income tax is that of the chosen branch and
the lower of the two; California and New York add it back and
Massachusetts Part B AGI keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 4 commits October 19, 2026 23:08
…-ald

# Conflicts:
#	policyengine_us/variables/gov/states/ca/tax/income/ca_additions.py
#	policyengine_us/variables/gov/states/ny/tax/income/adjusted_gross_income/ny_additions.py
- 62(a)(22) caps the 2020 deduction at $300 for every return; the 2020
  Form 1040 instructions' $150 for married filing separately has no basis
  in the statute, which governs (PolicyEngine statute-first rule,
  2026-10-19).
- Count only the head's and spouse's cash gifts to 170(b)(1)(A)
  organizations (resolved_charitable_cash_donations_50_pct); a dependent's
  gifts are on the dependent's own return. New
  charitable_contributions_ald_person gives each filer's part, by their own
  gifts, for per-person AGI; Kentucky adds back that part.
- Without branching (as CI runs YAML tests), the 2020 itemization choice
  counts what not itemizing takes off AGI with the standard deduction.
- The tuition and fees MAGI subtracts line 10b (2020 Pub. 970 Worksheet
  6-1 line 2).
- New York: ny_recomputed_federal_agi (IT-201 line 19a) adds back IT-558
  A-003; NY AGI, the IT-196 floors and limitation, and the credits read it
  (2020 IT-196, IT-213, IT-214, IT-216, IT-221).
- Minnesota: AMT income adds back M1NC line 6 (2020 M1MT line 4); the
  Social Security worksheet step 8 leaves out line 10b (2020 M1M p.8).
- Michigan's 2020 MI-1040CR line 30 cite is file page 28.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_itemization_branch (tools/general.py) gives the itemizing and
not_itemizing branches to tax_unit_itemizes and both tax liability
variables, so every caller asks for the same inputs and shares one
branch. #10038 adds the same helper with a
claim of right override; whichever lands second keeps that version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CVRP counts income before adjustments (Implementation Manual), so
  line 10b does not lower it.
- Kentucky adds back each filer's part in ky_agi; ky_additions stays a
  pure input, so supplying it no longer drops the addback.
- Minnesota: Laws 2023, ch. 1, sec. 22(c)(2) and (d)(2), retroactive for
  2020, make the 62(a)(22) amount an addition and part of AMT income.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 20, 2026 04:11
MaxGhenis and others added 4 commits October 20, 2026 00:51
- Without branching, the 2020 itemization choice compares everything each
  choice takes from gross income: taxable_income_deductions_if_itemizing
  (Schedule A, wagering losses, the QBI deduction it allows) against
  taxable_income_deductions_if_not_itemizing plus the AGI reduction.
- New York: get_ny_recomputed_branch, a branch with the 2020 charitable
  deduction zeroed and the federal itemization choice kept, so the NY and
  NYC EITC match the federal credit recomputed with IT-201 line 19a
  (IT-215) and the Empire State child credit's pre-TCJA federal credit
  uses line 19a (IT-213 Worksheet A).
- NYC household, school, child care and income tax elimination credits
  read ny_recomputed_federal_agi; it is no longer limited to New York
  units, since NYC tests set residence without the state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The New York branch sets adjusted gross income to line 19a (federal AGI
  as reported plus IT-558 A-003) instead of zeroing the deduction and
  recomputing, which also moved taxable Social Security; this also covers
  a supplied adjusted_gross_income.
- For the Empire State child credit it keeps income tax before credits as
  reported (IT-213 Worksheet A lines 7-8); the EITC branch does not read
  it, because New York City income tax enters the federal SALT deduction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IT-213 Worksheet C line 7 carries federal Schedule 8812 line 13, whose
lines 12-13 use the earned income credit as reported, so the child
credit's branch keeps eitc with the reported federal tax (Sol review r4).

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

# Conflicts:
#	policyengine_us/tests/policy/baseline/gov/states/mn/tax/income/mn_amt_taxable_income.yaml
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Handing this PR to the US + core hub.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant