Repository navigation
Count only the filer's and spouse's payroll taxes in the refundable CTC and Additional Medicare Tax, and in the CRFB surtax base - #9825
Merged
Conversation
26 U.S.C. 24(d)(2)(A) defines the refundable credit's social security taxes as the taxpayer's own, and Schedule 8812 line 21 adds the spouse's on a joint return. ctc_social_security_tax summed every tax unit member, dependents included. It now sums the person-level taxes over the head and spouse with tax_unit_non_dep_add, and takes the deductible part of self-employment tax per person, so it is right whether or not #9801 lands first. The Additional Medicare Tax it counts comes from the return's own Form 8959, which counts the head's and spouse's wages only, so additional_medicare_tax (and the Biden budget reform's copy of it) now leaves dependents' wages out. The Puerto Rico refundable CTC and the Wyden-Smith reform used the same sum; the latter now reads ctc_social_security_tax. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d base The CRFB AGI surtax's expanded base adds retirement contributions, tax-exempt interest, health insurance premiums, the HSA and student loan deductions, the foreign earned income exclusion and tax-exempt Social Security to AGI. It summed every tax unit member, so a dependent's 401(k) deferrals, tax-exempt interest and IRA contributions were added to a return whose AGI never held them. tax_exempt_social_security also carried a dependent's whole benefit, since only the head's and spouse's benefits enter the section 86 calculation. The base now adds the person-level sources over the head and spouse with tax_unit_non_dep_add, and takes Social Security from a new filer_tax_exempt_social_security: the head's and spouse's benefits less the taxable part. The YAML cases give AGI as an input, so they test the additions alone, before or after #9801. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ler's return Hypothesis draws batches of tax units in 2019, 2020, 2024 and 2026 and runs each with and without its dependents' amounts in one simulation: - A dependent's wages, 401(k) and 403(b) deferrals and Social Security never change the filer's AGI, CTC, income tax or CRFB surtax. - With AGI given, no dependent amount changes the CTC's payroll taxes, the Additional Medicare Tax or the surtax's additions. - Each of these equals an independent numpy sum over the head and spouse. A fixed-household case checks that the alternative refundable formula decides the refund. All three tests fail on main. 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 #9825 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 76 53 -23
Branches 2 0 -2
=========================================
- Hits 76 53 -23
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:
|
A 2024 head of household earns $150,000; a dependent earns $10,000 and contributes $5,000 to an IRA. The dependent's IRA deduction is on the dependent's own return, so AGI is $150,000 and the expanded base adds nothing for it: the surtax is $500. The case fails at the old head of this branch (AGI $145,000, surtax $450), on main before #9801 (AGI $145,000) and on main without this branch (surtax $550). With #9801 in, the property test's full-pipeline invariant also covers a dependent's IRA contribution. Self-employment income stays out: the qualified business income deduction still sums every member's qbid_amount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Footnote 2 of "Break Glass: A Plan for the Next Economic Shock" defines the individual surtax base as AGI plus retirement contributions, HSA/MSA contributions, deductible student loan interest, Social Security not counted toward AGI, tax-free bond interest and employer-provided health insurance. The plan does not address dependents; the comments now say the head-and-spouse attribution is inferred from the base starting at the return's AGI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The list includes the foreign earned income exclusion, which footnote 2 of CRFB's Break Glass plan does not name, and #9763 tracks how the health insurance and retirement entries map to variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
US + core hub merge audit, us#9825 at
|
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.
Summary
The refundable child tax credit's "social security taxes", the Additional Medicare Tax and the CRFB AGI surtax's expanded base all summed every tax unit member. So a dependent's own payroll taxes, wages and contributions landed on the parent's return. This PR restricts each to the head and spouse. It follows up #9801 (dependents' above-the-line deductions), which has merged; this branch now includes it.
Round 2: review r1
1f9d85aafc.upstream/main(47ab53e0fb) is merged into this branch without conflicts: no file changed on both sides, so no main hunk needed resolving. The derived-AGI regression the review asked for is incontrib/crfb/agi_surtax.yaml:A 2024 head of household earns $150,000. A dependent earns $10,000 and contributes $5,000 to an IRA.
Nothing is supplied but wages and the contribution. AGI is calculated: $150,000, because the dependent's IRA deduction is on the dependent's own return.
The expanded base adds nothing for that deduction, so the surtax is (150,000 − 100,000) × 1% = $500.
The case fails on each tree without both fixes; values below from a direct calculation on each tree:
34e3dc974d, before Keep dependents' above-the-line deductions off the filer's AGI #9801)1f9d85aafc^=4732913a0e)47ab53e0fb)16891ef47b)The three commits after the merge (
795b0f166b,d2b6e053b9,c6914e7d39) change only tests, comments and parameter metadata, and the case passes atc6914e7d39(Tests below).On main before Keep dependents' above-the-line deductions off the filer's AGI #9801, the surtax was right only because the add-back of the dependent's IRA cancelled the deduction in AGI. Without this branch, Keep dependents' above-the-line deductions off the filer's AGI #9801 leaves the add-back and the surtax becomes $550. Without Keep dependents' above-the-line deductions off the filer's AGI #9801, this branch drops the add-back while AGI still subtracts the deduction, and the surtax becomes $450.
With Keep dependents' above-the-line deductions off the filer's AGI #9801 in, the property test's full-calculation invariant (invariant 2 below) now covers a dependent's traditional IRA contribution as well. The fixed high-income household gets one too. The test's docstring no longer says "until Keep dependents' above-the-line deductions off the filer's AGI #9801 lands".
increased_baseparameters now cite the paper (they had no reference), and the comments insources.yamlandagi_surtax.pysay the same.ctc_value) from a fresh run against main with Keep dependents' above-the-line deductions off the filer's AGI #9801.non_refundable_ctcis labelled as the nominal remainderctc − refundable_ctc. Tax-exempt interest is not in the full-calculation invariant: the test leaves it out because of EITC investment-income test after #9572: dependents' amounts, passive income that is also earned income, and farm rental #9635. It appears only in invariant 1, which the test checks with AGI given.tax_exempt_social_securityhas 11 other consumers, not ten, and two of them are per-return measures (follow-ups); the invariants are scoped to the inputs the property test draws; the methodology note says the base starts from the paper and names where the source list differs from it; a dependent's own surtax is listed as unmodeled; and the derived-AGI table names the tree its values came from.Statute and sources
26 U.S.C. 24(d)(1)(B)(ii) (LII): with 3 or more qualifying children, the refundable credit can use "the excess (if any) of— (I) the taxpayer's social security taxes for the taxable year, over (II) the credit allowed under section 32".
24(d)(2)(A): "The term 'social security taxes' means, with respect to any taxpayer for any taxable year— (i) the amount of the taxes imposed by sections 3101 and 3201(a) on amounts received by the taxpayer during the calendar year in which the taxable year begins, (ii) 50 percent of the taxes imposed by section 1401 on the self-employment income of the taxpayer for the taxable year, and (iii) 50 percent of the taxes imposed by section 3211(a) on amounts received by the taxpayer". (B) excludes taxes the taxpayer is entitled to have refunded under section 6413(c).
Schedule 8812 (2024) Part II-B (form, p. 2):
The 2020 form (Part II, lines 9 to 13) has the same structure. A dependent's Form W-2 is on the dependent's own return, so it never reaches the parent's line 21.
Additional Medicare Tax. The instructions' Additional Medicare Tax and RRTA Tax Worksheet (i1040s8 2024, p. 9) take it from the return's own Form 8959, line 7. Form 8959 line 1 counts "your Medicare wages and tips … If you are filing a joint return, also include your spouse's wages and tips" (i8959 2024, p. 3). So
additional_medicare_tax, a component of these taxes, must also leave out a dependent's wages. It summed them: a couple with $240,000 of wages and a 16-year-old earning $20,000 was charged $90.The fix
ctc_social_security_tax: replacedadds/subtractswith a formula. It sums the parameter lists withtax_unit_non_dep_add, which adds person-level variables over the head and spouse only and tax-unit-level variables as they are.gov.irs.credits.ctc.refundable.social_security.add: replacedself_employment_tax_aldwith the person-levelself_employment_tax_ald_person, so the head-and-spouse filter is applied once, here. (Keep dependents' above-the-line deductions off the filer's AGI #9801 also narrows the tax-unitself_employment_tax_ald; reading the person-level amount does not depend on that.)unreported_payroll_tax,additional_medicare_taxandexcess_payroll_tax_withheldare tax-unit-level and describe the return.subtractschecked:excess_payroll_tax_withheldis a tax-unit input (Schedule 3 line 11 of this return), so it is unchanged.additional_medicare_tax: sumspayroll_tax_gross_wagesandtaxable_self_employment_incomeover the head and spouse (Form 8959 lines 1 and 8). The Biden budget reform's copy of this formula gets the same change.pr_refundable_ctc_social_security_tax: used the same parameter list withadds. It now uses the same head-and-spouse sum.add. It now readsctc_social_security_tax.reforms/crfb/agi_surtax.py): the expanded base addsp.increased_base.sourceswithtax_unit_non_dep_add.tax_exempt_social_security(tax_unit_social_security − tax_unit_taxable_social_security) carried a dependent's whole benefit, because only the head's and spouse's benefits enter section 86. The source list now uses a newfiler_tax_exempt_social_security:tax_unit_social_security_for_taxability − tax_unit_taxable_social_security.tax_exempt_social_securityitself is unchanged. It has 11 other consumers: Medicaid's MAGI modification, the federal sales-tax-table income, income lists for six state programs (CO, ME, RI, WA, WI, WV), MO's property tax credit, VT's renter credit and the WATCA reform. Two of them, the sales-tax-table income and WATCA's alternative-tax MAGI, measure one return's income and still count a dependent's whole benefit (follow-ups below). This PR changes none of the 11 and has not checked the other nine.With #9801
AGI and the expanded base now agree. #9801 keeps a dependent's above-the-line deductions off the filer's AGI, and this PR keeps the same dependent's contributions out of the add-backs. Each needs the other: the table under "Round 2" shows the surtax with either fix alone.
Methodology note
The CRFB surtax base starts from CRFB's published proposal. Footnote 2 of CRFB's "Break Glass: A Plan for the Next Economic Shock" reads: "On the individual side, the surtax is applied to a broad definition of income that includes Adjusted Gross Income (AGI) plus retirement contributions, HSA/MSA contributions, deductible student loan interest, Social Security income not counted toward AGI, interest income on tax-free bonds, and the value of employer-provided health insurance." The footnote sets rates on "individual income". The paper says its estimate is "based largely on numbers from PolicyEngine, who estimated a 1% tax on individual AGI between $100,000 and $1 million and a 2% tax on individual AGI above $1 million".
The paper does not discuss dependents. Counting only the head's and spouse's add-backs is an inference: the base starts from AGI, a per-return amount (§62), and the paper frames it as individual income, which supports counting the same filers' amounts. A dependent's 401(k) deferral, tax-exempt interest or Social Security benefit belongs to a return whose AGI the surtax never sees. Review r1 found no separate household-pooling choice to make. Which items belong in the base, and which variable stands for each, is a separate question. #9763 tracks the health insurance and retirement entries, and the footnote does not list the foreign earned income exclusion, which the source list includes. The
sources.yamlcomment now says so.Invariants
These hold for every input the property test draws: filers aged 25 to 64 in Texas, with one to five dependents aged 0 to 17, all qualifying children. (For a qualifying relative, the dependent's own gross income decides whether they are a dependent and whether the filer may file as head of household, so their income can rightly change the filer's return.)
ctc_social_security_tax,pr_refundable_ctc_social_security_tax,additional_medicare_taxor the surtax's additions to AGI. The test gives AGI and taxable Social Security as inputs for this one.qbid_amount;ctc_social_security_tax, the Puerto Rico version,additional_medicare_taxandagi_surtaxequal an independent numpy sum of the model's person-level amounts (payroll taxes, wages, contributions, benefits) over the head and spouse, with the Additional Medicare Tax and the surtax rates applied from the parameters.self_employment_tax_alddirectly now has it replaced by the person-level amounts. With Social Security $100, Medicare $100, a supplied tax-unit SE deduction of $50, Additional Medicare $25 and excess withholding $200, a unit with no dependents gets $75 on main and $25 here (Sol review, P3). In the 2026 microsimulation below, none of the 53,537 tax units without dependents changed by more than half a cent in any compared tax-unit variable (the largest difference among them is $0.004); all 3,469 that changed have dependents.Tests
New:
ctc_social_security_tax_dependents.yaml, with hand-computed amounts:In each, a 16-year-old child earns $8,000, the EITC is barred by $46,000 of interest, and the alternative formula decides the refund.
ctc_social_security_tax.yaml: a person-level case. The existing cases now setself_employment_tax_ald_person.additional_medicare_tax.yaml: joint wages and a dependent's wages.contrib/crfb/agi_surtax.yaml:tests/core/test_dependent_payroll_taxes_ctc_and_surtax_invariants.py: two Hypothesis properties over batches of 1 to 12 tax units, in 2019, 2020, 2024 and 2026. Each unit is calculated with and without its dependents' amounts in one simulation, under the baseline and under the CRFB reform with the expanded base. A fixed-household test asserts that the alternative formula decides each low-wage family's refund and that the surtax applies.Round 2:
c6914e7d39: all 35 checks pass (gh pr checks 9825exits 0), including every Full Suite shard, the microsimulation suite, Household API Partners and Lint.34e3dc974dand4732913a0e(AGI $145,000) and at47ab53e0fb(surtax $550), and passes at16891ef47b.16891ef47b. At the old head34e3dc974d, 2 failed and 1 passed: a dependent's IRA deduction still moved the filer's AGI. At main47ab53e0fb, 3 failed onctc_social_security_tax.c6914e7d39), each touched YAML file on its own:ctc_social_security_tax.yaml4 passed,ctc_social_security_tax_dependents.yaml3 passed,additional_medicare_tax.yaml5 passed,contrib/crfb/agi_surtax.yaml14 passed.Round 1, at
34e3dc974d:contrib/crfbandgov/irs/credits/ctc: 162 passed.tests/core/test_dependent_payroll_taxes_ctc_and_surtax_invariants.pyandtests/code_health: 139 passed.Impact
Default dataset (
populace_us_2024.h5@populace-us-2024-spm-20260909), policyengine-core 3.32.15, through the hub's locked runner. Main with #9801 (47ab53e0fb) against this head (c6914e7d39), one run each, compared record by record on the same records; a record counts as changed when it moves by more than half a cent. All three years ran on the restored main tree (each base run imports/tmp/ctcss-r2/main, the exact tree at47ab53e0fb).ctc_social_security_tax(summed over tax units)ctc_phase_inrefundable_ctcctc(total credit)non_refundable_ctc(nominal:ctc − refundable_ctc)ctc_value)income_taxadditional_medicare_tax/employee_payroll_taxhousehold_net_incomeadjusted_gross_income,eitc,ctc_qualifying_childrenctcdoes not change, sonon_refundable_ctc, the nominal remainderctc − refundable_ctc, rises by the same amount. These families cannot use it: for each of the 20 units,ctc_value= min(ctc,ctc_limiting_tax_liability+refundable_ctc) falls by exactly the refundable decrease, $14.3M in all, and income tax after refundable credits rises by the same amount. For 13 more units (4.4k weighted),ctc_phase_infalls by $9.4M in all but the refundable credit does not change:refundable_ctcis the lesser of the refundable maximum and the part of the credit the phase-in amount unlocks above tax liability. For each of these units, either tax liability plus the lower phase-in amount still covers the whole credit, or the refundable maximum is still no more than what that amount unlocks (for one unit the credit is $0).4613f8c792. One tax unit (weight 7,455) accounts for the $29.0M difference. On that main, its $3,892 refundable CTC rested entirely on a dependent's payroll taxes. On main with Keep dependents' above-the-line deductions off the filer's AGI #9801, itsctc_social_security_taxis already $0, so this PR no longer changes it. The other 20 units, and the Additional Medicare Tax figures, are the same in both rounds.Follow-ups (not in this PR)
ctc_social_security_taxcounts all of it throughadditional_medicare_tax.section_22_income(Schedule R) subtractstax_unit_social_security − tax_unit_taxable_social_security, so a dependent's benefits reduce the parents' elderly or disabled credit. It also sumspension_incomeandtotal_disability_paymentsover all members.filer_tax_exempt_social_securityis the head-and-spouse amount it needs.state_sales_tax_income_bracket; Schedule A instructions: Form 1040 AGI "plus any nontaxable items") addstax_exempt_social_security, which holds a dependent's whole benefit, and sums the person-level nontaxable items (tax-exempt interest, veterans' benefits, workers' compensation, SSI, tax-exempt pension and retirement distributions) over every member. WATCA's alternative-tax MAGI (Section 1A(d)) addstax_exempt_social_security; it sets both eligibility for the alternative maximum tax and the tax itself. Both count a dependent's benefits on the filer's return;filer_tax_exempt_social_securityis the per-return amount.qbid_amount, so a dependent's self-employment income raises the filer's deduction. At this head, a 16-year-old's $30,000 of self-employment income gives a parent with $60,000 of wages a $5,576 deduction and cuts the parent's 2024 income tax from $2,241 to $1,572.axiom: us:statutes/26/24/d#ctc_social_security_tax encoded-correct (companion test
three_children_social_security_excess_is_greater_than_earned_income_phase_inin us/statutes/26/24/d.test.yaml; the module takes the taxpayer's own §3101/§3201(a)/§1401 taxes as tax-unit inputs and never sums persons); us:statutes/26/3101/b/2#additional_medicare_tax encoded-correct (wagesis the return's own; companion testjoint_above_threshold, $300,000 joint → $450, the same figure as this PR's YAML case); CRFB surtax n/a: contributed reform, not law🤖 Generated with Claude Code