Skip to content

v2 report app: comparison-path US national baselines never load the precomputed baselines #1137

Done

Description

@anth-volk

What happens

Since #1072 (released 2026-11-17 09:16 UTC), the v2 report app's comparison-path reports never load their US national current-law baseline from the precomputed baselines. Every baseline region-group segment computes a cache key the precompute never stores, misses, and calculates the baseline. These reports are the shadow comparisons with production jobs and the operator-only POST /internal/stage12/reports, which carry all production US national traffic. Production telemetry recorded 752 baseline segment misses and 1 hit from 2026-11-16 to 2026-11-26.

Cause

The cache key (stage12_cache/keys.py, Stage12BaselineCacheIdentity) includes the SHA-256 of the child's output plan.

  • Let Stage 12 report runs share simulation runs, each storing its own simulation's output #1072 changed stage12_cache/precompute_planning._planned_pair to plan the precomputed baselines with resolve_simulation_output_plan, the plan every run of the simulation stores. That plan adds person.self_employment_income and person.weekly_hours_worked, the inputs .py's labour-supply output reads.
  • The report-run coordinator (ReportRunCoordination) gives each child that stored plan, so its baselines match.
  • The comparison-path coordinator (ReportCoordination) gives each child the report's own plan (CoordinationCore.child_output_plan returns resolve_report_output_plan(report)), so its baselines never match.

Computed offline from the installed bundle for a US national 2026 report raising the CTC base amount to $3,000 (region group 0): the comparison path's baseline segment identity is stage12-bl1-6bf58faeedaedc36, and the precomputed one is stage12-bl1-928929ee9ffcc2a4.

Cost

Measured from production telemetry: a hit saves about 470 segment-seconds of compute and about 58 s of the baseline simulation's elapsed time per current-law US national report.

Fix

ReportCoordination gives its baseline the baseline's stored plan whenever that plan holds every column the report reads from the baseline (side_read_plan), and keeps the report's plan otherwise (for example include_cliffs reports). The reform keeps the report's plan. The shared aggregation already reads a side stored under its own plan, as the report-run path has since #1072. The stored files are reused, so no precompute run is needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions