Skip to content

Store person_household_id and person_benunit_id as integers - #2273

Merged
MaxGhenis merged 7 commits into
mainfrom
fix-person-entity-id-int-2267
Oct 24, 2026
Merged

MaxGhenis merged 7 commits into
mainfrom
fix-person-entity-id-int-2267

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #2267

person_household_id and person_benunit_id now use the same integer storage as the other entity identifiers. IDs such as 900,000,001, 900,000,002 and 900,000,003 remain distinct when calculated, exported, saved as CSV and loaded again. The old float32 memberships rounded these IDs together and could merge households during a Core-dataset export/rebuild.

The variables use core's existing int32 storage. Within -2,147,483,648 through 2,147,483,647, whole-number identifiers remain exact. Exported membership columns are integers; pandas reads the CSV integer text as int64. This PR does not widen core's store to int64. The five-ID check warns if a value cannot fit its storing variable exactly, retaining the existing behavior for builds using identifiers outside that range.

Merged current main with a merge commit, preserving its construction-reform state handling and group-row alignment. The two failing dataframe round-trip tests now require exact integer memberships for both households and benefit units, verify CSV int64 values, and retain the existing structure/value checks. Legacy float input compatibility tests remain. simulation.py has only the original PR's 21 added lines; no extra production logic was added during adoption.

Validation uses a local UV_LINK_MODE=clone uv sync --frozen --extra dev Python 3.13 environment (core 3.33.2), foreground pytest -n 2, two BLAS/OpenMP threads, and the required load/disk/compressor gates. 33 focused tests passed (300 existing MicroSeries array-access warnings, 2626.95s), including all 30 identifier cases and the three dataframe/reform round trips. The full-input Budget differential passed: 108 financial arrays, 108 weighted totals, 36 weight arrays and six entity-structure checks match exactly. Final head and detailed scope are recorded in the hand-off comment. make format, uvx ruff format --check . and the F811/F821 package checks pass.

Budget scope: the managed route converts to UKSingleYearDataset and calls country Microsimulation; publication calculators consume its arrays/weights directly, bypassing the wrapper’s dataframe membership joins. No UK policy formula reads either changed membership variable. The numerical differential checks nine monetary variables for 2026–2031 under current law and a dated before-load allowance reform; it does not regenerate every poverty/decile/student-loan/publication output.

The remaining range limitation is deliberate: identifiers outside int32 warn and may be altered when stored. Existing follow-ups are policyengine-core#467, policyengine-uk-data#558 and microcosm#1194. Main has already fixed the older group-table ordering problem (#2278), so that former PR precondition no longer applies.

Reproducer: policyengine_uk/tests/test_dataframe_dataset.py::test_an_exported_frame_saved_as_csv_loads_back

axiom: n/a: identifier storage and simulation export infrastructure

Independent review and landing remain with the hub.

MaxGhenis and others added 2 commits October 10, 2026 17:07
Both membership variables were declared float, so policyengine-core stored
them as float32, which holds whole numbers exactly only up to 2**24.
Identifiers near 900 million read back rounded: calculate,
to_input_dataframe() and UKSingleYearDataset.from_simulation returned
900000000.0 for three different households, and a simulation built from a
policyengine-core dataset file (rebuilt from that export) merged them into
one household.

Declare both int, like person_id, benunit_id and household_id, so they are
stored as int32 and are exact up to 2**31 - 1. Every cached UK dataset's
identifiers fit (the largest seen is 967,010,009). build_from_ids now refuses
identifiers outside the int32 range or not whole, which the store's astype
would otherwise wrap or truncate without an error.

