Skip to content

Fix Virginia age deduction: protect fixed pre-1939 amount from income phase-out - #9303

Open
DTrim99 wants to merge 1 commit into
PolicyEngine:mainfrom
DTrim99:fix/va-age-deduction-fixed-amount
Open

Fix Virginia age deduction: protect fixed pre-1939 amount from income phase-out#9303
DTrim99 wants to merge 1 commit into
PolicyEngine:mainfrom
DTrim99:fix/va-age-deduction-fixed-amount

Conversation

@DTrim99

@DTrim99 DTrim99 commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #9302.

What

Virginia grants two distinct age deductions under Va. Code § 58.1-322.03(5):

(a) A deduction in the amount of $12,000 for individuals born on or before January 1, 1939.
(b) A deduction in the amount of $12,000 for individuals born after January 1, 1939, who have attained the age of 65. This deduction shall be reduced by $1 for every $1 that the taxpayer's adjusted federal adjusted gross income exceeds $50,000 for single taxpayers or $75,000 for married taxpayers.

The income test appears only in subparagraph (b). The (a) fixed deduction is never reduced.

va_age_deduction previously computed a single combined maximum ($12,000 × count_eligible) and then subtracted the entire AFAGI excess from the whole thing whenever not every eligible filer qualified for the fixed amount. For a mixed-age couple — one spouse born on/before Jan 1, 1939 (fixed) and one born after (income-based) — this wiped out the protected fixed $12,000.

This PR splits the deduction into the fixed portion (never reduced) and the income-based portion (reduced by the excess), so only the (b) amount is means-tested.

Impact

Only the mixed-age married case changes. All-fixed, all-income-based, and single-filer cases are unchanged.

Failing case (taxsim #1140)

Joint filers, TY2022: taxpayer born 1/1/1937 (fixed $12,000), spouse born 1/1/1945 (income-based), AFAGI $160,294 ≫ $75,000 married threshold so the (b) amount phases to $0.

  • TaxAct Form 760: age deduction $12,000, VA taxable income 131,057.
  • PolicyEngine before: $0, VA taxable income 143,058 (tax before credits $690 too high).
  • PolicyEngine after: $12,000. ✓

Tests

  • Corrected the existing joint mixed-age test, which encoded the buggy value ($9,000) — the statute gives $12,000.
  • Added the Reduce MD CTC by the federal CTC #1140 record as a regression test.
  • All 18 va_age_deduction tests pass.

🤖 Generated with Claude Code

… phase-out

Va. Code § 58.1-322.03(5) grants two age deductions: (a) a fixed $12,000
for filers born on or before January 1, 1939, which is not income-tested,
and (b) a $12,000 for filers born after that date, reduced dollar-for-
dollar by the amount adjusted federal AGI exceeds the threshold. The
income test applies only to (b). The prior formula computed a combined
maximum and subtracted the full excess from the whole thing, wiping out
the protected fixed amount for a mixed-age couple. Split the deduction so
only the income-based portion is reduced.

Fixes PolicyEngine#9302

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8326a14) to head (4c42ff5).
⚠️ Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##              main     #9303    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           12         1    -11     
  Lines          161        30   -131     
==========================================
- Hits           161        30   -131     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DTrim99
DTrim99 requested a review from hua7450 August 19, 2026 19:19
@DTrim99
DTrim99 marked this pull request as ready for review August 19, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virginia age deduction: fixed $12,000 (born on/before Jan 1, 1939) wrongly reduced when combined with a phased-out income-based deduction

1 participant