Skip to content

Read stored draws for UC, student loans and PIP - #2877

Merged
juaristi22 merged 20 commits into
mainfrom
claude/deterministic-engine-phase-1a-s1-j31my4
Nov 14, 2026
Merged

juaristi22 merged 20 commits into
mainfrom
claude/deterministic-engine-phase-1a-s1-j31my4

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Addresses #2874
axiom: n/a: microsimulation-only: stored inputs for engine draws, no rule changes

This branch merges #2873's head 697529b, which carries main at 74db8b6, so it brings main's supplied-input rewrite (#2308) and policyengine-core 3.34.9 (#2897). #2873 merged into main as f6b7fbd, and the branch merges with main at b007ac8 without conflicts.

What and why

Three new yearly inputs, with no formula:

  • uc_new_claimant_health_element_draw (benefit unit, float, default 1.0): a uniform in [0, 1) that the dataset build stores. In each Universal Credit rebalancing year with no status for the year, add_universal_credit_reform gives a benefit unit the new-claimant LCWRA rate when the draw falls below new_claimant_share.
  • pip_phase_in_draw (person, float, default 1.0): the PIP phase-in scenario removes a person's PIP in a year from 2025 to 2029 when the draw falls below that year's share.
  • would_claim_student_loan (person, bool, default False): the stored take-up decision that uprate_student_loan_plans uses for new borrowers.

Each consumer uses the stored input when the dataset supplies it and runs its own seeded draw, unchanged and inline, when it does not. The UC modifier and the PIP scenario ask input_source whether a supplied draw reaches the year, read it through Simulation.calculate, and compare it with the share in float64. Student loan uprating reads the column from the projected table after checking its raw values. No published dataset carries these columns yet, so outputs on today's data change only where latest_supplied_input_period now ranks two earlier periods differently (below).

Reading a stored draw

utils/stored_draws.py registers the two draws with their entity, value type and definition period. input_source(population, name, period) returns the period, branch, tier and sequence number of the supplied input policyengine-core reads, None where no supplied input reaches the period, and raises otherwise. It changes nothing in storage and returns no array. It refuses:

  • a request other than one whole year in storage form (a month, year:2026:2, month:2026-06:12, year:2025-01-15);
  • a current or holder definition that changes the entity, type or period, or adds a formula, uprating, defined_for, calculate_output, adds, subtracts or requires_computation_after; a neutralised or abolished draw; core's macro cache; carry turned off where the read needs it;
  • a holder with a disk tier, naming Storage keys need a structured (branch, period) scheme: str(period) is lossy and separators collide with branch names policyengine-core#526;
  • a non-derived value in the slot core reads that no one supplied; a derived value whose carry source no one supplied, or that differs from its source; and, with no supplied source, a derived value other than the default the holder follows.

In a simulation built from data, Simulation.calculate runs the check after its input-lifecycle and stale-record cleanups and drops the request's fast-cache entry. For a source-backed draw it calls core with map_to=None, checks that core's answer equals the source's array (same dtype and shape) and that the source has not changed, then maps it. calculate_add, calculate_divide and calculate_output refuse a registered draw. A context variable counts running pe-uk calculations on any simulation, and set_input refuses a new draw while one runs or while the holder stores a derived value of the draw. Situations keep core's path.

Supplied-input helpers

SUPPLIED_INPUT_VARIABLES now holds the three new columns, and set_model_value refuses them. latest_supplied_input_period now ranks with core's _latest_input_key, so of the supplied periods before the request it picks the one core's carry-over would pick: a period of the variable's own unit before one of another unit, and of two that start on one day, the one that ends last (test_latest_supplied_period_matches_core_carry_order; test_two_periods_starting_on_one_day_rank_by_core_order shows the tie).

The general helpers (supplied_input, supplied_input_periods, latest_supplied_input_period, supplied_by and stored_supplied_value) keep main's rule: they count the nearest branch's surviving recorded input, in a tier where Holder._stores_user_input finds it, as core's _get_recorded_input_array and _get_set_input_periods do. The formulas and scenarios on main that call them, including add_universal_credit_reform's check of a supplied uc_LCWRA_element, get the same answers as on main, apart from that ranking. stored_as_input also keeps main's code, which asks core's Holder._is_input, so it reads only the first tier that holds the slot.

input_source names the input a calculation reads, so it counts a recorded key through _counted_input and its tier helper _engine_read_storage. _counted_input counts the key only on the branch Holder._branch_storing names for the period, and only while the tier core reads there (memory before disk) holds the input as core's _is_input decides. The two rules part in two cases, and in each one core's calculate reads another value:

  • on a child branch, a value the child stores over a parent's input: the general helpers return the parent's input, and _counted_input counts nothing on the child (test_a_child_branch_value_over_a_parent_input_is_not_counted_on_the_child);
  • an input on disk under a value cached in memory: the general helpers return the input, and _counted_input counts nothing (test_an_input_on_disk_under_a_memory_cache_is_supplied_but_not_counted).

The two rules also part on a key the simulation never recorded. The general helpers pass only recorded keys, so main's _supplied_value_storage does not check the record, and with no location record for a slot it takes either tier. input_source passes the key of the branch core reads, recorded or not, so _counted_input needs core's _is_input, which checks the record. At the merge commit 0e75f18, Python bound main's copies of _supplied_value_storage and stored_supplied_value, so _counted_input counted a non-derived value no one supplied. There, on core 3.34.9, test_a_non_input_carry_source_raises and test_a_child_branch_value_over_a_parent_input_raises_on_the_child fail because input_source raises in neither case, and both pass after the split.

The core Dataset route

Before it exports, Simulation.build_from_dataset refuses a dataset that carries any stored column (the UC deduction draws, months_since_last_birthday, warm_home_discount_random_draw and the three new columns) when any person, benefit unit or household identifier fails to survive the int32 cast, naming the entity and identifiers. It also refuses a dataset whose stored columns, attends_private_school_random_draw, uc_receives_new_claimant_health_element or attends_private_school it supplies for some period but not the first, or whose draws change between periods. None of pe-uk's own core-route fixtures carries such a column, so the route refuses none of them.

Core versions

QUALIFIED_CORE_VERSIONS records 3.34.9, the version main locks. tests/code_health/test_core_version_gate.py fails when uv.lock or the installed core holds another version, and says what to rerun before adding one. It reads uv.lock from the source tree or the directory the tests run from, so it runs without a skip when CI tests the built wheel.

