Skip to content
Merged
1 change: 1 addition & 0 deletions changelog.d/fix-dwks-regular-tax-lines.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cap the regular tax at the tax on all taxable income at the ordinary rates (26 U.S.C. 1(h)(1), Schedule D Tax Worksheet line 47), and make regular_tax_before_credits, which Form 6251 line 10 uses, the regular tax the model charges (income_tax_main_rates plus capital_gains_tax) instead of a second worksheet computation. regular_tax_before_credits now includes the capital gains tax.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
- title: 26 U.S. Code § 1(j)(5)(B) - Capital gains rate thresholds
href: https://www.law.cornell.edu/uscode/text/26/1#j_5_B
- title: 2026 IRS data release
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=12
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=13
- title: 2025 IRS data release
href: https://www.irs.gov/pub/irs-drop/rp-24-40.pdf#page=7
- title: 2024 IRS data release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ brackets:
- title: 26 U.S. Code § 24(i)(2) - Inflation adjustment for credit amount
href: https://www.law.cornell.edu/uscode/text/26/24#i_2
- title: 2026 IRS data release
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=13
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=14
# IRC §24(i)(2) adjusts the $2,200 statutory base using 2024 as reference year.
# Current implementation uses incremental uprating from latest value, which
# produces correct results but differs from statutory base-year calculation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ metadata:
- title: 26 U.S. Code § 24(i)(1) - Inflation adjustment for refundable amount
href: https://www.law.cornell.edu/uscode/text/26/24#i_1
- title: 2026 IRS data release
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=13
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=14
- title: 2025 IRS data release
href: https://www.irs.gov/pub/irs-drop/rp-24-40.pdf#page=8
- title: 2024 IRS data release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
href: https://www.mainelegislature.org/legis/statutes/36/title36sec5124-C.html
- title: 36 M.R.S. Sec. 5124-C(1-B)(B) and (1-C)(B) (Maine additional standard deduction equals the IRC Section 63(c)(3) amount)
href: https://legislature.maine.gov/statutes/36/title36sec5124-C.html
- title: IRS Rev. Proc. 2025-32, Section 3.14(3) (2026 federal additional standard deduction for the aged or the blind)
- title: IRS Rev. Proc. 2025-32, Section 4.14(3) (2026 federal additional standard deduction for the aged or the blind)
href: https://www.irs.gov/pub/irs-drop/rp-25-32.pdf#page=18
SINGLE:
2018-01-01: 1_600
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,80 +5,9 @@
amount_taxed_below_rate,
tax_at_main_rates,
)
from policyengine_us.variables.gov.irs.tax.federal_income.foreign_earned_income_exclusion.schedule_d_tax_worksheet_after_capital_gain_excess import (
schedule_d_tax_worksheet_after_capital_gain_excess,
)


def create_additional_tax_bracket() -> Reform:
class regular_tax_before_credits(Variable):
value_type = float
entity = TaxUnit
definition_period = YEAR
label = "Regular tax before credits"
documentation = "Regular tax on regular taxable income before credits"
unit = USD

def formula(tax_unit, period, parameters):
p = parameters(period).gov.irs
filing_status = tax_unit("filing_status", period)
# As in the baseline formula, a Form 2555 filer stacks taxable
# income on the excluded amount (26 U.S.C. 911(f)).
dwks1 = tax_unit("taxable_income_plus_section_911_exclusion", period)
worksheet = schedule_d_tax_worksheet_after_capital_gain_excess(
tax_unit, period, tax_unit("taxable_income", period)
)

dwks16 = min_(p.capital_gains.thresholds["1"][filing_status], dwks1)
dwks17 = min_(tax_unit("dwks14", period), dwks16)
dwks20 = dwks16 - dwks17
lowest_rate_tax = p.capital_gains.rates["1"] * dwks20
# Break in worksheet lines
dwks13 = worksheet.line_13
dwks21 = min_(dwks1, dwks13)
dwks22 = dwks20
dwks23 = max_(0, dwks21 - dwks22)
dwks25 = min_(p.capital_gains.thresholds["2"][filing_status], dwks1)
dwks19 = tax_unit("dwks19", period)
dwks26 = min_(dwks19, dwks20)
dwks27 = max_(0, dwks25 - dwks26)
dwks28 = min_(dwks23, dwks27)
dwks29 = p.capital_gains.rates["2"] * dwks28
dwks30 = dwks22 + dwks28
dwks31 = dwks21 - dwks30
dwks32 = p.capital_gains.rates["3"] * dwks31
# Break in worksheet lines
dwks33 = min_(worksheet.line_9, worksheet.unrecaptured_section_1250_gain)
dwks10 = worksheet.line_10
dwks34 = dwks10 + dwks19
dwks36 = max_(0, dwks34 - dwks1)
dwks37 = max_(0, dwks33 - dwks36)

