Conversation
PE-core 3.24.0-3.24.3 cache-invalidation wiped set_input values across apply_reform, causing UK household-impact calculations to return zero (#1628). 3.25.0 (PolicyEngine/policyengine-core#475) preserves user inputs while still invalidating formula-output caches. All 11 tests/test_household_impact.py cases pass on the new pin. Closes #1628 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1628.
Bumps `policyengine_core` minimum to `>=3.25.0` to pick up the `set_input` preservation fix from PolicyEngine/policyengine-core#475.
Why
PE-core 3.24.0–3.24.3 introduced a cache-invalidation cascade that wiped `set_input` values whenever a reform was applied during simulation construction. For policyengine.py this manifested as UK household-impact calculations returning zero — `income_tax`, `universal_credit`, `child_benefit` all came back as £0 even for households with substantial earnings, because the country subclass's dataset inputs got wiped by the reform apply that runs during init.
3.25.0 preserves user-provided inputs (including `holder.set_input` via `SimulationBuilder.finalize_variables_init`) while still invalidating formula-output caches.
Test plan
Generated with Claude Code