Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/1124-uk-local-doctrine.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The UK local doctrine moves to 2,000 epochs and the `nation_grain_family_equal_sqrt_count` target-weight rule and keeps K=15 clones (microcosm#1124; rulings of 2026-10-13), so the dense role's defaults and a release candidate's pinned posture follow, and the release pre-flight checks the ruled values. A sized dense build (`--dataset-households`) defaults to an exact-count draw at π_hi 0.5, a refit baseline floor of 0.5 and a chi-square refit L2 penalty toward uniform weights at λ 0.0216 when the request leaves them unset; explicit values still win.

The local release can now ship the 100,000-household selection instead of the whole pool. A release candidate may request `--dataset-households 100000` when it carries the size doctrine (`local_doctrine.uk_local_size_doctrine`): those settings, no selection L2 penalty, drawn with the solve seed and selected afresh rather than resumed from a size checkpoint. Any other size or setting is refused, and stays candidate-only. Such a build is releasable on the dense line's requirements, with no matched-size scorecard: every release-blocking gate, the rotated holdout (each fold reruns the size selection, its budget search starting from the main search's `--selection-initial-lambda`), and the incumbent-surface evaluation on one engine over the released file. The pre-flight also checks the size receipt: requested and realized 100,000 households, under the doctrine's settings.
7 changes: 7 additions & 0 deletions changelog.d/1124-uk-local-release-gates.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Three release-blocking gates that failed on the first K=25 local candidate for reasons of policy, not fit, now have reviewed answers (microcosm#1124; María's rulings of 2026-10-13).

- **Line-scoped exclusions.** A reviewed exclusion may name `release_lines` (`national`, `local`), the lines whose evidence earned it. A gate context declares its line (`release_line`): the full build declares `local`, and the national gate kernel and the release-cut certifier declare `national`. On any other line, and wherever a context declares no line, a scoped entry stands aside: it neither suppresses a failure nor reads as stale, and the gate details name it. Unscoped entries behave as before everywhere, and unscoped receipts keep their policy payload. The four schema-2 exclusion gates (degenerate surface, target fit, input-mass parity, QRF tail) honour it.
- **`uk_qrf_tail_concentration`.** The `charitable_investment_gifts` exclusion is scoped to the national line, where it was earned. On the K-clone local pool the gate counts clone rows, so the column sits below the threshold and the entry read as stale.
- **`uk_degenerate_release_surface`.** `household.atomic_area_basis` is constant at `assigned` by construction on the local line; it gets a local-line exclusion and stays in the export as assignment provenance (microcosm#932).
- **One engine block per clone.** The local release pre-flight accepts an engine resolved per clone when the build recorded the pool representation exact (identical copies scaled to the pool), as `release_verdict` and the runbook already did. The record now states what exact covers (`exact_scope`): the weight-share scaling, not engine draws that depend on a record's position, which can differ between per-clone and single-block runs. The incumbent-surface evaluation still requires one block, re-measures the released file on it and fails release on any row more than 25% from its target, so the shipped file's fit is gated on the engine a consumer runs.
- The dense runbook passes the national line's licensed `--input-mass-reference`.
1 change: 1 addition & 0 deletions changelog.d/1124-uk-local-scorer-graph-selection.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`tools/score_uk_local_candidate.py` scores graph-built candidates again. It reads the candidate's target selection (the manifest's `outputs.target_registry`, national and local rows together) and keeps its local rows; a registry artifact still loads as before. Its frozen count is re-pinned to 21,804, the compiled local reference count of the #1123 surface on the 942a1fa feed (it was 20,885 from before #1123). Every current candidate failed both checks, and assembly requires the score receipt. Found by the f1 smoke of the local release path.
1 change: 1 addition & 0 deletions changelog.d/1124-uk-problem-kernel-identity.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK local solve binds the row-metadata target-weight rules end to end (microcosm#1124): `prepare_uk_full_solve` computes a `grain_family_equal` or `nation_grain_family_equal` (or `*_sqrt_count`) vector from the row carrier of its own targets and keeps the carrier on the prepared solve, the rotated holdout weights its held rows through the same carrier, and the graph problem binds a `target_loss_weight_receipt` (shares by grain, family and nation, and the vector's digest) that the build manifest copies into `solve`. The dense posture, the CLI choices, the holdout diagnostics schema and the candidate scorer admit the new names; the national role refuses them, and release candidates refuse every rule but the doctrine's. The `uk.full.problem` kernel's implementation hash now also covers `local_rowwise`, `national_doctrine` and `target_weights`, where its loss weights are built, so an edit to those modules re-keys the problem instead of replaying a stale vector; the rotated-holdout kernel's hash covers the doctrine and rule modules for the same reason.
3 changes: 3 additions & 0 deletions changelog.d/1124-uk-qrf-tail-surface.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The UK QRF tail-concentration gate no longer checks the report columns `spi_benefit_coherence` (microcosm#1100) replaces on every SPI-channel row. The stage zeroes the income-tested legacy reports (contributory and income-based JSA, Income Support, Working and Child Tax Credit, income-related ESA, Severe Disablement Allowance) and restores IIDB, AFCS and bereavement support from the FRS twin. After it these columns hold only FRS respondents' own reports, so the donor-tail broadcast the gate looks for (#462) cannot occur in them; their concentration is that of a small population of genuine reporters and their clone copies. The surface reads the superseded columns from the stage's declared operations and lists them in its details as `superseded_by_spi_benefit_coherence`.

`hmrc_spi_other_income` and `hmrc_spi_taxable_termination_pay` stay on the surface: they are real stage-1 draws. They failed national release-cut certification as genuinely concentrated instruments, rare on the SPI tape, whose top 100 records carry nearly their whole mass whether counted by row or by independent record; the CGT clones and SPI copies also take them past the carrier floor. They are deferred behind national-line reviewed exclusions, time-boxed to 2027-01-14, until the gate is re-armed on independent draws (microcosm#1277).
1 change: 1 addition & 0 deletions changelog.d/1124-uk-refit-best-iterate.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK size refit now keeps its best epoch on the objective it minimizes (microcosm#1124). With an L2 penalty the shared solver used to return the closing state, because its best-iterate rule tracked the target loss alone. `calibrate` and `refit_l0_selection` gain `retain_best_objective`: with `l2_lambda > 0` on the plain Adam path (free mass, no L0) the solve returns the epoch with the lowest target loss plus the weighted penalty, recorded as `options["iterate_selection"] == "best_feasible_objective"`. It is off by default, so other solves are unchanged; the UK refit turns it on, since under the 100,000-household release its weights are the released weights.
1 change: 1 addition & 0 deletions changelog.d/1124-uk-size-stage-l2-wiring.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`microcosm-build-uk --dataset-households` runs take the size stages' L2 penalties from the command line (microcosm#1124): `--selection-l2-lambda/--selection-l2-anchor/--selection-l2-basis` for the informed L0 search and `--refit-l2-lambda/--refit-l2-anchor/--refit-l2-basis` for the exact-count refit (chi-square basis; anchors `initial` and `uniform`). Each requires `--dataset-households` and is refused by the national role. A release candidate may carry only the size doctrine's refit penalty and no selection penalty (`rowwise_cli.size_doctrine_drift`), and the pre-flight fails on any other recorded penalty. `UKGraphCalibrationConfig` carries them as `selection_l2`/`refit_l2`: the selection penalty joins the search, draw and refit node parameters, the refit penalty the refit node's alone, and the rotated holdout re-solves each fold under both. An off penalty adds no node parameter, no run parameter and no identity field, so default builds keep their node keys' parameters, manifests and checkpoint identities.
1 change: 1 addition & 0 deletions changelog.d/1124-uk-size-stage-l2.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK dataset-size search and refit each take their own L2 penalty (microcosm#1124): `select_uk_dataset_size` gains `selection_l2_lambda/anchor/basis` and `refit_uk_dataset_size` also `refit_l2_lambda/anchor/basis`, validated by `uk_size_l2` (chi-square basis only, since the record basis only shrinks mass under free mass; anchors `initial` and `uniform`, where the refit's `initial` is the normalized, optionally floored Horvitz–Thompson baseline). An off penalty passes no L2 keyword to the solver, so default runs, their solver options and their size receipts are unchanged; an on penalty is receipted (`selection_l2`, `refit_l2` with the chi-square distance to its anchor, `refit_iterate_selection`). A reused selection must have been searched under the requested L2 and loss weights; a full-pool size refuses size-stage settings. The size checkpoint binds `selection_l2` in its identity only when it is on, so existing checkpoints keep loading, and its loader and writer check it against the search's own options. A typed `UKStageTargetWeighting` seam runs either stage under a named rule other than the dense solve's (the size-experiment harness; graph builds never pass it), and `UKSizeDraw.from_payload` parses a stored draw for the refit node and the harness alike.
1 change: 1 addition & 0 deletions changelog.d/1124-uk-target-weight-rules.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Four named UK local target-weight rules that read row metadata beyond the grain (microcosm#1124): `grain_family_equal` (equal grain shares, then equal family shares inside each grain), `nation_grain_family_equal` (a fourth `nation_region` grain for every national row below the UK-wide aggregates, splitting on the new shared `UK_WIDE_GEOGRAPHY_IDS`), and a `*_sqrt_count` variant of each that shares a cell's count budget by the square root of the target value while keeping every grain, family and cell budget. They are computed in `uk_runtime.target_weights` from one row-aligned carrier (`UKTargetRows`) built identically from declared targets and from a stored ordered problem, with a weights digest and a share receipt by grain, family and nation, and a typed stage seam (`UKStageTargetWeighting`) for the size experiments. `uniform` and `grain_equal` are unchanged bit for bit. `nation_grain_family_equal_sqrt_count` is the doctrine's rule (`1124-uk-local-doctrine.changed.md`), and release candidates refuse every other rule.
1 change: 1 addition & 0 deletions changelog.d/882-uc-housing-element-renewal.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `dwp.uc.households_housing_element` measure exclusion is renewed for one month, to 2026-11-14 (microcosm#882; renewed by juaristi22 on 2026-10-14 for the microcosm#1124 local release): the model still has no other/unknown tenure, so DWP's any-tenure housing-element count stays structurally above the bound social and private tenure rows.
1 change: 1 addition & 0 deletions changelog.d/telemetry-emitter-startup-timeout.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The UK build's telemetry emitter adapter now waits up to 15 seconds, rather than 3, for the local emitter service to become ready. The service took about four seconds to start on an M1 Max even with a warm cache, so every build on such a machine fell back to local-only telemetry. The value is a ceiling: a faster start is not delayed.
1 change: 1 addition & 0 deletions changelog.d/uk-full-inspection-export.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`microcosm-build-uk --release-role dense --inspection-export` exports, packages and stages a candidate's H5 for inspection even when a structural full-build gate blocks the artifact. It is candidate-only (refused with `--release-candidate` and by the national role), records `inspection_export` in the request, the export descriptor and the manifest parameters, leaves the bundle unreleasable and keeps the blocked exit status. The kernel lives in `uk_runtime.inspection_export`, so default node keys are unchanged.
16 changes: 8 additions & 8 deletions docs/evidence/spec-engine/us-f0-coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1656,13 +1656,13 @@
"compiler_ir.node_slices"
],
"expected": {
"map_sha256": "41a64b8820bf161e316c49e3f2b666a247b58f6f6d50dd4395b89c8f5b1399f6",
"protocol_sha256": "0e4c8a4ace5e10747065669a009691d0eee9179ca42b344f8912c5ca239ebde6"
"map_sha256": "1efa1551b0711e69fd89e5fbfa00384a209a158989bcc830b594b93a1c5a71fc",
"protocol_sha256": "73cd2b524a057e74620e48072edaf192d158e29b6358c6ff59af6eeac46a4269"
},
"failures": [],
"observed": {
"map_sha256": "41a64b8820bf161e316c49e3f2b666a247b58f6f6d50dd4395b89c8f5b1399f6",
"protocol_sha256": "0e4c8a4ace5e10747065669a009691d0eee9179ca42b344f8912c5ca239ebde6"
"map_sha256": "1efa1551b0711e69fd89e5fbfa00384a209a158989bcc830b594b93a1c5a71fc",
"protocol_sha256": "73cd2b524a057e74620e48072edaf192d158e29b6358c6ff59af6eeac46a4269"
},
"status": "covered"
},
Expand All @@ -1677,7 +1677,7 @@
"compiler_ir.seed_stream_map"
],
"expected": {
"implementation_sha256": "0e4c8a4ace5e10747065669a009691d0eee9179ca42b344f8912c5ca239ebde6",
"implementation_sha256": "73cd2b524a057e74620e48072edaf192d158e29b6358c6ff59af6eeac46a4269",
"protocol": "legacy-v1",
"streams": [
"build_model",
Expand All @@ -1698,7 +1698,7 @@
},
"failures": [],
"observed": {
"implementation_sha256": "0e4c8a4ace5e10747065669a009691d0eee9179ca42b344f8912c5ca239ebde6",
"implementation_sha256": "73cd2b524a057e74620e48072edaf192d158e29b6358c6ff59af6eeac46a4269",
"protocol": "legacy-v1",
"streams": [
"build_model",
Expand Down Expand Up @@ -2599,7 +2599,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "3080fe938df62216dc4853c1163639817de3c537e0e932309642fbd3f7d8f266"
"spec_sha256": "4d08ff77d2118ec4f7d63fcf17983f774b9d1142b0b8308bfdc30767ece76f1f"
}
},
"report_schema_version": 3,
Expand All @@ -2609,7 +2609,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "3080fe938df62216dc4853c1163639817de3c537e0e932309642fbd3f7d8f266"
"spec_sha256": "4d08ff77d2118ec4f7d63fcf17983f774b9d1142b0b8308bfdc30767ece76f1f"
},
"status": "pass"
}
3 changes: 3 additions & 0 deletions docs/shared-constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ and build packages. It currently defines:
- `UK_REGION_TIER`, `UK_REGION_TIER_ENUM` and `UK_LADDER_NATION_REGION_CODES` (the
twelve-area region tier UK national references fan out over, its spine
`region` enum names, and the ladder's nation pseudo-codes; microcosm#905)
- `UK_WIDE_GEOGRAPHY_IDS` (the K-prefixed UK-wide aggregates among
`UK_GEOGRAPHY_ID_TO_LABEL`, which the nation grain of the UK target-weight
rules splits on; microcosm#1124)
- `US_STATE_FIPS_TO_POSTAL`
- `US_STATE_NUMERIC_FIPS_TO_POSTAL`
- `US_STATE_POSTAL_TO_NUMERIC_FIPS`
Expand Down
30 changes: 21 additions & 9 deletions docs/uk-dataset-size-plan-355.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on [#870](https://github.com/PolicyEngine/microcosm/pull/870)'s branch. The PR i

## Decisions retained

(2026-10-13: microcosm#1124 moved the local doctrine to 2,000 epochs and
`nation_grain_family_equal_sqrt_count`, kept K=15, and gave sized builds the
defaults π_hi 0.5, refit floor 0.5 and a uniform refit L2 penalty; see
`uk_runtime/local_doctrine.py`. The values below are this plan's, as decided.)

- Pool generation keeps clone count **K=15**. Requested output households is a
different parameter, applied after cloning and materialization.
- The joint surface retains national, constituency and local-authority rows,
Expand Down Expand Up @@ -175,15 +180,22 @@ Three should-fix items and two questions changed the machinery:
- **Zero-valued targets are counted.** `zero_target_rows` in the size receipt says how many compiled rows
carry a zero target, the case where the contribution prior uses a unit denominator.

## Certification and publication still required

The implementation produces **candidates**, not a new certified UK default.
A size request refuses `--release-candidate`, and its manifest records
`releasable=false` even if the diagnostic gate run passes. The dense assembler
must not interpret a compact candidate as the already reviewed dense line.
The existing registry, production pointers and pe.py default are unchanged.

Before any size can be promoted:
## Certification and publication

**Ruling of 2026-10-13 (microcosm#1124):** the local release ships the
100,000-household selection under the dense line's publication requirements
(every release-blocking gate, the rotated holdout, the pre-flight and the
incumbent-surface evaluation on one engine over the released file). The whole
pool is too large for one engine and for the consumers who load the file. A
release candidate may request exactly that size with the size doctrine
(`local_doctrine.uk_local_size_doctrine`); the pre-flight checks the size
receipt, and the assembler takes the sized candidate on the same contract. The
matched-size scorecard and promotion protocol below are no longer required for
that size; they stay the route for any other size, which remains candidate-only
with `releasable=false`. The existing registry, production pointers and pe.py
default are unchanged.

Before any other size can be promoted:

1. Run the licensed full-input build, retain all gate failures and measure
local ESS and fit. A nominal 50k size is not guaranteed to clear the floors
Expand Down
Loading
Loading