Repository navigation
Exclude section 68(c) deductions from the pre-2026 80 percent ceiling on the itemized deduction limitation - #9695
Merged
Merged
Conversation
Before P.L. 119-21, 26 USC 68(a)(2) capped the overall limitation on itemized deductions at 80 percent of "the itemized deductions otherwise allowable", and 68(c) excluded medical expenses, investment interest, and casualty, theft and wagering losses from that term. The Schedule A Itemized Deductions Worksheet—Line 29 (2013-2017) implements this on line 2. PolicyEngine applied the 80 percent to all itemized deductions, so filers with medical expenses, investment interest or casualty losses got too large a reduction whenever the ceiling bound. Add gov.irs.deductions.itemized.limitation.excluded_deductions and subtract it from the base of the 80 percent ceiling in the non-OBBB branch. The P.L. 119-21 branch (2026+) is unchanged: sec. 70111(a) rewrote section 68 without subsection (c). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9695 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 1 -3
Lines 76 30 -46
Branches 2 2
=========================================
- Hits 76 30 -46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Addresses the independent review of #9695: the excluded_deductions comment now says the 2017 worksheet's qualified disaster-relief contributions are not modeled, and the property test builds the parameter tree once instead of per call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Independent review, for the merge record:
Axiom mirror: TheAxiomFoundation/rulespec-us#1449 (queued, pe-parity). |
Contributor
Author
|
Merged by the US + core hub (acting as lander) on the merge gates:
|
This was referenced Oct 5, 2026
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.
Fixes #9693.
axiom: TheAxiomFoundation/rulespec-us#1449 queued (26 USC 68 as in effect for TY2013-2017, including the (c) exclusions, and the (f) TY2018-2025 suspension)
axiom: us:statutes/26/68#itemized_deduction_reduction_base encoded-correct (TY2026: section 68 as rewritten by P.L. 119-21 has no (c) carve-out; companion tests itemized-medical-only, itemized-interest-only, itemized-casualty-completed and itemized-68-single-deduction-lesser in us/policies/income_tax/itemized_taxable_income_deductions_pipeline.test.yaml)
rulespec-us encodes only the P.L. 119-21 section 68, from 2026. The pinned axiom-corpus release has no pre-2026 text of section 68, so the TY2013-2017 version can't be encoded until that text is ingested. The rulespec-us issue lays out that ingest and the encode.
Summary
Before P.L. 119-21, 26 USC 68(a)(2) capped the overall limitation on itemized deductions at "80 percent of the amount of the itemized deductions otherwise allowable". Section 68(c) says that, "for purposes of this section", "itemized deductions" does not include:
Line 2 of the Schedule A Itemized Deductions Worksheet—Line 29 removes the same amounts before line 4 takes 80%. PolicyEngine took 80% of all itemized deductions. So whenever the 80% ceiling bound, it reduced deductions too much. The verbatim law and worksheet text are in #9693.
This PR:
gov.irs.deductions.itemized.limitation.excluded_deductions:medical_expense_deduction,investment_interest_expenseandcasualty_loss_deduction, from 2009.investment_interest_expenseis the investment interest thatinterest_deductionincludes (deductible_interest_expense→non_mortgage_interest).wagering_losses_deductionis deducted outsidetotal_itemized_taxable_income_deductions, so gambling losses were never in the base and are not subtracted again.itemized_taxable_income_deductions_reduction, takes the 80% ceiling on the total minus those amounts:min(3% × AGI excess, 80% × max(0, total − excluded)).Changes in results
agi_rate,itemized_deduction_rateanditemized_deductionsdon't resolve before 2015, and they raiseParameterNotFoundError.limitation.obbb.appliesset false (the prior-law counterfactual): the (c) exclusions now apply.Engine runs, same inputs on
main(bf71be3) and on this branch:The figures are the reduction. policyengine-taxsim routes TAXSIM's
mortgageandotheritemintodeductible_mortgage_interest, so emulator outputs don't change.Impact (real microsimulation)
Real PolicyEngine-US microsimulations, default dataset
populace_us_2024.h5@populace-us-2024-spm-20260909(79,729 tax units), policyengine-core 3.32.15. Base is main at 6b0e773; the PR is head 64f3613 (main merged in). One run per side per year, compared record by record.itemized_taxable_income_deductions($1,856.0bn),taxable_income,income_tax($2,592.6bn) andhousehold_net_incomeare identical on every record. This is expected: the change applies to tax years 2013–2017 only, and 2026 uses P.L. 119-21 section 70111.records_nonzero= 0). The 2024-based dataset carries no pre-2024 incomes, so the default data cannot price the 2013–2017 change. The household examples above are the evidence for those years.Tests
itemized_taxable_income_deductions_reduction.yamlhas five new cases. Their expected values come from the worksheet arithmetic, written out line by line in comments:main; the separate-filer case (the 3% leg binds) and the 2026 case pass on both, as intended;investment_interest_expenseas a person input, so it also checks how that input reachesinterest_deductionand the exclusion;policyengine_us/tests/core/test_itemized_deduction_limitation_properties.py(new) runs 600 seeded random tax units per case through one simulation each: all five filing statuses, AGI from $0 to $1.5 million, and random mixes of the seven deduction components, with every fifth unit holding only excluded deductions. It follows the grid pattern oftest_ar_medical_expense_deduction_properties.py, so it needs no new dependency. Onmain, 7 of its 8 tests fail. The exception is the 2026 composition test, which guards the unchanged branch.Invariants
applicable_amount.yaml)test_reduction_matches_the_line_29_worksheettest_reduction_matches_the_line_29_worksheet,test_2026_prior_law_counterfactual_uses_the_worksheettest_reduction_responds_to_components_and_incometest_reduction_responds_to_components_and_incometest_2026_reduction_ignores_the_mix_of_deductionsobbb.appliesfalse, 2026 follows the worksheet logic at the 2026 applicable amountstest_2026_prior_law_counterfactual_uses_the_worksheetThe float32 tolerance scales with the size of the operands: $0.01 plus a relative 1e-6. The 80% base is a difference of two float32 sums, which at $200,000 can leave about a cent where exact arithmetic gives 0.
Not changed here
interest_deduction,deductible_interest_expenseornon_mortgage_interestdirectly bypassesinvestment_interest_expense, so the investment interest inside those amounts is not excluded.investment_interest_expensehas no net-investment-income cap federally. The exclusion subtracts exactly what the total includes, so the 80% base is right either way.Verification
tests/policy/baseline/gov/irs, 1,132 passed) and the state suites that read federal itemized deductions (5,617 passed) pass locally: GA, CO, NM, ID, SC, UT, MO, LA, ME, MT, AR,states/tax, and CA deductions.tests/corepasses, andruff format --checkpasses.🤖 Generated with Claude Code