Skip to content

Add annual mortality graph trajectories with isolated evaluation - #436

Draft
MaxGhenis wants to merge 2 commits into
population-graph-slice-20260904from
dynamics-mortality-trajectory-20260909
Draft

Add annual mortality graph trajectories with isolated evaluation#436
MaxGhenis wants to merge 2 commits into
population-graph-slice-20260904from
dynamics-mortality-trajectory-20260909

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The optional mortality graph currently adds only one future period. This adds run_mortality_trajectory to fit once and project through an explicit end year, retaining every person-period, original identity, survivor weight, and lineage. Each annual application uses the existing Dynamics mortality and ageing operations with person/year-keyed draws.

Annual evaluation reads a typed snapshot of the actual materialized population. Its separately declared synthetic holdout cannot affect subsequent simulation or cache keys. Unsupported ages produce typed failure evidence and guarded descendants that preserve the latest valid population; reports distinguish application failure from the pinned executor's actual execution/cache receipts. Extending the horizon reuses earlier graph nodes and the fitted model.

This PR is stacked on draft #420. It retains the exact tested graph/Frame pin 3ff92b0aea14407d09479bff5623dc7d1a92d008; the related core contracts are under review in PolicyEngine/microcosm#873 and PolicyEngine/microcosm#893 and must be reconciled before landing. It does not change the M6 loop, mortality law, scientific gates, Q5 source-workflow pin, or historical evidence. One exact source exclusion plus import-reachability coverage keeps this optional module outside the historical birth-evidence identity.

Validation:

  • 88 focused tests passed: 28 new annual graph cases, 57 existing graph/refit/step cases, and 3 exact historical identity/import-reachability checks. Inputs are synthetic; no native-data evaluation was run.
  • Independent review found no remaining actionable findings after adding malformed-prerequisite and blocked model/ageing/holdout regression checks.
  • Scoped Black (79 columns), Ruff, and whitespace checks passed. Test-tier counts are updated. Both validation workflows now accept PRs against feature branches, so stacked PRs receive checks; the deployment job still requires a push to master. CI runs the annual graph on Python 3.13 and 3.14 with the exact graph extra.

Limits: this is synthetic engineering, not a DynaSim score or scientific/national projection certificate. Full-history snapshots have not been benchmarked at national scale. Household accounting, births, immigration, calendar-year mortality improvement, and the full M6 loop are outside this graph. Root creation, fitting, store corruption, and unexpected structural errors can still abort execution; retained diagnostic export covers application and evaluation failures.

@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
social-security-model Ready Ready Preview Sep 9, 2026 4:56pm UTC

Request Review

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.

1 participant