In core 3.34.9 (PolicyEngine/policyengine-core#653), Population.get_holder gives a kept holder the current definition when its entity and ETERNITY storage match, so a draw read after update_variable follows the current default. test_a_cached_default_is_compared_with_the_default_the_holder_follows and test_a_holder_given_another_definition_follows_the_current_one check that. Core keeps a holder whose ETERNITY storage no longer fits, as when a reform gives the draw ETERNITY storage and code then restores the year definition on the system directly, and the request check refuses it (test_a_holder_core_keeps_from_an_eternity_definition_is_refused). The holder's-definition check refuses a holder that Simulation.build_from_populations adopts from a simulation whose system gives the draw another type: core's Population.clone keeps that system's entity, so get_holder gives the adopted holder that system's definition while this simulation's own stays current (test_a_holder_adopted_from_another_system_is_refused). The neutralised check reads both definitions, so a neutralised definition on either side refuses the read (test_a_neutralised_definition_on_either_side_of_an_adoption_is_refused). When the other system moves the draw to another entity, core's own entity check refuses the read first, so the test of a holder of another entity sets one directly (test_a_holder_kept_with_another_entity_raises).

Invariants

  • Qualified core: the lock and the installed core hold 3.34.9.
  • Output-neutral by construction: without the columns each consumer runs today's draw; with columns built by the reference encoder from today's draws, the UC statuses, LCWRA amounts and PIP amounts agree bit for bit on the DataFrame and core Dataset routes.
  • Representation: an encoded draw lies in [0, 1), survives a float32 round trip, sits within 2^-24 of its legacy draw, and each consumer compares it in float64, so it keeps the legacy decision at every covered threshold (property test). Compared in float32, a stored 3/8 would fall on the wrong side of a share of 3/8 + 2^-28.
  • Reformability: new-claimant status is monotone in the share and PIP phase-out in the phase-in share (property tests); no student loan call passes a rate, and the stored decision holds in every projected year.
  • Fail closed (read rules): every read of a registered draw passes input_source before core and the answer check after; ADD, DIVIDE and output refuse draws; the fast cache never answers one.
  • Cache survival: a surviving draw cache unequal to its current proven source raises; an invalidated cache recomputes from the current source.
  • Precedence unchanged: a status supplied for the year wins; one supplied only earlier leaves the later year to the draw; a repeated modifier, a reform after construction and an export replayed under another share keep the statuses.
  • Keys and order: the core route refuses stored columns with identifiers that do not survive the int32 cast, and stored columns not supplied for the first period.
  • Determinism: applying the PIP scenario with stored draws for every year leaves numpy's global state as it was.
  • Recorded rule: over sequences of inputs, caches, model values, deletions, disk writes and calculations on a branch and a child made at any step, the general helpers agree with core's _stores_user_input, _get_recorded_input_array and _get_set_input_periods (property test).
  • Engine-read rule: in the same property test, _counted_input counts a key exactly when the simulation records it, Holder._is_input holds on the branch core reads, and the model did not store the value; each counted value equals Holder.get_array's and, for a variable that is not neutralised, supplied_input's. For a neutralised variable _counted_input still counts the input while get_array reads the default, and input_source refuses a neutralised draw first (example test).
  • Subsample: after Simulation.subsample, each draw and stored take-up decision reads as the kept record's value in each stored year and the year after, on the simulation and on a branch, and input_source names that input with the sequence number core records.

Test plan

  • test_supplied_input_tightening.py: registration, ranking (with a Hypothesis property against core's order), _counted_input's rule beside the general helpers' rule, and the set_model_value refusal.
  • test_stored_draw_input_source.py: provenance, requests, definitions (with the holders core 3.34.9 keeps), disk tier, dispatch, setter, lifecycle, restore and the differential against core's own calculate.
  • test_stored_draw_consumers.py: each consumer with and without its column, precision, precedence, validation and properties.
  • test_stored_draw_core_route.py: identities for each entity, supplied periods, and the with/without differential on both routes.
  • test_supplied_inputs.py: a property test of both rules against core on a branch and its child, and a neutralised example.
  • test_subsample.py: stored draws after Simulation.subsample.
  • code_health/test_core_version_gate.py and code_health/test_stored_draw_reads.py (no package read of a draw skips calculate).

At c353315 on core 3.34.9, one process per file or directory:

  • the four files the version gate then named gave 12, 65, 27 and 21 passed;
  • test_input_records.py, test_subsample.py and test_supplied_inputs.py gave 15, 63 and 66 passed;
  • the 13 other test files that import supplied_inputs or stored_draws gave 592 passed, 0 failed;
  • policyengine_uk/tests/code_health gave 3785 passed and 1 failed. test_check_fix_pr.py::test_pytest_default_collection_confirms_function_and_class_names runs pytest.main with plugin autoload off, so it rejects the run's PYTEST_ADDOPTS="-n 0"; with that variable unset, test_check_fix_pr.py gave 168 passed;
  • the 7 YAML files that name uc_receives_new_claimant_health_element or uc_LCWRA_element, which the UC modifier sets, gave 154 passed, 0 failed under policyengine-core test. No YAML test names the three draws.

402197bf5 adds test_a_holder_adopted_from_another_system_is_refused, makes the disk-under-cache example of the property test in test_supplied_inputs.py cache a non-derived value (core stores no derived value over an input, so the old example built nothing), and adds test_supplied_inputs.py and test_subsample.py to the files the version gate says to rerun on a new core. At 402197bf5, test_stored_draw_input_source.py gave 66 passed, test_supplied_inputs.py 66 and code_health/test_core_version_gate.py 3. CI at that head passes all 21 checks: the Test workflow run plus Aggregate impact, Changelog fragments and Fix evidence.

be2b70e69 adds test_a_neutralised_definition_on_either_side_of_an_adoption_is_refused, which tests each half of the neutralised check alone, and notes in test_supplied_inputs.py which of its checks is independent of core. It changes no package code.

ruff format --check, ruff check, ruff check --select F811,F821 policyengine_uk (ruff 0.17.2), git diff --check and .github/check_fix_pr.py pass. Before this merge, at 5a784a7, mutations of each refusal, of each consumer's float64 promotion, of the fast-cache eviction, of the set_model_value refusal, of both core-route checks, of #6's validation and of its loader each failed a test; this branch has not rerun them.

Differentials

A grid of hand-built households for 2025 to 2027 stores each draw column in every year, in 2026 only, or not at all, and reads the draws and the UC status on the default branch and on a branch made from it (named reform, with no reform applied), and uc_LCWRA_element and PIP after the phase-in scenario on the default branch. A second set projects a 2025 dataset with student loan take-up absent, legacy, all true and all false. #2877's head (5a784a7) on core 3.34.1, and c353315, whose package code this head keeps, on 3.34.1 and on 3.34.9, agree on all 861 values, with no errors at any point.

After Simulation.subsample(n=4, seed=2) on a data-built fixture with both draws and take-up stored for 2025 and 2026, each read equals the kept record's stored value in 2025, 2026 and 2027, on the simulation and on a branch made after it, and input_source names that input with the sequence number core records (test_stored_draws_follow_the_records_a_subsample_keeps).

What later stages finish

Stage 2 adds protected storage and sealed populations, with a storage check inside input_source. Phase 2 fails closed: it removes the seeded fallbacks, registers the other required draws and outcomes, and adds months_since_last_birthday's answer check and inclusive lookup.


Generated by Claude Code

claude and others added 8 commits November 5, 2026 04:39
Port policyengine-us's scanner for engine-time randomness and hash draws
as a code-health test. EXEMPT lists the package's SHA-256 digests, which
fingerprint, key caches or check content; RATCHET lists today's draws:
the splitmix64 helper, the formulas and uprating that call it, and the
seeded numpy draws in participation and two scenarios. Cases that need
newer syntax are filtered at collection, so no Python reports a skip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6H1FBndAKeuXdSGuft
The guard's docstring now says it looks for draws and not for the clock
(#2875). The comments on the splitmix64 and Universal Credit entries say
which constants the scan recognises, which entries reach the hash and how
Simulation.__init__ applies the modifier. Two test rows follow
PolicyEngine/policyengine-us#10447 at 221f2fe44, and a changelog fragment
records the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e reads it

Define uc_new_claimant_health_element_draw, pip_phase_in_draw and
would_claim_student_loan as yearly inputs with no formula, and register
them with the supplied-input helpers. supplied_input_periods, and with it
supplied_by, latest_supplied_input_period and supplied_input, now count a
recorded key only when its branch is the one core reads for the period and
the tier core reads there still holds the input. latest_supplied_input_period
ranks with core's _latest_input_key. set_model_value refuses the three new
columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HUE9hj2BPEjEXLL68
input_source(population, name, period) names the supplied input
policyengine-core reads for a registered draw, returns None where none
reaches the period, and raises for anything else. In a simulation built
from data, Simulation.calculate applies it before core, drops the request's
fast-cache entry, and checks core's answer against the source after.
calculate_add, calculate_divide and calculate_output refuse a draw, and
each counts as a running calculation. set_input refuses a new draw while a
calculation runs or a derived value of the draw is stored, and checks
would_claim_student_loan's raw values before core casts them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HUE9hj2BPEjEXLL68
…cenario

Each consumer asks input_source whether a stored input reaches the year.
The UC rebalancing modifier compares uc_new_claimant_health_element_draw,
promoted to float64, with the new-claimant share; the PIP scenario does the
same with pip_phase_in_draw and the phase-in share; student loan uprating
uses the stored would_claim_student_loan decision after checking its raw
values. Without the column, each runs its existing seeded draw, inline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HUE9hj2BPEjEXLL68
…e core versions

The core Dataset route refuses a dataset carrying a stored column whose
person, benefit unit or household identifiers do not survive the int32
cast, and one whose stored columns or exempting outcomes are supplied for
a later period but not the first, or whose draws change between periods,
before it exports anything. A code-health test fails when uv.lock or the
installed policyengine-core holds a version outside the qualified set, and
another fails on any package read of a stored draw that skips calculate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HUE9hj2BPEjEXLL68
…eachable branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwQq6HUE9hj2BPEjEXLL68
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Aggregate impact on certified data: pass

Base b007ac82f1 against head 494cf1b5b0, both on enhanced_frs_2024_25.h5 (policyengine-uk-data 1.58.1, sha256 056e80fd8e91), fiscal years 2025-26 to 2031-32. Each year is a full microsimulation run on each side.

Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in report_spec.yaml; a flag does not fail the job).

Workflow run and full report

Notes

  • In the years a figure from fewer than 10 records is suppressed (spending.disabled_students_allowance), every total containing it, and the decile incomes, are rebuilt from their other components, so no published total includes it. Those totals are marked †. A change is withheld where the two sides leave out different figures and can't be lined up.

Moves flagged for review

None.

Spending by benefit and service

Measure 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Disabled Students' Allowance suppressed suppressed suppressed suppressed suppressed suppressed suppressed

Caseloads

Measure 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Disabled Students' Allowance suppressed suppressed suppressed suppressed suppressed suppressed suppressed

Household net income by decile

No household's net income changes in any year.

No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles; standard reform costings (change in gov_balance); standard reforms: change in each reform's target.

Checks failing on both base and head (1)
  • VAT excluding private school fees is never negative (sign:vat): 2025-26: 76 units below zero, a weighted £-52,314,332 in total; 2026-27: 76 units below zero, a weighted £-54,150,722 in total; 2027-28: 76 units below zero, a weighted £-56,043,426 in total
Counted-once check

The check raised each of 92 components by £1 per unit in 2026-27 and read every head of its totals household by household: its own head must rise by exactly £1, no other tax head may move, no other benefit may rise, and the model's own total must move by what its heads moved. A response that is not finite breaks every rule. The check measures a head that breaks a rule twice more: once holding every other head at its baseline value, and once holding every other head at its value after the first £1 while the component rises again. The head fails where either measurement still shows the response. The check cannot hold a head at a value that is not finite. In each unit where another head is not finite after the first £1, it holds that head at its baseline value, and the second measurement judges no household the unit belongs to. There a head fails wherever it first broke a rule, or wherever the check could not confirm whether its response contains the component. 0 failed and the check skipped 0.

  • widowed_parents_allowance: pension_credit responds only through other heads in fewer than 10 households (other heads that moved there: carers_allowance; gov_spending; not a failure)
  • widowed_parents_allowance: pension_credit responds only through other heads in fewer than 10 households (other heads that moved there: carers_allowance; household_benefits; not a failure)
Provenance
Side Commit Runtime Environment hash Partition hash Time
base main b007ac82f1 uk 2.178.8 (files 5ac59168be2f), core 3.34.9, py 3.13.18 aarch64 58f0af7065c5 f5dab8526157 2905.88s
head #2877 merged into main 494cf1b5b0 uk 2.178.8 (files e9748fe839a4), core 3.34.9, py 3.13.18 aarch64 58f0af7065c5 f5dab8526157 2926.86s

Dataset: hf://policyengine/policyengine-uk-data-private/enhanced_frs_2024_25.h5@2526edbbb687a3b54dbb11272e5389e4b62d2ac2, sha256 056e80fd8e9151d78f432a25cde863340baee81304c6216a37fb575ce8563784 (verified on both sides), policyengine-uk-data 1.58.1.

Receipts by tax head: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Final charge on cash interest in non-cash ISAs £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Lifetime ISA withdrawal charge £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Income tax £294.44bn £315.21bn £335.80bn £351.25bn £366.92bn £385.32bn £399.96bn
National Insurance (employee and self-employed) £51.70bn £54.14bn £56.13bn £57.73bn £59.76bn £61.64bn £63.51bn
National Insurance (employer) £148.71bn £155.37bn £160.88bn £165.09bn £172.06bn £177.36bn £182.57bn
Employer NI change borne by capital £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Employer NI change borne by consumers £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Capital gains tax £12.60bn £13.15bn £13.60bn £14.11bn £14.67bn £15.24bn £15.80bn
Student loan repayments £7.82bn £8.13bn £8.39bn £8.58bn £8.79bn £9.04bn £9.29bn
VAT excluding private school fees £242.22bn £249.47bn £258.67bn £264.86bn £270.95bn £277.04bn £283.21bn
Change in VAT from its baseline £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
VAT on private school fees £1.95bn £2.01bn £2.09bn £2.14bn £2.20bn £2.26bn £2.31bn
Change in private school VAT from its baseline £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Fuel duties £24.71bn £24.13bn £26.00bn £26.83bn £26.51bn £25.78bn £24.63bn
Alcohol duties £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Tobacco duties £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Vehicle excise duties £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Betting and gaming duties £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
TV licence fee £4.26bn £4.40bn £4.41bn £4.42bn £4.43bn £4.44bn £4.45bn
Council tax £49.21bn £52.16bn £54.89bn £57.95bn £61.16bn £64.47bn £67.91bn
High value council tax surcharge £0.00bn £0.00bn £0.00bn £0.48bn £0.49bn £0.50bn £0.51bn
Northern Ireland domestic rates £0.55bn £0.58bn £0.60bn £0.63bn £0.66bn £0.69bn £0.72bn
Business rates £34.68bn £36.20bn £38.00bn £39.46bn £42.27bn £43.25bn £44.29bn
Stamp duty land tax on the household's own purchases £6.88bn £7.32bn £7.66bn £8.06bn £8.47bn £8.91bn £9.35bn
Stamp duty land tax paid by companies £4.72bn £4.57bn £5.29bn £6.03bn £6.37bn £6.92bn £7.45bn
Land transaction tax (Wales) £0.07bn £0.08bn £0.08bn £0.09bn £0.10bn £0.10bn £0.11bn
Land and buildings transaction tax (Scotland) £0.31bn £0.32bn £0.33bn £0.35bn £0.36bn £0.38bn £0.40bn
Unspecified tax change borne by capital £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Unspecified tax change borne by consumers £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Wealth tax £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Wealth tax excluding the main residence £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Land value tax £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Carbon tax £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Spending by benefit and service: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Lifetime ISA bonus £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
State Pension £121.68bn £125.92bn £126.72bn £129.48bn £132.98bn £136.65bn £140.41bn
Pension Credit £6.21bn £6.46bn £6.68bn £6.82bn £6.89bn £7.07bn £7.22bn
Winter Fuel Payment £1.86bn £1.85bn £1.79bn £1.77bn £1.78bn £1.78bn £1.78bn
Pension Age Winter Heating Payment (Scotland) £0.19bn £0.20bn £0.20bn £0.21bn £0.21bn £0.22bn £0.22bn
Universal Credit £75.71bn £81.81bn £84.29bn £86.34bn £87.51bn £89.06bn £89.70bn
Housing Benefit £8.57bn £8.52bn £8.85bn £9.06bn £9.29bn £9.57bn £9.84bn
Council Tax Reduction £2.19bn £2.32bn £2.44bn £2.58bn £2.72bn £2.87bn £3.02bn
Employment and Support Allowance (income-related) £0.79bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Employment and Support Allowance (contribution-based) £5.20bn £5.37bn £5.56bn £5.69bn £5.82bn £5.95bn £6.09bn
Jobseeker's Allowance (income-based) £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Jobseeker's Allowance (contribution-based) £0.29bn £0.30bn £0.31bn £0.31bn £0.32bn £0.33bn £0.34bn
Income Support £0.11bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Working Tax Credit £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Child Tax Credit £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Incapacity Benefit £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Personal Independence Payment £26.95bn £28.03bn £29.05bn £30.09bn £30.75bn £31.51bn £32.21bn
Disability Living Allowance £7.49bn £7.79bn £8.07bn £8.36bn £8.55bn £8.76bn £8.95bn
Attendance Allowance £8.68bn £9.03bn £9.36bn £9.69bn £9.90bn £10.15bn £10.38bn
Carer's Allowance £4.48bn £4.66bn £4.83bn £5.00bn £5.11bn £5.27bn £5.42bn
Carer Support Payment (Scotland) £0.31bn £0.32bn £0.33bn £0.34bn £0.35bn £0.36bn £0.37bn
Scottish Carer Supplement £0.00bn £0.04bn £0.04bn £0.05bn £0.05bn £0.05bn £0.05bn
Severe Disablement Allowance £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn
Industrial Injuries Disablement Benefit £0.50bn £0.52bn £0.54bn £0.55bn £0.56bn £0.58bn £0.59bn
Armed Forces Compensation Scheme £0.61bn £0.63bn £0.65bn £0.66bn £0.68bn £0.69bn £0.71bn
War Widow's or Widower's Pension £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Child Benefit £16.20bn £16.82bn £17.39bn £18.01bn £18.40bn £18.84bn £19.26bn
Scottish Child Payment £0.49bn £0.52bn £0.53bn £0.55bn £0.56bn £0.57bn £0.56bn
Two Child Limit Payment (Scotland, counterfactual) £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Healthy Start vouchers £0.05bn £0.05bn £0.05bn £0.05bn £0.05bn £0.05bn £0.05bn
Maternity Allowance £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Statutory Maternity Pay £3.30bn £3.41bn £3.54bn £3.62bn £3.70bn £3.78bn £3.87bn
Statutory Paternity Pay £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Statutory Sick Pay £1.12bn £1.16bn £1.20bn £1.23bn £1.26bn £1.29bn £1.32bn
Sure Start Maternity Grant £0.01bn £0.01bn £0.01bn £0.01bn £0.01bn £0.01bn £0.01bn
Bereavement Support Payment £0.67bn £0.69bn £0.71bn £0.73bn £0.75bn £0.76bn £0.78bn
Widowed Parent's Allowance £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Tax-Free Childcare £0.56bn £0.57bn £0.57bn £0.58bn £0.60bn £0.61bn £0.59bn
Extended childcare entitlement £2.99bn £3.50bn £3.59bn £3.71bn £3.78bn £3.86bn £3.93bn
Universal childcare entitlement £2.06bn £2.22bn £2.29bn £2.37bn £2.43bn £2.48bn £2.53bn
Targeted childcare entitlement £0.50bn £0.51bn £0.52bn £0.54bn £0.55bn £0.57bn £0.56bn
Childcare Offer for Wales £0.26bn £0.28bn £0.28bn £0.29bn £0.30bn £0.31bn £0.32bn
Care to Learn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Childcare Grant £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Parents' Learning Allowance £0.20bn £0.20bn £0.20bn £0.20bn £0.20bn £0.20bn £0.20bn
Adult Dependants' Grant £0.06bn £0.06bn £0.04bn £0.04bn £0.04bn £0.04bn £0.04bn
Travel Grant £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Disabled Students' Allowance suppressed suppressed suppressed suppressed suppressed suppressed suppressed
16 to 19 Bursary Fund £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
NHS spending £203.89bn £204.30bn £204.56bn £204.91bn £205.34bn £205.85bn £206.35bn
State education spending £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn
Transport subsidy spending £25.05bn £25.10bn £25.14bn £25.18bn £25.23bn £25.30bn £25.36bn
Cost-of-living support payment £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Energy Bills Rebate £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Household Energy Payment £0.00bn £2.11bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Energy Price Guarantee subsidy £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Basic income £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Disability basic income £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Other public spending budget change £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Caseloads: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Lifetime ISA bonus 0k 0k 0k 0k 0k 0k 0k
State Pension 11,264k 11,145k 10,819k 10,700k 10,723k 10,750k 10,776k
Pension Credit 1,489k 1,484k 1,476k 1,454k 1,452k 1,457k 1,466k
Winter Fuel Payment 7,844k 7,783k 7,473k 7,375k 7,391k 7,409k 7,427k
Pension Age Winter Heating Payment (Scotland) 803k 802k 800k 797k 799k 801k 802k
Universal Credit 6,343k 6,419k 6,408k 6,369k 6,364k 6,343k 6,295k
Housing Benefit 1,249k 1,182k 1,181k 1,165k 1,164k 1,166k 1,168k
Council Tax Reduction 3,326k 3,344k 3,351k 3,364k 3,375k 3,388k 3,395k
Employment and Support Allowance (income-related) 71k 0k 0k 0k 0k 0k 0k
Employment and Support Allowance (contribution-based) 719k 720k 721k 722k 724k 726k 728k
Jobseeker's Allowance (income-based) 0k 0k 0k 0k 0k 0k 0k
Jobseeker's Allowance (contribution-based) 67k 67k 67k 67k 67k 68k 68k
Income Support 25k 0k 0k 0k 0k 0k 0k
Working Tax Credit 0k 0k 0k 0k 0k 0k 0k
Child Tax Credit 0k 0k 0k 0k 0k 0k 0k
Incapacity Benefit 0k 0k 0k 0k 0k 0k 0k
Personal Independence Payment 3,567k 3,575k 3,579k 3,585k 3,593k 3,602k 3,611k
Disability Living Allowance 1,291k 1,294k 1,296k 1,298k 1,300k 1,304k 1,307k
Attendance Allowance 1,695k 1,698k 1,700k 1,703k 1,707k 1,711k 1,715k
Carer's Allowance 1,034k 1,037k 1,038k 1,040k 1,042k 1,060k 1,062k
Carer Support Payment (Scotland) 71k 71k 71k 72k 72k 72k 72k
Scottish Carer Supplement 0k 71k 71k 72k 72k 72k 72k
Severe Disablement Allowance 4k 4k 4k 4k 4k 4k 4k
Industrial Injuries Disablement Benefit 137k 137k 137k 138k 138k 138k 139k
Armed Forces Compensation Scheme 93k 93k 94k 94k 94k 94k 94k
War Widow's or Widower's Pension 0k 0k 0k 0k 0k 0k 0k
Child Benefit 8,124k 8,121k 8,121k 8,131k 8,146k 8,162k 8,179k
Scottish Child Payment 351k 352k 352k 353k 350k 348k 337k
Two Child Limit Payment (Scotland, counterfactual) 0k 0k 0k 0k 0k 0k 0k
Healthy Start vouchers 200k 200k 200k 201k 201k 201k 202k
Maternity Allowance 0k 0k 0k 0k 0k 0k 0k
Statutory Maternity Pay 333k 333k 334k 334k 335k 336k 337k
Statutory Paternity Pay 0k 0k 0k 0k 0k 0k 0k
Statutory Sick Pay 181k 182k 182k 182k 182k 183k 183k
Sure Start Maternity Grant 26k 26k 26k 26k 26k 26k 26k
Bereavement Support Payment 98k 98k 98k 98k 98k 99k 99k
Widowed Parent's Allowance 0k 0k 0k 0k 0k 0k 0k
Tax-Free Childcare 1,043k 1,027k 1,014k 1,009k 1,011k 1,009k 993k
Extended childcare entitlement 795k 800k 796k 797k 798k 798k 792k
Universal childcare entitlement 1,071k 1,072k 1,072k 1,073k 1,076k 1,079k 1,074k
Targeted childcare entitlement 165k 156k 154k 154k 155k 155k 150k
Childcare Offer for Wales 39k 39k 39k 39k 39k 39k 39k
Care to Learn 0k 0k 0k 0k 0k 0k 0k
Childcare Grant 0k 0k 0k 0k 0k 0k 0k
Parents' Learning Allowance 98k 98k 98k 99k 99k 99k 99k
Adult Dependants' Grant 18k 18k 12k 12k 12k 12k 12k
Travel Grant 0k 0k 0k 0k 0k 0k 0k
Disabled Students' Allowance suppressed suppressed suppressed suppressed suppressed suppressed suppressed
16 to 19 Bursary Fund 0k 0k 0k 0k 0k 0k 0k
Cost-of-living support payment 0k 0k 0k 0k 0k 0k 0k
Energy Bills Rebate 0k 0k 0k 0k 0k 0k 0k
Household Energy Payment 0k 21,065k 0k 0k 0k 0k 0k
Energy Price Guarantee subsidy 0k 0k 0k 0k 0k 0k 0k
Basic income 0k 0k 0k 0k 0k 0k 0k
Disability basic income 0k 0k 0k 0k 0k 0k 0k
Government balance, each component counted once: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Government receipts, each component once £884.82bn £927.25bn £972.82bn £1,008.07bn £1,046.18bn £1,083.32bn £1,116.48bn
Government spending £529.29bn † £545.33bn † £550.40bn † £559.11bn † £566.74bn † £575.46bn † £583.07bn †
Government balance, each receipt once £355.53bn † £381.92bn † £422.41bn † £448.95bn † £479.44bn † £507.86bn † £533.41bn †
Benefits in household_benefits but not in gov_spending £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Model totals: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
gov_tax £884.82bn £927.25bn £972.82bn £1,008.07bn £1,046.18bn £1,083.32bn £1,116.48bn
household_tax £491.95bn £520.39bn £551.18bn £575.98bn £600.96bn £626.66bn £648.39bn
pre_budget_change_household_tax £484.13bn £512.26bn £542.79bn £566.92bn £591.68bn £617.12bn £638.58bn
gov_spending £529.29bn † £545.33bn † £550.40bn † £559.11bn † £566.74bn † £575.46bn † £583.07bn †
household_benefits £529.29bn † £545.33bn † £550.40bn † £559.11bn † £566.74bn † £575.46bn † £583.07bn †
gov_balance £355.53bn † £381.92bn † £422.41bn † £448.95bn † £479.44bn † £507.86bn † £533.41bn †
Household income totals: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Household market income £1,637.96bn £1,702.77bn £1,757.35bn £1,806.41bn £1,855.97bn £1,912.43bn £1,970.44bn
Household net income £1,636.63bn † £1,687.51bn † £1,715.12bn † £1,747.12bn † £1,778.28bn † £1,816.57bn † £1,859.19bn †
Household net income (HBAI definition) £1,449.51bn £1,499.52bn £1,530.52bn £1,564.80bn £1,597.47bn £1,635.15bn £1,676.12bn
Population: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
People 69,245k 69,383k 69,473k 69,592k 69,738k 69,912k 70,080k
Benefit units 35,110k 35,181k 35,226k 35,286k 35,360k 35,449k 35,534k
Households 31,046k 31,108k 31,149k 31,201k 31,267k 31,345k 31,420k
Poverty rates: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Absolute poverty, before housing costs: everyone 16.2% 15.4% 16.3% 16.2% 16.4% 16.4% 16.5%
Absolute poverty, before housing costs: children 24.6% 21.8% 23.0% 22.7% 22.9% 23.0% 23.2%
Absolute poverty, before housing costs: working-age adults 14.0% 13.7% 14.6% 14.6% 14.7% 14.7% 14.9%
Absolute poverty, before housing costs: pensioners 13.7% 13.4% 14.0% 13.9% 14.0% 14.0% 13.9%
Absolute poverty, after housing costs: everyone 21.5% 21.0% 22.0% 22.5% 22.8% 23.0% 23.4%
Absolute poverty, after housing costs: children 33.1% 31.2% 32.1% 32.4% 32.8% 33.2% 34.0%
Absolute poverty, after housing costs: working-age adults 19.9% 19.8% 20.8% 21.5% 21.8% 22.0% 22.2%
Absolute poverty, after housing costs: pensioners 12.7% 12.4% 13.2% 13.2% 13.3% 13.4% 13.6%
Relative poverty, before housing costs: everyone 16.9% 15.9% 16.3% 16.2% 16.3% 16.2% 16.5%
Relative poverty, before housing costs: children 25.7% 22.6% 23.0% 22.7% 22.8% 22.6% 23.2%
Relative poverty, before housing costs: working-age adults 14.4% 14.0% 14.6% 14.6% 14.7% 14.6% 14.9%
Relative poverty, before housing costs: pensioners 14.5% 14.1% 14.0% 13.8% 13.8% 13.9% 13.9%
Relative poverty, after housing costs: everyone 21.4% 20.9% 21.2% 21.3% 21.3% 21.5% 21.7%
Relative poverty, after housing costs: children 32.9% 31.0% 31.1% 31.0% 31.0% 31.2% 31.7%
Relative poverty, after housing costs: working-age adults 19.8% 19.7% 20.2% 20.4% 20.4% 20.6% 20.8%
Relative poverty, after housing costs: pensioners 12.5% 12.4% 12.2% 11.8% 11.7% 11.8% 12.1%
People in poverty: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Absolute poverty, before housing costs: everyone 11,246k 10,704k 11,333k 11,298k 11,407k 11,448k 11,584k
Absolute poverty, before housing costs: children 3,676k 3,270k 3,455k 3,406k 3,441k 3,463k 3,509k
Absolute poverty, before housing costs: working-age adults 5,947k 5,858k 6,277k 6,330k 6,387k 6,400k 6,490k
Absolute poverty, before housing costs: pensioners 1,624k 1,576k 1,602k 1,562k 1,579k 1,585k 1,584k
Absolute poverty, after housing costs: everyone 14,869k 14,565k 15,263k 15,690k 15,910k 16,094k 16,373k
Absolute poverty, after housing costs: children 4,940k 4,671k 4,814k 4,873k 4,931k 5,015k 5,145k
Absolute poverty, after housing costs: working-age adults 8,424k 8,435k 8,943k 9,324k 9,474k 9,559k 9,683k
Absolute poverty, after housing costs: pensioners 1,504k 1,460k 1,505k 1,493k 1,505k 1,520k 1,545k
Relative poverty, before housing costs: everyone 11,694k 11,032k 11,318k 11,297k 11,348k 11,350k 11,584k
Relative poverty, before housing costs: children 3,847k 3,389k 3,454k 3,406k 3,427k 3,414k 3,509k
Relative poverty, before housing costs: working-age adults 6,128k 5,990k 6,270k 6,330k 6,356k 6,359k 6,490k
Relative poverty, before housing costs: pensioners 1,719k 1,652k 1,594k 1,561k 1,565k 1,576k 1,584k
Relative poverty, after housing costs: everyone 14,800k 14,518k 14,756k 14,791k 14,867k 15,002k 15,214k
Relative poverty, after housing costs: children 4,916k 4,649k 4,661k 4,651k 4,673k 4,701k 4,796k
Relative poverty, after housing costs: working-age adults 8,396k 8,414k 8,699k 8,813k 8,870k 8,959k 9,049k
Relative poverty, after housing costs: pensioners 1,488k 1,455k 1,395k 1,326k 1,324k 1,342k 1,369k
Inequality: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Gini coefficient, equivalised HBAI income before housing costs 0.3076 0.3049 0.3055 0.3054 0.3059 0.3064 0.3080
Mean household net income in each side's own deciles: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Decile 1: mean household_net_income per household £17,748 † £17,980 † £17,927 † £18,181 † £18,318 † £18,538 † £18,742 †
Decile 2: mean household_net_income per household £28,029 † £29,037 † £28,754 † £28,997 † £29,258 † £29,676 † £30,171 †
Decile 3: mean household_net_income per household £34,252 † £35,426 † £36,069 † £36,548 † £37,157 † £37,774 † £38,103 †
Decile 4: mean household_net_income per household £38,926 † £40,769 † £41,716 † £42,763 † £43,387 † £44,167 † £44,499 †
Decile 5: mean household_net_income per household £43,346 † £45,603 † £46,054 † £47,001 † £47,755 † £48,626 † £50,309 †
Decile 6: mean household_net_income per household £47,933 † £49,175 † £50,879 † £52,032 † £52,922 † £53,942 † £54,719 †
Decile 7: mean household_net_income per household £55,672 † £56,650 † £57,493 † £57,674 † £58,791 † £59,706 † £61,106 †
Decile 8: mean household_net_income per household £68,786 † £70,811 † £71,870 † £73,483 † £73,890 † £75,325 † £77,181 †
Decile 9: mean household_net_income per household £78,891 † £81,011 † £80,860 † £82,646 † £85,464 † £86,940 † £89,508 †
Decile 10: mean household_net_income per household £116,864 † £120,162 † £124,545 † £126,420 † £125,756 † £128,269 † £130,694 †
Standard reform costings (change in gov_balance): head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Raise basic rate by 1pp £6.41bn £6.66bn £6.63bn £6.85bn £7.03bn £7.25bn £7.47bn
Raise higher rate by 1pp £3.61bn £3.87bn £4.00bn £4.22bn £4.44bn £4.71bn £4.83bn
Raise personal allowance by ~800GBP/year £-3.82bn £-3.93bn £-4.01bn £-4.05bn £-4.11bn £-4.24bn £-1.95bn
Raise child benefit by 25GBP/week per additional child £-1.99bn £-1.75bn £-1.55bn £-1.38bn £-1.30bn £-1.18bn £-1.07bn
Reduce Universal Credit taper rate to 20% £-20.83bn £-21.38bn £-21.81bn £-22.02bn £-22.37bn £-22.77bn £-22.96bn
Raise Class 1 main employee NICs rate to 10% £10.89bn £11.30bn £11.71bn £12.01bn £12.31bn £12.62bn £13.00bn
Raise VAT standard rate by 2pp £24.17bn £24.97bn £25.86bn £26.46bn £27.07bn £27.68bn £28.31bn
Raise additional rate by 3pp £2.90bn £3.15bn £3.22bn £3.41bn £3.61bn £3.85bn £4.14bn
Raise the Universal Credit standard allowance by 10% £-3.06bn £-3.23bn £-3.30bn £-3.40bn £-3.48bn £-3.53bn £-3.55bn
Raise the State Pension by 10% £-7.76bn £-7.99bn £-8.22bn £-8.44bn £-8.79bn £-8.52bn £-8.86bn
Standard reforms: change in each reform's target: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Raise basic rate by 1pp: change in income_tax £6.55bn £6.86bn £6.79bn £7.00bn £7.20bn £7.44bn £7.66bn
Raise higher rate by 1pp: change in income_tax £3.61bn £3.92bn £4.01bn £4.23bn £4.45bn £4.72bn £4.84bn
Raise personal allowance by ~800GBP/year: change in income_tax £-3.94bn £-4.07bn £-4.14bn £-4.18bn £-4.22bn £-4.40bn £-1.76bn
Raise child benefit by 25GBP/week per additional child: change in child_benefit £2.33bn £2.14bn £1.95bn £1.76bn £1.65bn £1.52bn £1.40bn
Reduce Universal Credit taper rate to 20%: change in universal_credit £20.79bn £21.36bn £21.84bn £22.07bn £22.39bn £22.80bn £23.01bn
Raise Class 1 main employee NICs rate to 10%: change in national_insurance £11.15bn £11.63bn £12.00bn £12.29bn £12.61bn £12.94bn £13.31bn
Raise VAT standard rate by 2pp: change in vat £23.98bn £24.77bn £25.66bn £26.24bn £26.85bn £27.46bn £28.07bn
Raise additional rate by 3pp: change in income_tax £2.90bn £3.15bn £3.22bn £3.42bn £3.62bn £3.86bn £4.12bn
Raise the Universal Credit standard allowance by 10%: change in universal_credit £3.06bn £3.22bn £3.32bn £3.41bn £3.48bn £3.54bn £3.55bn
Raise the State Pension by 10%: change in state_pension £10.68bn £11.17bn £11.28bn £11.60bn £12.03bn £12.46bn £12.96bn

@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.

Review status: COMPLETE at 5a784a7e926d4bc5b1471770ae67d4f96f139140. No findings or material evidence gaps.

Independent code/test and policy/source review covered the stored UC health and PIP draws, student-loan take-up, supplied-input precedence, provenance/cache/lifecycle checks and Core Dataset routing. The change introduces allocation inputs rather than new statutory rules.

Validation: 202/202 focused repository tests passed on the lock-matched Core 3.34.1 environment, plus one synthetic final-output/order check. The stored UC draw changes LCWRA, final Universal Credit and household net income by the same £2,550.48; reversing calculation order gives identical results. The unchanged #2873 randomness guard was checked byte-for-byte against its prior reviewed head; its earlier 384 passes were reused, not rerun or added to the 202 count. All 20 hosted checks currently pass at this exact head.

Equivalence remains conditional on the supplied reference decisions and covered thresholds. This review does not certify producer calibration, private datasets, population effects, arbitrary-share float64 equivalence or the author's full dual-Core-version/mutation totals. The disclosed shadowed-input/carry-ranking changes and seeded fallback boundary remain explicit.

Approval withheld: this PR is still a draft and its description requires #2873 to land first. The completed review can be reused when readiness, parent integration and exact-head checks are reassessed.

MaxGhenis and others added 12 commits November 11, 2026 12:59
Main gained Simulation.subsample and policyengine_uk/utils/subsample.py
through #2308 on 9 November, after this branch's last CI run. The guard
scans the whole package, so the merge queue ran it over that code and
removed #2873 for a failed check on 11 November.

The merge has no conflict: main does not touch the guard or its changelog
fragment. On the merged tree the guard reports eight draw patterns, all in
the subsample code; the next commit handles them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
On main's code the guard reports eight draw patterns, all in the subsample
tool that #2308 added. Five sit in policyengine_uk/utils/subsample.py, where
it hashes the seed, makes a generator and draws households. The other three
are the calls that reach them, in draw_household_counts, subsample_simulation
and Simulation.subsample.

This commit lists the eight in a third allowlist, SAMPLING_TOOLS. The two
package tests allow RATCHET and SAMPLING_TOOLS summed per key. draw_helpers
still reads EXEMPT alone, so the tool's functions stay draw helpers and a
use of one from any other scope counts there as a draw helper call. RATCHET,
RATCHET_CEILING, EXEMPT and the scanner do not change.

Four new guard tests pin the list. The tool's three functions are draw
helpers. A formula that uses a listed sampler fails. The list names only the
subsample tool and shares no key with RATCHET or EXEMPT. No package module
uses an attribute named subsample, because the scan does not follow method
calls. A new test in test_subsample.py checks that the draw neither reads
nor moves numpy's or the standard library's global random stream.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
697529b merges main 74db8b6 into #2873's guard branch and adds the
SAMPLING_TOOLS allowlist for Simulation.subsample's draw. It brings main's
rewrite of policyengine_uk/utils/supplied_inputs.py (#2308, 3e45f83 and
42414bd) and the move to policyengine-core 3.34.9 (#2897).

supplied_inputs.py stopped on three hunks. Each takes main's side:

1. The supplied_input_periods docstring.
2. Its filter: main's _supplied_without_reading, which counts a recorded
   input that Holder._stores_user_input finds in either tier, and reads a
   value only where the model stored one (set_model_value).
3. supplied_input: main's walk over _visible_branch_names, returning the
   nearest branch's surviving recorded input, as core's
   Simulation._get_recorded_input_array does.

Git kept both sides' _supplied_value_storage and stored_supplied_value,
since neither existed at the merge base. Python binds main's later pair,
so here #2877's _counted_input runs on main's tier rule. The next commit
gives #2877's tier helper its own name and leaves one definition of each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge kept two copies of _supplied_value_storage and
stored_supplied_value, and Python bound main's, so #2877's _counted_input
quietly ran on main's tier rule. The two copies answer different
questions:

- Main's (from #2308) counts the recorded input: a surviving input in a
  tier where Holder._stores_user_input finds it, memory first, on the
  nearest branch that still stores one. Core's
  Simulation._get_recorded_input_array and _get_set_input_periods use the
  same rule, and main tests its helpers against them. supplied_input,
  supplied_input_periods, latest_supplied_input_period, supplied_by,
  stored_as_input and stored_supplied_value keep it.
- #2877's counts the input a calculation reads: only on the branch
  Holder._branch_storing names, only in the tier the engine reads there
  (memory before disk), and only for a key the simulation records
  (policyengine_core.holders.helpers._is_input).

stored_draws.input_source names, through _counted_input, the input
Simulation.calculate will read, and check_draw_answer then compares
core's answer with it. So _counted_input keeps #2877's rule, under its
own name, _engine_read_storage, and main's copies are the only
stored_supplied_value and _supplied_value_storage. The module docstring
now says which reader uses which rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two of #2877's four tightening tests asserted the engine-read rule on the
general helpers, which now keep main's recorded rule. They assert it on
_counted_input instead, and assert main's rule on the general helpers
beside it:

- test_a_child_branch_value_over_a_parent_input_is_not_supplied_on_the_child
  becomes ..._is_not_counted_on_the_child.
- test_an_input_on_disk_counts_only_when_memory_does_not_hide_it splits:
  the memory_cache=False case (both rules agree) becomes
  test_an_input_on_disk_counts_when_memory_holds_nothing, and the True case
  becomes test_an_input_on_disk_under_a_memory_cache_is_supplied_but_not_counted.

The other two, where both rules agree, are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Hypothesis test over sequences of set_input, put_in_cache, set_model_value,
deletions, writes to disk, calculations and get_branch checks, on a branch
and a child made at any step: the general helpers against core's
_stores_user_input, _get_recorded_input_array and _get_set_input_periods;
_counted_input against Holder._is_input and Holder.get_array; and that
supplied_input returns every value _counted_input counts. An example test
covers a neutralised variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
core#653: Population.get_holder gives a holder the current definition when
its entity and ETERNITY storage match. Rewrites the two tests that assumed
otherwise, and adds tests for the stale holders core still keeps: one
from an ETERNITY definition (public API; the request check refuses it) and
one of another entity (set directly; the holder's-definition check
refuses it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each draw and the stored student loan decision read after a subsample
equals the kept record's stored value, in each stored year and carried
into 2027, on the simulation and on a branch made after it, and
input_source names that input with the sequence number core records.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Building the simulation already makes the draw's holder under its year
definition, so updating the system to an ETERNITY definition left that
holder in place and the test's first assertion failed on core 3.34.9.
apply_reform drops a holder whose ETERNITY storage no longer fits, and
the next lookup makes one for the ETERNITY definition. Restoring the year
definition on the system directly then leaves that holder, and the
request check refuses the read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main locks and requires core 3.34.9 (#2897). The four files the version
gate names pass on 3.34.9 at this head. 3.33.3 and 3.34.1 leave the set:
this branch requires 3.34.9 and has not run the four files there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Simulation.build_from_populations keeps another simulation's entities, so
get_holder gives an adopted holder that system's definition while this
simulation's own definition stays current. The new test adopts a holder
whose reform makes the draw an int and checks that calculate refuses it.
The property test's example of an input on disk under a cached value now
caches a non-derived value, since core stores no derived value over an
input. The core version gate lists test_supplied_inputs.py and
test_subsample.py among the files to rerun on a new core.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On core 3.34.9 a holder takes on a neutralised current definition
(core#653), so test_a_neutralised_draw_raises trips both halves of the
neutralised check at once and nothing tested either half alone. The new
test adopts a holder through build_from_populations with a neutralise
reform on one side, then the other, and expects each to raise.

Also notes in check_both_rules that the holder._is_input comparison
checks consistency, and the get_array equality is the independent check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 14, 2026 06:25
@MaxGhenis
MaxGhenis requested a review from juaristi22 November 14, 2026 06:25

@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 be2b70e691a6b67b9857245f7389cbfa46ece2d6: COMPLETE, no findings or material evidence gaps.

The follow-up covers the supplied-input rewrite, Core 3.34.9 holder/adoption semantics, provenance and carry refusals, neutralisation on both sides of adoption, and stored-draw subsampling. Parent #2873’s merged head 697529ba5 is integrated; this approval follows the new review rather than transferring an earlier one.

Validation: 215 repository tests passed, plus three synthetic contracts through final UC/PIP/student-loan consumers. Snapshot imports, 17 selected lock pins and all 194 Core payload files matched; formatting/lint and diff checks passed. No private data, installation or full-main suite was run. Statutory policy review is inapplicable to this engine infrastructure change.

The current-head required checks and readiness were refreshed immediately before approval.

@juaristi22
juaristi22 added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit fe00412 Nov 14, 2026
22 of 23 checks passed
@juaristi22
juaristi22 deleted the claude/deterministic-engine-phase-1a-s1-j31my4 branch November 14, 2026 18:34
juaristi22 added a commit to PolicyEngine/microcosm that referenced this pull request Nov 19, 2026
policyengine-uk 2.179.0 (PolicyEngine/policyengine-uk#2877) reads a
stored uniform per benefit unit, uc_new_claimant_health_element_draw:
in each rebalancing year a unit with the LCWRA element gets the
new-claimant rate where its draw falls below new_claimant_share.
Without it the engine draws in benefit-unit order, so who gets the
lower rate is random with respect to everything the file records.

A new last spine stage, uc_new_claimant_draw, stores the draw:
- its population is the units the engine pays Universal Credit with
  the LCWRA element at the calibration year (one engine read);
- within it, units are ordered by claim recency, the completed months
  from DWP's claim start (FRS BENEFITS.UCSTART) to the interview, then
  by the age of the youngest claimant or partner, youngest first;
- a unit without a linked claim start takes months drawn from the
  linked claims in its age band, pooled to 30 source households;
- each unit takes the midpoint of its slice of the population's
  weight, and every other unit an identity-keyed uniform, so the draw
  is uniform overall and the engine keeps the parameter's share.

frs_spine carries the recency as the benefit-unit carrier
frs_uc_claim_months, which the release drops. The draw leaves
UK_ENGINE_DEFAULT_INPUTS and joins the export surface's allowed
columns, so the data contract's gate digests follow, and the signed
entry for uc_receives_new_claimant_health_element is restated. The
stage spec and its schema branch, the graph cell, the kernel, spine
and fixture registrations, the coverage manifest, the roster pins and
the build graph doc follow. Tests: the stage's own (engine-free and
on the locked engine) and the carrier's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22 added a commit to PolicyEngine/microcosm that referenced this pull request Nov 20, 2026
policyengine-uk 2.179.0 (PolicyEngine/policyengine-uk#2877) reads a
stored uniform per benefit unit, uc_new_claimant_health_element_draw:
in each rebalancing year a unit with the LCWRA element gets the
new-claimant rate where its draw falls below new_claimant_share.
Without it the engine draws in benefit-unit order, so who gets the
lower rate is random with respect to everything the file records.

A new last spine stage, uc_new_claimant_draw, stores the draw:
- its population is the units the engine pays Universal Credit with
  the LCWRA element at the calibration year (one engine read);
- within it, units are ordered by claim recency, the completed months
  from DWP's claim start (FRS BENEFITS.UCSTART) to the interview, then
  by the age of the youngest claimant or partner, youngest first;
- a unit without a linked claim start takes months drawn from the
  linked claims in its age band, pooled to 30 source households;
- each unit takes the midpoint of its slice of the population's
  weight, and every other unit an identity-keyed uniform, so the draw
  is uniform overall and the engine keeps the parameter's share.

frs_spine carries the recency as the benefit-unit carrier
frs_uc_claim_months, which the release drops. The draw leaves
UK_ENGINE_DEFAULT_INPUTS and joins the export surface's allowed
columns, so the data contract's gate digests follow, and the signed
entry for uc_receives_new_claimant_health_element is restated. The
stage spec and its schema branch, the graph cell, the kernel, spine
and fixture registrations, the coverage manifest, the roster pins and
the build graph doc follow. Tests: the stage's own (engine-free and
on the locked engine) and the carrier's.

Co-Authored-By: Claude Opus 5.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.

3 participants