Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
147ca33
salvage: sol tranche-1 in-flight coverage work at backend disconnect …
MaxGhenis Jul 10, 2026
b6e5836
wip: salvage sol tranche 2 in-flight tips-family work (backend discon…
MaxGhenis Jul 10, 2026
0c7bbfb
wip: salvage sol tranche 3 — tips family with passing full suite (aut…
MaxGhenis Jul 10, 2026
c152211
wip: salvage sol tranche 4 in-flight work (model capacity outage)
MaxGhenis Jul 10, 2026
34a71f2
Salvage shadow-repo tranche work: overtime/FLSA family verified green…
MaxGhenis Jul 10, 2026
59ce9af
wip: babysitter salvage after run 1 exit
MaxGhenis Jul 10, 2026
def6934
Restore eCPS retirement contribution inputs
MaxGhenis Jul 10, 2026
2810c58
Restore eCPS casualty loss input
MaxGhenis Jul 10, 2026
b8bca10
Restore eCPS miscellaneous itemized input
MaxGhenis Jul 10, 2026
f0f1567
Restore eCPS childcare input
MaxGhenis Jul 10, 2026
d12d1b5
Restore eCPS alimony inputs
MaxGhenis Jul 10, 2026
79ed389
wip: babysitter salvage after run 1 exit
MaxGhenis Jul 10, 2026
1dfb60e
Restore eCPS Section 199A input family
MaxGhenis Jul 11, 2026
d107403
Restore eCPS domestic production deduction input
MaxGhenis Jul 11, 2026
2f73b89
Restore eCPS child support input family
MaxGhenis Jul 11, 2026
d67fff3
Restore eCPS disability benefits input
MaxGhenis Jul 11, 2026
7f2230c
Restore eCPS educator expense input
MaxGhenis Jul 11, 2026
6c7e136
Restore eCPS health insurance premium input
MaxGhenis Jul 11, 2026
3846db7
Restore signed eCPS farm income inputs
MaxGhenis Jul 11, 2026
4dd269b
Document financial assistance source exclusion
MaxGhenis Jul 11, 2026
014571d
Restore eCPS SIPP vehicle inputs
MaxGhenis Jul 11, 2026
7766abf
Promote typed household weight coverage
MaxGhenis Jul 11, 2026
e98117c
wip: babysitter salvage after run 191114-1 exit
MaxGhenis Jul 11, 2026
73704c7
Complete eCPS Form 4952 input restoration
MaxGhenis Jul 11, 2026
201c7a3
Restore eCPS capital gain detail inputs
MaxGhenis Jul 11, 2026
9d54531
Restore eCPS relationship inputs
MaxGhenis Jul 11, 2026
02caadd
Document unavailable WIC nutritional risk input
MaxGhenis Jul 11, 2026
4b541cb
Restore eCPS retirement distributions
MaxGhenis Jul 11, 2026
8626d45
wip: babysitter salvage after run 081503-1 exit
MaxGhenis Jul 11, 2026
07805af
Complete retirement distribution support-base wiring
MaxGhenis Jul 11, 2026
7703c0d
Restore eCPS household net worth
MaxGhenis Jul 11, 2026
593db76
Keep exclusion evidence metadata declarative
MaxGhenis Jul 11, 2026
d297766
Restore eCPS housing and tenure inputs
MaxGhenis Jul 12, 2026
30e565e
Restore eCPS prior-year income inputs
MaxGhenis Jul 12, 2026
f2ed689
Restore eCPS SALT refund income
MaxGhenis Jul 12, 2026
b445f6a
Restore eCPS SPM energy subsidy
MaxGhenis Jul 12, 2026
5b20211
Reject stale bases missing latest eCPS inputs
MaxGhenis Jul 12, 2026
03b7d74
Document unavailable eCPS survivor benefits
MaxGhenis Jul 12, 2026
60a13e5
Document unavailable eCPS DC PTC take-up
MaxGhenis Jul 12, 2026
b3829fc
Restore measured eCPS Medicare take-up
MaxGhenis Jul 12, 2026
e10fc38
Document unresolved Head Start take-up sources
MaxGhenis Jul 12, 2026
4d3073a
Restore source-anchored housing assistance take-up
MaxGhenis Jul 12, 2026
fea7eb4
Document SSI and unemployment source dependencies
MaxGhenis Jul 12, 2026
ef45913
Restore eCPS workers compensation
MaxGhenis Jul 12, 2026
06b4e2a
Restore source-backed eCPS WIC claims
MaxGhenis Jul 12, 2026
9e2e94a
Restore measured eCPS voluntary filing
MaxGhenis Jul 12, 2026
36f3115
Restore eCPS SSI disability criterion
MaxGhenis Jul 12, 2026
58f8879
Restore source-calibrated eCPS SSI take-up
MaxGhenis Jul 12, 2026
a974a2d
Restore measured eCPS Head Start take-up
MaxGhenis Jul 12, 2026
db605e7
Restore eCPS weeks unemployed
MaxGhenis Jul 12, 2026
35982fc
Merge origin/main into buildm-ecps-coverage
MaxGhenis Jul 12, 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
51 changes: 51 additions & 0 deletions COVERAGE_PROGRESS.md

Large diffs are not rendered by default.

78 changes: 64 additions & 14 deletions experiments/build_j_recert/buildj_base.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash
# Build J STEP 1 — base pool rebuild on main's stages (populace#368 re-certification).
# Replicates Build F's base command EXACTLY on origin/main's base builder
# (byte-identical to Build F's tools/build_us_puf_support_base.py) to (a) satisfy the
# #368 "base pool rebuild" step and (b) EMPIRICALLY confirm determinism. The SNAP
# (#350/#352/#353) and SCF-wealth (#373) enrichments are RELEASE-TIME source stages
# (us_runtime/*), NOT base-builder stages, so the base sha is expected == Build F's
# 18833fb6 (documented finding vs the task's "new base sha expected" premise).
# Build J STEP 1 — rebuild the current source-staged base pool.
# The branch now restores CPS/ACS housing inputs in the reusable base builder,
# so Build F's pre-housing base and any pre-prior-year-income base are stale.
# Cache reuse is allowed only when every newly restored persisted leaf carries
# signal.
#
# Compute discipline: ~12 min (Build F was 12m14s), one chunk (<30 min). Detached via
# setsid+caffeinate; pidfile + real rc + append log + memory-pressure sampler.
Expand All @@ -27,28 +25,71 @@ TS=$(date -u +%Y%m%dT%H%M%SZ)
PLOG="$LOGDIR/pressure_base_$TS.log"
mkdir -p "$LOGDIR" "$OUTDIR"
say() { echo "[$(date -u +%FT%TZ)] $1" | tee -a "$LOG"; }
base_has_restored_signal() {
.venv/bin/python -c '
import sys
import pandas as pd

required = {
"person": (
"pre_subsidy_rent",
"self_employment_income_last_year",
"previous_year_income_available",
"salt_refund_income",
"takes_up_medicare_if_eligible",
"workers_compensation",
"would_claim_wic",
),
"spm_unit": (
"receives_housing_assistance",
"takes_up_housing_assistance_if_eligible",
"spm_unit_tenure_type",
"spm_unit_energy_subsidy",
),
"household": ("tenure_type",),
}
try:
with pd.HDFStore(sys.argv[1], mode="r") as store:
tables = {
entity: store.select(entity, columns=list(names))
for entity, names in required.items()
}
except (KeyError, TypeError, ValueError):
raise SystemExit(1)
ok = all(
name in tables[entity] and tables[entity][name].nunique(dropna=False) > 1
for entity, names in required.items()
for name in names
)
raise SystemExit(0 if ok else 1)
' "$1"
}
rm -f "$LOGDIR/base.rc"

cd "$WT" || { say "FATAL cannot cd $WT"; echo 2 > "$LOGDIR/base.rc"; exit 2; }
source .venv/bin/activate 2>/dev/null

# ---- integrity preflight on inputs (reproduce Build F's exact base) ----
chk() { local got exp; got=$(shasum -a 256 "$1" | cut -c1-16); [ "$got" = "$2" ] || { say "FATAL sha mismatch $1: $got != $2"; echo 2 > "$LOGDIR/base.rc"; exit 2; }; }
for f in "$USD/census_cps_2024.h5" "$USD/census_cps_2023.h5" "$USD/census_cps_2022.h5" "$USD/puf_2024.h5" "$AGING_FACTS" "$CDX" "$BLADDER"; do
for f in "$USD/census_cps_2024.h5" "$USD/census_cps_2023.h5" "$USD/census_cps_2022.h5" "$USD/puf_2024.h5" "$USD/acs_2022.h5" "$AGING_FACTS" "$CDX" "$BLADDER"; do
[ -f "$f" ] || { say "FATAL missing input $f"; echo 2 > "$LOGDIR/base.rc"; exit 2; }
done
chk "$AGING_FACTS" a5d34d4aad325d8c
chk "$CDX" 383a666631aafd4f
chk "$BLADDER" 7ba39b959068181b
chk "$USD/acs_2022.h5" 0b319b496f19a691

SHORT=$(git rev-parse --short HEAD)
PEUS=$(.venv/bin/python -c "from importlib.metadata import version; print(version('policyengine-us'))" 2>/dev/null)
say "BUILD J BASE START commit=$SHORT pe-us=$PEUS pid=$$ pressure_log=$PLOG"
say " inputs: asec 2024/2023/2022 + puf_2024; aging-facts a5d34d4a; cdx 383a6666; bladder 7ba39b95; seed 0 n-est 32"
say " inputs: asec 2024/2023/2022 + puf_2024 + acs_2022; aging-facts a5d34d4a; cdx 383a6666; bladder 7ba39b95; seed 0 n-est 32"

if [ -f "$BASE" ]; then
say "BASE: already present at $BASE — verifying sha only (delete to force rebuild)"
if [ -f "$BASE" ] && base_has_restored_signal "$BASE"; then
say "BASE: already present with nondefault restored input surface at $BASE — reusing"
else
if [ -f "$BASE" ]; then
say "BASE: cached artifact is stale or restored-input-default-only — rebuilding in place"
fi
# ---- memory-pressure sampler (self-terminates on python exit; SAMPLE ONLY, no kill) ----
( echo "ts_utc,free_pct,swap_used_mb,py_rss_mb,py_pid"
while :; do
Expand All @@ -62,12 +103,13 @@ else
done ) >> "$PLOG" 2>&1 &
SAMPLER=$!

say "BASE: rebuilding (3-year ASEC pool 2024+2023+2022, 2x PUF clone, spec-less equal thirds)"
say "BASE: rebuilding (3-year ASEC pool 2024+2023+2022, pinned ACS 2022 rent donor, 2x PUF clone, spec-less equal thirds)"
.venv/bin/python tools/build_us_puf_support_base.py \
--asec-h5 2024="$USD/census_cps_2024.h5" \
--asec-h5 2023="$USD/census_cps_2023.h5" \
--asec-h5 2022="$USD/census_cps_2022.h5" \
--puf-h5 "$USD/puf_2024.h5" \
--acs-h5 "$USD/acs_2022.h5" \
--target-year 2024 \
--seed 0 --n-estimators 32 \
--ledger-facts "$AGING_FACTS" \
Expand All @@ -83,13 +125,21 @@ else
if [ $rc -ne 0 ]; then echo "$rc" > "$LOGDIR/base.rc"; say "BASE FAILED rc=$rc — diagnose in base_j.log"; exit "$rc"; fi
fi

if ! base_has_restored_signal "$BASE"; then
echo 2 > "$LOGDIR/base.rc"
say "BASE FAILED: output does not persist all restored nondefault inputs"
exit 2
fi

BASE_SHA=$(shasum -a 256 "$BASE" | cut -d' ' -f1)
echo "$BASE_SHA" > "$LOGDIR/base.sha"
say "BASE sha: $BASE_SHA"
if [ "$BASE_SHA" = "18833fb68e60ee74461608d81a5c5ab7d52435e17026d9e3b062d9de18d6871f" ]; then
say "BASE sha CONFIRMS Build F 18833fb6 — base pool unchanged (assets/SNAP are release-time source stages, not base-builder stages)"
echo 2 > "$LOGDIR/base.rc"
say "BASE FAILED: Build F's pre-housing SHA was reused"
exit 2
else
say "BASE sha DIFFERS from 18833fb6 — investigate before proceeding (base builder or deps changed the pool)"
say "BASE sha differs from pre-housing Build F as required"
fi
echo "0" > "$LOGDIR/base.rc"
say "BUILD J BASE DONE rc=0 sha=$BASE_SHA"
28 changes: 28 additions & 0 deletions packages/populace-build/src/populace/build/source_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,54 @@
"compute_ratio",
"declare_income_reference_offset",
"derive",
"derive_childcare_inputs",
"derive_child_support_inputs",
"derive_disability_benefits",
"derive_energy_subsidy",
"derive_education_inputs",
"derive_eligibility_inputs",
"derive_hours_worked",
"derive_housing_tenure_inputs",
"derive_immigration_status",
"derive_medicare_take_up",
"derive_other_health_insurance_premiums",
"derive_prior_year_income",
"derive_snap_abawd_discretionary_exemption",
"derive_snap_take_up",
"derive_puf_policyengine_variables",
"derive_mortgage_balance_hints",
"derive_pregnancy",
"derive_relationship_inputs",
"derive_retirement_distributions",
"derive_retirement_contributions",
"derive_workers_compensation",
"derive_weeks_unemployed",
"derive_wic_claim",
"disaggregate_aggregate_records",
"fit_labor_market_models",
"fit_tip_income_model",
"fit_weighted_acs_rent_qrf",
"fit_vehicle_model",
"fit_weighted_imputer",
"fit_weighted_qrf",
"fold_into",
"head_carry",
"join",
"impute_retirement_contributions_to_puf_support",
"impute_childcare_to_puf_support",
"impute_child_support_to_puf_support",
"impute_disability_benefits_to_puf_support",
"impute_energy_subsidy_to_puf_support",
"impute_housing_assistance_to_puf_support",
"impute_other_health_insurance_premiums_to_puf_support",
"impute_prior_year_income_to_puf_support",
"impute_retirement_distributions_to_puf_support",
"impute_workers_compensation_to_puf_support",
"impute_weeks_unemployed_to_puf_support",
"map_columns",
"read_table",
"read_tables",
"read_acs_rent_donor",
"replace_sentinels",
"split_component_by_share",
"support_clip",
Expand Down
Loading
Loading