Skip to content

Fix KY family size tax credit at 1.33 boundary#8251

Open
DTrim99 wants to merge 3 commits into
PolicyEngine:mainfrom
DTrim99:DTrim99/ky-fstc-rounding-fix
Open

Fix KY family size tax credit at 1.33 boundary#8251
DTrim99 wants to merge 3 commits into
PolicyEngine:mainfrom
DTrim99:DTrim99/ky-fstc-rounding-fix

Conversation

@DTrim99
Copy link
Copy Markdown
Collaborator

@DTrim99 DTrim99 commented May 8, 2026

Summary

KY's Schedule ITC publishes Family Size Tax Credit thresholds in whole dollars and rounds 0.5-cent fractions up to the next whole dollar. PE's family_size/rate.yaml encoded the breakpoints as exactly 1.27 and 1.33, leaving a sub-dollar window where MGI lands between the share threshold and KY's published cutoff — resulting in PE returning a 0% rate instead of 10% (or 20% instead of 30%) at the boundary.

For 2025 family of 4 (FPG = $32,150):

  • KY publishes "10% credit if MGI not over $42,760"
  • $42,760 / $32,150 = 1.330016, not 1.33
  • A household with true MGI = $42,759.88 (e.g. issue #852) gets share = 1.330012 in PE's float32, which exceeds the 1.33 bracket → 0% (TaxAct: 10%, $91 credit)

Fix bumps the two affected thresholds to 1.2701 and 1.3301. The other brackets (1.04, 1.08, 1.12, 1.16, 1.20, 1.24, 1.30) land on whole dollars for all KY family sizes and are unchanged.

Test plan

  • Existing 4 KY FSTC rate tests still pass
  • 3 new boundary tests (just below cutoff with cents, exactly at $42,760, clearly above) pass
  • End-to-end check on issue 852 inputs: PE now returns FSTC = $91.04 and KY tax = $819.36, matching TaxAct ($91 / $819)
  • CI green

Reported in PolicyEngine/policyengine-taxsim#852.

🤖 Generated with Claude Code

KY's 2025 Schedule ITC publishes the FSTC table with whole-dollar MGI
boundaries. At the 1.27 and 1.33 share-of-FPG breakpoints, KY rounds
the .5-cent fraction up to the next whole dollar (e.g. for family of 4
the 1.33 cutoff is published as $42,760, not $42,759.50). PE's bracket
was encoded at exactly 1.33, leaving households with MGI between
$42,759.50 and $42,760 receiving 0% credit instead of 10%.

Adjust the 1.27 and 1.33 thresholds to 1.2701 and 1.3301 to absorb the
0.5-cent rounding-up convention. The 1.04, 1.08, 1.12, 1.16, 1.20,
1.24, and 1.30 brackets land on whole dollars for all KY family sizes
and are unchanged.

Reported in PolicyEngine/policyengine-taxsim#852.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.47%. Comparing base (623a65c) to head (ca21cfa).
⚠️ Report is 152 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##              main    #8251       +/-   ##
============================================
- Coverage   100.00%   70.47%   -29.53%     
============================================
  Files           12     4726     +4714     
  Lines          173    68743    +68570     
  Branches         4      347      +343     
============================================
+ Hits           173    48450    +48277     
- Misses           0    20292    +20292     
- Partials         0        1        +1     
Flag Coverage Δ
unittests 70.47% <ø> (-29.53%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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 PavelMakarchuk May 11, 2026 13:17
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.

2 participants