PolicyEngine / PolicyEngine/policyengine-us
§68 reduction uses a truncated 2/37 rate and float32 rounding
- Dominant language
- Python
- Stars
- 162
- Forks
- 212
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 97
Description
**Versions:** policyengine-us 1.767.3 (source pin `49d19b239a593dbac8920ac6fd80cfe33372343a`), policyengine-core 3.30.3.
**Summary:** §68(a) prescribes a reduction of exactly **2/37** of the applicable base. PE stores the rate as a truncated decimal in `parameters/gov/irs/deductions/itemized/limitation/obbb/rate.yaml` and computes the final in float32, so large bases round visibly: with itemized deductions and a §68 base of $10,000,000, the lawful reduction is 10,000,000 × 2/37 = **$540,540.5405405…**; PE computes **$540,540.5** and the final deduction differs by ≈$0.54 (measured final 9,459,460 vs lawful 9,459,459.4594…).
This is a precision-class divergence (truncated rational parameter + float32 output). Storing the rate as the exact rational (or computing `base * 2 / 37`) and/or widening the output dtype would eliminate it. Statute: 26 USC 68(a) (Pub. L. 119-21). Found via Axiom Foundation cross-engine validation (`us-itemized-taxable-income-deductions-grid`, case `itemized-68-rational-rate`).
Contributor guide
Research direction
Start with parameters/gov/irs/deductions/itemized/limitation/obbb/rate.yaml and trace how the §68 reduction is computed and its output dtype. Reproduce the us-itemized-taxable-income-deductions-grid case itemized-68-rational-rate using the reported $10,000,000 base. Done means the calculation uses exact 2/37 precision and no longer shows the reported rounding divergence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, yaml
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100