Skip to content

Coalesce sparse PE input aliases by row#173

Merged
MaxGhenis merged 1 commit into
mainfrom
codex/alias-coalesce-pe-inputs-20260602
Jun 2, 2026
Merged

Coalesce sparse PE input aliases by row#173
MaxGhenis merged 1 commit into
mainfrom
codex/alias-coalesce-pe-inputs-20260602

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Coalesce sparse PE income/input aliases row-by-row when the canonical export column exists but is zero and a source alias carries the value.
  • Applies to wage/employment income, self-employment income, taxable interest, dividend totals/components, and capital gains/LTCG inputs.
  • Preserves component-first dividend behavior while allowing total-only rows to populate non-qualified dividends instead of being masked by all-zero components.

Context

The post-#170 H5 passed export-column parity, but source alias inspection showed important PE input families were being zeroed whenever a canonical column existed sparsely. The sidecar audit showed this particularly on employment/wages, taxable interest, and dividends. This PR fixes that structural alias masking without changing calibration, robust-loss scoring, or the APG optimizer branch.

Tests

  • uv run --python 3.13 --extra dev python -m pytest tests/pipelines/test_us.py::TestUSMicroplexPipeline::test_augment_policyengine_person_inputs_coalesces_sparse_source_aliases_by_row tests/test_variables.py::test_normalize_dividend_columns_coalesces_sparse_total_aliases_by_row
  • uv run --python 3.13 --extra dev python -m pytest tests/pipelines/test_us.py::TestUSMicroplexPipeline::test_augment_policyengine_person_inputs_materializes_agi_parity_inputs tests/pipelines/test_us.py::TestUSMicroplexPipeline::test_augment_policyengine_person_inputs_coalesces_sparse_source_aliases_by_row
  • uv run --python 3.13 --extra dev python -m pytest tests/test_variables.py
  • uv run --python 3.13 ruff check src/microplex_us/pipelines/us.py src/microplex_us/variables.py tests/pipelines/test_us.py tests/test_variables.py

@MaxGhenis MaxGhenis merged commit 14c114a into main Jun 2, 2026
5 checks passed
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