Repository navigation
Conversation
Add state_pension_flat_share (E1) and state_pension_addon_weekly_base (E2), read only at the data year. While the period's pension type matches the data-year type, basic or new State Pension pays E1 times the period's full rate, and additional State Pension uprates E2 by September CPI from the data year. A changed type, a NONE type at the data year, or no supplied split keeps today's split at the legislated full rate. The carer overlap keeps its share on that split, so a supplied split moves no data-year Carer's Allowance or Carer Support Payment. A supplied pair that does not add up to the report at the legislated full rate raises an error instead of being clipped.
Cover data-year invariance of State Pension, the overlap, Carer's Allowance and Carer Support Payment; the default against the starting commit's formulas through 2040; projection of a single-year dataset across the forecast boundary; re-typed and NONE-type records; the 52-week annualisation; refusal of infeasible inputs; an age-addition reform; and Hypothesis properties for the pieces' rates, the exact sum and monotonicity.
The split's cap and the age addition taken off the report both read current law (#2122). A reformed simulation calculates State Pension while the July 2025 Universal Credit setup runs, before its current-law baseline simulation is attached, so reading that simulation's parameters fell back to the reformed ones and the split check rejected the supplied pieces. parameters.baseline, read at 30 April as the fiscal-year conversion samples it, gives the same rates (checked for six reforms, 2015 to 2032) and is there throughout construction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e data year exact Round 1 review fixes: - Read current-law rates and the age addition from processed_parameters(), which no reform or scenario modifier changes and which exists while a reformed simulation is built. - Use the supplied split only when both inputs are supplied for the data year (supplied_by), for a person over State Pension age then whose BASIC or NEW type is unchanged; everyone else keeps the cap split. One input without the other raises. - In the data year, where the full rate is the legislated one, fit the add-on so the float32 total equals the cap split's exactly, nudging the flat part off a round-half-to-even tie. A total short of a carer benefit threshold would otherwise pay the Scottish Carer Supplement. - Read each type's rate only when someone has the type, so a pre-2016 basic situation needs no new State Pension rate; the overlap reads the cap split the same way. - Refuse non-finite inputs and a nonzero split for a zero report; make the add-on a stock; register both inputs. - Tests for each finding, the legal-piece round trip, the #2122 reform cases and the projection levels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fits The test supplies a value for every registered input. The person reports no State Pension, and the model refuses a nonzero split for a zero report, so both parts of the split are zero. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… where it holds Review r2 found that a directly stored component could double the data-year pension, that an input for an earlier year triggered a false refusal, and that the default calculation had lost main's rounding and laziness. - A split is used only when both inputs are supplied for the data year itself; inputs for any other year are ignored and never checked. - Where basic, new or additional State Pension is stored for a year, all three take the cap split for that year and the overlap uses the stored components, as on main. The three components join SUPPLIED_INPUT_VARIABLES so stored_as_input can answer for them. - Each component reads only its own type's rates, and only where someone has the type; basic and new never read September CPI, and the CPI ratio is exactly one in the data year. The cap split divides the float32 report by a scalar rate, which keeps main's float32 quotient. - Nonfinite inputs get their named error whatever NumPy's error settings. - Tests: an exact differential against main's arithmetic through 2040, exact data-year invariance including clamped, zero and subnormal reports, each component alone against the full calculation, the stored-component and other-year cases, the period age guard, an undated new State Pension reform with literal amounts, and a generated round trip of the inputs' own defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…omponents A supplied split keeps the State Pension a report gives only if Core sums the three components the split gives. Core reads any value it did not calculate in place of a formula, including one put_in_cache stores without derived=True, and a reform can redefine a component. Then all three keep the cap split, and the overlap uses the components Core sums. One check (_split_in_use) now decides where the split applies, for each component and for the overlap, so with no inputs the overlap runs main's lines. A year that starts in the data year on another day is no longer taken for the data year, and the weekly report ignores NumPy's error settings so a nonfinite input still gets its named error. Tests cover review round 3's cases: a cached component, a component set on a branch or clone after a calculation, a neutralised component, a shifted annual period, a subnormal report, the period age guard with a half share, and generated legal pieces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reform in force in the data year that changes how State Pension age or type is set there (an undated State Pension age change, no new State Pension, or a redefined is_SP_age, state_pension_age, months_since_state_pension_age or state_pension_type) checked a supplied split against a type it was not built for and refused the dataset. The split now gives way to the cap split for everyone under such a reform, as before the split inputs existed. A reform that starts after the data year keeps the split. The new State Pension start moves to a shared helper so the type formula and the check read it the same way, and the variables' docs say the data year is the dataset's first year. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core loads each variable file as a module of its own, so the simulation's State Pension type Enum is a different class from the one an import of the file gives. The definition check compared possible_values and default_value by identity, so it read state_pension_type as redefined at current law and turned a supplied split off everywhere. It now compares an Enum class by its name and members and an Enum member by its name and value. The tests that retype the data year now use reforms that do: a male State Pension age of 1,080 months (the parameter is in months), and no new State Pension before 2101 (a scalar applies from 2023, after the 2016 start). A test checks the type rules follow current law without a reform, and another that two systems define every variable alike. The split inputs' docs say to start a State Pension age or type reform after the data year. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The legal-pieces property pins each record's type for the data year, and the pin carries forward, but the add-on is paid only from State Pension age in the period. A man held at 66 is below the State Pension age of 67 in 2030, so his add-on is zero there. The property now expects that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hing without inputs - components_follow_formulas returns False where gov.abolitions abolishes a component, as Core does before it reads a formula, so a supplied split no longer pays half the basic pension beside a nil additional pension. - The split checks that an input was supplied for the data year before it reads the report or the type rules, so a simulation without the inputs calculates the overlap as main does. - The data-year refit keeps the cap split's own add-on where the supplied pair already reaches the total, so supplying the cap split's pair back gives its components exactly. - The scenario test now checks a split that pays differently from the cap split under a frozen rate; the docs define the data year. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t off A reform in force in the data year that changes how State Pension age or type is set there turns a supplied split off for everyone, so the reformed simulation uses the cap split while its baseline uses the supplied one. StatePensionSplitIgnoredWarning now says so, once per simulation, and names the remedy: start the reform after the data year. The input docs and the changelog name the warning and the abolition case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Household net income by decileNo 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)
Counted-once checkThe 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.
Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
Core applies a reform given as one value with no dates from 2000, so an undated State Pension age or type reform is in force in the data year and turns a supplied split off in the reformed simulation. The warning and both inputs' docs now say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the reform dates - StatePensionSplitIgnoredWarning now also fires, once per simulation, where a basic, new or additional State Pension stored for the period, or a reform that redefines or abolishes one, turns a supplied split off: a dataset column for a component does so in every year that holds it. - A value given with no dates is in force from 2023 in a reform dict and from 2000 through Reform.from_dict or parameter_changes. The warning and both inputs' docs now say so, give a date-range remedy (a bare year key sets one fiscal year only), and ask for the inputs to be built with the version that reads them. - The changelog lists the reforms that turn the split off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The warning and both input docs gave a d + 1 date range as the remedy, which is untested, and said a bare year key sets one fiscal year, which is wrong for Reform.from_dict. They now give the tested range (2026-01-01.2100-12-31 for a 2024 data year), the bare-key reading on each route, the causes the data-year check covers, and dropping both inputs as the other remedy. The warning was marked as given before it was issued, so under an error warnings filter a second calculation returned the cap split with no error. It is now marked after it is issued, and keyed on the cause and data year. A test covers the error filter. Refs #2976 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The component warning names the year it was raised for, but it fires once per simulation and data year, so a later year with a stored, redefined or abolished component stays silent. The message now says so: every such year takes the split at the legislated full rate. Refs #2976 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use Core storage precedence for component overrides, refresh calculations after input deletion, and explain data-year retyping in split refusals. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schedule a refresh only when deletion removes a stored value, and prevent a nested calculation from reusing the earlier gross pension. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… causes Co-Authored-By: GPT-6.2 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s the draw Co-Authored-By: GPT-6.2 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bles Compare the active timetable and track visible pension type inputs from both input APIs. Refresh affected branch calculations and give each simulation its own warning record. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22
left a comment
There was a problem hiding this comment.
Review at ab68e01424ce675e6f7cf10e66a5186ae2297356: COMPLETE — no findings or material evidence gaps in the changed scope.
Independent policy/source and code/test reviews checked the supplied data-year split, separate component uprating and age addition, reform/type/age gates, cache and storage behavior, and affected final pension and carer-benefit results. The DWP 2024–25 rates, 2026 uprating order, and age-addition provision support the reviewed component and data-year oracles. Later forecast tests verify the model's projection contract.
The scope retains a specific limitation: E1/E2 are uprating inputs, and the existing cap-share overlap inference remains an approximation. Additional pension and the age addition are excepted from statutory Carer's Allowance overlap (regulation 4, regulation 12). This review does not certify that inference as a reconstruction of legal basic/additional entitlement, including within-cap SERPS. The documented reset requirement for raw holder edits and bounded cause detection also remain interface limits. No new wrong final outcome was substantiated within the stated contract.
Hosted run 46685475596 checks a merge tree identical to this head on CPython 3.13.18/Core 3.34.9: 14,218 passed, 61 skipped, 2 xfailed; YAML 6,887 passed. Ten outcome-artifact digests and focused outcomes were independently verified, including 88 legal-split, 33 component, 11 storage, 10 carer-payment and four overlap-property tests. Counts overlap. Fourteen official originals and fourteen text derivatives passed integrity checks. Local model tests were not run because no matching environment was available; no dependencies were installed or private population runs performed. Author historical test/aggregate claims were not substituted for current-head evidence.
The PR remains a draft, so approval is deferred. Full reports, source evidence and result JSON are retained by the review monitor.
Fixes #2976
axiom: n/a: microsimulation data interface; the legislated State Pension rules do not change
What this adds
Two person inputs let a dataset such as Microcosm say how much of a reported State Pension is linked to the full rate. The model reads them only for the data year d: the dataset's first year or, in a simulation without a dataset, the year being calculated.
state_pension_flat_share(E1): the full-rate-linked part, as a share of the legislated full rate for the person's type in dstate_pension_addon_weekly_base(E2): the rest, in data-year pounds a week, linked to September CPIToday the model pays a report as basic or new State Pension up to the legislated full rate for the person's type (the cap), and the rest as additional State Pension; this description calls that the cap split. Both inputs exclude the age addition. Where neither is supplied, their formulas return the cap split's pair (
data_year_cap_split), and the cap israte_by_typewithcurrent_law_state_pension()for the person's type in d, so a dataset writer can build the pair from both. The model uses the pair only when all of these hold:derived=True, and no reform redefines or abolishes one;Then, in year y:
The cap split applies when neither input is supplied, the data-year type is NONE, the person's type in the period differs from their data-year type, or a row with an explicit BASIC or NEW type is under State Pension age in d. It also applies to everyone in a period for which a component is stored, redefined or abolished (a component override, departure 6), and to everyone in a simulation in which the model detects a data-year type or age cause (departure 10). When the model turns a supplied split off for either reason, it emits a
StatePensionSplitIgnoredWarningonce per simulation, data year and reason. In a period with a component override, the warning says that a component is stored, redefined or abolished; otherwise it names the first data-year cause the model detected. Under Python's default warning filter, a repeat of the same message from the same place later in the same process is not shown. An E2 below zero by no more than the float32 rounding tolerance is accepted and counts as zero. Later years then pay no additional State Pension, but in d the refit below can still pay one float32 step: £0.0009765625 a year for a NEW report of £221.20 a week with E1 = 1 and E2 = −£0.00001.Data-year invariance
At current law and for reforms that start after d,
state_pension,overlapping_state_pension, Carer's Allowance and Carer Support Payment in d equal their values without the inputs, bit for bit. Where the full rate in d is the legislated one, the add-on in d is the rest of the cap split's total, fitted so the float32 total equals it exactly:A total £0.0005 short of a Carer Support Payment threshold would otherwise pay the full Scottish Carer Supplement (
test_a_supplied_split_never_pays_a_carer_supplement_the_cap_split_does_not).Under a reform that sets the full rate in d, the flat part in d is E1 × 52 × the reformed rate, so the #2122 cases assert E1 × 52 × reformed rate + 52 × E2 in d. This holds for a dated basic rate reform (a reformed full rate of £200 a week for an 85-year-old with E1 = 0.5 and E2 = £30: basic £5,200, additional £1,560, State Pension £6,773 with the £13 age addition) and an undated new rate reform (a reformed full rate of £300 a week, E1 = 0.5, E2 = £10: new £7,800, additional £520, State Pension £8,320).
With no inputs
Each component is worked out on its own and reads only what it needs: basic and new State Pension read only their own type's rates and never September CPI, and a type's rate is read only where someone has that type. The cap split divides the float32 weekly report by a scalar rate, as main does, so it keeps main's float32 quotient (£90.05 a week of basic State Pension in 2024-25 pays £4,682.6005859375, not £4,682.60009765625).
A seeded grid compared main (e6909e8) with this branch at
7a9190128, both on Core 3.38.0: 240 synthetic dataset records from 2024 to 2033 (basic, new, additional, State Pension, overlap, type), 60-person synthetic situations in 2009, 2014, 2016, 2020, 2024 and 2026, one component per fresh simulation, a reform that neutralises each component, and each component cached withoutderived=Truein 2024 and 2026. 165 of 168 arrays are identical, bit for bit, with no signed-zero differences. In the other 3, main raisesTypeErrorand this branch returns values: new State Pension in 2009 and 2014 (zero, with no new State Pension type), and additional State Pension in 2009. The grid results describe7a9190128. Later commits changed component storage lookup, cache handling and detection of data-year type or age changes. Outside the grid, a report of −0.0 gives +0.0 new State Pension to a person whose type is not NEW, where main gives −0.0.Where neither input is supplied for d, the split reads neither the report nor the State Pension type rules, so the overlap runs main's lines and reads only the components: a report whose formula raises is never read (
test_overlap_without_a_split_never_reads_the_report). Under a reform that neutralises additional State Pension, a £200 BASIC report overlaps its £8,814, as on main. Under one that abolishes it throughgov.abolitions, the same report with a supplied half share pays and overlaps £8,814 too (test_an_abolished_component_keeps_the_cap_split), where it would otherwise pay half the basic pension and no additional pension.Current-law rates
The legislated rates that bound the split, and the age addition that
state_pension_reported_excluding_age_additiontakes off the report, come fromprocessed_parameters(), the shared processed current-law tree. A reformed simulation calculates State Pension during the July 2025 Universal Credit setup, before its baseline simulation is attached, and a scenario modifier can edit the system's own parameters, so neither the attached baseline norparameters.baselineserves. A probe compared the parameter leaves (basic rate, new rate, age addition amount and age) in the attached baseline simulation's tree withprocessed_parameters(), for current law and five reforms (age addition, basic rate, dated new rate, single-day new rate, triple lock off), 2015 to 2032, with the new rate from 2016: 0 mismatches. Underno_economic_assumptions, the split is still checked against current law, then pays its share of the frozen rate: an 85-year-old reporting half the 2027 basic rate plus £30 a week, with E1 = 0.5 and E2 = £30, gets half the frozen rate plus £30 a week, where the cap split would pay the whole report as basic State Pension (test_the_split_is_checked_against_current_law_under_a_scenario).Refusals
Where the calculation reaches the split check (an input supplied for d, the components following the model's formulas, and no detected data-year type or age cause under departure 10), a supplied pair that does not fit the report raises a
ValueErrornaming the input, row and data year, instead of being clipped: a non-finite value; a share outside zero to one, above the share the report covers, or nonzero for a NONE type; an add-on below zero by more than the tolerance; a nonzero split for a report that is zero excluding the age addition; or a pair that does not add up to the report excluding the age addition. Supplying one input for d without the other raises too. Where the calculation doesn't reach the check, as when the model turns the split off for a component override or a detected data-year cause, the pair is ignored and not checked. A non-finite input gets its own error whatever NumPy's error settings, including on a subnormal report. Separately, Core refuses a NaN in a dataset or inset_inputwhen the value is loaded, in any year; that error names the input but no row or year.Design choices beyond #2976
Elsewhere in this description, these numbered items are cited as departures (departure 1 to departure 12).
state_pension_reported_excluding_age_additionreads the current-law age addition fromprocessed_parameters()instead of the attached baseline simulation. The caps, the legislated full rates, come from there too. Their values are unchanged wherever main read an attached baseline, at current law and under the five reforms above. During the July 2025 Universal Credit setup, before the baseline is attached, main read the reformed simulation's own parameters, so a rate or age-addition reform moved the cap and the deduction there; this branch reads current law (departure 12).The exact refit in d, above. Where it keeps the cap split, it does so in d only.
The cap split for an explicit BASIC or NEW type below State Pension age in d, since guarding the add-on by age but not the flat part would break data-year invariance for such a person.
Both inputs are required together, for d itself, and a report that is zero once the age addition is taken off needs a zero split. Projected copies of the inputs are ignored only while the dataset's first year stays d: a projected year saved as a dataset of its own reads them as its pair, and raises where they don't fit that year's report.
state_pension_addon_weekly_baseis a stock (quantity_type = STOCK), so a monthly read is not divided by 12.Where Core would not sum the model's own components for a period, the split is off for that period and the overlap uses the components Core sums, as on main. That is where a component is stored for the period (an input, a model value, or a value cached without
derived=True, which Core reads in place of the formula) or a reform redefines one (replaces_definition) or abolishes one (gov.abolitions, which Core checks before it reads a formula or a stored value). To find a stored component, the model follows Core's visible branches, reads memory before disk, and looks up the exact disk key for the requested period. The definition check compares every attribute Core calculates a component from, such as its formula for the period, default,defined_for, what it adds or subtracts, its definition period andquantity_type, and skips the descriptive ones (label, documentation, unit, reference, metadata and a few others). So a reform that changes onlyquantity_typeturns the split off too, and the person gets the cap split. A dataset column for a component turns the split off for every record in every year that holds it, with aStatePensionSplitIgnoredWarning: a single-year dataset is projected to 2032, so from d to 2032. From 2033, where nothing is stored, the split applies again, so a pair that does not fit the report raises there, though nothing checked it through 2032 (run at7a9190128: a column of the 2024-25 basic rate turned the split off from 2024 to 2032, and a valid pair gave the split from 2033 to 2036). Neither Microcosm nor policyengine-uk-data writes such a column today.basic_state_pension,new_state_pensionandadditional_state_pensionjoinSUPPLIED_INPUT_VARIABLES, sostored_as_inputcan answer for them.The September CPI ratio is exactly one in d itself. This gives the same value wherever main works, and no component in d now needs September CPI. A year that starts in d on another day is not d: with the index doubled on 1 July 2024 alone,
year:2024-07pays a £200 BASIC report's add-on at twice its rate, £3,172, as main does.The check in 6 reads what is stored for the period instead of recording a dependency, which Core does not track. A formula that makes a branch and stores a component on it while the branch's parent is calculating could leave a component the parent calculated standing on the branch. No formula in policyengine-uk stores a State Pension component or a split input on a branch: the branches the model makes (marriage tax reforms, measurement branches, the Pension Credit income tax, ESA, tax credit and UC non-dependant branches, and the marginal tax rate branches) store other variables.
Simulation.set_inputfrom outside, with every ancestor idle, drops the calculated values before the next calculation, so a component set that way on a branch or a clone after a calculation gets the cap split. After raw holder writes or deletions, callsimulation.reset_calculations()before calculating again. If such an edit changes whether the split applies, the next formula that checks the split can raise a cache-reset error. PublicSimulation.delete_arrays()schedules a refresh before the next outermost calculation.Simulation.set_inputalso refreshes a branch before its next calculation when it stores a data-year type or age input there while the branch's parent is calculating. Where all three components are already cached, Core can calculate State Pension without rechecking whether the split applies.When the model detects a data-year type or age cause, it turns the split off for everyone, even when no row's type changes. The check covers redefinitions in d of
state_pension_type,is_SP_age,months_since_state_pension_age,state_pension_age,is_male,age,date_of_birth,months_since_last_birthdayandgender. In a simulation built from a dataset, it also coversperson_id,person_weightandhousehold_weightwhen Core reads no non-derivedmonths_since_last_birthdayfor d on the simulation's branch. It compares the State Pension age timetable's active bracket structures, evaluated values and evaluation class in d, and the exact new State Pension start. In a simulation built from a dataset, it also checks inputs for d of the first eight variables written after the dataset loads throughSimulation.set_inputorHolder.set_input. It counts such an input only where Core reads it for d and can replay it. The check does not count dataset columns for those variables. The warning names the first cause the model detected. Three examples, each tested: an undated State Pension age of 90 (1,080 months) for men born before 6 December 1953 (Pensions Act 1995, Schedule 4, rule (1)), no new State Pension before 2101, and a redefinedis_SP_age. Under each, the model pays what it pays without the inputs, in d, d + 1 and d + 6. The definition check compares an Enum by its members, since Core loads each variable file as a module of its own and its Enum classes differ from an import's. The new State Pension start now comes from one helper (new_state_pension_start), which the type formula and the check share.Drop both inputs to use the cap split. To keep the split, date an override of the existing male pension-age parameter to take effect after d, for example
2026-01-01.2100-12-31for a 2024 data year. A scalar applies from 2023 in a reform dict and from 2000 throughReform.from_dictorparameter_changes. In a reform dict orparameter_changes, a bare year key such as"2026"covers fiscal year 2026 only; throughReform.from_dict, it applies from 1 January 2026 onwards. Only the reformed simulation turns the split off, so the reform's change from the baseline also holds the gap between the split and the cap split; the warning says so, and the inputs' docs give both remedies above. The model keeps the split for a 2024 or 2025 data year under a reform from 2026 (tested).When the model detects no cause, it still checks each pair against the row's data-year type: it raises a
ValueErrorwhere a pair built for another type does not fit, and applies a pair that fits without a warning. An all-CPI pair (E1 = 0) can still fit when a different model version moves a row from BASIC to NEW or from NONE to BASIC or NEW, or when the row's type comes from a dataset column. In each year in which that row is over State Pension age and has its data-year type, the model pays the whole report as additional State Pension linked to September CPI. Build each pair with the model version that will read it, for the type that version gives the row in d. At31cb7cb35, the model retyped a NONE row with no error or warning under anis_SP_ageinput for 2024 and under anis_malereform for 2015. When the model detects a cause, it uses the cap split and warns once per simulation and data year (departure 10). During construction, the July 2025 Universal Credit setup can calculate State Pension before a standard post-load modifier runs, so the model can refuse a pair that does not fit even where it would turn the split off once the modifier has run.With no inputs, the model differs from main in three ways (With no inputs, above). At
7a9190128it returned values for the three arrays where main raisesTypeError. A report of −0.0 gives +0.0 new State Pension to a person whose type is not NEW. And the caps and the age addition come fromprocessed_parameters()where main read the attached baseline simulation, or the reformed simulation's own parameters during the July 2025 Universal Credit setup, before the baseline is attached (departure 1).Open items
simulation.reset_calculations()before calculating again (departure 9).is_maleredefinition, a trackedis_SP_agestore or a State Pension age-scale evaluation change, it turns the supplied split off, and its warning names the cause. Where the model detects no cause, as when a row's type comes from a dataset column or a different policyengine-uk version, it still checks the pair: it raises aValueErrorif the pair no longer fits and applies the pair without a warning if it still fits.quantity_typeturns the split off (departure 6). This errs toward the cap split.Tests
policyengine_uk/tests/test_state_pension_legal_split.pycovers:is_malewith and without retyping,date_of_birth, a scale evaluation-mode change, changed and equalis_SP_ageoverwrites, and the birthday-storage cases for ID, weights, gender andmonths_since_last_birthday;derived=True, a component set on a branch or a clone after a calculation, a reform that neutralises a component, one that abolishes it throughgov.abolitions, a stored component's warning, given once and raised on each calculation under anerrorwarnings filter, and inputs for other years;no_economic_assumptions, a split that pays half the frozen rate plus its add-on, below the cap split;test_supplied_inputs.py, every variable's calculation definition, alike in two systems;Test runs
The table below records historical runs at
c3b7178ad.uv.lockpin)test_state_pension_legal_split.pytest_state_pension_components.pytest_state_pension_age.pytest_supplied_inputs.pytest_supplied_input_tightening.pytest_state_pension_reported_weeks.pytest_carer_support_payment.pytest_carer_overlapping_benefits_properties.pytest_uc_state_pension_properties.pytest_state_pension_rate_rounding.pytests/policy/baseline/gov/dwp)Each of these changes, made one at a time on Core 3.34.9, failed the test written to catch it:
The date-range remedy and the bare year key behave as departure 10 says on all three routes (a reform dict,
parameter_changesandReform.from_dict).ab68e0142, the head, is one commit on6680fd92f. With it, the model keeps the split under two equivalent age timetable edits, turns the split off for a type or age input written after loading throughHolder.set_input, refreshes a branch that gets a type or age input throughSimulation.set_inputwhile its parent is calculating, and warns once on each simulation that calculates the affected split. The commit also updates the inputs' docs and the changelog. These runs used Python 3.13.5 and Core 3.34.9 (theuv.lockpin). The 12 selected tests are the new regressions and their controls:6680fd92ftest_state_pension_legal_split.py, 12 selected regressions and controlsab68e0142test_state_pension_legal_split.py, the same 12ab68e0142test_state_pension_legal_split.pyab68e0142test_state_pension_components.pyab68e0142test_state_pension_split_storage.pyab68e0142test_state_pension_age.pyab68e0142test_state_pension_reported_weeks.pyab68e0142test_state_pension_rate_rounding.pyab68e0142test_supplied_inputs.pyab68e0142test_supplied_input_tightening.pyab68e0142test_carer_support_payment.pyab68e0142test_carer_overlapping_benefits_properties.pyab68e0142test_uc_state_pension_properties.pyab68e0142policyengine_uk/testsab68e0142tests/policy(591 files)ab68e0142tests/policy/baselineab68e0142tests/policy/baseline/gov/dwp)ab68e0142ab68e0142tests/policy/integrationab68e0142tests/policy/reformsAt
ab68e0142, the 106 skips are 60 parameter cases intest_dwp_published_rates.pywith no uprating or a series that ends before 2026-27, one test that needs the optionalpolicyengine_bundlespackage, and 45 tests that need survey data. The expected failure is #1947.Cost: with a pair set to the inputs' own defaults, a fresh simulation of the 240 grid records calculating State Pension from 2024 to 2032 took 0.88 times as long as without it (median of five runs in one process, the run without the pair first in each, at
7a9190128).🤖 Generated with Claude Code