Skip to content

Preserve missing UC advance repayments in mixed populations - #2581

Merged
juaristi22 merged 1 commit into
fix-uc-advance-cash-2410from
fix-2574-advance-missingness
Oct 26, 2026
Merged

juaristi22 merged 1 commit into
fix-uc-advance-cash-2410from
fix-2574-advance-missingness

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2578

Stacked on #2574 (fix-uc-advance-cash-2410, reviewed base 41daefdd1671b029b8c2c650d30787f586cdd69f). Please keep both PRs together for adoption. This branch does not modify the parent branch.

When one benefit unit supplies an advance repayment amount, Core fills every omitted unit with the variable default and bypasses the amount formula. A default of zero silently removes another claimant's fallback: the 2025 age-30 ADVANCE_ONLY case with latent rate 0.1 loses £480.168/year when a neighbour supplies zero.

Use the existing cash-input convention (uc_reported_capital, benunit_reported_capital): the default -1 preserves missingness per unit, and the deduction formula resolves negative amounts through the shared legacy cash estimate. Explicit zero and positive cash keep their precedence. Fully supplied, partially supplied and unsupplied populations are covered. The existing same-year baseline allowance, caps, abolition switches, penny floor, supplied-rate precedence and protected-floor allocation retain their behavior.

Validation:

  • uvx ruff format --check .: passed (1937 files); full ruff check . and git diff --check: passed.
  • Focused tests blocked by host disk: 0 executed. The resource gates were monitored in the foreground for 30.9 minutes; disk stayed below 55 GB decimal and was 50.749 GB when stopped. Load1 at stop was 26.18 (limit 110). The waiting runner was stopped before pytest launched.
  • The frozen local environment is Python 3.13.15/Core 3.33.2. The prepared focused run uses -n 2 and BLAS/OpenMP threads of 2, covering both deduction YAML files, test_uc_deductions.py, the new seven population cases and Hypothesis peer-independence property, and allowance-rebalancing tests. The retry command and helpers are in workspace .job/HANDOFF.md.
  • Local focused validation and hub independent review remain open. No CI checks were attached to the stacked draft when queried.

Reproducer: policyengine_uk/tests/test_uc_advance_repayment_properties.py::test_each_unit_resolves_its_own_advance_amount

axiom: n/a: per-unit missing-input handling only; the cash recovery policy encoded by #2574 is unchanged

No full-population microsimulation, data build or documentation build is required for this input-handling fix. Independent final-head review remains with the UK hub. Keep draft; do not merge or mark ready.

@MaxGhenis

MaxGhenis commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

UC advance missingness fix is pushed as draft #2581, stacked on #2574's fix-uc-advance-cash-2410 branch. Head: 52201202239dfb73ddb5224ceff0753cdc2e4787; parent remains 41daefdd1671b029b8c2c650d30787f586cdd69f. No commits were pushed to the parent branch.

  • Change/impact: default -1 preserves omitted units in partially supplied cash arrays. The deduction formula resolves each missing amount through the shared legacy fallback; explicit zero remains zero. Includes fully supplied/unsupplied cases and the £480.168 mixed-zero regression. No aggregate run or data build was performed.
  • Tests: full repository uvx ruff format --check . (1937 files), ruff check . and whitespace checks pass. Seven population regressions, a Hypothesis peer-independence property and a mixed-zero YAML case were added. The prepared focused Python/YAML suite (including Keep UC advance repayments fixed under allowance reforms #2574's tests and allowance rebalancing) uses -n 2 in the foreground, frozen Python 3.13.15/Core 3.33.2 and BLAS/OpenMP limits of 2.
  • Open items: 0 local tests executed: after 30.9 minutes monitoring the resource gates, free disk remained below the required 55 GB decimal (50.749 GB at stop; load1 26.18, limit 110). The foreground runner was stopped before pytest launched. Retry once host disk space is available; workspace .job/HANDOFF.md contains the exact gated command. Local focused validation and the hub's independent final-head review are still pending. No CI checks were attached to the stacked draft when queried. Keep draft; do not merge or mark ready.

Workspace-local .job/PROGRESS.md, HANDOFF.md, handoffs.jsonl and recovery bundle are available for the hub. Track the narrow P2 in #2578; adopt this stack together with #2574 before the fallback build.

@juaristi22 juaristi22 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 52201202239dfb73ddb5224ceff0753cdc2e4787. No actionable findings.

The fallback is now resolved separately for each benefit unit, preserving explicit zero and cash inputs while retaining the existing estimate for missing values. All 19 focused tests passed, including peer/permutation invariance and final UC outcomes of £6,000 and £5,519.832 for explicit-zero and missing-input units. Existing estimation, caps, abolition and award floors remain consistent.

@juaristi22
juaristi22 merged commit 5220120 into fix-uc-advance-cash-2410 Oct 26, 2026
14 checks passed
@juaristi22
juaristi22 deleted the fix-2574-advance-missingness branch October 26, 2026 11:43
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