Skip to content

Require policyengine-core 3.30.1 and add substitution-channel regression test#9087

Merged
hua7450 merged 3 commits into
mainfrom
fix/lsr-substitution-core-bump
Jul 20, 2026
Merged

Require policyengine-core 3.30.1 and add substitution-channel regression test#9087
hua7450 merged 3 commits into
mainfrom
fix/lsr-substitution-core-bump

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Fixes #9086.

policyengine-core 3.30.1 (PolicyEngine/policyengine-core#521) fixes Simulation.delete_arrays so the mtr_for_adult_N sub-branches inside the named behavioral measurement branches actually purge inherited parent values. Under cores 3.24.4–3.30.0 both measurement branches recorded MTR = 1.0 for every adult, relative_wage_change was exactly zero, and the substitution channel of labor supply responses (and the capital-gains MTR channel) contributed exactly $0 to every behavioral run since 2026-04-18 (bisect in the issue comments). Static/root-simulation MTRs were unaffected.

This PR:

  • bumps the core requirement >=3.26.5>=3.30.1;
  • adds an end-to-end regression test (real Simulation, bracket-2 rate reform + substitution elasticity) asserting the measurement branches record distinct, sane MTRs, a negative relative_wage_change, and a negative substitution response. Verified: passes in 18s with core 3.30.1, fails with 3.30.0 (the existing tests in this file mock the measurement plumbing, which is why they never caught this).
  • changelog fragment under changelog.d/fixed/.

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits July 19, 2026 12:15
…ion test

The LSR/CG measurement branches recorded MTR = 1.0 for every adult in both
the baseline and reform branches under policyengine-core >= 3.24.4 (see
PolicyEngine/policyengine-core#521), which zeroed relative_wage_change and
made the substitution channel inert in every behavioral run. Bump the core
requirement to the fixed release and add an end-to-end regression test that
fails on the broken cores.

Fixes #9086.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same regression class as the substitution test: under policyengine-core
< 3.30.1 both capital-gains MTR measurement slots recorded 1.0, zeroing
relative_capital_gains_mtr_change and the realization response. Verified
failing with core 3.30.0 and passing with 3.30.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hua7450
hua7450 merged commit 2e56ceb into main Jul 20, 2026
65 of 66 checks passed
@hua7450
hua7450 deleted the fix/lsr-substitution-core-bump branch July 20, 2026 13:54
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.

Substitution channel of behavioral responses is inert: LSR measurement branches record MTR = 1.0 for every adult

2 participants