Fixes #2267

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Data builds can number identifiers past the int32 range. uk-data's
clone_and_assign offsets clone k by k * 10 ** (digits of the largest id), so
a local build of the 2024-25 FRS at its default of 10 clones would reach
about 9.1 billion (its release and PR builds use one clone). Microcosm's UK
build sizes its clone offsets the same way (id_multiplier_for_values) on ids
that already reach 967 million, and its policyengine-uk adapter passes frames
to UKSingleYearDataset without renumbering them. person_id, benunit_id and
household_id already wrap out-of-range ids without an error, while the
populations, built from the given arrays, stay exact. Refusing such ids could
turn those builds from wrong stored ids into failures, so build_from_ids
gives an EntityIdWarning instead. In-range ids are unchanged: they read back
exactly and raise no warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits October 10, 2026 18:11
From the review of #2273:

- An object array of Python numbers, such as a pandas column mixing
  integers and floats, skipped the check, and core's astype truncates its
  fractions. check_entity_ids now converts such an array to the NumPy type
  that holds its values and checks that. Text and integers beyond 64 bits
  stay object and are left to core, which converts or rejects them.
- The structure invariant for out-of-range identifiers covers UK tables and
  DataFrames only. build_from_dataset rebuilds a policyengine-core dataset
  file from the stored identifiers, which have changed and lost their order,
  so its test now checks only the warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the second review of #2273:

- An object array whose cells NumPy cannot line up, such as a nested
  array, made check_entity_ids raise. It now leaves such arrays to core.
- The docstring and invariant 5 now name what is checked: integer and float
  arrays, and object arrays of Python floats and of integers within 64 bits.
  Decimal values and larger integers are left to core.
