Wrong Schedule R initial amount for MFS filers
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
Inizia da policyengine_us/variables/gov/irs/credits/elderly_and_disabled/section_22_income.py, indicato nell’issue, e controlla i test esistenti per Section 22 income e Schedule R. Esegui i test pertinenti, poi verifica che un contribuente MFS usi l’importo iniziale di $3,750, mentre i contribuenti single e joint mantengano i rispettivi importi. Il lavoro è concluso quando l’esempio MFS segnalato non riceve più il credito errato e i test pertinenti passano.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
This bug report was generated by Claude Code 2.1.314 running Opus 5.5
with medium effort. The response below was generated after reading
this validation summary.
Summary
PolicyEngine-US (version 2.87.0, used by policyengine-taxsim 3.3.0 at
commit c0d565948af3896e3a6e4d34970f7502d17cdf34) gives a married
filing separately (MFS) filer who is 65 or older a Schedule R
(credit for the elderly or the disabled) initial amount of $5,000
instead of the statutory $3,750. This overstates the credit, and
so understates income tax, for low-income elderly MFS filers.
The law
IRC section 22(c)(2)(A) sets the initial amount at:
- (i) $5,000 for a single individual or a joint return where only one
spouse is a qualified individual, - (ii) $7,500 for a joint return where both spouses are qualified
individuals, and - (iii) $3,750 for a married individual filing a separate return.
IRC section 22(d) reduces the initial amount by one-half of AGI above
$7,500 (single), $10,000 (joint), or $5,000 (MFS), and the credit is
15% of the reduced amount. The Schedule R instructions (Part I, box
8, and Part III, line 10) give the same $3,750 and $5,000 MFS amounts.
In addition, IRC section 22(e)(1) allows the credit to a married
individual filing separately only if the spouses lived apart for the
whole year. Tax-Calculator records do not record whether MFS spouses
lived apart, so Tax-Calculator (like PE) allows the credit to every
MFS filer aged 65 or older. That limitation is therefore not part of
the difference described here.
Why PE is wrong
PE's section_22_income variable
(policyengine_us/variables/gov/irs/credits/elderly_and_disabled/section_22_income.py)
chooses the initial amount with:
initial_amount = select(
[
num_qualifying_individuals == 1,
num_qualifying_individuals == 2,
filing_status == filing_status.possible_values.SEPARATE,
],
[
elderly_disabled.amount.one_qualified, # 5,000
elderly_disabled.amount.two_qualified, # 7,500
elderly_disabled.amount.separate, # 3,750
],
default=0,
)
select returns the value for the first condition that is true. An
MFS tax unit has only one person, so an elderly MFS filer satisfies
num_qualifying_individuals == 1 first and gets $5,000; the
SEPARATE branch is never reached. PE's phase-out threshold
parameter is correct (phase_out.threshold.SEPARATE = 5,000).
Putting the SEPARATE condition first would fix the bug.
Note that with the $5,000 MFS threshold, PE's result,
5,000 - (AGI - 5,000) / 2, equals 3,750 - (AGI - 7,500) / 2. So the
output looks as if PE used the correct $3,750 initial amount with the
single-filer $7,500 AGI threshold, but the cause is the initial
amount.
Example tax unit
A 2021 MFS filer aged 72 with $14,000 of wages and no other income,
in the TAXSIM input format used by the PolicyEngine-TAXSIM tool:
taxsimid,year,mstat,page,pwages,idtl
1062,2021,6,72,14000,2
This is unit 1062 of the a21 validation sample in
taxcalc/validation/pe_taxsim/samples/a21.in.csv.gz.
| Item | Tax-Calculator | PolicyEngine |
|---|---|---|
| AGI | 14,000 | 14,000 |
Taxable income (v18) |
100 | 100 |
Income tax before credits (v19) |
10 | 10 |
| Section 22 amount after phase-out | 0 | 500 |
| Schedule R credit, before tax limit | 0 | 75 |
| Schedule R credit | 0 | 10 |
fiitax |
-2,526.33 | -2,536.33 |
The two models agree on every other part of fiitax (the EITC of
$1,136.33 and the $1,400 recovery rebate credit).
Tax-Calculator: 3,750 - (14,000 - 5,000) / 2 = -750, so there is no
credit. PolicyEngine: 15% x (5,000 - (14,000 - 5,000) / 2) = $75,
limited to the $10 tax. At $15,000 of wages both models give no
credit, because PE's amount, 5,000 - 5,000, is also zero.
The PE results were confirmed by running the pinned PE version
directly (elderly_disabled_credit_potential = 75 and
elderly_disabled_credit = 10 at $14,000 of wages; both zero at
$15,000).
cc: @MaxGhenis @PavelMakarchuk
- Lingua principale
- Python
- Stelle
- 170
- Fork
- 217
- Merge medio
- 4g 9h
- PR unite (30g)
- 391
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policyengine-us
-
South Carolina OSS: require SSI's citizen or qualified-noncitizen test (S.C. Code Regs. 126-920)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PolicyEngine/policyengine-us#10545 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
PolicyEngine/policyengine-us#10524 ·
I maintainer di solito rispondono entro 2 giorni
-
bug state-income-tax states/ia
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
PolicyEngine/policyengine-us#10512 ·
I maintainer di solito rispondono entro 2 giorni
-
bug state-income-tax states/la
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine-us#10510 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
PolicyEngine/policyengine-us#10487 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di PolicyEngine/policyengine-us
Issue simili
-
area:scripts area:tests bug priority:later
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Ikalus1988/MisakaNet#4358 ·
I maintainer di solito rispondono entro 1 giorno
-
Discovered ports from service discovery are never propagated to modules in Module.load()Forse già presa @vishalmore90 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OWASP/Nettacker#1828 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
aws-samples/sample-per-model-bedrock#708 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
[Performance] Bound resolve_api_hashes raw fallback reads to the 1 MiB region actually scannedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sjkim1127/Reversecore_MCP#365 ·
I maintainer di solito rispondono entro 1 giorno