p = parameters(period).gov.irs.income

dwks38 = p.amt.capital_gains.capital_gain_excess_tax_rate * dwks37
# Break in worksheet lines
dwks39 = dwks19 + dwks20 + dwks28 + dwks31 + dwks37
dwks40 = dwks1 - dwks39
dwks41 = p.amt.brackets.rates[-1] * dwks40

# Compute regular tax using bracket rates and thresholds
# The shared schedule clamps inverted brackets as in the
# baseline formulas (#9084).
reg_taxinc = max_(0, dwks19)
bracket = parameters(period).gov.contrib.additional_tax_bracket.bracket
reg_tax = tax_at_main_rates(reg_taxinc, filing_status, bracket)

# Return to worksheet lines
dwks42 = reg_tax
dwks43 = dwks29 + dwks32 + dwks38 + dwks41 + dwks42 + lowest_rate_tax
excluded = max_(0, tax_unit("foreign_earned_income_exclusion", period))
tax_on_excluded = tax_at_main_rates(excluded, filing_status, bracket)
dwks43 = where(excluded > 0, max_(0, dwks43 - tax_on_excluded), dwks43)
dwks44 = tax_unit("income_tax_main_rates", period)
dwks45 = min_(dwks43, dwks44)
return where(tax_unit("has_qdiv_or_ltcg", period), dwks45, dwks44)

class income_tax_main_rates(Variable):
value_type = float
entity = TaxUnit
Expand Down Expand Up @@ -110,6 +39,28 @@ def formula(tax_unit, period, parameters):
tax_on_excluded = tax_at_main_rates(excluded, filing_status, bracket)
return where(excluded > 0, max_(0, tax - tax_on_excluded), tax)

class tax_on_taxable_income_at_main_rates(Variable):
value_type = float
entity = TaxUnit
definition_period = YEAR
label = "Tax on all taxable income at the main rates"
reference = "https://www.law.cornell.edu/uscode/text/26/1#h_1"
unit = USD

def formula(tax_unit, period, parameters):
# Schedule D Tax Worksheet line 46 on the reform's rate schedule,
# as in the baseline formula on the baseline schedule. Section
# 1(h)(1) caps the regular tax at it (capital_gains_tax).
taxable_income = tax_unit(
"taxable_income_plus_section_911_exclusion", period
)
bracket = parameters(period).gov.contrib.additional_tax_bracket.bracket
filing_status = tax_unit("filing_status", period)
tax = tax_at_main_rates(max_(0, taxable_income), filing_status, bracket)
excluded = max_(0, tax_unit("foreign_earned_income_exclusion", period))
tax_on_excluded = tax_at_main_rates(excluded, filing_status, bracket)
return where(excluded > 0, max_(0, tax - tax_on_excluded), tax)

class taxable_income_taxed_below_25_percent(Variable):
value_type = float
entity = TaxUnit
Expand All @@ -135,7 +86,7 @@ def formula(tax_unit, period, parameters):
class reform(Reform):
def apply(self):
self.update_variable(income_tax_main_rates)
self.update_variable(regular_tax_before_credits)
self.update_variable(tax_on_taxable_income_at_main_rates)
self.update_variable(taxable_income_taxed_below_25_percent)

return reform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
section_911_net_capital_gain_other_than_dividends,
)
from policyengine_us.variables.gov.irs.tax.federal_income.capital_gains.capital_gains_tax import (
limit_to_tax_at_main_rates,
rate_gain_taxed_at_28_percent,
)

Expand Down Expand Up @@ -144,7 +145,13 @@ def formula(tax_unit, period, parameters):
adjusted_net_cg,
taxable_unrecaptured_gain,
)
return main_cg_tax + unrecaptured_gain_tax + remaining_cg_tax
# As in the baseline formula, section 1(h)(1) keeps the regular
# tax within the tax on all taxable income at the main rates.
return limit_to_tax_at_main_rates(
tax_unit,
period,
main_cg_tax + unrecaptured_gain_tax + remaining_cg_tax,
)

