Treat TAXSIM mstat 6 as a married-filing-separately return - #1246
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c61127c to
32d768d
Compare
32d768d to
0ccf2ca
Compare
Both emulator paths now build mstat 6 as a single-person tax unit whose head is is_separated and whose unit has cohabitating_spouses, so PE-US computes filing status SEPARATE (HEAD_OF_HOUSEHOLD with a qualifying child) and the IRC 86(c)(1)(C) zero Social Security base, matching taxsimtest. The batch path previously added a spouse (PE computed JOINT) and the single-household path computed SINGLE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Seeded random mstat 6 records check that the unit never has a spouse, the head alone is is_separated, filing status is SEPARATE or HEAD_OF_HOUSEHOLD by whether a dependent is under 19, both execution paths agree, and a childless separate return never owes less federal tax than a single return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…habiting assumption PE-US 2.15 nets Oregon's 2023 kicker credit into siitax for every filing status while taxsimtest does not (taxsim #1071), so the Oregon itemizer case no longer isolates mstat 6. North Carolina 2023 (taxsimtest 3420.00 single, 3467.50 separate) matches in both paths on PE-US 2.15.1. Also note that a TAXSIM row cannot express a separate filer who lived apart all year, so the emulator assumes cohabitation, as taxsimtest does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…path check - diagnose-issue playbook listed mstat 6 as dependent; it is married filing separately (8 is dependent taxpayer). - The dashboard formatter labels mstat 6 'Married Filing Separately', with a Vitest case. - taxsimtest's NY zero applies only to mstat 6 records without dependents. - CLAUDE.md notes that cohabitating_spouses also selects AZ's property-tax-credit table for claimants living with others. - The cross-path property test also compares fiitax. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0ccf2ca to
d6218fc
Compare
|
Merge audit (2026-09-28 open-PR sweep): |
Summary
TAXSIM
mstat6 is a married-filing-separately return. Neither emulator path handled it:TaxsimMicrosimDataset._process_person_data_for_year):has_spouse = np.isin(mstat, [2, 6])put a spouse into the tax unit, so PolicyEngine computed a joint return. An mstat 6 row with $400k of 2023 wages was taxed with MFJ brackets.form_household_situation): built a plain one-person unit, so PolicyEngine computed single.Both paths now build mstat 6 as a single-person tax unit plus dependents, never a spouse. Two inputs are set:
is_separatedon the head. PE-US'sfiling_statusformula yieldsSEPARATE, orHEAD_OF_HOUSEHOLDwhen a qualifying child lets IRC 7703(b) treat the filer as unmarried.cohabitating_spouseson the tax unit. This selects the IRC 86(c)(1)(C) zero Social Security base, which taxsimtest applies to mstat 6. The zero base applies to a separate filer who "does not live apart from his spouse at all times during the taxable year"; a TAXSIM row cannot say the filer lived apart all year, so the emulator assumes they did not, as taxsimtest does.MSTAT_MARRIED_SEPARATE = 6is exported frompolicyengine_taxsim.core.input_mapper; an in-progress axiom-oracles change (not yet pushed) plans to gate its emulator leg on that name. The README, R docs, dashboard marital-status codes, thevariable_mappings.yamlmstat type, and the text-output label now list mstat 6.Once this merges, the Populace benchmark converter (#1216,
scripts/convert_h5_to_taxsim.py) can emit mstat 6 for PolicyEngine'sSEPARATEtax units instead of mstat 1.TAXSIM's definition
The bundled binary enforces both: it aborts on mstat 6 with a nonzero
sageorswages.How taxsimtest taxes mstat 6 (build cd2026081819)
These are paired probes: each record was run as mstat 1 and as mstat 6. The federal set covers 27 profiles × 2021–2025 with state 0; the state set covers 51 states × {2021, 2023, 2025} × 6 profiles. After this change, the emulator reproduces every federal mstat 6 behavior below; the divergences are listed in the next section.
cohabitating_spouses)Known divergences (not emulated)
The emulator's job is to map TAXSIM inputs; PolicyEngine then computes the law. Each row quotes the operative text, extracted mechanically from law.cornell.edu or the state instructions on 2026-09-24/25.
gov.irs.credits.eitc.eligibility.separate_filer)Arizona is a case where the same flag moves PE toward taxsimtest. Take a 70-year-old renter with a $3,000 pension and $6,000 rent in 2023. taxsimtest gives mstat 6 $145.00 more property-tax credit than mstat 1 (siitax −393.22 vs −248.22). PE with
cohabitating_spousesgives $200 more; PE without the flag gives the same as mstat 1.State sweep
Four independent research runs root-caused every state where the mstat-6-specific error exceeded $5 on the six profiles swept. The error is measured as
(pe6 − pe1) − (ts6 − ts1). Each run used taxsimtestidtl=5traces, PE-US code, and verbatim state forms.Invariants (tested)
For every mstat 6 record, tested on 60 seeded random records across 2021–2025 with random incomes, ages, and 0–3 dependents:
depxdependents, never a spouse;is_separatedis set on the head only;cohabitating_spousesis set.v28) and federal income tax after credits (fiitax) as the batch path.Tests
tests/test_married_filing_separately.pyhas 44 tests:origin/maincode, 37 of the first 41 tests fail.axiom: n/a: TAXSIM input mapping in the emulator; no policy rule is changed. The IRC 32(d)(2) separated-spouse EITC encoding debt is tracked separately.
🤖 Generated with Claude Code