Repository navigation
Conversation
…losses deduction Fixes #9637. - gambling_winnings joins gov.irs.gross_income.sources (26 U.S.C. 61(a), Schedule 1 line 8b). - wagering_losses_deduction is min(rate x losses, winnings) for the head and spouse; the rate is 1 through 2025 and 0.9 from 2026 (P.L. 119-21 sec. 70114). - The deduction moves into the Schedule A list (line 16) and the pre-2018 section 68(c) exclusions. - States: AL, CA, DC, DE, HI, KS, MI, MN, MS, MT, NY, PA, VA, WI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eform's formula Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n, Kentucky 2018, Montana allocation - Alabama and pre-2023 Iowa gross income count the head's and spouse's gambling winnings (new person variables), not a dependent's. - Delaware allocates wagering losses over the head's and spouse's losses only. - Kentucky allowed no wagering losses for 2018 (2019 Ky. Acts ch. 151). - Montana allocates each spouse's own losses first. - Document what the gambling inputs hold; move the integration cases into the deduction's YAML file; add section 68 cases; fix reference titles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Context from the original session (cbe2e2c2), for the US + core hub, which now owns this PR. I have not pushed to this branch since the hub adopted it. Evidence at
Review r1 ( Axiom: rulespec-us#1658–#1672 were filed from drafts written before the r1 fixes. Not covered by them: Kentucky's 2018 exclusion ( Stack: North Carolina's wagering deduction is #10110 (draft), on top of this PR and #10028. |
|
Heads-up on an overlap with #9977 (draft, §163(d) limit), from the session that wrote #9695. Both PRs edit
Whichever lands second will conflict on the list and the property test, and the resolved list needs all four entries: - medical_expense_deduction
- investment_interest_expense_deduction
- casualty_loss_deduction
- wagering_losses_deductionIf this PR lands first, nothing changes here: This PR also covers two of the follow-ups noted in #9695, wagering losses in the 2026 2/37 base and the 90% limit, so I'm not pursuing those separately. |
|
Coordination with #10136, which fixes the 2026 section 68 taxable-income leg (#9170). Both PRs edit two files, and the overlaps are textual only:
Semantics after both land: #10136's new |
Review follow-ups (GPT-6.1 Sol, approve with nits): - tax_unit_itemizes reads itemized deductions from the itemizing branch only when the rewritten section 68 is in force, the only case where they depend on the itemization choice; other years and the prior-law counterfactual keep the main-simulation value, so non-branching mode adds no branch there. - A 2026 case with branch_to_determine_itemization false. - The property tests' docstring states that gambling losses outside the limited base is a model limitation (#10070), not the law; the 2026 monotonicity check raises one itemized component instead of seven. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…temized deductions (#10136) * Net the 2026 section 68 taxable-income leg of non-itemized deductions Section 68(a)(2), as rewritten by P.L. 119-21 sec. 70111(a), measures "taxable income ... (determined without regard to this section and increased by such amount of itemized deductions)". For an itemizer that is AGI less exemptions and every deduction 63(b) allows besides itemized deductions (199A, 224, 225, 151(d)(5)(C), 163(h)(4)). The reduction used AGI minus exemptions, overstating the base for filers with a QBI deduction. - New taxable_income_before_itemized_deductions gives that amount; the reduction and Idaho's recomputation of it use it. - Section 199A(e)(1), as amended by sec. 70111(b), computes taxable income without regard to section 68, so taxable_income_less_qbid deducts itemized deductions before the limitation from 2026. This also keeps the reduction -> QBID -> reduction chain acyclic. - tax_unit_itemizes reads itemized deductions from the itemizing branch, since the QBI deduction (and so the limitation) depends on the choice. Fixes #9170 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test the 2026 section 68 taxable-income leg from statute arithmetic - YAML cases for single, joint, separate and head-of-household filers, with 2026 37 percent bracket starts from Rev. Proc. 2025-32 sec. 4.01, and a qualified REIT dividend case where the QBI deduction is capped by taxable income computed without regard to section 68 (199A(e)(1)). - taxable_income_before_itemized_deductions unit cases (63(b)/(d), the 2029 end of the OBBB deductions, wagering losses as an itemized deduction). - An itemization-choice case the corrected limitation flips. - Property and differential tests: leg (2) and the reduction restated from the statute; bounds; each 63(b) deduction lowers leg (2) one for one; monotonicity in AGI and itemized components; a calculated QBI deduction with the itemization choice set and calculated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Branch for itemized deductions only under the P.L. 119-21 section 68 Review follow-ups (GPT-6.1 Sol, approve with nits): - tax_unit_itemizes reads itemized deductions from the itemizing branch only when the rewritten section 68 is in force, the only case where they depend on the itemization choice; other years and the prior-law counterfactual keep the main-simulation value, so non-branching mode adds no branch there. - A 2026 case with branch_to_determine_itemization false. - The property tests' docstring states that gambling losses outside the limited base is a model limitation (#10070), not the law; the 2026 monotonicity check raises one itemized component instead of seven. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tighten the 2026 monotonicity bound and pin the QBI deduction in the non-branching case Optional nits from the Sol delta review (approve): allowed itemized deductions rise by at least 35/37 of an increase; the comment cites tests 6 and 8; the non-branching itemization case asserts the 60,000 QBI deduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ctions Main's #10068 added California's and Minnesota's non-disaster casualty and theft loss deductions in the same itemized-deduction formulas this PR changes. Both survive: each state's casualty deduction replaces the federal amount, and the permitted wagering deduction is protected from the itemized-deduction reduction. No test expectation changed. Resolution notes and 30 passing test files (200 cases) are in the hub's evidence for this merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fixes #9637. Federal gross income left out gambling winnings while itemizers still deducted gambling losses, so gambling lowered tax. This PR:
gambling_winningsingov.irs.gross_income.sources(26 U.S.C. 61(a); Schedule 1 line 8b);wagering_losses_deductionthe smaller of the allowed share of losses and the winnings, with a new parametergov.irs.deductions.itemized.wagering_losses.rate: 1 through 2025 and 0.9 from 2026 (P.L. 119-21 § 70114);irs_gross_incomealready does for income (a dependent's gambling is on the dependent's own return);deductions_if_itemizinginto the Schedule A listgov.irs.deductions.itemized_deductions(Schedule A line 16), and into the pre-2018 section 68(c) exclusions;The issue left point 4 open ("decide separately"). It is needed here: once winnings are in AGI, every state that starts from federal itemized deductions would tax the winnings and deny the losses. With the deduction in the Schedule A total, those states carry it the way their returns do, the 2026 section 68 limitation counts it, and the itemization fallback comparison sees it.
The law
limitation.excluded_deductionsnow names them. From 2026 the rewritten section 68 has no such exclusion, and the 2/37 reduction counts them.Households,
mainand this branchSingle filer aged 40 in Texas with $60,000 of wages (the issue's cases), 2024, from
evidence/state_flow_{base,branch}.json:main: AGI, itemizes, income taxOn
maina $5,000 net gain lowered tax by $1,357 and break-even gambling by $1,957. For 2026 the same $30,000 / $25,000 filer deducts $22,500 (90% of losses):main$3,839, branch $9,323.States
Every state whose income tax reads federal AGI, gross income, taxable income or the federal itemized totals was reviewed (44 jurisdictions and Puerto Rico; eight research runs,
~/reviews/us-hub/gambling-9637/research/). I re-read each source cited for a change below. Changes:al_gambling_loss_deduction(losses up to winnings, no 90% share, outside the 2% limit)ca_wagering_losses_deductionreplaces the federal amount: all losses up to winnings (California's Code is the IRC as of January 1, 2025), outside the high-income limitationhi_reduced_itemized_deductionsreturns the full total when the worksheet says "not limited" (it returned 0)mi_wagering_losses_deductionfrom 2021: the federal itemized amount, for federal itemizersmt_wagering_losses_deduction: attribute each spouse’s own losses first, then allocate the residual over uncovered winningsny_wagering_losses_deduction(2017 federal rules: all losses up to winnings), in the itemized total and outside the Pease worksheet's limited basepa_gambling_loss_offset: Pennsylvania taxes winnings net of each spouse's own wagering costs. PA-1000 rebate income no longer adds winnings on top of AGI, and nets the lossesgambling_losses)Right after the federal change with no state edit: AZ, CO, CT, GA, ID, IL, IN, LA, MD, ME, MO, ND, NE, NM, OH, OK, OR, RI, SC, TN, UT, VT. Arkansas keeps its own rule (#9636): its gross income lists already count winnings and
ar_gambling_loss_deductionhas no 90% share. New Jersey's own gross income list already counts winnings. North Carolina's deduction (G.S. 105-153.5(a)(2)e, from 2025) is a separate PR stacked on this one.Main-vs-branch differential
scripts/state_flow.pyruns one single filer per state for 2021, 2024, 2025 and 2026, three wage levels, five winnings/losses pairs, with and without $25,000 of charitable gifts (1,530 households a year), onmain(fe0c3a6) and on this branch.state_income_taxandincome_taxare identical onmainand the branch for every state, year and household (largest difference $0.00).main, gambling moved state tax only through the federal itemization choice, in both wrong directions: for the $60,000 filer with $30,000 / $25,000 in 2024 it cut Colorado tax by $524, Iowa by $723 and South Carolina by $779, and raised DC tax by $949 and Virginia by $489.main; Mississippi $0 (unmodeled)."Gambling never lowers state tax" is not a law of every state, so it is not a test. The differential shows where it fails on the branch, each for a reason in the law or in an existing approximation:
Invariants
For every winnings × losses × other-deductions grid point (
test_gambling_winnings_and_losses_properties.py):Intended exceptions to "never lowers": deductions that grow with AGI (charitable gifts above the AGI limit, and the state income tax PE estimates from AGI). The tests fix the charitable and state and local tax deductions so the invariant is exact; the state differential above shows the exceptions.
test_itemized_deduction_limitation_properties.pynow generates wagering losses as one of the 68(c) exclusions, so its worksheet restatement covers them for 2015–2017 and the 2026 base.test_ar_gambling_properties.py(unchanged) still checks that Arkansas's deduction equals the federal one through 2025.Tests
Current head:
6c438507a582c9b44913b02bd371b58d75da963f, a merge commit bringing in mainde3815f4ccec7c698f4c6c6a5e024acd79f3579b. It merges cleanly with current main.Focused verification on this exact tree (
84db243769): 221 passed across 30 files (187 YAML cases in 28 files; 34 Python tests in 2 files), one file per process with thread caps of 4.test_gambling_winnings_and_losses_properties.pycrashed in that runner (exit -11 after 183 s) while the build was being stopped at its 6-hour limit. The hub re-ran it in the foreground on the same tree: 21 passed (log:hub-rerun-test_gambling_winnings_and_losses_properties.login the hub's evidence for this merge).test_itemized_deduction_limitation_properties.pyfailed once in an interrupted first attempt and then passed (13) in the runner.Merge resolution: main's #10068 added California's and Minnesota's non-disaster casualty and theft loss deductions in the same itemized-deduction formulas; both changes survive (each state's casualty deduction replaces the federal amount, and the permitted wagering deduction stays protected from the itemized-deduction reduction). All main YAML cases in the conflicted files keep their inputs and outputs. No expectation changed in the merge. The Alabama dependent-income case in
al_agi.yamlis main's, not this PR's: main's #9943 changed its formula and expectation from $48,500 to $40,000 (parent-only AGI = $40,000 wages; dependent income and deductions no longer counted), and this branch now carries main's version. Partner contract tests were not edited.test_itemized_deduction_limitation_properties.pyitemized_taxable_income_deductions_reduction.yamltaxable_income_deductions_if_itemizing.yamlwagering_losses_deduction.yamlirs_gross_income.yamlal_agi.yamlal_gambling_loss_deduction.yamlca_itemized_deductions.yamlca_itemized_deductions_pre_limitation.yamldc_itemized_deductions.yamlde_itemized_deductions_indv.yamlde_itemized_deductions_unit.yamlhi_itemized_deductions.yamlhi_reduced_itemized_deductions.yamlia_gross_income.yamlks_itemized_deductions.yamlky_itemized_deductions_unit.yamlmi_subtractions.yamlmn_itemized_deductions.yamlms_itemized_deductions_unit.yamlmt_wagering_losses_deduction.yamlny_itemized_deductions_phase_out.yamlny_itemized_deductions_phase_out_integration.yamlny_wagering_losses_deduction.yamlpa_total_taxable_income.yamlpa_property_tax_or_rent_rebate_income.yamlva_itemized_deductions.yamlwi_itemized_deduction_credit.yamlmn_walz_hf1938.yamltest_gambling_winnings_and_losses_properties.pyNot in this PR
Review findings that remain open for the US + core hub; the owner contested findings 1, 2, 5 and 7 as defects reproduced on main with non-gambling inputs. Main has since fixed finding 1 (#10136); findings 2, 5 and 7 remain pre-existing on main and are outside this PR. The original r1 response is preserved in
hub-evidence/review-response-r1.md.2026 section 68 in states that add up raw Schedule A components (AZ, DC, DE, KY, MD, ME, MT, NE, NM, OK, OR): the 2/37 reduction does not reach their itemized deductions for any component.
Winnings by source. One
gambling_winningsinput cannot separate exempt state lottery prizes (CA; ID and VA prizes under $600; OR; NJ prizes of $10,000 or less; PA noncash prizes; MI pre-1989 installments), Massachusetts's licensed-wagering losses, Mississippi's three categories, West Virginia's in-state losses or Puerto Rico's exempt lotteries.Own income lists. Alabama's pooling is fixed on main by Leave tax unit dependents' income out of Alabama AGI #9943 (merged into this branch;
al_agi.pyusestax_unit_non_dep_add, soal_gambling_winningsis now a harmless second exclusion); this PR excludes dependent winnings; Arkansas still pools a dependent's gambling (and other income) onto the head; New Jersey taxes gross rather than net winnings; New Mexico modified gross income and Oklahoma's credit gross income omit winnings; Michigan household resources lack the $300 exclusion; Washington's WFTC phase-out uses AGI where the statute uses earned income.Federal section 68 threshold (r1 finding 1): fixed on main. Main's Net the 2026 section 68 taxable-income leg of the QBI and other non-itemized deductions #10136, merged into this branch, makes
itemized_taxable_income_deductions_reductionreadtaxable_income_before_itemized_deductions, which nets out QBID, tips, overtime, the senior deduction and car-loan interest; r1's example ($650,600 AGI, $20,000 QBID) now gives $0.AMT (r1 finding 2): AMTI still retains the regular section 68 reduction. This reproduces on main without gambling and awaits separate hub resolution.
Hawaii threshold gate (r1 finding 9): left to Update Hawaii income tax for Act 35 (2025 IRC conformity) and fix its itemized deduction limit #9940. Whichever PR lands second must coordinate the wagering source and excluded-deduction list. Model the claim of right repayment deduction and credit (26 U.S.C. 1341) and North Carolina's rules that depend on it #10038 also overlaps this PR’s deduction lists and formulas.
Stale comment (follow-up).
taxable_income_before_itemized_deductions.py:29-36still describes wagering losses as listed apart from the other itemized deductions and filters them out; they are now insideitemized_taxable_income_deductions, so the filter is a no-op. Harmless; to be cleaned up in a follow-up.Montana 2021-2023 joint allocation (open methodology choice). Each spouse keeps their own losses first (sourced in the 2023 Form 2 instructions); any remaining joint allowance is spread in proportion to each spouse's uncovered winnings, which the instructions do not state as a formula. Awaiting Max's decision (d1460).
Effects beyond income tax
Winnings now enter federal AGI and MAGI everywhere, so every AGI-based rule sees them: the EITC AGI test, the CTC phase-out, the premium tax credit and Medicaid MAGI, taxable Social Security, the 2025+ SALT-cap phase-down, IRMAA and state AGI-based credits. These follow the law. One gap: Medicaid spreads lottery and gambling awards of $80,000 or more over several months (42 U.S.C. 1396a(e)(14)(K)), which annual MAGI cannot show (listed in the follow-ups).
Section 165(d)(2) also counts any otherwise allowable deduction incurred in wagering as a wagering loss (added by Pub. L. 115-97 §11050 for 2018-2025 and made permanent by Pub. L. 119-21 §70114), and the 90% limit from 2026 applies to it. For the casual gamblers modelled here it adds nothing, since they have no such deductions.
Axiom
axiom: TheAxiomFoundation/rulespec-us#1658 TheAxiomFoundation/rulespec-us#1659 TheAxiomFoundation/rulespec-us#1660 TheAxiomFoundation/rulespec-us#1661 TheAxiomFoundation/rulespec-us#1662 TheAxiomFoundation/rulespec-us#1663 TheAxiomFoundation/rulespec-us#1664 TheAxiomFoundation/rulespec-us#1665 TheAxiomFoundation/rulespec-us#1666 TheAxiomFoundation/rulespec-us#1667 TheAxiomFoundation/rulespec-us#1668 TheAxiomFoundation/rulespec-us#1669 TheAxiomFoundation/rulespec-us#1670 TheAxiomFoundation/rulespec-us#1671 TheAxiomFoundation/rulespec-us#1672 TheAxiomFoundation/rulespec-us#1738 TheAxiomFoundation/rulespec-us#1739 queued
All seventeen parity drafts are filed: rulespec-us #1658-#1672 (federal 165(d) and fourteen states) and #1738 (Kentucky TY2018 exclusion) and #1739 (Iowa pre-2023 gross winnings), each under the hub's standing d1142 parity go.
Hub microsimulation impact (current head)
A real microsimulation on the default dataset, main at the merge base
de3815f4ccagainst this PR's head6c438507a5, for 2025 and 2026. The runs went one at a time under the shared heavy-job lock. Sums are weighted.gambling_winningswagering_losses_deductionadjusted_gross_incomeitemized_taxable_income_deductionshi_reduced_itemized_deductionsstate_income_taxincome_taxhousehold_net_incomehousehold_benefitsThe gambling variables do not move: the default dataset has no gambling inputs. Only
hi_reduced_itemized_deductionsmoves among the itemized outputs (about 1,230 records). State income tax changes for 2 records in 2025 and 1 in 2026. The comparison files are national totals, so they don't show each record's state; the 2026 record matches the one Hawaii record in the pre-merge run, and federal tax, AGI and federal itemized deductions don't move in either year.Comparison files are in
fixes/10070-impact/on the hub host.