class reform(Reform):
def apply(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
section_911_net_capital_gain_other_than_dividends,
)
from policyengine_us.variables.gov.irs.tax.federal_income.capital_gains.capital_gains_tax import (
limit_to_tax_at_main_rates,
rate_gain_taxed_at_28_percent,
)

Expand Down Expand Up @@ -134,7 +135,13 @@ def formula(tax_unit, period, parameters):
taxable_unrecaptured_gain,
)

return main_cg_tax + unrecaptured_gain_tax + remaining_cg_tax
# As in the baseline formula, section 1(h)(1) keeps the regular
# tax within the tax on all taxable income at the main rates.
return limit_to_tax_at_main_rates(
tax_unit,
period,
main_cg_tax + unrecaptured_gain_tax + remaining_cg_tax,
)

class reform(Reform):
def apply(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_me_standard_deduction_does_not_follow_federal_in_2026():


def test_me_standard_deduction_applies_the_federal_dependent_cap_in_2027():
# IRC Section 63(c)(5), as adjusted by Rev. Proc. 2025-32 section .14(2):
# IRC Section 63(c)(5), as adjusted by Rev. Proc. 2025-32 section 4.14(2):
# an individual who is a dependent of another taxpayer gets at most the
# greater of the dependent floor and earned income plus a fixed addition,
# capped at the ordinary basic standard deduction. Maine follows the federal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
foreign_tax_credit: 0
regular_tax_before_credits: 11_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
alternative_minimum_tax: 0

Expand All @@ -112,7 +111,6 @@
foreign_tax_credit: 0
regular_tax_before_credits: 11_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
alternative_minimum_tax: 1_000

Expand Down Expand Up @@ -168,7 +166,6 @@
foreign_tax_credit: 0
regular_tax_before_credits: 30_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
# Line 3 = 280,000. Line 4 = 280,000 x 28% - 4,782 = 73,618. Line 5 =
# 130,000 x 26% = 33,800. Line 6 = 39,818, which goes on Form 6251 line 7.
Expand All @@ -187,7 +184,6 @@
foreign_tax_credit: 0
regular_tax_before_credits: 30_000
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
# Form 6251 line 7 = 150,000 x 26% = 39,000.
alternative_minimum_tax: 9_000
Expand All @@ -203,7 +199,6 @@
foreign_tax_credit: 0
regular_tax_before_credits: 0
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
# Line 3 = 180,000. Line 4 = 180,000 x 28% - 2,391 = 48,009. Line 5 =
# 130,000 x 28% - 2,391 = 34,009. Line 6 = 14,000.
Expand All @@ -219,9 +214,9 @@
amt_part_iii_required: true
amt_tax_including_cg: 57_785
foreign_tax_credit: 0
regular_tax_before_credits: 0
# Form 6251 line 10: the regular tax, all of it capital gains tax.
regular_tax_before_credits: 42_637.50
form_4972_lumpsum_distributions: 0
capital_gains_tax: 42_637.50
output:
# Form 6251 line 39 = 311,900 x 28% - 4,782 = 82,550, line 38 = 57,785,
# line 40 = 57,785. Worksheet line 5 = 100,000 x 26% = 26,000, line 6 =
Expand All @@ -238,6 +233,5 @@
foreign_tax_credit: 0
regular_tax_before_credits: 0
form_4972_lumpsum_distributions: 0
capital_gains_tax: 0
output:
alternative_minimum_tax: 0
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
dwks19: 136_000
unrecaptured_section_1250_gain: 0
output:
# Rev. Proc. 2025-32, section 3.10: for 2026 the 28 percent rate applies
# Rev. Proc. 2025-32, section 4.10: for 2026 the 28 percent rate applies
# above $122,250 for married individuals filing separate returns
# ($244,500 for all other taxpayers). Line 17 is all of line 12,
# $136,000, so line 18 is 28% * $136,000 - 2% * $122,250 = $38,080 -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
# $759,250 = $151,850; line 22 tax on $134,250 = $25,067; line 25
# $201,779.50.
taxable_income: 1_059_250
regular_tax_before_credits: 25_067
income_tax_main_rates: 25_067
capital_gains_tax: 176_712.5
regular_tax_before_credits: 201_779.5
# Form 6251: line 1 $1,059,250; line 2a $15,750; line 4 $1,075,000 plus
# 25% * ($1,075,000 - $900,350) = $43,662.50 for married filing
# separately (line 4 instructions) = $1,118,662.50. Line 5: $68,500 -
Expand Down
Loading
Loading