Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0becdc4
qbid income definition
baogorek May 22, 2025
04e3c02
new formulas
baogorek May 22, 2025
2728f39
Split input income variables into separate files
baogorek May 26, 2025
2ab3fd8
Merge pull request #6047 from PolicyEngine/codex/separate-variable-cl…
baogorek May 26, 2025
956077e
renaming. new qbid formulas
baogorek May 26, 2025
2d64d19
Merge branch 'master' of github.com:PolicyEngine/policyengine-us into…
baogorek May 26, 2025
6680a82
adding one unit test
PavelMakarchuk May 26, 2025
c319360
Refine QBI deduction references
baogorek May 27, 2025
5960e75
Merge pull request #6050 from PolicyEngine/codex/add-tax-code-referen…
baogorek May 27, 2025
1383eb3
Document tax form references for QBID
baogorek May 27, 2025
57edd94
Merge pull request #6052 from PolicyEngine/codex/add-comments-to-map-…
baogorek May 27, 2025
fc197c8
adding a test
baogorek May 27, 2025
912b6e4
tests for qbid_amount
baogorek May 27, 2025
d1953f3
Add QBI qualification flags and update QBI formula
baogorek May 27, 2025
81e7edc
Merge pull request #6058 from PolicyEngine/codex/add-new-qualified-bu…
baogorek May 27, 2025
6e99bb5
Fix uprating for QBI income variables
baogorek May 27, 2025
47fbb1d
Merge pull request #6059 from PolicyEngine/codex/fix-uprating-logic-f…
baogorek May 27, 2025
dfbe13b
Format files with black
baogorek May 28, 2025
62dc758
Merge pull request #6065 from PolicyEngine/codex/run-black-linter-on-…
baogorek May 28, 2025
ddc36bc
Merge branch 'master' of github.com:PolicyEngine/policyengine-us into…
baogorek May 28, 2025
a297757
responding to reviewer requests
baogorek May 28, 2025
4b0ddc0
adding references
baogorek May 28, 2025
e792429
reverting qbid logic files
baogorek May 29, 2025
58c1fcd
Removing new files added as they are part of the new branch now
baogorek May 29, 2025
c38872f
Split income variables into separate files
baogorek May 29, 2025
fe2cce3
Merge pull request #6069 from PolicyEngine/codex/refactor-income.py-i…
baogorek May 29, 2025
8725c53
linting
baogorek May 29, 2025
df06bed
cleaning up the emp_self_emp_ratio situation
baogorek May 30, 2025
65ae818
linter
baogorek May 30, 2025
23f3803
Update changelog for QBID preparation variables
baogorek May 30, 2025
02e258a
Merge pull request #6075 from PolicyEngine/codex/update-changelog_ent…
baogorek May 30, 2025
aa58dd3
adding one more thing to the changelog
baogorek May 30, 2025
c2e157f
yet another changelog mod
baogorek May 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- bump: minor
changes:
added:
- estate_income_would_be_qualified
- farm_operations_income_would_be_qualified
- farm_rent_income_would_be_qualified
- partnership_s_corp_income_would_be_qualified
- rental_income_would_be_qualified
- self_employment_income_would_be_qualified
changed:
- qualified_business_income

- bump: patch
changes:
fixed:
- corrected uprating for QBI dividend income variables
- documented uprating for farm_operations_income
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description: The reconciled QBID includes business development company income if this is true.

values:
0000-01-01: false

metadata:
unit: bool
period: year
label: QBID includes a proportion of BDC income
reference:
- title: Providing for reconciliation pursuant to H.Con.Res. 14, the Concurrent Resolution on the Budget for Fiscal Year 2025
href: "https://docs.house.gov/meetings/WM/WM00/20250513/118260/BILLS-119CommitteePrintih.pdf#page=7"
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ values:
metadata:
unit: list
label: Qualified business income deductions
reference:
- title: 26 U.S. Code § 199A(c)(1) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#c_1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ values:
2018-01-01:
- self_employment_income
- partnership_s_corp_income
- farm_income
- farm_rent_income
- farm_operations_income
- rental_income
- estate_income

