Skip to content

Chunk the baseline-levels batch so the reform-validation backfill survives the hosted runner - #107

Merged
PavelMakarchuk merged 1 commit into
PolicyEngine:mainfrom
DTrim99:fix-reform-validation-oom
Jul 23, 2026
Merged

Chunk the baseline-levels batch so the reform-validation backfill survives the hosted runner#107
PavelMakarchuk merged 1 commit into
PolicyEngine:mainfrom
DTrim99:fix-reform-validation-oom

Conversation

@DTrim99

@DTrim99 DTrim99 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The problem

The scheduled reform-validation backfill (reform-validation-backfill.yml) has failed on every run since 2026-07-21 — the runner receives a shutdown signal ~4 minutes into the first batch, which is the hosted-runner signature for OOM. As a result Build M and Build O reached the dashboard with no reform_validation.json (no override committed, nothing on HF).

Root cause: the levels batch scores every default_baseline_level_specs() row against one accumulating baseline simulation in a single subprocess. That suite grew from 74 specs (when the buildi/buildj backfills succeeded) to ~176 when the Census SPM state-poverty-rate backtests were added to the default set in populace — and the person-level state-rate computations push the process past ubuntu-latest's 7GB.

The fix

  • Chunk the levels batch: LEVELS_CHUNK = 16 specs per short-lived subprocess, each with a fresh baseline — the same isolation the reform batches already use (CHUNK = 2). merge is unchanged (concat + dedup by id), so the merged artifact is identical to the monolithic payload.
  • Install CPU torch explicitly in the workflow: the default PyPI index resolves CUDA wheels (~4GB of nvidia-* packages, visible in the failed-run logs) that the producer never uses and that eat the runner's disk/memory headroom.

Verification

  • python -m py_compile on the patched script; --plan/--only/--merge modes all flow through the same _batches() generator so partial names stay consistent within a run.
  • A full Build O reproduction with the identical producer call is currently running on a 64GB Modal container; I'll open the Build O override PR from it (workflow-equivalent artifact) — this PR makes the scheduled path self-sufficient again for Build P onward.

After merge I'll dispatch the workflow against Build M to confirm the fix end-to-end and backfill the remaining gap.

🤖 Generated with Claude Code

The scheduled reform-validation backfill has been OOM-killed on every run
since 2026-07-21 ("runner has received a shutdown signal" ~4 min into the
levels batch), leaving Build M and Build O with no reform_validation.json.
The levels suite grew from 74 to ~176 specs when the Census SPM state-rate
backtests joined default_baseline_level_specs(), and scoring them all
against one accumulating baseline simulation exceeds ubuntu-latest memory.

Score levels in LEVELS_CHUNK=16 slices, each in its own short-lived
subprocess with a fresh baseline (same isolation the reform batches already
use); merge is unchanged (concat + dedup by id). Also install CPU torch
explicitly - the default index resolves ~4GB of CUDA wheels the runner
never uses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@DTrim99 is attempting to deploy a commit to the PolicyEngine Team on Vercel.

A member of the Team first needs to authorize it.

@PavelMakarchuk
PavelMakarchuk merged commit f993df4 into PolicyEngine:main Jul 23, 2026
1 check failed
DTrim99 added a commit to DTrim99/calibration-diagnostics that referenced this pull request Jul 23, 2026
…loss100-22bd902-20260722T232627Z (Modal reproduction)

The scheduled workflow was OOM-broken until PolicyEngine#107 merged (its 18:26Z run
today still ran pre-fix code), so this override was produced on a 64GB
Modal container running the identical producer path
(tools/reform_validation/backfill.py, unmodified) at the release-exact
policyengine-us 1.764.6 / policyengine-core 3.26.11; provenance in the
file's _backfill_note. 226 rows - the first payload carrying the Census
state SPM poverty-rate suite (104 percent-unit rows, rendered by PolicyEngine#108).

Producer predates populace#513, so the State reform suite is the
original 8 rows. Since the scheduled workflow skips releases that
already have an override, the expanded-registry regeneration for this
release comes from a follow-up Modal run against post-#513 main
(superseding commit to this file); Build P onward picks up the expanded
registry automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DTrim99 added a commit to DTrim99/calibration-diagnostics that referenced this pull request Jul 27, 2026
…loss100-22bd902-20260722T232627Z (Modal reproduction)

The scheduled workflow was OOM-broken until PolicyEngine#107 merged (its 18:26Z run
today still ran pre-fix code), so this override was produced on a 64GB
Modal container running the identical producer path
(tools/reform_validation/backfill.py, unmodified) at the release-exact
policyengine-us 1.764.6 / policyengine-core 3.26.11; provenance in the
file's _backfill_note. 226 rows - the first payload carrying the Census
state SPM poverty-rate suite (104 percent-unit rows, rendered by PolicyEngine#108).

Producer predates populace#513, so the State reform suite is the
original 8 rows. Since the scheduled workflow skips releases that
already have an override, the expanded-registry regeneration for this
release comes from a follow-up Modal run against post-#513 main
(superseding commit to this file); Build P onward picks up the expanded
registry automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DTrim99 added a commit to DTrim99/calibration-diagnostics that referenced this pull request Jul 27, 2026
Regenerated on Modal at the same release-exact engine versions with the
producer at populace 51fbd3f (post-#513 registry expansion): adds the six
tracker-informed state credit/deduction bills, three federal benchmark
rows (ARPA CTC, ARPA childless EITC, CBO all-rates-+1pt), and the
$1,200/person UBI mechanical check to the buildo override. Chunked-levels
path from PolicyEngine#107 exercised end-to-end on this run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PavelMakarchuk pushed a commit that referenced this pull request Aug 3, 2026
* Backfill reform_validation.json for populace-us-2024-buildo-sparse-rmloss100-22bd902-20260722T232627Z (Modal reproduction)

The scheduled workflow was OOM-broken until #107 merged (its 18:26Z run
today still ran pre-fix code), so this override was produced on a 64GB
Modal container running the identical producer path
(tools/reform_validation/backfill.py, unmodified) at the release-exact
policyengine-us 1.764.6 / policyengine-core 3.26.11; provenance in the
file's _backfill_note. 226 rows - the first payload carrying the Census
state SPM poverty-rate suite (104 percent-unit rows, rendered by #108).

Producer predates populace#513, so the State reform suite is the
original 8 rows. Since the scheduled workflow skips releases that
already have an override, the expanded-registry regeneration for this
release comes from a follow-up Modal run against post-#513 main
(superseding commit to this file); Build P onward picks up the expanded
registry automatically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Supersede with the post-populace#513 payload (236 rows)

Regenerated on Modal at the same release-exact engine versions with the
producer at populace 51fbd3f (post-#513 registry expansion): adds the six
tracker-informed state credit/deduction bills, three federal benchmark
rows (ARPA CTC, ARPA childless EITC, CBO all-rates-+1pt), and the
$1,200/person UBI mechanical check to the buildo override. Chunked-levels
path from #107 exercised end-to-end on this run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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