Skip to content

Fix LIHEAP and Louisiana credit errors in mixed simulations - #10822

Draft
MaxGhenis wants to merge 3 commits into
mainfrom
liheap-la-credit-mixed-simulations
Draft

MaxGhenis wants to merge 3 commits into
mainfrom
liheap-la-credit-mixed-simulations

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Fix DC and Illinois LIHEAP payments and Louisiana's school readiness credit when simulations combine states or tax units. Each household keeps the amount it receives alone.

  • Clip DC's income key to the model's existing keys 1–10 before indexing the DC benefit tables.
  • Clip Illinois's income key to rows 1–4 before indexing the Illinois benefit tables.
  • Project Louisiana's tax-unit child care credit to each member before applying that child's facility rate and eligibility, then sum within the tax unit. Parents must calculate each child's credit separately under R.S. 47:6104.

Closes #10788

Invariants

  • All eight affected outputs equal their results for the same household alone, whatever other households share the simulation. The property checks arbitrary state mixes and tax-unit membership, plus explicit populations containing every state and multiple Louisiana tax units.
  • Existing state and eligibility masks continue to return zero outside their scope. The mixed-state YAML cases and property check these masks.
  • Valid matrix rows, expense caps and credit rates retain main's amounts. The full variable-named YAML files check existing policy cases and the new standalone examples.
  • Intended changes: the reported mixed populations calculate successfully, and explicit income keys outside a matrix use its nearest endpoint. YAML cases check DC keys 0/1/10/11 and Illinois keys 0/1/4/5.
  • Households outside the affected cases retain main's results.

Validation

  • dc_liheap_payment.yaml: 29 cases, including both new zero-mask controls.
  • il_liheap_base_payment.yaml: 25 cases.
  • il_liheap.yaml: two cases checking the total and both IHWAP eligibility outputs.
  • la_school_readiness_tax_credit.yaml: 14 cases, including both new no-child controls.
  • test_liheap_la_credit_mixed_simulations.py::test_households_keep_their_results_in_any_state_mix: one property passes with max_examples=8 and two explicit examples.
  • make format: passes with the pinned Ruff 0.15.5.
  • Mutation checks: removing DC's clamp produces one expected failure; removing Illinois's produces two; removing Louisiana's projection produces four failures and two passing standalone controls. All formulas restore successfully.

The YAML hand checks give DC min(904, 2,000) = 904, Illinois min(910, 2,000) = 910, and Louisiana 50 × 2 = 100 and 80 × 1.5 = 120.

Python checks population independence through separately constructed simulations, which fixed YAML examples cannot establish for generated compositions. The property uses eight generated populations and two explicit populations, including all 50 states and DC together.

Local macOS measurements include startup and wrapper overhead. The log's creation time and the memory report's completion time supply elapsed time.

Property run Core Wall seconds Peak GiB
Initial reproduction, fails at DC lookup 3.33.2 73.24 1.10
Complete passing check 3.34.2 132.51 1.56

The failing run stops before the population comparisons. The passing pytest session reports 65.43 seconds. The test shares the default model and retains result arrays, with at most 106 small simulations across the configured examples.

The existing rest-python core group will collect the property. On the base commit, its Linux CI chunks peaked at 6.478–8.794 GiB. These reports predate this addition; local single-file checks do not validate the full group. Base CI run.

PR checks skipped because this PR remains a draft. Full suites, partner checks and microsimulations await the hub and CI.

Methodology choices

  • Use existing endpoint rows as safe lookup keys before Core applies its masks. Synthetic out-of-range overrides test lookup robustness and introduce no eligibility threshold.
  • Project the sum of Louisiana's refundable and nonrefundable child care credits to each person before multiplying by that person's facility rate.
  • Use 2026 for the new cases. YAML supplies credit and child-eligibility inputs to isolate attribution; the property derives child eligibility from age and tax-unit membership.
  • Preserve existing parameters, eligibility conditions and expense caps. These implementation repairs require no new legal interpretation or source-conflict entry.
  • Expect no increase or decrease in previously valid household amounts. Mixed populations regain the existing payments; the hub will measure population effects.

axiom: n/a: repairs vectorized lookups and entity projection without changing encoded provisions.

Microsimulation impact

To be measured before merge.

Other open work

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits November 12, 2026 00:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant