Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
288b2e3
Pin the bytes of the ACS local target surface on the pinned feed and …
juaristi22 Nov 26, 2026
e3e483d
Let a cross-grain rule declare how a control is divided (allocator hook)
juaristi22 Nov 26, 2026
bc8aa6a
Add the shared controls module beside the cross-grain operator
juaristi22 Nov 26, 2026
d1f62f9
Declare the US nesting mechanisms and add the adapter to the operator
juaristi22 Nov 26, 2026
6da6e3b
Make the district SOI shares on the shared cross-grain operator
juaristi22 Nov 26, 2026
55fa55c
Make the county rows on the shared cross-grain operator
juaristi22 Nov 26, 2026
c3dc13b
Declare the US nesting inventory, with docs and a coverage test
juaristi22 Nov 26, 2026
3aac702
Merge main into the US target nesting branch and re-pin the US F0 con…
juaristi22 Nov 27, 2026
350cd9d
Propose the US nesting rule for rulings (design page, no code)
juaristi22 Nov 27, 2026
17ee670
Record the nine nesting rulings and how they are declared in the UK's…
juaristi22 Nov 27, 2026
0358811
Restate how the nesting rulings are declared as one general model
juaristi22 Nov 27, 2026
947978c
Make the bound, the members and the bridge selector general in the op…
juaristi22 Nov 27, 2026
938c7fa
Annotate the adapter's parameters that the spine-blindness check read…
juaristi22 Nov 27, 2026
d91ae5b
Refuse a declared leg with no row, and hold the keys of a reconciled …
juaristi22 Nov 27, 2026
2264fb3
Put the US on the cross-grain model: the UK's key names, the operator…
juaristi22 Nov 27, 2026
0116515
Describe the US on the cross-grain model in the pages and the changelog
juaristi22 Nov 27, 2026
625c937
Record the ten rulings on the steps in the design page
juaristi22 Nov 27, 2026
6e76eae
Hold the county rows of the pinned county facts to the old code, and …
juaristi22 Nov 27, 2026
fa297a0
Declare the district bridge's bound on the county SOI bridge
juaristi22 Nov 27, 2026
f1c17c5
Hold each declared member one time, and compare more operator shapes …
juaristi22 Nov 27, 2026
bb6776f
Put back a lost district refusal, and tighten the US declaration and …
juaristi22 Nov 27, 2026
ff0b9fa
Refuse targets and district receipts that a materialize stage of olde…
juaristi22 Nov 27, 2026
672e829
Correct the pages after the review of the nesting PR
juaristi22 Nov 27, 2026
a8b9d2c
Merge main (be6a1983d) into the nesting branch, with the US F0 pins w…
juaristi22 Nov 27, 2026
ca5e864
Keep the district property test inside the operator's limit, and test…
juaristi22 Nov 28, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The US nests its local target rows on the shared cross-grain operator that the UK uses (`microcosm.build.cross_grain`), with no target change (microcosm#1760). The operator gains general options that the UK does not declare, so the UK outputs are the same; the UK graph hashes the file, so UK target nodes and the nodes after them compute again on the next UK run. The options: a bound of a bridge measured from the median factor, one-sided, that can unbind a leg; the declared members of a leg; bridge selectors; an optional `allocator`; and `cross_grain_metadata`, the keys of a reconciled row. The shared `microcosm.build.cross_grain_controls` holds the row-level pass (`reconcile_rows`) and the allocators that keep the US values bit for bit until the feed re-pin. `us/cross_grain_declarations.json` declares the US choices under the UK's key names (bridge selectors, a derived control, relations, local routes, members). `state_cd_soi_surface`, `with_county_populations`, `state_county_soi_surface` and `acs_household_surface` keep their names and signatures, and each target value on the pinned feed and ladder is the value it was. **The metadata keys change**: district and county rows carry `cross_grain_parent`, `cross_grain_value_before`, `cross_grain_factor`, `cross_grain_control` and `cross_grain_members` in place of the `state_cd_*` and `state_county_*` keys, and the district receipt takes the fields `bridge`, `level_bridge_out_of_band` and `factor_by_measure`. So the bytes of the `state_cd` registry, roles and receipts move. A refusal that the operator makes has the operator's text; the check that the district file agrees with itself is gone (the compile holds that sum); a concept with two parent sources is refused. The county SOI bridge declares the bound of the district bridge (1.25 around the median factor across states, unbind): a state outside it loses its county rows of that measure and the receipt names it; no state is outside it on the pinned county facts, so no county value changes. A later stage refuses targets or a district receipt that a materialize stage of older code wrote, and says to run `--stage materialize` again. The materialize stage also writes the operator's receipts to `target_nesting.json`. See `docs/us-target-nesting.md`.
20 changes: 10 additions & 10 deletions docs/evidence/spec-engine/us-f0-coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"country": "us",
"documentation_sha256": "fda6ec0dd925077f4d84d30a1c206dd81d82c5e16bd94506e81fe1b9f7e2f466",
"field_usage": {
"authored_normative_field_count": 32618,
"authored_normative_field_count": 32621,
"claim_count": 48,
"claims": [
{
Expand All @@ -16,8 +16,8 @@
"legacy_sinks": [],
"mode": "front_end_validation",
"pointer_class": "all",
"pointer_count": 113,
"pointer_sha256": "11b70807bf06832e71367643c7d0e09891c1d4923fe574b471d6632562129897",
"pointer_count": 116,
"pointer_sha256": "3a77833a2aee67d0f58a3dd972f947a79a24afc7c0ebc1821a0e8dd3cbf5771a",
"rationale": null,
"relative_sink_prefix": null,
"source_prefix": "/authored/country_package.json",
Expand Down Expand Up @@ -758,20 +758,20 @@
"verifier": "vintages"
}
],
"configuration_field_count": 42404,
"consumed_field_count": 42404,
"configuration_field_count": 42407,
"consumed_field_count": 42407,
"generation0_effect_counts": {
"legacy_behavior": 38780,
"no_generation0_effect": 3624
"no_generation0_effect": 3627
},
"mode_counts": {
"compiler_semantic": 27674,
"front_end_validation": 358,
"front_end_validation": 361,
"identity_only": 103,
"legacy_behavior": 14269
},
"multiple_primary_use_field_count": 0,
"pointer_inventory_sha256": "38fc67ba13d62a5c0eaff36abb8f04d4d2974e21baaed6d2966d76480e643608",
"pointer_inventory_sha256": "b7565bf43ff7139460a8345d3858a6950c4fdcf4cb61afe6b056550040b1c710",
"resolved_binding_field_count": 9786,
"unused_field_count": 0
},
Expand Down Expand Up @@ -2585,7 +2585,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "7e282f7fd459c63a25f1ad8b57fc88cb118088c353e81dce26080ad87f266375"
"spec_sha256": "be3d73636c7c4ed192ff1ba651cbc4dc31074e9c78da7351f6922a0cc2a90d83"
}
},
"report_schema_version": 3,
Expand All @@ -2595,7 +2595,7 @@
"country": "us",
"schema_id": "country_spec",
"schema_version": 1,
"spec_sha256": "7e282f7fd459c63a25f1ad8b57fc88cb118088c353e81dce26080ad87f266375"
"spec_sha256": "be3d73636c7c4ed192ff1ba651cbc4dc31074e9c78da7351f6922a0cc2a90d83"
},
"status": "pass"
}
17 changes: 16 additions & 1 deletion docs/us-acs-local-county-rung.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ shares and ACS county households, scores four held-out ACS county families,
gives every county a reliability grade, and moves a few same-PUMA households
into any county the staging frame leaves empty.

Since microcosm#1760 the three share mechanisms of the rung (county
population, county SOI shares, county households) run on the shared
cross-grain operator, through `us_runtime.target_nesting`, with their choices
declared in `us/cross_grain_declarations.json`. The tool functions keep their
names, and every row has the value it had. The metadata keys and the receipts
changed with microcosm#1760: the rows carry the operator's `cross_grain_*`
keys. See [US target nesting](us-target-nesting.md).

## Plan and invariants

- Population measures are household size times county membership. County
Expand Down Expand Up @@ -82,6 +90,13 @@ to USD in the county facts file; the county rung does not apply another scale fa
duplicate facts, negative or nonfinite shares, zero share denominators,
incomplete county inventories, incompatible boundaries, and missing or
ambiguous state parents. No unsupported concept receives a new engine measure.
A state whose factor (its state target over the sum of its county source
values) is more than 1.25 times its measure's median across states, or less
than 0.8 times it, loses its county rows of that measure: the receipt names
it under `bridge.unbound`, and its state target stays. This is the declared
bound of the county bridge in `us/cross_grain_declarations.json`, the same as
the district bridge's (see [US target nesting](us-target-nesting.md)). On the
pinned county facts no state is outside it.
Full runs also require the ladder to declare all 3,144 county-equivalents;
matching omissions from both ladder and SOI cannot pass as a complete release.
An ACS county family can later provide child targets with the same state-parent
Expand Down Expand Up @@ -345,7 +360,7 @@ The inspected Chronicle publisher inputs have two concrete issues:
share is Maui's published value over the state's published county sum, and
its households are those in either county. Kalawao keeps its own
population row (from the ladder, like every county's) and ACS rows. The SOI receipt records the merge under
`combined_cells`, and each Maui row carries `state_county_cell_members`
`combined_cells`, and each Maui row carries `cross_grain_members`
`15005,15009`. Any other county missing from SOI, a declared cell whose
host is missing too, or a declaration across states is refused.
- **Connecticut:** both packages use the nine planning-region codes `09110`
Expand Down
43 changes: 28 additions & 15 deletions docs/us-acs-local-soi-target-surface.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ storage](#target-matrix-storage) replaces this.
the TY2022 SOI congressional-district file (`22incd.csv`, record-set spec
`irs_soi.congressional_district_2022.all_returns.v1`), reconciled so that
every state concept has one vintage. The rule is
`us_acs_local_cd_surface.state_cd_soi_surface`.
`us_acs_local_cd_surface.state_cd_soi_surface`. Since microcosm#1760 that
function calls `us_runtime.target_nesting.district_soi_surface`: the shared
cross-grain operator divides each state row among its district rows, with the
choices below declared in `us/cross_grain_declarations.json`. Each row has the
value it had. The metadata keys and the receipt changed with microcosm#1760,
so the bytes of the surface moved. See
[US target nesting](us-target-nesting.md).

### One vintage per state concept

Expand Down Expand Up @@ -232,7 +238,7 @@ district rows, are mostly 1.00 to 1.10.
state's level. The factor band below drops those blocks.

`materialize_rss.json` records the full table under
`soi_surface.rebase_factor_by_measure`.
`soi_surface.factor_by_measure`.

### The factor band

Expand All @@ -255,16 +261,20 @@ bridge built on that sibling is trusted there:
bridge loses the bridged state row and its district rows
(`level_bridge_out_of_band:<measure>`).

Every failing verdict is recorded in the receipt under
`factor_band.out_of_band` with the verdict, its ratio, the median and the
relative gap. The band only judges finite positive ratios: a sibling whose
two levels differ in sign is a data defect and is refused outright. So is a
district file that disagrees with itself: wherever the file carries a state
row beside its district rows, the two must agree to 1e-6
(`STATE_CD_INTERNAL_RTOL`), since no median absorbs a column or crosswalk
defect inside the file. On the pinned feed all 2,193 blocks agree to float
precision (largest relative gap 4e-16; the receipt records it under
`internal_consistency`, and the feed-gated test pins it).
The band is the declared bound of the bridge between the two files
(`historic_table_2_state_vs_district_file` in
`us/cross_grain_declarations.json`), and the shared cross-grain operator
applies it (see [US target nesting](us-target-nesting.md)). The receipt
records each block that the bound takes off under `bridge.unbound`, with its
factor, and each distrusted bridge under `level_bridge_out_of_band`, with the
verdict, its ratio, the median and the relative gap. The band only judges
finite positive ratios: a sibling whose two levels differ in sign is a data
defect and is refused outright.

Until microcosm#1760 this stage also refused a district file whose own state
row was not the sum of its district rows. That check is gone: the compile
scales the district rows to that state row before this stage runs
(`reconcile_ledger_target_hierarchy`), so the sum holds by construction.

On the pinned feed the band drops eight:

Expand Down Expand Up @@ -309,9 +319,12 @@ amounts (median 1.062; the two above 1.25x the median are dropped) and
stamp, the sibling ratio shrinks with it. Its district rows keep their
within-state shares, as every other district row does.

Every district row records its parent (`state_cd_parent_target_name`), the
parent's basis, the district file's own value and the rebase factor; a
bridged state row records its sibling and bridge factor.
Every district row records its parent (`cross_grain_parent`), what
reconciled it (`cross_grain_control`), the district file's own value
(`cross_grain_value_before`) and the factor (`cross_grain_factor`). A bridged
state row records its sibling (`cross_grain_control` reads
`level_bridge:<sibling>`) and its bridge factor. These are the keys of every
row that the shared cross-grain operator reconciles.

### What stays off the surface

Expand Down
Loading
Loading