Skip to content

Run selective contrib and reform tests one file per process - #10188

Merged
MaxGhenis merged 1 commit into
mainfrom
ci/selective-reform-per-file
Oct 13, 2026
Merged

MaxGhenis merged 1 commit into
mainfrom
ci/selective-reform-per-file

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Quick Feedback runs CRFB reform directory targets in one coverage-instrumented Core process. On #10066, run 38227190703 attempt 1 and attempt 2 each passed the first location's 5 Python tests, then ran policyengine_us/tests/policy/contrib/crfb as one process collecting 43 cases. The runner received a shutdown signal 20m42s and 14m47s after that CRFB process started. Memory exhaustion is the likely cause; the shutdown logs do not prove OOM.

All 22 Full Suite jobs, including all 9 contrib shards, succeeded. The successful CRFB shard ran its 8 files separately using test_batched.py --mode per-file --workers 1, passing all 43 cases. Its largest recorded per-file RSS was 12,010 MB.

The selective runner now reuses that batcher's per-file enumeration for selected directories under tests/policy/contrib and tests/policy/reform. It runs the resulting files sequentially, so only one file's model/reform caches remain resident at a time. This bounds memory by an individual file rather than a whole directory; memory within a file is unchanged. Both YAML suffixes and the Python tests previously discovered in those directories are retained. Changed-file mapping, selection limits, existing deferrals, and directly selected file targets are unchanged.

Every child keeps the existing coverage run -a --branch command and include patterns, accumulating coverage into the same data file. Failures still fail the overall run while later files execute. The workflow comment now describes the process isolation accurately; no jobs or concurrency were added.

Test plan

  • Policy calculation tests: not applicable (CI routing only).
  • Changelog fragment in changelog.d/.
  • make format (Ruff 0.15.5): formatting and lint pass.
  • policyengine_us/tests/code_health/test_selective_test_batches.py: 18 passed in 29.37s, using --noconftest --confcutdir=policyengine_us/tests/code_health to skip unrelated country-package setup (one temporary-directory cleanup warning).
  • policyengine_us/tests/core/test_run_selective_tests.py: 18 passed in 15.14s. An untracked local namespace adapter loaded the actual runner through its package import without initializing the country model; test contents were unchanged.

Both files ran sequentially with OMP_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 MKL_NUM_THREADS=4 VECLIB_MAXIMUM_THREADS=4 NUMEXPR_NUM_THREADS=4 OMP_WAIT_POLICY=PASSIVE. The supplied local environment lacked coverage, so it was installed into an untracked workspace-only dependency directory for these checks.

The new tooling tests record subprocess commands and use temporary files; they do not construct simulations or load datasets. The standalone CLI smoke check also guards against importing the US model in the parent runner.

Hub microsimulation impact

Structurally zero. The PR changes only CI test routing: .github/workflows/pr.yaml (comments), policyengine_us/tests/run_selective_tests.py, a code-health test and a changelog fragment. No variable, parameter, reform or dataset changes, so no microsimulation output can move.

axiom: n/a: CI test routing

@MaxGhenis
MaxGhenis merged commit 6397beb into main Oct 13, 2026
26 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10188 at ad570fce30c0cb99c8b711f3239b9839ffb560e8 (squash): Run selective contrib and reform tests one file per process.

  • Review: GPT-6.1 Sol review r1 APPROVE at ad570fc (reviews-gen/us-10188/review-r1.md): selection unchanged (AST-compared), contrib/reform folders run one file per process, failures and coverage preserved, regression test fails on main; one pre-existing P3 (baseline folders still one process).
  • Gates checked live at merge:
    • gh pr checks exits 0;
    • the latest Pull request run at the head concluded success;
    • MERGEABLE;
    • not a draft;
    • no reviewer's latest review requests changes;
    • the semantic-overlap guard;
    • head pinned.
  • Impact: Structurally zero: CI test routing only (workflow comments, run_selective_tests.py, a code-health test, changelog); no model code, parameters or data.
  • Order: Then re-run Correct CRFB expanded surtax premium addbacks; isolate salary-reduction reading #10066's Quick Feedback.
  • Axiom: n/a: CI test routing

@MaxGhenis
MaxGhenis deleted the ci/selective-reform-per-file branch October 13, 2026 01:57
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