Repository navigation
Conversation
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>
This was referenced Oct 12, 2026
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>
…-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
marked this pull request as ready for review
October 20, 2026 04:11
- 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
Contributor
Author
|
Handing this PR to the US + core hub.
🤖 Generated with Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_deductionno longer nets out the non-itemizer amount, butgov.irs.deductions.itemized_deductionsstill listedcharitable_deduction_for_non_itemizersfor 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 onitemized_deductions_less_saltortotal_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)
Changes
Federal
charitable_contributions_ald(TaxUnit, 2020 block ofgov.irs.ald.deductions):~tax_unit_itemizes × min(head's and spouse's cash to 170(b)(1)(A) organizations, $300). The cap isgov.irs.ald.charitable_contributions.cap, $300 in 2020 and 0 otherwise. It usesresolved_charitable_cash_donations_50_pctfrom Model full 5-tier charitable deduction limits under IRC § 170(b) #10192, summed withtax_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_itemizestakes: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, andstandard_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_itemizersis 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.
ca_additions)in_add_backs)ky_additions)additions.sourcesblock); AMT income adds it back; the SS worksheet step 8 leaves it outnc_additions)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_branchsets 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)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):
Invariants (
tests/core/test_charitable_contributions_ald_invariants.py)min(filers' cash, $300)for a non-itemizer, 0 for an itemizer, and 0 in 2021. Dependents' gifts are excluded.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: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, andmi_household_resources.Impact
No change to any year with records in the default dataset (2020 and 2021 microsimulations read every input as zero). Household examples:
Coordination
itemized_deductions.yaml: Add North Carolina's wagering losses itemized deduction from 2025 (G.S. 105-153.5(a)(2)e) #10110, Count gambling winnings in federal gross income and fix the wagering losses deduction #10070, Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 and the claim-of-right states each add an item to all three blocks, which this PR collapses into one. Whichever lands second keeps one block plus the new items.tax_unit_itemizes.pyandtools/general.py: 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 sameget_itemization_branch; keep its claim-of-right version.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 formatpassed. 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.