- The property tests suppress Hypothesis's too_slow health check, which a
  slow runner tripped while drawing one input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Infra backlog hand-off (23 October 2026).

  • Head: da99e2823cb53e5cf9fe6762611093d510248a0e on fix-person-entity-id-int-2267. Merged origin/main (a45baf5e490928db20fda96eb845214853fe8068) in 6e312758d, then committed the round-trip fixes separately. Shared history and authorship preserved.
  • Changes: kept the PR’s integer membership storage and warning-only checks for all five identifiers; retained main’s construction-reform state handling and group-row alignment. Repaired both failing dataframe expectations to require exact household AND benunit IDs through export, CSV text/readback and load. CSV columns infer int64; core storage is int32. The archived W1 owner no longer blocks simulation edits; simulation.py remains the original PR’s 21 added lines, with no extra adoption logic.
  • Focused tests: locked Python 3.13 / core 3.33.2, foreground pytest -n 2: 33 passed, 300 MicroSeries array-access warnings, 2626.95s. This includes all 30 ID cases plus deterministic CSV, generated dataframe round-trip, and reform-on-exported-frame tests. make format, uvx ruff format --check . (1,958 files), and package F811/F821 checks pass.
  • Budget differential: passed on the existing full Budget H5 (183,609 people, 94,577 benefit units, 78,190 households; SHA256 810ba980005a8b907cb51464279fa5e0125464b7af9a4871b7f6744c30951ece, unchanged after all runs). Four sequential independent runs varied only the two membership variable types (historical float32 versus proposed int32), under current law and a dated before-load personal-allowance reform, for 2026–2031. 108 financial arrays + 108 weighted totals + 36 weight arrays + 6 entity-structure checks match exactly. Variables: income tax, NI, UC, child benefit, state pension, council tax, VAT, government balance and household net income. All source membership values fit int32 and match the input in all four runs. Each graph was released before the next independent run. The Budget managed single-year route bypasses wrapper dataframe membership joins; no UK policy formula uses either changed membership variable. This isolates the type change within the same current code; it is not a complete checkout-to-checkout or publication-artifact comparison.
  • Resource gates: load1 <=110, os.statvfs free space >=55 GB decimal, compressor <30 GB, BLAS/OpenMP capped at 2. No survey build/download or data push.
  • Open items: core’s existing int32 range remains deliberate; out-of-range identifiers warn and may still be altered (core#467 / uk-data#558 / microcosm#1194). Full Budget publication artifacts were not regenerated. Remote current-head CI and independent review/landing remain with the hub. No merge, close or ready action taken.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Aggregate impact on certified data: pass

Base 368ce73dcb against head aaa66e8c5d, 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

Standard reform costings (change in gov_balance)

Measure 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Raise additional rate by 3pp 0 0 0 0 0 suppressed suppressed

Standard reforms: change in each reform's target

Measure 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
Raise additional rate by 3pp: change in income_tax 0 0 0 0 0 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.

Checks failing on both base and head (1)
  • VAT is never negative (sign:vat): 2025-26: 76 units below zero, a weighted £-54,797,972 in total; 2026-27: 76 units below zero, a weighted £-56,271,349 in total; 2027-28: 76 units below zero, a weighted £-57,609,146 in total
Counted-once check

Each of 85 components was raised by £1 per unit in 2026-27, and every head of its totals was read 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 head that breaks a rule is measured again twice: with every other head held at its baseline value, and with every other head held at its value after the first £1 while the component rises again. It fails where either still shows the response. 0 failed; 0 were skipped.

  • 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 368ce73dcb uk 2.149.0 (files 82bcb1e99617), core 3.33.2, py 3.13.17 aarch64 5913981f9193 2d09eca13f5d 1643.79s
head #2273 merged into main aaa66e8c5d uk 2.149.0 (files 88ad3fd8cac6), core 3.33.2, py 3.13.17 aarch64 5913981f9193 2d09eca13f5d 1642.83s

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
Income tax £299.29bn £319.01bn £336.54bn £351.69bn £367.24bn £385.36bn £403.66bn
National Insurance (employee and self-employed) £52.58bn £54.94bn £56.75bn £58.48bn £60.62bn £62.57bn £65.03bn
National Insurance (employer) £152.64bn £159.18bn £164.14bn £168.73bn £176.11bn £181.72bn £188.90bn
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.62bn £13.06bn £13.55bn £14.04bn £14.54bn £15.09bn £15.65bn
Student loan repayments £7.83bn £8.12bn £8.35bn £8.56bn £8.79bn £9.04bn £9.38bn
VAT £253.71bn £260.53bn £266.72bn £273.14bn £279.83bn £286.71bn £293.71bn
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 £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Fuel duties £24.53bn £24.64bn £26.64bn £26.69bn £26.42bn £25.76bn £26.35bn
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
TV licence fee £4.28bn £4.43bn £4.44bn £4.46bn £4.48bn £4.51bn £4.53bn
Council tax £49.21bn £51.88bn £54.97bn £58.29bn £61.55bn £64.92bn £68.49bn
High value council tax surcharge £0.00bn £0.00bn £0.00bn £0.48bn £0.49bn £0.51bn £0.52bn
Northern Ireland domestic rates £0.55bn £0.58bn £0.61bn £0.63bn £0.67bn £0.70bn £0.73bn
Business rates £31.73bn £31.73bn £31.73bn £31.73bn £31.73bn £31.73bn £31.73bn
Stamp duty land tax on the household's own purchases £6.93bn £7.42bn £7.85bn £8.26bn £8.68bn £9.09bn £9.51bn
Stamp duty land tax paid by companies £3.13bn £3.13bn £3.13bn £3.13bn £3.13bn £3.13bn £3.13bn
Land transaction tax (Wales) £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Land and buildings transaction tax (Scotland) £0.01bn £0.01bn £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn
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
State Pension £122.15bn £126.64bn £127.76bn £129.65bn £133.46bn £137.40bn £141.47bn
Pension Credit £6.68bn £7.07bn £7.09bn £7.16bn £7.28bn £7.42bn £7.52bn
Winter Fuel Payment £1.70bn £1.68bn £1.59bn £1.57bn £1.57bn £1.55bn £1.52bn
Pension Age Winter Heating Payment (Scotland) £0.19bn £0.20bn £0.20bn £0.21bn £0.21bn £0.22bn £0.22bn
Universal Credit £75.54bn £80.75bn £83.40bn £85.21bn £86.21bn £87.61bn £88.91bn
Housing Benefit £8.59bn £8.93bn £9.19bn £9.33bn £9.61bn £9.87bn £10.15bn
Council Tax Reduction £1.98bn £2.03bn £2.07bn £2.11bn £2.16bn £2.21bn £2.25bn
Employment and Support Allowance (income-related) £0.79bn £0.81bn £0.83bn £0.85bn £0.87bn £0.89bn £0.91bn
Employment and Support Allowance (contribution-based) £5.22bn £5.36bn £5.49bn £5.62bn £5.76bn £5.90bn £6.04bn
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.30bn £0.31bn £0.32bn £0.33bn £0.33bn
Income Support £0.12bn £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 £27.05bn £28.19bn £29.28bn £30.02bn £30.75bn £31.51bn £32.28bn
Disability Living Allowance £7.52bn £7.83bn £8.14bn £8.34bn £8.55bn £8.76bn £8.97bn
Attendance Allowance £8.71bn £9.08bn £9.43bn £9.67bn £9.90bn £10.15bn £10.40bn
Carer's Allowance £4.50bn £4.69bn £4.87bn £4.99bn £5.11bn £5.23bn £5.36bn
Carer Support Payment (Scotland) £0.31bn £0.32bn £0.34bn £0.34bn £0.35bn £0.36bn £0.37bn
Carer's Allowance Supplement (Scotland) £0.00bn £0.04bn £0.04bn £0.04bn £0.04bn £0.04bn £0.04bn
Severe Disablement Allowance £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn £0.03bn
Industrial Injuries Disablement Benefit £0.51bn £0.52bn £0.53bn £0.54bn £0.56bn £0.57bn £0.59bn
Armed Forces Compensation Scheme £0.61bn £0.62bn £0.64bn £0.65bn £0.67bn £0.69bn £0.70bn
War Widow's or Widower's Pension £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Child Benefit £16.23bn £16.91bn £17.53bn £17.96bn £18.39bn £18.84bn £19.29bn
Scottish Child Payment £0.50bn £0.52bn £0.53bn £0.55bn £0.56bn £0.57bn £0.58bn
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.32bn £3.41bn £3.49bn £3.57bn £3.66bn £3.75bn £3.84bn
Statutory Paternity Pay £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn £0.00bn
Statutory Sick Pay £1.13bn £1.16bn £1.19bn £1.22bn £1.25bn £1.28bn £1.31bn
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.70bn £0.72bn £0.74bn £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.55bn £0.56bn £0.57bn £0.58bn £0.60bn £0.61bn £0.59bn
Extended childcare entitlement £2.77bn £3.27bn £3.36bn £3.43bn £3.53bn £3.61bn £3.70bn
Universal childcare entitlement £2.26bn £2.45bn £2.51bn £2.58bn £2.64bn £2.72bn £2.78bn
Targeted childcare entitlement £0.47bn £0.49bn £0.50bn £0.51bn £0.52bn £0.53bn £0.47bn
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 £204.68bn £205.46bn £206.22bn £207.04bn £207.96bn £208.89bn £209.79bn
State education spending £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn £0.02bn
Transport subsidy spending £25.15bn £25.25bn £25.34bn £25.44bn £25.55bn £25.67bn £25.78bn
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
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
State Pension 11,308k 11,208k 10,906k 10,812k 10,860k 10,908k 10,955k
Pension Credit 1,491k 1,489k 1,478k 1,459k 1,459k 1,456k 1,453k
Winter Fuel Payment 7,091k 7,011k 6,599k 6,512k 6,493k 6,379k 6,248k
Pension Age Winter Heating Payment (Scotland) 806k 807k 807k 805k 809k 812k 816k
Universal Credit 6,361k 6,370k 6,404k 6,419k 6,390k 6,387k 6,368k
Housing Benefit 1,254k 1,252k 1,254k 1,239k 1,245k 1,247k 1,249k
Council Tax Reduction 3,187k 3,212k 3,224k 3,245k 3,262k 3,280k 3,294k
Employment and Support Allowance (income-related) 71k 71k 71k 72k 72k 72k 72k
Employment and Support Allowance (contribution-based) 722k 724k 727k 730k 733k 737k 740k
Jobseeker's Allowance (income-based) 0k 0k 0k 0k 0k 0k 0k
Jobseeker's Allowance (contribution-based) 67k 67k 68k 68k 68k 69k 69k
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,581k 3,595k 3,608k 3,623k 3,639k 3,655k 3,671k
Disability Living Allowance 1,296k 1,301k 1,306k 1,311k 1,317k 1,323k 1,329k
Attendance Allowance 1,701k 1,708k 1,714k 1,721k 1,729k 1,736k 1,744k
Carer's Allowance 1,038k 1,042k 1,046k 1,050k 1,055k 1,059k 1,064k
Carer Support Payment (Scotland) 71k 72k 72k 72k 73k 73k 73k
Carer's Allowance Supplement (Scotland) 0k 72k 72k 72k 73k 73k 73k
Severe Disablement Allowance 4k 4k 4k 4k 4k 4k 4k
Industrial Injuries Disablement Benefit 137k 138k 139k 139k 140k 140k 141k
Armed Forces Compensation Scheme 94k 94k 94k 95k 95k 95k 96k
War Widow's or Widower's Pension 0k 0k 0k 0k 0k 0k 0k
Child Benefit 8,136k 8,165k 8,185k 8,215k 8,249k 8,282k 8,314k
Scottish Child Payment 352k 354k 355k 359k 357k 358k 357k
Two Child Limit Payment (Scotland, counterfactual) 0k 0k 0k 0k 0k 0k 0k
Healthy Start vouchers 200k 201k 202k 203k 204k 204k 205k
Maternity Allowance 0k 0k 0k 0k 0k 0k 0k
Statutory Maternity Pay 334k 335k 336k 338k 339k 341k 342k
Statutory Paternity Pay 0k 0k 0k 0k 0k 0k 0k
Statutory Sick Pay 182k 183k 183k 184k 185k 186k 186k
Sure Start Maternity Grant 26k 26k 26k 27k 27k 27k 27k
Bereavement Support Payment 98k 98k 99k 99k 100k 100k 101k
Widowed Parent's Allowance 0k 0k 0k 0k 0k 0k 0k
Tax-Free Childcare 1,018k 1,029k 1,028k 1,033k 1,034k 1,039k 1,023k
Extended childcare entitlement 718k 724k 728k 732k 737k 741k 743k
Universal childcare entitlement 986k 989k 992k 997k 1,002k 1,013k 1,015k
Targeted childcare entitlement 98k 98k 96k 96k 96k 97k 84k
Care to Learn 0k 0k 0k 0k 0k 0k 0k
Childcare Grant 0k 0k 0k 0k 0k 0k 0k
Parents' Learning Allowance 98k 99k 99k 100k 100k 100k 101k
Adult Dependants' Grant 18k 18k 12k 13k 13k 13k 13k
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
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 £899.03bn £938.67bn £975.44bn £1,008.36bn £1,044.30bn £1,080.86bn £1,121.34bn
Government spending £530.58bn † £545.59bn † £553.49bn † £560.60bn † £569.15bn † £578.31bn † £587.34bn †
Government balance, each receipt once £368.44bn † £393.08bn † £421.95bn † £447.75bn † £475.14bn † £502.55bn † £534.00bn †
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 £899.03bn £938.67bn £975.44bn £1,008.36bn £1,044.30bn £1,080.86bn £1,121.34bn
household_tax £492.68bn £518.96bn £544.57bn £566.48bn £588.35bn £612.42bn £638.73bn
pre_budget_change_household_tax £484.85bn £510.84bn £536.22bn £557.44bn £579.07bn £602.88bn £628.84bn
gov_spending £530.58bn † £545.59bn † £553.49bn † £560.60bn † £569.15bn † £578.31bn † £587.34bn †
household_benefits £530.58bn † £545.59bn † £553.49bn † £560.60bn † £569.15bn † £578.31bn † £587.34bn †
gov_balance £368.44bn † £393.08bn † £421.95bn † £447.75bn † £475.14bn † £502.55bn † £534.00bn †
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,657.06bn £1,719.25bn £1,771.68bn £1,821.99bn £1,872.88bn £1,930.99bn £2,001.98bn
Household net income £1,655.70bn † £1,705.12bn † £1,738.71bn † £1,773.17bn † £1,809.60bn † £1,851.54bn † £1,903.54bn †
Household net income (HBAI definition) £1,462.17bn £1,509.90bn £1,543.94bn £1,577.28bn £1,611.67bn £1,651.05bn £1,701.84bn
Population: head levels
Measure (head) 2025-26 2026-27 2027-28 2028-29 2029-30 2030-31 2031-32
People 69,514k 69,778k 70,036k 70,316k 70,626k 70,944k 71,249k
Benefit units 35,247k 35,381k 35,512k 35,654k 35,811k 35,972k 36,127k
Households 31,167k 31,285k 31,401k 31,526k 31,665k 31,808k 31,944k
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.1% 15.2% 15.5% 15.7% 15.7% 15.8% 15.8%
Absolute poverty, before housing costs: children 24.2% 21.4% 21.6% 21.6% 21.7% 22.0% 21.8%
Absolute poverty, before housing costs: working-age adults 13.9% 13.5% 14.0% 14.2% 14.2% 14.3% 14.3%
Absolute poverty, before housing costs: pensioners 13.7% 13.2% 13.2% 13.4% 13.5% 13.5% 13.5%
Absolute poverty, after housing costs: everyone 21.6% 20.9% 21.4% 21.6% 21.9% 22.1% 22.3%
Absolute poverty, after housing costs: children 33.4% 30.9% 31.1% 31.3% 31.5% 32.0% 32.3%
Absolute poverty, after housing costs: working-age adults 19.9% 19.7% 20.3% 20.5% 20.8% 21.0% 21.1%
Absolute poverty, after housing costs: pensioners 12.8% 12.6% 12.6% 12.9% 13.1% 13.4% 13.4%
Relative poverty, before housing costs: everyone 17.2% 16.5% 16.5% 16.6% 16.4% 16.4% 16.4%
Relative poverty, before housing costs: children 26.4% 23.7% 23.4% 23.4% 22.9% 23.0% 22.9%
Relative poverty, before housing costs: working-age adults 14.7% 14.4% 14.7% 14.8% 14.7% 14.8% 14.8%
Relative poverty, before housing costs: pensioners 14.8% 14.8% 14.1% 14.2% 14.0% 14.0% 14.1%
Relative poverty, after housing costs: everyone 21.7% 21.1% 21.3% 21.3% 21.4% 21.4% 21.7%
Relative poverty, after housing costs: children 33.5% 31.3% 31.0% 30.8% 31.0% 31.0% 31.5%
Relative poverty, after housing costs: working-age adults 19.9% 19.8% 20.2% 20.3% 20.5% 20.5% 20.7%
Relative poverty, after housing costs: pensioners 13.0% 12.7% 12.6% 12.2% 12.1% 12.2% 12.5%
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,163k 10,583k 10,866k 11,011k 11,088k 11,228k 11,233k
Absolute poverty, before housing costs: children 3,629k 3,221k 3,263k 3,284k 3,310k 3,369k 3,350k
Absolute poverty, before housing costs: working-age adults 5,902k 5,806k 6,087k 6,198k 6,235k 6,305k 6,321k
Absolute poverty, before housing costs: pensioners 1,632k 1,556k 1,515k 1,529k 1,543k 1,555k 1,562k
Absolute poverty, after housing costs: everyone 15,000k 14,571k 14,968k 15,173k 15,433k 15,708k 15,854k
Absolute poverty, after housing costs: children 5,004k 4,656k 4,703k 4,745k 4,808k 4,897k 4,966k
Absolute poverty, after housing costs: working-age adults 8,476k 8,431k 8,814k 8,960k 9,130k 9,273k 9,341k
Absolute poverty, after housing costs: pensioners 1,520k 1,484k 1,451k 1,468k 1,496k 1,538k 1,547k
Relative poverty, before housing costs: everyone 11,974k 11,507k 11,542k 11,648k 11,548k 11,670k 11,705k
Relative poverty, before housing costs: children 3,963k 3,570k 3,543k 3,553k 3,489k 3,519k 3,518k
Relative poverty, before housing costs: working-age adults 6,246k 6,184k 6,378k 6,475k 6,459k 6,538k 6,554k
Relative poverty, before housing costs: pensioners 1,765k 1,753k 1,621k 1,620k 1,600k 1,613k 1,633k
Relative poverty, after housing costs: everyone 15,067k 14,732k 14,895k 14,945k 15,110k 15,214k 15,475k
Relative poverty, after housing costs: children 5,019k 4,715k 4,686k 4,669k 4,725k 4,753k 4,839k
Relative poverty, after housing costs: working-age adults 8,497k 8,516k 8,764k 8,884k 8,994k 9,060k 9,195k
Relative poverty, after housing costs: pensioners 1,551k 1,502k 1,445k 1,392k 1,391k 1,401k 1,441k
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.3088 0.3061 0.3068 0.3074 0.3078 0.3084 0.3095
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,841 † £18,023 † £18,040 † £18,084 † £18,438 † £18,627 † £18,803 †
Decile 2: mean household_net_income per household £28,086 † £29,021 † £28,787 † £29,226 † £29,487 † £29,939 † £30,568 †
Decile 3: mean household_net_income per household £34,361 † £35,678 † £36,193 † £36,764 † £37,055 † £37,700 † £38,313 †
Decile 4: mean household_net_income per household £38,776 † £40,951 † £42,048 † £42,647 † £43,424 † £44,189 † £44,704 †
Decile 5: mean household_net_income per household £43,948 † £44,841 † £45,903 † £46,641 † £47,851 † £48,655 † £49,864 †
Decile 6: mean household_net_income per household £48,438 † £49,772 † £50,873 † £51,669 † £51,947 † £53,410 † £54,725 †
Decile 7: mean household_net_income per household £56,400 † £57,626 † £58,395 † £59,133 † £60,160 † £60,960 † £62,360 †
Decile 8: mean household_net_income per household £69,281 † £70,763 † £72,241 † £73,343 † £74,868 † £76,016 † £78,283 †
Decile 9: mean household_net_income per household £79,811 † £82,188 † £83,310 † £84,759 † £86,323 † £87,891 † £90,929 †
Decile 10: mean household_net_income per household £117,852 † £120,687 † £122,639 † £124,783 † £127,005 † £129,364 † £132,261 †
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.22bn £6.50bn £6.70bn £6.90bn £7.11bn £7.34bn £7.62bn
Raise higher rate by 1pp £3.54bn £3.82bn £4.05bn £4.27bn £4.49bn £4.76bn £4.96bn
Raise personal allowance by ~800GBP/year £-3.83bn £-3.96bn £-4.03bn £-4.10bn £-4.19bn £-4.30bn £-2.02bn
Raise child benefit by 25GBP/week per additional child £-2.00bn £-1.76bn £-1.58bn £-1.48bn £-1.38bn £-1.28bn £-1.17bn
Reduce Universal Credit taper rate to 20% £-20.49bn £-21.05bn £-21.50bn £-21.94bn £-22.03bn £-22.40bn £-22.87bn
Raise Class 1 main employee NICs rate to 10% £11.07bn £11.51bn £11.84bn £12.14bn £12.49bn £12.83bn £13.23bn
Raise VAT standard rate by 2pp £25.01bn £25.68bn £26.29bn £26.92bn £27.58bn £28.26bn £28.95bn
Raise additional rate by 3pp £2.83bn £3.07bn £3.27bn £3.47bn £3.67bn suppressed suppressed
Raise the Universal Credit standard allowance by 10% £-3.03bn £-3.16bn £-3.28bn £-3.35bn £-3.39bn £-3.44bn £-3.51bn
Raise the State Pension by 10% £-7.81bn £-8.07bn £-7.99bn £-8.11bn £-8.36bn £-8.66bn £-9.02bn
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.36bn £6.65bn £6.86bn £7.07bn £7.28bn £7.52bn £7.80bn
Raise higher rate by 1pp: change in income_tax £3.55bn £3.83bn £4.06bn £4.28bn £4.50bn £4.77bn £4.97bn
Raise personal allowance by ~800GBP/year: change in income_tax £-3.96bn £-4.10bn £-4.19bn £-4.26bn £-4.36bn £-4.47bn £-1.77bn
Raise child benefit by 25GBP/week per additional child: change in child_benefit £2.34bn £2.15bn £1.96bn £1.85bn £1.74bn £1.63bn £1.51bn
Reduce Universal Credit taper rate to 20%: change in universal_credit £20.48bn £21.04bn £21.49bn £21.93bn £22.02bn £22.40bn £22.86bn
Raise Class 1 main employee NICs rate to 10%: change in national_insurance £11.33bn £11.79bn £12.13bn £12.44bn £12.78bn £13.13bn £13.62bn
Raise VAT standard rate by 2pp: change in vat £25.01bn £25.68bn £26.29bn £26.92bn £27.58bn £28.26bn £28.95bn
Raise additional rate by 3pp: change in income_tax £2.83bn £3.07bn £3.27bn £3.47bn £3.67bn suppressed suppressed
Raise the Universal Credit standard allowance by 10%: change in universal_credit £3.03bn £3.16bn £3.28bn £3.36bn £3.41bn £3.47bn £3.52bn
Raise the State Pension by 10%: change in state_pension £10.72bn £11.23bn £11.37bn £11.62bn £12.08bn £12.54bn £13.07bn

Keep integer membership expectations from newer main and add a deterministic large-ID example for both group types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review October 23, 2026 19:40
@MaxGhenis
MaxGhenis added this pull request to the merge queue Oct 23, 2026

@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 4d85ed08be16152ed699ee9c9b620fe43e961ab3. No actionable findings in the identifier storage, build warning or export/reload changes.

The two person membership variables now use integer storage consistent with the entity IDs they reference. The warning checks match the actual Core dtype and handle fractional/non-finite values before casting. The documented int32 range remains; this does not promise int64 storage.

Validation: 16 focused tests passed, including five 300-example Core-casting properties, the high-ID reproduction across projected years, H5 membership rebuild, and changed CSV/export/reload checks with income-tax equality. Ruff formatting and all current-head CI checks pass. No representative-population invariance claim is made.

Merged via the queue into main with commit 320bc6d Oct 24, 2026
18 checks passed
@MaxGhenis
MaxGhenis deleted the fix-person-entity-id-int-2267 branch October 24, 2026 12:58
@MaxGhenis

Copy link
Copy Markdown
Collaborator Author

Merged by the UK hub (Claude session 8e19f9d5) at head 4d85ed08b, through the merge queue with the head pinned.

  • What it does: it stores person_household_id and person_benunit_id as integers, not float32. float32 rounded large IDs: 900000036 read back as 900000064, which can put people in the wrong household or benefit unit.
  • Reviews: an independent GPT-6.1 Sol review (infra4-b) found the change sound, with no floating-ID reader anywhere and an exact-totals differential across Budget variables, but blocked on a newer-main test that still cast expected memberships to float32. The hub merged main and changed that test to exact integer IDs with a deterministic example. A GPT-6.1 Sol delta review (infra5) APPROVE at this head found no remaining float32 membership expectation.
  • Impact: no policy rule changes. Datasets whose IDs float32 rounded get their memberships right.
  • CI: all 17 checks pass at this head.
  • Why now: Max asked on 22 Oct to clear the UK PR backlog before the Budget.

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.

person_household_id and person_benunit_id are stored as float32, which rounds large identifiers

2 participants