From a74c82663e66f047a3239f34ba4bfe3591ccc5ec Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 30 Nov 2026 00:43:04 +0000 Subject: [PATCH 1/3] Correct the New Mexico SALT add-back worksheet Use allowed federal Schedule A SALT and round the worksheet ratio to four decimal places starting in tax year 2025. Co-Authored-By: GPT-6.2 Sol --- ...t-add-back-allowed-salt-and-ratio.fixed.md | 1 + .../salt_add_back_ratio_rounding_places.yaml | 10 +++ .../income/deductions/nm_salt_add_back.yaml | 57 ++++++++++++++++ .../tax/income/deductions/nm_salt_add_back.py | 67 +++++++++++-------- 4 files changed, 108 insertions(+), 27 deletions(-) create mode 100644 changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md create mode 100644 policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml diff --git a/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md new file mode 100644 index 00000000000..4b1c864f12c --- /dev/null +++ b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md @@ -0,0 +1 @@ +From 2025, New Mexico uses the allowed federal Schedule A SALT deduction and rounds the worksheet ratio to four decimal places when calculating its SALT add-back. diff --git a/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml new file mode 100644 index 00000000000..83a75f41840 --- /dev/null +++ b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml @@ -0,0 +1,10 @@ +description: New Mexico rounds the state and local income or sales tax share to this many decimal places for the SALT add-back. +values: + 2025-01-01: 4 +metadata: + unit: int + period: year + label: New Mexico SALT add-back ratio rounding places + reference: + - title: 2025 New Mexico PIT-1 instructions, page 24, line 10 worksheet + href: https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml index 96d3dd0de4c..4949bdfa744 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml @@ -83,3 +83,60 @@ # SALT is all income tax ($10,000), so the addback is the lesser: $81.08. itemized_taxable_income_deductions: 16_081.081081 nm_salt_add_back: 81.081081 + +- name: NM SALT add-back uses the phased-down Schedule A amount in 2025 + period: 2025 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 550_000 + state_withheld_income_tax: 15_000 + real_estate_taxes: 25_000 + state_sales_tax: 0 + local_sales_tax: 0 + output: + # Schedule A line 5e: $40,000 - 30% * ($550,000 - $500,000) = $25,000. + # PIT-1 line 10: min($25,000 * 0.3750, $25,000 - $15,750) = $9,250. + # NM taxable income: $550,000 + $9,250 - $25,000 = $534,250. + salt_deduction: 25_000 + nm_salt_add_back: 9_250 + nm_taxable_income: 534_250 + +- name: NM SALT add-back uses the phased-down Schedule A amount in 2026 + period: 2026 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 550_000 + state_withheld_income_tax: 15_000 + real_estate_taxes: 25_000 + state_sales_tax: 0 + local_sales_tax: 0 + output: + # Schedule A line 5e: $40,400 - 30% * ($550,000 - $505,000) = $26,900. + # PIT-1 line 10: min($26,900 * 0.3750, $26,900 - $16,100) = $10,087.50. + # NM taxable income: $550,000 + $10,087.50 - $26,900 = $533,187.50. + salt_deduction: 26_900 + nm_salt_add_back: 10_087.50 + nm_taxable_income: 533_187.50 + +- name: NM SALT add-back rounds the worksheet ratio to four places + period: 2025 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 350_000 + state_withheld_income_tax: 20_001 + real_estate_taxes: 40_000 + state_sales_tax: 0 + local_sales_tax: 0 + output: + # $20,001 / $60,001 rounds to 0.3333 on worksheet line 3. + # PIT-1 line 10: min($40,000 * 0.3333, $40,000 - $15,750) = $13,332. + nm_salt_add_back: 13_332 diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py index 076dac058b7..e160ba690db 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py @@ -8,46 +8,59 @@ class nm_salt_add_back(Variable): unit = USD definition_period = YEAR reference = ( - "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/1afc56af-ea90-4d48-82e5-1f9aeb43255a/PITbook2022.pdf#page=28", - "https://law.justia.com/codes/new-mexico/chapter-7/article-2/section-7-2-2/", + "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/856ebf4b-3814-49dd-8631-ebe579d6a42b/Personal%20Income%20Tax.pdf#page=19", "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/1afc56af-ea90-4d48-82e5-1f9aeb43255a/PITbook2022.pdf#page=28", "https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24", ) defined_for = StateCode.NM def formula(tax_unit, period, parameters): - itemizes = tax_unit("tax_unit_itemizes", period) - filing_status = tax_unit("filing_status", period) p = parameters(period).gov.irs.deductions - - # tax/income, federal Schedule A, line 5a. 1 salt_sales_or_income = tax_unit("state_and_local_sales_or_income_tax", period) - # state_and_local_tax, line 5d. 2 total_salt = add(tax_unit, period, ["real_estate_taxes"]) + salt_sales_or_income - # ratio = round(salt_sales_or_income[0] / total_salt[0], 4) - # ratio. 3 salt_ratio = np.zeros_like(total_salt) mask = total_salt != 0 salt_ratio[mask] = salt_sales_or_income[mask] / total_salt[mask] - # line 5e. 4 + filing_status = tax_unit("filing_status", period) salt_cap = p.itemized.salt_and_real_estate.cap[filing_status] salt_claimed = min_(salt_cap, total_salt) + return _apply_worksheet_limits(tax_unit, period, p, salt_claimed, salt_ratio) + + def formula_2025(tax_unit, period, parameters): + p = parameters(period).gov + deductions = p.states.nm.tax.income.deductions + salt_sales_or_income = tax_unit("state_and_local_sales_or_income_tax", period) + total_salt = tax_unit("salt", period) + + # Round the worksheet line 3 ratio with half-up ties. + scale = 10**deductions.salt_add_back_ratio_rounding_places + scaled_ratio = np.divide( + salt_sales_or_income.astype(float) * scale, + total_salt, + out=np.zeros_like(total_salt, dtype=float), + where=total_salt != 0, + ) + salt_ratio = np.floor(scaled_ratio + 0.5) / scale + + # Worksheet line 4 takes the allowed SALT from federal Schedule A line 5e. + salt_claimed = tax_unit("salt_deduction", period) + return _apply_worksheet_limits( + tax_unit, period, p.irs.deductions, salt_claimed, salt_ratio + ) + + +def _apply_worksheet_limits(tax_unit, period, irs_deductions, salt_claimed, salt_ratio): + itemizes = tax_unit("tax_unit_itemizes", period) + salt = min_(salt_claimed * salt_ratio, salt_claimed) + + standard_deduction = tax_unit("standard_deduction", period) + itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) + us_itemized_deductions = itm_deds_less_salt + salt_claimed + if irs_deductions.itemized.limitation.obbb.applies: + # From 2026, compare the allowed federal total, net of the + # section 68 reduction, with the standard deduction. + us_itemized_deductions = tax_unit("itemized_taxable_income_deductions", period) + itemized_excess = max_(us_itemized_deductions - standard_deduction, 0) - # 5 = salt_claimed * salt_ratio - # 6 = min(5, 4) - salt = min_(salt_claimed * salt_ratio, salt_claimed) - - standard_deduction = tax_unit("standard_deduction", period) - itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) - us_itemized_deductions = itm_deds_less_salt + salt_claimed - if p.itemized.limitation.obbb.applies: - # From 2026, compare the allowed federal total, net of the - # section 68 reduction, with the standard deduction. - us_itemized_deductions = tax_unit( - "itemized_taxable_income_deductions", period - ) - item_deds = max_(us_itemized_deductions - standard_deduction, 0) - - nm_item = min_(salt, item_deds) - return where(itemizes, nm_item, 0) + return where(itemizes, min_(salt, itemized_excess), 0) From 6dabaebb042dd43e560b7c43f46c3be9e2ee1bfb Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Mon, 30 Nov 2026 15:32:30 +0000 Subject: [PATCH 2/3] Correct New Mexico's Schedule A SALT and add-back Apply the statutory SALT limit from tax year 2019. Compute the allocation ratio from cent amounts and round it to four places. Include the full allowed SALT in New Mexico itemized deductions when the federal simulation caps it at available income. Co-Authored-By: GPT-6.2 Sol --- ...t-add-back-allowed-salt-and-ratio.fixed.md | 2 +- .../salt_add_back_ratio_rounding_places.yaml | 4 +- .../income/deductions/nm_salt_add_back.yaml | 254 ++++++++++++++++++ .../deductions/nm_itemized_deductions.py | 30 ++- .../tax/income/deductions/nm_salt_add_back.py | 27 +- .../income/deductions/nm_schedule_a_salt.py | 17 ++ 6 files changed, 315 insertions(+), 19 deletions(-) create mode 100644 policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_schedule_a_salt.py diff --git a/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md index 4b1c864f12c..25a3c8e331c 100644 --- a/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md +++ b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md @@ -1 +1 @@ -From 2025, New Mexico uses the allowed federal Schedule A SALT deduction and rounds the worksheet ratio to four decimal places when calculating its SALT add-back. +Corrected New Mexico's SALT add-back to use the allowed Schedule A amount and round the allocation ratio to four places from 2019. diff --git a/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml index 83a75f41840..e8f1fc2d41a 100644 --- a/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml +++ b/policyengine_us/parameters/gov/states/nm/tax/income/deductions/salt_add_back_ratio_rounding_places.yaml @@ -1,10 +1,12 @@ description: New Mexico rounds the state and local income or sales tax share to this many decimal places for the SALT add-back. values: - 2025-01-01: 4 + 2019-01-01: 4 metadata: unit: int period: year label: New Mexico SALT add-back ratio rounding places reference: + - title: 2019 New Mexico PIT-1 instructions, page 22, line 10 worksheet + href: https://realfile.tax.newmexico.gov/2019pit-1-ins.pdf#page=22 - title: 2025 New Mexico PIT-1 instructions, page 24, line 10 worksheet href: https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml index 4949bdfa744..7ae55e379ab 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml @@ -140,3 +140,257 @@ # $20,001 / $60,001 rounds to 0.3333 on worksheet line 3. # PIT-1 line 10: min($40,000 * 0.3333, $40,000 - $15,750) = $13,332. nm_salt_add_back: 13_332 + +- name: 2022 separate return must round the allocation ratio + period: 2022 + absolute_error_margin: 0.01 + input: &historical + state_code: NM + filing_status: SEPARATE + age: 40 + employment_income: 200_000 + state_and_local_sales_or_income_tax: 9_999 + real_estate_taxes: 20_002 + interest_deduction: 20_000 + tax_unit_itemizes: true + output: + # $9,999 / $30,001 rounds to 0.3333. $5,000 * 0.3333 = $1,666.50. + nm_salt_add_back: 1_666.50 + +- name: 2024 separate return must round the allocation ratio + period: 2024 + absolute_error_margin: 0.01 + input: *historical + output: + # The same $5,000 cap and 0.3333 ratio give $1,666.50. + nm_salt_add_back: 1_666.50 + +- name: 2019 separate return uses the first documented line 5e allocation + period: 2019 + absolute_error_margin: 0.01 + input: *historical + output: + # $5,000 * 0.3333 = $1,666.50 under the 2019 PIT-1 worksheet. + nm_salt_add_back: 1_666.50 + +- name: Schedule A SALT can exceed federal AGI + period: 2025 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 30_000 + state_and_local_sales_or_income_tax: 10_500 + real_estate_taxes: 24_500 + output: + # Schedule A allows $35,000. Its $10,500 / $35,000 share is 0.3000. + # The $10,500 add-back is below the $19,250 itemized excess. + # NM taxable income = $30,000 + $10,500 - $35,000 - $1,000. + nm_salt_add_back: 10_500 + nm_taxable_income: 4_500 + nm_itemized_deductions: 35_000 + salt_deduction: 30_000 + +- name: Exact four-place half with federal amounts in cents + period: 2025 + absolute_error_margin: 0.01 + input: &halfway + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: 10_101.01 + real_estate_taxes: 10_098.99 + interest_deduction: 10_000 + output: + # $10,101.01 / $20,200 = 0.50005. $20,200 * 0.5001 = $10,102.02. + nm_salt_add_back: 10_102.02 + +- name: Exact four-place half with whole dollars + period: 2025 + absolute_error_margin: 0.01 + input: + <<: *halfway + state_and_local_sales_or_income_tax: 10_001 + real_estate_taxes: 9_999 + output: + # $10,001 / $20,000 = 0.50005. $20,000 * 0.5001 = $10,002. + nm_salt_add_back: 10_002 + +- name: Zero SALT with non-SALT itemization + period: 2025 + input: &other_deductions + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: 0 + real_estate_taxes: 0 + interest_deduction: 30_000 + output: + # $30,000 exceeds the $15,750 standard deduction. Line 5e is $0. + tax_unit_itemizes: true + nm_salt_add_back: 0 + +- name: Negative raw property-tax input cannot produce a negative add-back + period: 2025 + input: + <<: *other_deductions + state_and_local_sales_or_income_tax: 5_000 + real_estate_taxes: -6_000 + tax_unit_itemizes: true + output: + # Raw SALT is -$1,000. The allowed amount floors at $0. + nm_salt_add_back: 0 + +- name: Itemized deductions equal the standard deduction + period: 2025 + input: &no_excess + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: 15_750 + real_estate_taxes: 0 + tax_unit_itemizes: true + output: + # $15,750 - $15,750 = $0 of itemized excess. + nm_salt_add_back: 0 + +- name: Itemized deductions below the standard deduction + period: 2025 + input: + <<: *no_excess + state_and_local_sales_or_income_tax: 15_000 + output: + # $15,000 - $15,750 is negative. The excess floors at $0. + nm_salt_add_back: 0 + +- name: Sales-tax election is included under New Mexico statute + period: 2025 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_withheld_income_tax: 3_000 + state_sales_tax: 8_000 + local_sales_tax: 0 + real_estate_taxes: 12_000 + output: + # Elect $8,000 in sales tax. $20,000 * 0.4000 = $8,000. + # The $20,000 - $15,750 excess limits the add-back to $4,250. + state_and_local_sales_or_income_tax: 8_000 + nm_salt_add_back: 4_250 + +- name: Single exactly at the SALT phase-down threshold + period: 2025 + input: &threshold + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 500_000 + state_and_local_sales_or_income_tax: 15_000 + real_estate_taxes: 25_000 + output: + # The cap is $40,000 at the threshold. $40,000 * 0.3750 = $15,000. + salt_deduction: 40_000 + nm_salt_add_back: 15_000 + +- name: Head of household exactly at the SALT phase-down threshold + period: 2025 + input: + <<: *threshold + filing_status: HEAD_OF_HOUSEHOLD + output: + # min($40,000 * 0.3750, $40,000 - $23,625) = $15,000. + salt_deduction: 40_000 + nm_salt_add_back: 15_000 + +- name: Surviving spouse exactly at the SALT phase-down threshold + period: 2025 + input: + <<: *threshold + filing_status: SURVIVING_SPOUSE + output: + # min($40,000 * 0.3750, $40,000 - $31,500) = $8,500. + salt_deduction: 40_000 + nm_salt_add_back: 8_500 + +- name: Joint threshold with two people contributing expenses + period: 2025 + input: + people: + first: + age: 40 + employment_income: 300_000 + real_estate_taxes: 12_000 + second: + age: 40 + employment_income: 200_000 + real_estate_taxes: 13_000 + tax_units: + couple: + members: [first, second] + filing_status: JOINT + state_withheld_income_tax: 15_000 + state_sales_tax: 0 + local_sales_tax: 0 + households: + home: + members: [first, second] + state_code: NM + output: + # $15,000 + $12,000 + $13,000 = $40,000 at $500,000 joint AGI. + # The $40,000 - $31,500 excess limits the $15,000 allocation to $8,500. + salt_deduction: 40_000 + nm_salt_add_back: 8_500 + +- name: Separate filer exactly at the SALT phase-down threshold + period: 2025 + absolute_error_margin: 0.01 + input: &separate + state_code: NM + filing_status: SEPARATE + separate_filer_itemizes: true + age: 40 + employment_income: 250_000 + state_and_local_sales_or_income_tax: 8_000 + real_estate_taxes: 16_000 + output: + # The spouse itemizes, so the standard deduction is $0. + # $8,000 / $24,000 rounds to 0.3333. $20,000 * 0.3333 = $6,666. + standard_deduction: 0 + salt_deduction: 20_000 + nm_salt_add_back: 6_666 + +- name: Separate filer above the threshold gets half the phased cap + period: 2025 + absolute_error_margin: 0.01 + input: + <<: *separate + employment_income: 270_000 + output: + # $20,000 - (0.30 / 2) * ($270,000 - $250,000) = $17,000. + # $17,000 * 0.3333 = $5,666.10. + salt_deduction: 17_000 + nm_salt_add_back: 5_666.10 + +- name: 2026 section 68 reduces the excess over the standard deduction + period: 2026 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 700_000 + state_and_local_sales_or_income_tax: 10_000 + interest_deduction: 8_000 + output: + # Section 68 reduces $18,000 by $18,000 * 2/37. + # The $17,027.027 - $16,100 excess limits the $10,000 allocation. + standard_deduction: 16_100 + salt_deduction: 10_000 + itemized_taxable_income_deductions: 17_027.027 + nm_salt_add_back: 927.027 diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py index 99ab95765ad..a7d7fc23e67 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py @@ -15,9 +15,29 @@ class nm_itemized_deductions(Variable): ) defined_for = StateCode.NM - def formula(tax_unit, period, parameters): - p = parameters(period).gov.irs.deductions.itemized.limitation - if p.obbb.applies: - # From 2026 the allowed federal total is net of section 68. - return tax_unit("itemized_taxable_income_deductions", period) + def formula(tax_unit, period): return tax_unit("total_itemized_taxable_income_deductions", period) + + def formula_2019(tax_unit, period, parameters): + p = parameters(period).gov.irs.deductions.itemized.limitation + # From 2026 the allowed federal total is net of section 68. + total_before_limit = "total_itemized_taxable_income_deductions" + federal_total_name = ( + "itemized_taxable_income_deductions" + if p.obbb.applies + else total_before_limit + ) + federal_total = tax_unit(federal_total_name, period) + + # A supplied Schedule A total already includes the claimed SALT. + simulation = tax_unit.simulation + if has_input_for_period(simulation, federal_total_name, period) or ( + p.obbb.applies + and has_input_for_period(simulation, total_before_limit, period) + ): + return federal_total + + # Restore SALT excluded by the federal simulation's available-income cap. + schedule_a_salt = tax_unit("nm_schedule_a_salt", period) + modeled_salt = tax_unit("salt_deduction", period) + return federal_total + max_(0, schedule_a_salt - modeled_salt) diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py index e160ba690db..49698bad8d2 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py @@ -10,6 +10,7 @@ class nm_salt_add_back(Variable): reference = ( "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/856ebf4b-3814-49dd-8631-ebe579d6a42b/Personal%20Income%20Tax.pdf#page=19", "https://klvg4oyd4j.execute-api.us-west-2.amazonaws.com/prod/PublicFiles/34821a9573ca43e7b06dfad20f5183fd/1afc56af-ea90-4d48-82e5-1f9aeb43255a/PITbook2022.pdf#page=28", + "https://realfile.tax.newmexico.gov/2019pit-1-ins.pdf#page=22", "https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24", ) defined_for = StateCode.NM @@ -27,24 +28,26 @@ def formula(tax_unit, period, parameters): salt_claimed = min_(salt_cap, total_salt) return _apply_worksheet_limits(tax_unit, period, p, salt_claimed, salt_ratio) - def formula_2025(tax_unit, period, parameters): + def formula_2019(tax_unit, period, parameters): p = parameters(period).gov deductions = p.states.nm.tax.income.deductions salt_sales_or_income = tax_unit("state_and_local_sales_or_income_tax", period) total_salt = tax_unit("salt", period) - # Round the worksheet line 3 ratio with half-up ties. + # Recover cents from the stored dollar amounts before rounding the ratio. + income_or_sales_tax_cents = np.rint(salt_sales_or_income.astype(float) * 100) + total_salt_cents = np.rint(total_salt.astype(float) * 100) scale = 10**deductions.salt_add_back_ratio_rounding_places scaled_ratio = np.divide( - salt_sales_or_income.astype(float) * scale, - total_salt, - out=np.zeros_like(total_salt, dtype=float), - where=total_salt != 0, + income_or_sales_tax_cents * scale, + total_salt_cents, + out=np.zeros_like(total_salt_cents), + where=total_salt_cents > 0, ) salt_ratio = np.floor(scaled_ratio + 0.5) / scale # Worksheet line 4 takes the allowed SALT from federal Schedule A line 5e. - salt_claimed = tax_unit("salt_deduction", period) + salt_claimed = tax_unit("nm_schedule_a_salt", period) return _apply_worksheet_limits( tax_unit, period, p.irs.deductions, salt_claimed, salt_ratio ) @@ -55,12 +58,12 @@ def _apply_worksheet_limits(tax_unit, period, irs_deductions, salt_claimed, salt salt = min_(salt_claimed * salt_ratio, salt_claimed) standard_deduction = tax_unit("standard_deduction", period) - itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) - us_itemized_deductions = itm_deds_less_salt + salt_claimed if irs_deductions.itemized.limitation.obbb.applies: - # From 2026, compare the allowed federal total, net of the - # section 68 reduction, with the standard deduction. - us_itemized_deductions = tax_unit("itemized_taxable_income_deductions", period) + # Compare the federal total after the section 68 reduction. + us_itemized_deductions = tax_unit("nm_itemized_deductions", period) + else: + itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) + us_itemized_deductions = itm_deds_less_salt + salt_claimed itemized_excess = max_(us_itemized_deductions - standard_deduction, 0) return where(itemizes, min_(salt, itemized_excess), 0) diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_schedule_a_salt.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_schedule_a_salt.py new file mode 100644 index 00000000000..8ce62325c8b --- /dev/null +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_schedule_a_salt.py @@ -0,0 +1,17 @@ +from policyengine_us.model_api import * + + +class nm_schedule_a_salt(Variable): + value_type = float + entity = TaxUnit + label = "Federal Schedule A line 5e SALT for New Mexico" + unit = USD + definition_period = YEAR + reference = ( + "https://realfile.tax.newmexico.gov/2019pit-1-ins.pdf#page=22", + "https://www.irs.gov/pub/irs-prior/f1040sa--2025.pdf#page=1", + ) + defined_for = StateCode.NM + + def formula_2019(tax_unit, period): + return max_(0, min_(tax_unit("salt", period), tax_unit("salt_cap", period))) From 8550e15134844f4b33d152a5e06b291facc35f51 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Tue, 1 Dec 2026 04:24:29 +0000 Subject: [PATCH 3/3] Correct New Mexico SALT add-back edge cases Co-Authored-By: GPT-6.2 Sol --- ...t-add-back-allowed-salt-and-ratio.fixed.md | 2 +- .../deductions/nm_itemized_deductions.yaml | 19 ++++ .../income/deductions/nm_salt_add_back.yaml | 102 ++++++++++++++++++ .../deductions/nm_itemized_deductions.py | 2 +- .../tax/income/deductions/nm_salt_add_back.py | 59 ++++++---- source_conflicts/candidates.yaml | 27 +++++ .../us-nm/pit-1-instructions-2019-p22.txt | 6 ++ .../us-nm/pit-1-instructions-2025-p24.txt | 6 ++ 8 files changed, 203 insertions(+), 20 deletions(-) create mode 100644 source_conflicts/sources/us-nm/pit-1-instructions-2019-p22.txt create mode 100644 source_conflicts/sources/us-nm/pit-1-instructions-2025-p24.txt diff --git a/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md index 25a3c8e331c..67ed2b7013b 100644 --- a/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md +++ b/changelog.d/nm-salt-add-back-allowed-salt-and-ratio.fixed.md @@ -1 +1 @@ -Corrected New Mexico's SALT add-back to use the allowed Schedule A amount and round the allocation ratio to four places from 2019. +Corrected New Mexico's SALT add-back from 2019 to use the allowed Schedule A SALT and the same itemized total as the return, preserve four-place rounding at ties, and account for property-only SALT and signed inputs. diff --git a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_itemized_deductions.yaml b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_itemized_deductions.yaml index 5178990e99b..2b469845ff5 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_itemized_deductions.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_itemized_deductions.yaml @@ -82,3 +82,22 @@ itemized_taxable_income_deductions_reduction: 0 nm_itemized_deductions: 37_000 nm_salt_add_back: 0 + +- name: Negative raw SALT cannot restore a positive itemized deduction + period: 2026 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + tax_unit_itemizes: true + state_and_local_sales_or_income_tax: 0 + real_estate_taxes: -1_000 + output: + # Allowed SALT and the federal itemized total both floor at $0. + # The $0 restoration leaves $0 of deductions and $100,000 of taxable income. + nm_schedule_a_salt: 0 + itemized_taxable_income_deductions: 0 + nm_itemized_deductions: 0 + nm_salt_add_back: 0 + nm_taxable_income: 100_000 diff --git a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml index 7ae55e379ab..87183e217f0 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/nm/tax/income/deductions/nm_salt_add_back.yaml @@ -394,3 +394,105 @@ salt_deduction: 10_000 itemized_taxable_income_deductions: 17_027.027 nm_salt_add_back: 927.027 + +- name: PIT-1 worksheet line 8 and return line 12 share the supplied itemized total + period: 2025 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + tax_unit_itemizes: true + state_and_local_sales_or_income_tax: 10_000 + total_itemized_taxable_income_deductions: 20_000 + output: + # All $10,000 of SALT is income tax. The $20,000 - $15,750 excess + # limits the add-back to $4,250. Taxable income is $100,000 + $4,250 - $20,000. + nm_itemized_deductions: 20_000 + nm_salt_add_back: 4_250 + nm_taxable_income: 84_250 + +- name: Schedule A components preserve an exact four-place midpoint + period: 2025 + absolute_error_margin: 0.01 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 300_000 + state_and_local_sales_or_income_tax: 22_529.98 + real_estate_taxes: 43_011.78 + output: + # $22,529.98 / ($22,529.98 + $43,011.78) = 0.34375, rounded to 0.3438. + # The add-back is $40,000 * 0.3438 = $13,752, below the $24,250 excess. + # Taxable income is $300,000 + $13,752 - $40,000 = $273,752. + nm_schedule_a_salt: 40_000 + nm_salt_add_back: 13_752 + nm_taxable_income: 273_752 + +- name: Negative line 5a cannot create a negative add-back + period: 2025 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: -5_000 + real_estate_taxes: 25_000 + output: + # Line 5a contributes $0 to the add-back. With the modeled $20,000 + # itemized total, taxable income is $100,000 - $20,000 = $80,000. + nm_salt_add_back: 0 + nm_taxable_income: 80_000 + +- name: Property-only SALT reform leaves no deductible income tax to add back + period: 2025 + reforms: policyengine_us.reforms.deductions.salt.limit_salt_deduction_to_property_taxes.limit_salt_deduction_to_property_taxes + input: + gov.contrib.deductions.salt.limit_salt_deduction_to_property_taxes: true + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: 35_000 + real_estate_taxes: 35_000 + interest_deduction: 30_000 + output: + # The $35,000 of allowed SALT is all property tax. The add-back is $0, + # and taxable income is $100,000 - ($35,000 + $30,000) = $35,000. + salt_deduction: 35_000 + nm_salt_add_back: 0 + nm_taxable_income: 35_000 + +- name: Elected sales tax is the only line 5a tax added back under New Mexico law + period: 2025 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_withheld_income_tax: 3_000 + state_sales_tax: 8_000 + local_sales_tax: 0 + real_estate_taxes: 12_000 + interest_deduction: 10_000 + output: + # The elected $8,000 is 0.4000 of the $20,000 of allowed SALT. + # The $30,000 - $15,750 excess permits the full $8,000 add-back. + nm_salt_add_back: 8_000 + +- name: A supplied Schedule A subtotal can include personal property tax + period: 2025 + input: + state_code: NM + filing_status: SINGLE + age: 40 + employment_income: 100_000 + state_and_local_sales_or_income_tax: 20_000 + real_estate_taxes: 30_000 + salt: 60_000 + output: + # Line 5d includes $10,000 of personal property tax. $20,000 / $60,000 + # rounds to 0.3333, and $40,000 * 0.3333 = $13,332. + nm_schedule_a_salt: 40_000 + nm_salt_add_back: 13_332 diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py index a7d7fc23e67..d9c1877d36d 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_itemized_deductions.py @@ -39,5 +39,5 @@ def formula_2019(tax_unit, period, parameters): # Restore SALT excluded by the federal simulation's available-income cap. schedule_a_salt = tax_unit("nm_schedule_a_salt", period) - modeled_salt = tax_unit("salt_deduction", period) + modeled_salt = max_(0, tax_unit("salt_deduction", period)) return federal_total + max_(0, schedule_a_salt - modeled_salt) diff --git a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py index 49698bad8d2..7d739d66f44 100644 --- a/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py +++ b/policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py @@ -26,20 +26,39 @@ def formula(tax_unit, period, parameters): filing_status = tax_unit("filing_status", period) salt_cap = p.itemized.salt_and_real_estate.cap[filing_status] salt_claimed = min_(salt_cap, total_salt) - return _apply_worksheet_limits(tax_unit, period, p, salt_claimed, salt_ratio) + if p.itemized.limitation.obbb.applies: + itemized_deductions = tax_unit("nm_itemized_deductions", period) + else: + itemized_deductions = ( + tax_unit("itemized_deductions_less_salt", period) + salt_claimed + ) + return _apply_worksheet_limits( + tax_unit, period, salt_claimed, salt_ratio, itemized_deductions + ) def formula_2019(tax_unit, period, parameters): p = parameters(period).gov deductions = p.states.nm.tax.income.deductions - salt_sales_or_income = tax_unit("state_and_local_sales_or_income_tax", period) - total_salt = tax_unit("salt", period) + salt_sources = p.irs.deductions.itemized.salt_and_real_estate.sources + + # The statutory add-back includes the elected income or sales tax. + line_5a = "state_and_local_sales_or_income_tax" + if line_5a not in salt_sources: + return 0 - # Recover cents from the stored dollar amounts before rounding the ratio. - income_or_sales_tax_cents = np.rint(salt_sales_or_income.astype(float) * 100) - total_salt_cents = np.rint(total_salt.astype(float) * 100) + income_or_sales_tax_cents = _salt_cents(tax_unit, period, line_5a) + if has_input_for_period(tax_unit.simulation, "salt", period): + total_salt_cents = _salt_cents(tax_unit, period, "salt") + else: + # Recover each component's cents before summing Schedule A line 5d. + total_salt_cents = income_or_sales_tax_cents + sum( + _salt_cents(tax_unit, period, source) + for source in salt_sources + if source != line_5a + ) scale = 10**deductions.salt_add_back_ratio_rounding_places scaled_ratio = np.divide( - income_or_sales_tax_cents * scale, + max_(income_or_sales_tax_cents, 0) * scale, total_salt_cents, out=np.zeros_like(total_salt_cents), where=total_salt_cents > 0, @@ -48,22 +67,26 @@ def formula_2019(tax_unit, period, parameters): # Worksheet line 4 takes the allowed SALT from federal Schedule A line 5e. salt_claimed = tax_unit("nm_schedule_a_salt", period) + # Worksheet line 8 uses the itemized total entered on PIT-1 line 12. + itemized_deductions = tax_unit("nm_itemized_deductions", period) return _apply_worksheet_limits( - tax_unit, period, p.irs.deductions, salt_claimed, salt_ratio + tax_unit, period, salt_claimed, salt_ratio, itemized_deductions ) -def _apply_worksheet_limits(tax_unit, period, irs_deductions, salt_claimed, salt_ratio): +def _salt_cents(tax_unit, period, source): + if tax_unit.entity.get_variable(source).entity.is_person: + amount = tax_unit.members(source, period) + return tax_unit.sum(np.rint(amount.astype(float) * 100)) + amount = add(tax_unit, period, [source]) + return np.rint(amount.astype(float) * 100) + + +def _apply_worksheet_limits( + tax_unit, period, salt_claimed, salt_ratio, itemized_deductions +): itemizes = tax_unit("tax_unit_itemizes", period) salt = min_(salt_claimed * salt_ratio, salt_claimed) - standard_deduction = tax_unit("standard_deduction", period) - if irs_deductions.itemized.limitation.obbb.applies: - # Compare the federal total after the section 68 reduction. - us_itemized_deductions = tax_unit("nm_itemized_deductions", period) - else: - itm_deds_less_salt = tax_unit("itemized_deductions_less_salt", period) - us_itemized_deductions = itm_deds_less_salt + salt_claimed - itemized_excess = max_(us_itemized_deductions - standard_deduction, 0) - + itemized_excess = max_(itemized_deductions - standard_deduction, 0) return where(itemizes, min_(salt, itemized_excess), 0) diff --git a/source_conflicts/candidates.yaml b/source_conflicts/candidates.yaml index ca5e93fde5e..dd3904aa40c 100644 --- a/source_conflicts/candidates.yaml +++ b/source_conflicts/candidates.yaml @@ -10253,6 +10253,33 @@ candidates: nm_additional_2021_income_rebate.py, nm_supplemental_2021_income_rebate.py, nm_deduction_for_certain_dependents_eligible.py, nm_cdcc_eligible.py, nm_medical_expense_credit.py). Ruled in October 2026 to follow the per-spouse gap-fill; verify which listed credits and rebates share that treatment.' +- id: us-nm:salt-add-back-elected-sales-tax + program: income-tax + years: + from: 2019 + type: tax + question: Does the PIT-1 line 10 add-back include general sales tax elected on Schedule A line 5a? + sources: + - kind: statute + citation: NMSA 1978 ยง 7-2-2(N)(2) (2023 HB 368, p. 7) + url: https://www.nmlegis.gov/Sessions/23%20Regular/final/HB0368.pdf#page=7 + - kind: instructions + citation: 2019 PIT-1 line 10 worksheet, line 1 (p. 22) + url: https://realfile.tax.newmexico.gov/2019pit-1-ins.pdf#page=22 + - kind: instructions + citation: 2025 PIT-1 line 10 worksheet, line 1 (p. 24) + url: https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24 + readings: + statute: Include state and local income or sales tax claimed as an itemized deduction, using the elected amount on line 5a. + other: Read the worksheet literally and include only income tax claimed on line 5a. + example: A 2025 single filer electing $8,000 of sales tax with $12,000 of real estate tax adds back $4,250 under the statute or $0 under the literal worksheet. + pe_us: + follows: statute + code: + - policyengine_us/variables/gov/states/nm/tax/income/deductions/nm_salt_add_back.py + prs: + - https://github.com/PolicyEngine/policyengine-us/pull/11299 + state: ruled - id: us-nv:liheap-cap-band-125-percent-column program: liheap years: diff --git a/source_conflicts/sources/us-nm/pit-1-instructions-2019-p22.txt b/source_conflicts/sources/us-nm/pit-1-instructions-2019-p22.txt new file mode 100644 index 00000000000..08aee898f55 --- /dev/null +++ b/source_conflicts/sources/us-nm/pit-1-instructions-2019-p22.txt @@ -0,0 +1,6 @@ +Source: https://realfile.tax.newmexico.gov/2019pit-1-ins.pdf#page=22 +Retrieved: 2026-11-30 (America/New_York) +Source PDF SHA-256: d6fe0660d50c6c5feea1e780d3d5999584384a7d33783464ee6e0f038eaf7e1a +Page 22, PIT-1 line 10 worksheet, line 1. Text extracted with pdftotext; line breaks joined. + +Enter the amount of state and local income taxes claimed on federal Schedule A, line 5a. diff --git a/source_conflicts/sources/us-nm/pit-1-instructions-2025-p24.txt b/source_conflicts/sources/us-nm/pit-1-instructions-2025-p24.txt new file mode 100644 index 00000000000..3deaceda1b9 --- /dev/null +++ b/source_conflicts/sources/us-nm/pit-1-instructions-2025-p24.txt @@ -0,0 +1,6 @@ +Source: https://realfile.tax.newmexico.gov/2025pit-1-ins.pdf#page=24 +Retrieved: 2026-11-30 (America/New_York) +Source PDF SHA-256: 7d578286a047513ef579659b3683cca5818e21e64448e6b442ae217dce27067a +Page 24, PIT-1 line 10 worksheet, line 1. Text extracted with pdftotext; line breaks joined. + +Enter the amount of state and local income taxes claimed on federal Schedule A, line 5a.