Skip to content

Add --assume-w2-wages flag for QBID alignment with TAXSIM#710

Merged
PavelMakarchuk merged 4 commits intomainfrom
add-assume-w2-wages-flag
Feb 26, 2026
Merged

Add --assume-w2-wages flag for QBID alignment with TAXSIM#710
PavelMakarchuk merged 4 commits intomainfrom
add-assume-w2-wages-flag

Conversation

@PavelMakarchuk
Copy link
Collaborator

Summary

  • Adds --assume-w2-wages CLI flag to policyengine and compare commands
  • When enabled, sets w2_wages_from_qualified_business to a large value so the Section 199A W-2 wage cap never binds
  • Aligns PE's QBID calculation with TAXSIM's simplified S-Corp handling (flat 20% of QBI, no W-2/UBIA cap)

Context

TAXSIM deliberately skips the W-2/UBIA wage cap when processing scorp input, applying a flat 20% QBID. PE correctly implements the cap per IRS Pub 535 / Section 199A, but since TAXSIM doesn't provide W-2 wage data, w2_wages_from_qualified_business defaults to 0 — which zeroes out QBID for taxpayers above the income threshold ($170,050 single / $340,100 MFJ in 2023). This accounts for ~175 of 252 federal mismatches in CPS comparisons.

Test plan

  • 9 new tests in tests/test_assume_w2_wages.py covering:
    • Runner stores flag correctly, defaults to False
    • High-income S-Corp filers see reduced federal tax with flag
    • No-S-Corp records are unaffected by flag
    • Below-threshold S-Corp filers are unaffected
    • Output shape unchanged
    • CLI policyengine command accepts flag
    • CLI produces different output with flag for S-Corp records
  • All tests pass locally

🤖 Generated with Claude Code

PavelMakarchuk and others added 3 commits February 26, 2026 12:30
TAXSIM skips the Section 199A W-2 wage/UBIA cap when processing S-Corp
income, applying a flat 20% QBID. PolicyEngine correctly implements the
cap but w2_wages_from_qualified_business defaults to 0 (TAXSIM doesn't
provide this data), which zeroes out QBID above the income threshold.

This flag sets w2_wages_from_qualified_business to a large value so the
cap never binds, matching TAXSIM's simplified calculation for validation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
w2_wages_from_qualified_business is a person-level variable, so
set_input needs the person count (not tax-unit/record count). Use
sim.get_variable_population() to get the correct array size.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk force-pushed the add-assume-w2-wages-flag branch from ec23611 to 0f73e3f Compare February 26, 2026 17:31
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PavelMakarchuk PavelMakarchuk marked this pull request as ready for review February 26, 2026 19:31
@PavelMakarchuk PavelMakarchuk merged commit 644101a into main Feb 26, 2026
7 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