Skip to content

Supply yearly input in subsampling holder test - #10671

Merged
MaxGhenis merged 4 commits into
mainfrom
spm-subsample-test-core552
Nov 7, 2026
Merged

MaxGhenis merged 4 commits into
mainfrom
spm-subsample-test-core552

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes test_spm_system.py, which fails with PolicyEngine/policyengine-core#552, and tightens a provenance test in test_social_security_real_core.py, which passed on both cores before. Both files pass with core #552 and with core's current master. The PR changes no model code.

  • test_spm_system.py. After subsampling, the holder test calculates is_household_head and requires a stored period. The reform gives that input a yearly definition without a formula. Core Add guaranteed income / cash assistance variable #552 returns its root default without caching when carry-over finds no source input. The test now supplies a yearly input after each subsample, and keeps its assertions for formula caching, yearly storage, reform policy bindings and baseline isolation.
  • test_social_security_real_core.py. The dataset rebuild provenance test stored its 2023 derived entry with put_in_cache. Before build_from_dataset runs, the adapter records _derived_cached_returns, which lists the derived and fast-only returns in the simulation's fast cache and skips stored inputs. With the old fixture, the 2023 entry never reached that list on either core. The test now supplies a 2022 input at construction. The 2023 read carries it over, and the test asserts that this return reaches _derived_cached_returns.

Tests

At 862156d871, whose parent 0cc7e65cd3 merges main at 67d4dde6cb:

impact: none (test only)
axiom: n/a: test-only change

🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 7, 2026 13:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test stored its 2023 derived entry with put_in_cache, which leaves no fast-cache return, so the adapter's pre-rebuild snapshot never saw that key under core#552. Supply 2022 at construction instead: the 2023 read carries it over and caches a derived return on both cores, and the test now asserts that return reaches _derived_cached_returns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 7, 2026 18:33
@MaxGhenis
MaxGhenis merged commit 86394bf into main Nov 7, 2026
42 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10671 at 862156d8710b2870fa3c8c06c855e1e2a361deae (squash): Supply yearly input in subsampling holder test.

  • What it changes: it fixes test_spm_system.py, which fails with Keep branch period reads, dumps, and disk deletion consistent policyengine-core#552, and tightens a provenance test in test_social_security_real_core.py. Both files pass with core Add guaranteed income / cash assistance variable #552 and with core's current master. It changes no model code.
  • Review: An Opus 5.5 reviewer approved this head in round 1 with no P1 or P2 findings. Both changed files pass on core master (9fd76e1ce3) and on core Add guaranteed income / cash assistance variable #552 merged into master (c5eef1efd9), and each change now catches a mutant that the old test let through. The body now follows the review's P3 notes on its wording. One P3 stays: the changelog fragment describes only the SPM change. It describes that change accurately, and fixing it would rerun CI on a test-only PR.
  • Gates checked live at merge:
    • gh pr checks exits 0;
    • the latest Pull request run at the head concluded success (42401924872, 35 of 35 jobs);
    • MERGEABLE;
    • not a draft;
    • no reviewer's latest review requests changes;
    • the semantic-overlap guard;
    • the merge pins the head.
  • Impact: none; the PR changes only tests.
  • Axiom: n/a; the PR changes only tests.

🤖 Generated with Claude Code

@MaxGhenis
MaxGhenis deleted the spm-subsample-test-core552 branch November 7, 2026 19:55
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.

1 participant