diff --git a/changelog.d/fix-vt-veteran-credit-rounding.fixed.md b/changelog.d/fix-vt-veteran-credit-rounding.fixed.md new file mode 100644 index 00000000000..03730f45237 --- /dev/null +++ b/changelog.d/fix-vt-veteran-credit-rounding.fixed.md @@ -0,0 +1 @@ +Count only whole $100 steps of adjusted gross income above $25,000 in the Vermont veteran tax credit's phase-out, as the Department of Taxes directs on Schedule IN-112. Veteran filers with adjusted gross income from $25,001 to $29,999, other than a multiple of $100, now receive $5 more. diff --git a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/amount.yaml b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/amount.yaml index 5b30ceaee98..ea71c0f7204 100644 --- a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/amount.yaml +++ b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/amount.yaml @@ -7,7 +7,7 @@ metadata: - title: Vermont Legislature S.51 Bill Status href: https://legislature.vermont.gov/Documents/2026/Docs/BILLS/S-0051/S-0051%20As%20Passed%20by%20Both%20House%20and%20Senate%20Official.pdf#page=11 - title: 2025 Vermont Income Tax Return Booklet - href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=36 + href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=34 values: 2000-01-01: 0 2025-01-01: 250 diff --git a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/full_credit_threshold.yaml b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/full_credit_threshold.yaml index 1a2c45a4074..cffa9da3f09 100644 --- a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/full_credit_threshold.yaml +++ b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/full_credit_threshold.yaml @@ -7,7 +7,7 @@ metadata: - title: Vermont Legislature S.51 Bill Status href: https://legislature.vermont.gov/Documents/2026/Docs/BILLS/S-0051/S-0051%20As%20Passed%20by%20Both%20House%20and%20Senate%20Official.pdf#page=11 - title: 2025 Vermont Income Tax Return Booklet - href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=36 + href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=34 values: 2000-01-01: 0 2025-01-01: 25_000 diff --git a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/income_increment.yaml b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/income_increment.yaml index 3e5b19543af..b2e794d4e00 100644 --- a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/income_increment.yaml +++ b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/income_increment.yaml @@ -7,7 +7,7 @@ metadata: - title: Vermont Legislature S.51 Bill Status href: https://legislature.vermont.gov/Documents/2026/Docs/BILLS/S-0051/S-0051%20As%20Passed%20by%20Both%20House%20and%20Senate%20Official.pdf#page=11 - title: 2025 Vermont Income Tax Return Booklet - href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=36 + href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=34 values: 2000-01-01: 0 2025-01-01: 100 diff --git a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/partial_credit_threshold.yaml b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/partial_credit_threshold.yaml index e22c47c13d5..10fb3f9df37 100644 --- a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/partial_credit_threshold.yaml +++ b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/partial_credit_threshold.yaml @@ -7,7 +7,7 @@ metadata: - title: Vermont Legislature S.51 Bill Status href: https://legislature.vermont.gov/Documents/2026/Docs/BILLS/S-0051/S-0051%20As%20Passed%20by%20Both%20House%20and%20Senate%20Official.pdf#page=11 - title: 2025 Vermont Income Tax Return Booklet - href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=36 + href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=34 values: 2000-01-01: 0 2025-01-01: 30_000 diff --git a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/reduction_per_increment.yaml b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/reduction_per_increment.yaml index ea78f6f378c..f4c999110d5 100644 --- a/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/reduction_per_increment.yaml +++ b/policyengine_us/parameters/gov/states/vt/tax/income/credits/veteran/reduction_per_increment.yaml @@ -7,7 +7,7 @@ metadata: - title: Vermont Legislature S.51 Bill Status href: https://legislature.vermont.gov/Documents/2026/Docs/BILLS/S-0051/S-0051%20As%20Passed%20by%20Both%20House%20and%20Senate%20Official.pdf#page=11 - title: 2025 Vermont Income Tax Return Booklet - href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=36 + href: https://tax.vermont.gov/sites/tax/files/documents/Income-Booklet-2025.pdf#page=34 values: 2000-01-01: 0 2025-01-01: 5 diff --git a/policyengine_us/tests/core/test_vt_veteran_tax_credit_invariants.py b/policyengine_us/tests/core/test_vt_veteran_tax_credit_invariants.py new file mode 100644 index 00000000000..ac6f9d15d8d --- /dev/null +++ b/policyengine_us/tests/core/test_vt_veteran_tax_credit_invariants.py @@ -0,0 +1,169 @@ +"""Invariants for Vermont's veteran tax credit, 32 V.S.A. § 5830g. + +Under subsection (c), Vermont pays $250 on federal adjusted gross income (AGI) +of $25,000 or less, "$250.00 less $5.00 per $100.00" of AGI above $25,000 +while AGI stays below $30,000, and nothing from $30,000. On the 2025 +Schedule IN-112 (Part II, lines 8-12), filers count whole hundreds: line 10 +has them divide the excess by 100, "rounding down to the nearest whole number". + +`_worksheet` follows those lines with the dollar amounts typed from the statute +and the schedule, so it reads neither the parameters nor the formula. For every +tax unit: + +1. Differential: a Vermont tax unit with a veteran gets the worksheet's amount + from 2025, and every other tax unit gets zero. One simulation per year checks + each whole-dollar AGI from $0 to $35,000. Hypothesis adds negative, large and + fractional AGIs, joint units, units without a veteran, New Hampshire units + and 2024, the year before the credit began. +2. Bounds: 0 <= credit <= $250. +3. Monotonicity: among Vermont units with a veteran, a higher AGI never brings + a higher credit. +""" + +import numpy as np +import pytest +from hypothesis import HealthCheck, given, settings +from hypothesis import strategies as st + +from policyengine_us import Simulation + +TOLERANCE = 0.001 # dollars + +MAXIMUM_CREDIT = 250 +FULL_CREDIT_AGI_LIMIT = 25_000 +NO_CREDIT_AGI = 30_000 +FIRST_YEAR = 2025 +YEARS = (2024, 2025, 2026) + + +def _worksheet(agi): + """2025 Schedule IN-112, Part II, lines 8-12, then § 5830g(c)(3).""" + line_8 = np.asarray(agi, dtype=float) + line_9 = np.where( + line_8 <= FULL_CREDIT_AGI_LIMIT, 0, line_8 - FULL_CREDIT_AGI_LIMIT + ) + line_10 = np.floor(line_9 / 100) + line_11 = line_10 * 5 + line_12 = np.where(line_9 == 0, MAXIMUM_CREDIT, MAXIMUM_CREDIT - line_11) + return np.where(line_8 >= NO_CREDIT_AGI, 0, line_12) + + +@pytest.mark.parametrize("year", [2025, 2026]) +def test_vt_veteran_tax_credit_matches_worksheet_at_every_whole_dollar(year): + top = 35_000 + sim = Simulation( + situation={ + "people": {"veteran": {"is_veteran": {year: True}}}, + "tax_units": {"tax_unit": {"members": ["veteran"]}}, + "households": { + "household": {"members": ["veteran"], "state_code": {year: "VT"}} + }, + "axes": [ + [ + { + "name": "adjusted_gross_income", + "min": 0, + "max": top, + "count": top + 1, + "period": year, + } + ] + ], + } + ) + agi = np.asarray(sim.calculate("adjusted_gross_income", year), dtype=float) + credit = np.asarray(sim.calculate("vt_veteran_tax_credit", year), dtype=float) + + np.testing.assert_array_equal(agi, np.arange(top + 1)) + np.testing.assert_allclose(credit, _worksheet(agi), atol=TOLERANCE) + + # Each whole $100 above $25,000 takes $5, and the last $5 goes at $30,000. + assert set(np.unique(credit)) == set(range(0, MAXIMUM_CREDIT + 1, 5)) + assert credit[29_999] == 5 and credit[30_000] == 0 + assert (np.diff(credit) <= 0).all() + + +agis = st.one_of( + st.integers(-50_000, 60_000).map(float), + st.integers(24_900, 30_100).map(float), + st.integers(2_490_000, 3_010_000).map(lambda cents: cents / 100), + st.sampled_from( + [ + 25_000.0, + 25_000.01, + 25_099.99, + 25_100.0, + 29_899.99, + 29_900.0, + 29_999.99, + 30_000.0, + ] + ), +) + + +@st.composite +def tax_units(draw): + joint = draw(st.booleans()) + return { + "agi": draw(agis), + "state": draw(st.sampled_from(["VT", "VT", "VT", "NH"])), + "veterans": [draw(st.booleans()) for _ in range(2 if joint else 1)], + } + + +def _situation(units): + # One simulation holds every year, so every_year keys each input by all of YEARS. + def every_year(value): + return {year: value for year in YEARS} + + people, tax_unit_inputs, households = {}, {}, {} + for i, unit in enumerate(units): + members = [] + for j, is_veteran in enumerate(unit["veterans"]): + name = f"person_{i}_{j}" + people[name] = {"age": every_year(40), "is_veteran": every_year(is_veteran)} + members.append(name) + tax_unit_inputs[f"tax_unit_{i}"] = { + "members": members, + "adjusted_gross_income": every_year(unit["agi"]), + } + households[f"household_{i}"] = { + "members": members, + "state_code": every_year(unit["state"]), + } + return {"people": people, "tax_units": tax_unit_inputs, "households": households} + + +def _check(units): + sim = Simulation(situation=_situation(units)) + has_veteran = np.array([any(unit["veterans"]) for unit in units]) + in_vermont = np.array([unit["state"] == "VT" for unit in units]) + for year in YEARS: + agi = np.asarray(sim.calculate("adjusted_gross_income", year), dtype=float) + credit = np.asarray(sim.calculate("vt_veteran_tax_credit", year), dtype=float) + qualifies = has_veteran & in_vermont & (year >= FIRST_YEAR) + + # 1. Differential against the worksheet. + np.testing.assert_allclose( + credit, np.where(qualifies, _worksheet(agi), 0), atol=TOLERANCE + ) + + # 2. Bounds. + assert (credit >= 0).all() + assert (credit <= MAXIMUM_CREDIT).all() + + # 3. Monotonicity in AGI among the units that qualify. + by_agi = np.argsort(agi[qualifies], kind="stable") + assert (np.diff(credit[qualifies][by_agi]) <= TOLERANCE).all() + + +@settings( + max_examples=12, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], +) +@given(st.lists(tax_units(), min_size=1, max_size=20)) +def test_vt_veteran_tax_credit_invariants(units): + _check(units) diff --git a/policyengine_us/tests/policy/baseline/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml b/policyengine_us/tests/policy/baseline/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml index f51d241fe7f..c6c9356224a 100644 --- a/policyengine_us/tests/policy/baseline/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml +++ b/policyengine_us/tests/policy/baseline/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml @@ -149,3 +149,174 @@ state_code: VT output: vt_veteran_tax_credit: 0 + +- name: Veteran tax credit, 2025, negative AGI, line 9 is 0, pays $250 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: -1_000 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2025, $24,999 AGI, line 9 is 0, pays $250 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 24_999 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2025, $25,000 AGI, line 9 is 0, pays $250 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_000 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2025, $25,001 AGI, floor(1 / 100) = 0, pays $250 - 0 x $5 = $250 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_001 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2025, $25,099 AGI, floor(99 / 100) = 0, pays $250 - 0 x $5 = $250 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_099 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2025, $25,100 AGI, floor(100 / 100) = 1, pays $250 - 1 x $5 = $245 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_100 + output: + vt_veteran_tax_credit: 245 + +- name: Veteran tax credit, 2025, $25,101 AGI, floor(101 / 100) = 1, pays $250 - 1 x $5 = $245 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_101 + output: + vt_veteran_tax_credit: 245 + +- name: Veteran tax credit, 2025, $25,199 AGI, floor(199 / 100) = 1, pays $250 - 1 x $5 = $245 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_199 + output: + vt_veteran_tax_credit: 245 + +- name: Veteran tax credit, 2025, $25,200 AGI, floor(200 / 100) = 2, pays $250 - 2 x $5 = $240 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_200 + output: + vt_veteran_tax_credit: 240 + +- name: Veteran tax credit, 2025, $27,550 AGI, floor(2,550 / 100) = 25, pays $250 - 25 x $5 = $125 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 27_550 + output: + vt_veteran_tax_credit: 125 + +- name: Veteran tax credit, 2025, $29,899 AGI, floor(4,899 / 100) = 48, pays $250 - 48 x $5 = $10 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 29_899 + output: + vt_veteran_tax_credit: 10 + +- name: Veteran tax credit, 2025, $29,900 AGI, floor(4,900 / 100) = 49, pays $250 - 49 x $5 = $5 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 29_900 + output: + vt_veteran_tax_credit: 5 + +- name: Veteran tax credit, 2025, $29,901 AGI, floor(4,901 / 100) = 49, pays $250 - 49 x $5 = $5 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 29_901 + output: + vt_veteran_tax_credit: 5 + +- name: Veteran tax credit, 2025, $29,999 AGI, floor(4,999 / 100) = 49, pays $250 - 49 x $5 = $5 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 29_999 + output: + vt_veteran_tax_credit: 5 + +- name: Veteran tax credit, 2025, $30,000 AGI, at the $30,000 cutoff, pays $0 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 30_000 + output: + vt_veteran_tax_credit: 0 + +- name: Veteran tax credit, 2025, $30,001 AGI, above the $30,000 cutoff, pays $0 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 30_001 + output: + vt_veteran_tax_credit: 0 + +- name: Veteran tax credit, 2025, $30,100 AGI, above the $30,000 cutoff, pays $0 + period: 2025 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 30_100 + output: + vt_veteran_tax_credit: 0 + +- name: Veteran tax credit, 2026, $25,099 AGI, floor(99 / 100) = 0, pays $250 - 0 x $5 = $250 + period: 2026 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 25_099 + output: + vt_veteran_tax_credit: 250 + +- name: Veteran tax credit, 2026, $29,999 AGI, floor(4,999 / 100) = 49, pays $250 - 49 x $5 = $5 + period: 2026 + input: + state_code: VT + is_veteran: true + adjusted_gross_income: 29_999 + output: + vt_veteran_tax_credit: 5 diff --git a/policyengine_us/tests/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml b/policyengine_us/tests/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml index d7edaa67399..d47279641ef 100644 --- a/policyengine_us/tests/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml +++ b/policyengine_us/tests/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.yaml @@ -1,6 +1,7 @@ - name: No veteran status - zero credit period: 2025 input: + state_code: VT is_veteran: false adjusted_gross_income: 20_000 output: @@ -29,19 +30,17 @@ input: state_code: VT is_veteran: true - adjusted_gross_income: 25_050 # $50 above threshold, triggers first increment + adjusted_gross_income: 25_050 output: - # ceil(50/100) = 1 increment, $250 - (1 * $5) = $245 - vt_veteran_tax_credit: 245 + vt_veteran_tax_credit: 250 - name: Veteran at exact increment boundary period: 2025 input: state_code: VT is_veteran: true - adjusted_gross_income: 25_200 # Exactly 2 increments above threshold + adjusted_gross_income: 25_200 output: - # ceil(200/100) = 2 increments, $250 - (2 * $5) = $240 vt_veteran_tax_credit: 240 - name: Veteran with moderate income reduction @@ -49,23 +48,23 @@ input: state_code: VT is_veteran: true - adjusted_gross_income: 27_000 # $2,000 above threshold + adjusted_gross_income: 27_000 output: - # ceil(2000/100) = 20 increments, $250 - (20 * $5) = $150 vt_veteran_tax_credit: 150 - name: Veteran near phaseout boundary period: 2025 input: + state_code: VT is_veteran: true - adjusted_gross_income: 29_950 # $50 below $30,000 threshold + adjusted_gross_income: 29_950 output: - # ceil(4950/100) = 50 increments, $250 - (50 * $5) = $0 (max reduction reached) - vt_veteran_tax_credit: 0 + vt_veteran_tax_credit: 5 - name: Veteran above partial credit threshold - no credit period: 2025 input: + state_code: VT is_veteran: true adjusted_gross_income: 35_000 # Above $30,000 threshold output: @@ -74,6 +73,7 @@ - name: Before 2025 - no credit regardless of veteran status and income period: 2024 input: + state_code: VT is_veteran: true adjusted_gross_income: 15_000 # Low income but before effective date output: diff --git a/policyengine_us/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.py b/policyengine_us/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.py index 5682d1c8397..e37b90e5386 100644 --- a/policyengine_us/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.py +++ b/policyengine_us/variables/gov/states/vt/tax/income/credits/vt_veteran_tax_credit.py @@ -8,7 +8,9 @@ class vt_veteran_tax_credit(Variable): definition_period = YEAR unit = USD reference = [ - "https://vtdigger.org/2025/06/25/gov-phil-scott-signs-13-5-million-tax-credit-package-benefiting-low-income-workers-families-retirees-and-veterans/" + "https://legislature.vermont.gov/statutes/section/32/151/05830g", + "https://tax.vermont.gov/sites/tax/files/documents/IN-112-2025.pdf#page=2", + "https://tax.vermont.gov/sites/tax/files/documents/IN-112-Instr-2025.pdf#page=5", ] defined_for = StateCode.VT documentation = "Vermont veteran tax credit providing $250 refundable credit for low-income veterans as part of S.51 (2025) tax relief package." @@ -38,8 +40,9 @@ def formula(tax_unit, period, parameters): # Calculate partial credit amount based on parameterized reduction structure excess_income = agi - p.full_credit_threshold - # Number of income increments (rounded up) - income_increments = np.ceil(excess_income / p.income_increment) + # Filers count whole increments and drop any partial one + # (2025 Schedule IN-112, Part II, line 10). + income_increments = np.floor(excess_income / p.income_increment) # Reduction per increment reduction_amount = income_increments * p.reduction_per_increment # Calculate partial credit (minimum of 0)