Repository navigation
Conversation
…ed as dependents The federal filing requirement tested every tax unit's unearned income against $500 plus the additional standard deduction. Under 26 U.S.C. 6012(a)(1)(C)(i)(I) and (f)(2)(D) that test applies only to an individual described in section 63(c)(5), and the amount is the section 63(c)(5)(A) amount for the year ($1,350 in 2025), not the unindexed $500. - Apply the test to the head, and on a joint return each spouse, who can be claimed as a dependent on another return. - Read the amount from gov.irs.deductions.standard.dependent.amount and add that person's own additional standard deduction for age or blindness. - Count gross income from every source except wages and self-employment income, so a self-employment loss or a tax unit dependent's wages no longer change the filer's unearned income. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rement - Hypothesis properties: split invariance for filers nobody can claim, monotonicity in income, claimability never removing the requirement, and tax unit dependents' income never mattering. - A boundary grid checked against Publication 501 (2025), Table 2, computed directly from its published amounts, and against medicaid_person_is_required_to_file, the other Table 2 implementation. - Keep the YAML cases a dollar away from the two thresholds where the statute and the IRS charts differ at the exact dollar, and say in the formula that the joint return test follows Table 2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…deduction When a spouse can be claimed, the Standard Deduction Worksheet for Dependents limits the joint standard deduction, which PR #10024 adopts. The case now isolates the per-spouse unearned income test under either deduction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Section 6012(a)(1)(A) excuses a filer only when gross income is less than the basic standard deduction, while Chart B says more than; the 2026 instructions are not yet out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of tests - Move the earned income sources of the unearned income test into gov.irs.income.filing_requirement.dependent.earned_income_sources, citing the IRS dependent worksheet, and count Schedule F farm income as earned. A test checks that every listed source is a gross income source. - Stop pinning decision d1395: drop the 2025 case of a claimed spouse aged 65 at exactly $2,950 and the case of a claimable filer filing separately, limit the joint grid to claimed spouses under 65 and not blind, and compare with medicaid_person_is_required_to_file only in 2025. - Start every Hypothesis batch with a unit that must file and one that need not, and assert each property has rows to check. - Drop the duplicate section 6012 reference entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…invariant, test farm income - Property 7 (claimability never removes a requirement) now leaves out separate filers as well as blind ones: Table 2 and the statute differ for a claimable married dependent filing separately (decision d1395). - Add a 2025 joint case where a claimed spouse's $2,000 of farm profit is earned income; dropping farm income from the earned sources fails it. - Correct the docstring's claim about what the anchor units guarantee. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Hand-off to the US + core hub (session
|
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.
What is wrong on main
tax_unit_is_required_to_file(main at065d0e9560) ends with an unearned income test that it applies to every tax unit:gov.irs.deductions.standard.dependent.amount.earned_incomesummed over every member. Gross income counts only the head and spouse and floors each source at zero, butearned_incomeis net of losses and includes dependents. So a $10,000 self-employment loss counts as $10,000 of unearned income.Reported as "P2, pre-existing" by the independent review of #10022.
What the law requires
2018 to 2025: 26 U.S.C. 6012(f)
The standard deduction of an individual described in section 63(c)(5) (one "with respect to whom a deduction under section 151 is allowable to another taxpayer") is limited. Its basic standard deduction "shall not exceed the greater of— (A) $500, or (B) the sum of $250 and such individual's earned income", indexed under 63(c)(4) to $1,350 and $450 for 2025 (Rev. Proc. 2024-40 §2.15(2)). The additional standard deduction for age and blindness is added on top.
2026 on: 26 U.S.C. 6012(a)(1)
Subsection (f) covers only "a taxable year beginning after December 31, 2017, and before January 1, 2026". Pub. L. 119-21 does not amend section 6012: the word does not occur in the enrolled text. Its §70102 and §70103 made the larger standard deduction (63(c)(7)) and the zero exemption amount (151(d)(5)) permanent. So from 2026 the rule is (a)(1), with an exemption amount of zero. (A) excuses an individual whose gross income is "less than" the basic standard deduction, raised under (B) for age 65. Then:
IRS charts
Publication 501 (2025), Table 2 and Chart B of the 2025 Form 1040 instructions, for single dependents under 65 and not blind, say a return is due if any of these applies:
If 65 or older or blind, the amounts are $3,350 ($5,350 if both), $17,750 ($19,750), and $3,350 ($5,350) or earned income plus $2,450 ($4,450). For married dependents 65 or older or blind, the unearned income test is "more than $2,950 ($4,550 if 65 or older and blind)". Chart A, for everyone else, has a gross income test only. The 2024 charts (page 10) have the same form with $1,300, $14,600 and $450.
For an unmarried filer, tests 1 and 2 never decide anything on their own: each implies test 3. The limited standard deduction is at least $1,350 plus the additions, and, up to the regular amount, at least earned income plus $450. So the existing comparison of gross income with
standard_deductionalready gives Chart B's answer:basic_standard_deductionapplies the section 63(c)(5) limit when the head can be claimed. The unearned income test changes the result only on a joint return where a spouse can be claimed.Fix
head_is_dependent_elsewhere,spouse_is_dependent_elsewhere). No new input.gov.irs.deductions.standard.dependent.amount, plus that person's own additional standard deduction (is_irs_agedandis_blindtimesaged_or_blind.amountfor the filing status).gov.irs.gross_income.sourcesexcept the earned income sources, each floored at zero as inirs_gross_income. The earned sources are a new parameter,gov.irs.income.filing_requirement.dependent.earned_income_sources: wages, business income and farm income. That is Form 1040 line 1z and Schedule 1 lines 3 and 6, the earned income of the IRS dependent worksheet (2025 instructions, page 35). Schedule 1 line 5 (rents, royalties, partnerships, S corporations, trusts) is not on that list, so partnership income counts as unearned here, as it is outsideearned_incomeon main. A general partner's earnings for services can be earned income (Publication 501). The model's inputs do not separate them, so a claimed spouse whose only income is such earnings can trip the unearned income leg; that needs a separate input.Nothing else changes: the gross income test, the section 911 add-back (#10022) and the standard deduction are untouched.
Where the statute and the charts differ (decision d1395)
The fix keeps three readings that main already used, and queues them for Max as d1395. No test asserts anything that depends on them.
Age and blindness in the 2018–2025 joint test. §6012(f)(2)(D) uses the section 63(c)(5)(A) amount alone. Chart B adds the additional standard deduction ($2,950 for a married dependent 65 or older). The fix follows Chart B, as main did (main added the tax unit's additional standard deduction). It matters only for a claimed spouse who is 65 or older or blind and files jointly. Section 152(b)(2) bars a dependent who files a joint return; Publication 501 excepts a joint return filed only to claim a refund.
2026 for claimable filers who are blind, and the exact dollar. Read literally, (a)(1)(A)–(B) leave blindness out of the threshold and require a return at exactly the threshold ("less than"). The 2017 Chart B, the last under the same text (page 9), includes blindness and says "more than". The model's gross test uses
>and the standard deduction with blindness, for every year, and this PR does not change that. The 2026 instructions will show the IRS reading.A claimable filer who is married and files separately. Chart B (married dependents) requires a return only if the spouse itemizes or one of the $1,350, $15,750 or earned-income-plus-$450 tests is met. Section 6012(f) and (a)(1) give such a filer no exception, so any gross income requires a return. The model follows the statute here, as main does.
Also open, and handed to the 2026 PR (#10137): from 2026, §6012(a)(1)(A)(iv)'s joint exception "shall not apply if ... any other taxpayer is entitled to an exemption for such spouse under section 151(c)".
Out of scope and proposed as a separate session (now #10137): from 2026, filers nobody can claim face (a)(1)(A)–(B), whose thresholds leave out blindness and use "less than". The model applies the 2025 rule in every year.
Tests
tax_unit_is_required_to_file_dependents.yaml: 49 cases, 2024, 2025 and 2026. They cover non-dependents with small unearned income, a dependent a dollar under and over each Chart B leg, the 65-or-older and blind additions (single and joint), the $15,300 earned income cap, a self-employment loss, a claimed spouse's farm profit (earned income), a child's income in the tax unit, and the claimed spouse on a joint return. 19 of the 49 fail on main (065d0e9560).tests/core/test_filing_requirement_dependent_invariants.py: a boundary grid at every Table 2 threshold, Hypothesis properties, and one pinned exception. Invariants below.tax_unit_is_filer.yaml(both),eitc_filer_gate.yaml,section_911_state_eitc.yamlandmedicaid_person_is_required_to_file.yaml.Invariants (each executed)
medicaid_person_is_required_to_file, the other Table 2 implementation on main. It is not compared in 2026, where the §6012(a)(1) treatment of blindness and the exact dollar is open (d1395).Every Hypothesis batch starts with a unit that must file and one that need not; each property asserts that it has rows to check, and the batch asserts that it holds both answers.
Intended exception (pinned): a smaller self-employment loss can end the requirement for a claimable filer. A loss does not reduce gross income (Chart A: "don't reduce your income by any losses"), but it does reduce the earned income that sets the limited standard deduction.
Mutation check (at
a9e58977ff; logs in~/reviews/us-hub/reviews-gen/us-10135/mutation-r2.txton the hub host). Each mutant of the formula ran against both test files:065d0e9560)>=instead of>Every mutant fails at least one test.
Merges with open PRs
basic_standard_deductioncases.medicaid_person_is_required_to_file's gross income and is otherwise independent.CI cost
The new Python file runs in the
coregroup of the rest Python tests. Locally (macOS, shared host at load 150 to 250), its four tests take 10.4 s inside pytest and 29.8 s wall time including the model import, with a peak memory footprint of 1.08 GB. These are not Linux CI measurements.Impact
Real microsimulations of the default dataset (
hf://datasets/policyengine/populace-us/populace_us_2024.h5@populace-us-2024-spm-20260909), policyengine-core 3.32.15, one run per side and year under the shared heavy-job lock; weighted sums. Run outputs and record-by-record comparisons are on the hub host in~/reviews/us-hub/fixes/10135-impact/and~/reviews/us-hub/fixes/aca-ptc-take-up-impact/.This PR alone: main
065d0e9560(policyengine-us 2.39.0) against this PR's formulaaca_ptc(entitlement)This PR with #10140: main
c09ffb4b30(policyengine-us 2.40.0) against the two merged (f9102afc46=7fed1d3d27+00570b48b7)aca_ptc(entitlement)assigned_aca_ptc(take-up weighted)used_aca_ptcWhat the numbers show:
would_file_taxes_voluntarilyis set for 86% of records. So filers fall by only 1.6M and 1.7M.tax_unit_is_filer; the one filing gate inside them is the EITC's, which already counts anyone who would file to claim the credit (eitc.py;would_file_if_eligible_for_refundable_creditis not in the dataset, so it defaults to true).aca_ptcby $0.80bn and $1.21bn. Of that, $0.07bn and $0.22bn belongs to units that take up the credit (aca_ptc × takes_up_aca_if_eligible, computed from the same runs; assigned PTC $60.58bn → $60.51bn and $47.66bn → $47.44bn). Those units file to claim the credit, buttax_unit_is_filerhas no such reason to file. Count ACA premium tax credit take-up as filing a return to claim it #10140 adds it. With both PRs the take-up-weighted and used credit change by less than $500 in total. The remaining fall inaca_ptc, $0.73bn and $1.00bn, is entitlement for 85k and 105k tax units that do not take up the credit and no longer file: Gate aca_ptc on tax_unit_is_filer (closes #7748) #8056's gate, working as designed. So does Maryland Premium Assistance's 2026 fall of $13.4M (one record, 14k tax units).medicaid_uses_non_filer_rules; 42 CFR 435.603(f)(3)).Merge order: land #10140 with or before this PR, so the take-up-weighted credit never dips.
Medicaid and the filing signal (decision d1415). With #10140, a tax unit that files only to claim the premium tax credit counts as filing for the credit. For Medicaid's household rules it still counts as a non-filer:
medicaid_uses_non_filer_rulesreadstax_unit_is_filer. 42 CFR 435.603(f)(1) applies the tax-filer rules to someone who "expects to file". For a unit not required to file, that expectation depends on the credit, the credit depends on Medicaid, and Medicaid depends on the expectation. The review of this PR (round 2, P1) found a household that flips between them: a California couple aged 62 with a $30,000 taxable pension and a claimed adult student. On main the old $500 test makes them "required", so they are filers: a Medicaid household of three at 112.6% FPL, eligible for Medicaid, with no credit. With both PRs they are non-filers for Medicaid: a household of two at 141.8% FPL, above California's 138% limit. They take up the credit, which is a reason to file. Making the two consistent needs Medicaid computed both ways, a methodology choice queued as d1415.In the data it moves almost nothing. Of the 1.6M (2025) and 1.7M (2026) tax units that stop counting as filers, 10,438 and 22,932 take up ACA. Their take-up-weighted credit changes by −$590 and −$134 in total. Three records a year in them, 0.43 weighted people, change Medicaid eligibility. The other Medicaid changes, about 45k people a year, are in units that stop filing and do not take up ACA. (Computed from the record-level outputs of the runs below, joined to the dataset's tax units.)
axiom: TheAxiomFoundation/rulespec-us#1696 queued
(rulespec-us encodes only §6012(f), with the section 63(c)(5) unearned income test as two free inputs that every fixture sets false, and nothing for §6012(a)(1) from 2026. The issue carries the verbatim law, required outputs, a pasteable
review_findingand 14 hand-computed companion cases from the same sources as these YAML tests.)🤖 Generated with Claude Code