metadata:
unit: list
label: Qualified business income sources
reference:
- title: 26 U.S. Code § 199A(c)(3)(A) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#c_3_A
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Alternative QBID cap rate on pass-through business property owned
metadata:
unit: /1
label: Alternative QBID rate on business property
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(ii) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_ii
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Pass-through qualified business income deduction rate.
metadata:
label: Qualified business income deduction rate
unit: /1
reference:
- title: 26 U.S. Code § 199A(a)(2) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#a_2
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: Alternative QBID cap rate on pass-through business W-2 wages paid.
metadata:
label: Alternative QBID rate on W-2 wages
unit: /1
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(ii) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_ii
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ description: QBID cap rate on pass-through business W-2 wages paid.
metadata:
label: QBID rate on W-2 wages
unit: /1
reference:
- title: 26 U.S. Code § 199A(b)(2)(B)(i) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_2_B_i
values:
2013-01-01: 0.0
2014-01-01: 0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
description: Dollar gap between upper and lower threshold of pre-QBID taxable income
metadata:
unit: currency-USD
reference:
- title: 26 U.S. Code § 199A(b)(3)(B) - Qualified business income
href: https://www.law.cornell.edu/uscode/text/26/199A#b_3_B
HEAD_OF_HOUSEHOLD:
2013-01-01: 1.0
2018-01-01: 50_000.0
Expand Down
91 changes: 65 additions & 26 deletions policyengine_us/reforms/reconciliation/reconciled_qbid.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,75 @@ class qbid_amount(Variable):
)

def formula(person, period, parameters):
p = parameters(period).gov.irs.deductions

# 1. Compute the new maximum QBID
p = parameters(period).gov.irs.deductions.qbi
p_ref = parameters(period).gov.contrib.reconciliation.qbid

# 1. Core inputs ----------------------------------------------------
# Form 8995, line 1 (qualified business income)
qbi = person("qualified_business_income", period)
qbid_max = p.qbi.max.rate * qbi

# 2. Compute the wage/property cap (unchanged)
# Specified service trade or business check box on Form 8995/8995-A
is_sstb = person("business_is_sstb", period)

# Form 8995, line 6 (REIT/PTP income)
reit_ptp_income = person("qualified_reit_and_ptp_income", period)
# Income from business development companies (not on current forms)
bdc_income = person("qualified_bdc_income", period)

# Form 1040, line 15 (taxable income) before QBID
taxable_income = person.tax_unit("taxable_income_less_qbid", period)
# Form 1040, filing status check box
filing_status = person.tax_unit("filing_status", period)

threshold = p.phase_out.start[filing_status] # §199A(e)(2)
phase_in_rate = p_ref.phase_out_rate # 75 % "phase-in" rate

# 2. 23 % of total QBI ---------------------------------------------
qbid_max = p.max.rate * qbi

# 3. Wage / UBIA limitation (non-SSTB only) ------------------------
# W-2 wages for the trade or business (Form 8995-A, Part I)
w2_wages = person("w2_wages_from_qualified_business", period)
b_property = person("unadjusted_basis_qualified_property", period)
wage_cap = w2_wages * p.qbi.max.w2_wages.rate
alt_cap = (
w2_wages * p.qbi.max.w2_wages.alt_rate
+ b_property * p.qbi.max.business_property.rate
# Unadjusted basis immediately after acquisition (UBIA)
# (Form 8995-A, Part I)
ubia_property = person("unadjusted_basis_qualified_property", period)

qbi_non_sstb = where(is_sstb, 0, qbi)
w2_wages_non_sstb = where(is_sstb, 0, w2_wages)
ubia_property_non_sstb = where(is_sstb, 0, ubia_property)

wage_limit = p.max.w2_wages.rate * w2_wages_non_sstb # 50 % wages
alt_limit = (
p.max.w2_wages.alt_rate * w2_wages_non_sstb # 25 % wages
+ p.max.business_property.rate * ubia_property_non_sstb # 2.5 % UBIA
)
full_cap = max_(wage_cap, alt_cap)

# 3. Phase‑out logic: 75% of each dollar above the threshold
taxinc_less_qbid = person.tax_unit(
"taxable_income_less_qbid", period
wage_ubia_cap = max_(wage_limit, alt_limit)

step1_uncapped = p.max.rate * qbi_non_sstb
step1_deduction = min_(step1_uncapped, wage_ubia_cap)

# 4. Limitation phase-in amount (75 % × excess) --------------------
excess_income = max_(0, taxable_income - threshold)
phase_in_amount = phase_in_rate * excess_income

step2_deduction = max_(0, qbid_max - phase_in_amount)

# 5. QBI component: greater of Step 1 or Step 2 --------------------
qbi_component = max_(step1_deduction, step2_deduction)

# 6. REIT, PTP, and optional BDC component (always 23 %) -----------
reit_ptp_bdc_base = reit_ptp_income + where(
p_ref.use_bdc_income,
bdc_income,
0,
)
filing_status = person.tax_unit("filing_status", period)
threshold = p.qbi.phase_out.start[filing_status]
p_ref = parameters(period).gov.contrib.reconciliation.qbid
phase_out_rate = p_ref.phase_out_rate
excess_income = max_(0, taxinc_less_qbid - threshold)
reduction_amount = phase_out_rate * excess_income
# 4. Apply phase‑out to the 22% deduction
phased_deduction = max_(0, qbid_max - reduction_amount)
# 5. Final QBID is the lesser of the phased deduction or the wage/property cap
return min_(phased_deduction, full_cap)
reit_ptp_bdc_deduction = p.max.rate * reit_ptp_bdc_base

total_before_income_cap = qbi_component + reit_ptp_bdc_deduction

# 7. Overall 23 % taxable-income ceiling (§199A(a)(2)) -------------
income_cap = p.max.rate * taxable_income

return min_(total_before_income_cap, income_cap)

class reform(Reform):
def apply(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
- name: Meade and Shroff Entity 1 with no REIT/PTP income
period: 2022
input:
qualified_business_income: 80_000
w2_wages_from_qualified_business: 8_000
unadjusted_basis_qualified_property: 50_000
taxable_income_less_qbid: 400_100
qualified_reit_and_ptp_income: 0
business_is_sstb: False
filing_status: JOINT
output:
qbid_amount: 8_800

- name: Meade and Shroff Entity 1 plus $1K in REIT/PTP income
period: 2022
input:
qualified_business_income: 80_000
w2_wages_from_qualified_business: 8_000
unadjusted_basis_qualified_property: 50_000
taxable_income_less_qbid: 400_100
qualified_reit_and_ptp_income: 1000
business_is_sstb: False
filing_status: JOINT
output:
qbid_amount: 9_000

- name: Meade and Shroff Entity 1, no REIT/PTP, higher taxable income
period: 2022
input:
qualified_business_income: 80_000
w2_wages_from_qualified_business: 8_000
unadjusted_basis_qualified_property: 50_000
taxable_income_less_qbid: 460_100
qualified_reit_and_ptp_income: 0
business_is_sstb: False
filing_status: JOINT
output:
qbid_amount: 4_000

- name: Meade and Shroff Entity 1, no REIT/PTP, lower taxable income
period: 2022
input:
qualified_business_income: 80_000
w2_wages_from_qualified_business: 8_000
unadjusted_basis_qualified_property: 50_000
taxable_income_less_qbid: 330_100
qualified_reit_and_ptp_income: 0
business_is_sstb: False
filing_status: JOINT
output:
qbid_amount: 16_000

- name: Meade and Shroff Entity 5, no REIT/PTP
period: 2022
input:
qualified_business_income: 110_000
w2_wages_from_qualified_business: 60_000
unadjusted_basis_qualified_property: 6_000
taxable_income_less_qbid: 400_100
qualified_reit_and_ptp_income: 0
business_is_sstb: True
filing_status: JOINT
output:
qbid_amount: 8_800
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: Taxable income over QBI in 2024
period: 2024
input:
qbid_amount: 10_000
taxable_income_less_qbid: 30_000
adjusted_net_capital_gain: 2_000
output:
qualified_business_income_deduction: 5_600

- name: Taxable income under QBI in 2024
period: 2024
input:
qbid_amount: 3_000
taxable_income_less_qbid: 30_000
adjusted_net_capital_gain: 2_000
output:
qualified_business_income_deduction: 3_000

- name: Taxable reduced to 0
period: 2024
input:
qbid_amount: 10_000
taxable_income_less_qbid: 30_000
adjusted_net_capital_gain: 32_000
output:
qualified_business_income_deduction: 0
Loading
Loading