Skip to content

Limit Alabama, North Carolina and Hawaii mortgage interest to the amounts their laws allow - #10274

Merged
MaxGhenis merged 9 commits into
mainfrom
state-mortgage-interest-federal-cap
Oct 23, 2026
Merged

MaxGhenis merged 9 commits into
mainfrom
state-mortgage-interest-federal-cap

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Alabama, North Carolina and Hawaii read uncapped mortgage_interest, so they allowed interest on debt above the IRC 163(h)(3) acquisition-debt limits. With $40,000 of interest on $1.5M of 2020 debt, main allows $40,000 in all three states. Federal law allows $20,000.

  • Alabama and North Carolina allow only the interest federal law allows. They now read deductible_mortgage_interest, the amount after the federal limits.
  • Hawaii makes IRC 163(h)(3)(F) inoperative, so it keeps the pre-TCJA limits: $1,000,000 of acquisition debt plus $100,000 of home equity debt. The new hi_mortgage_interest_deduction applies them using the N-11 / 2017 Publication 936 worksheet calculation with a PE federal-floor safeguard.

The US + core hub's round-2 review of #10003 found the defect; it is pre-existing on main. This PR supersedes the unopened branch al-nc-mortgage-interest-federal-cap (2efb58d). That branch's review blockers (mixed-vintage and grandfathered debt) were fixed on main by #10025.

Law

State Provision What it allows
Alabama Code of Alabama 40-18-15(a)(2): interest "limited to the amount allowable as an interest deduction for federal income tax purposes in the corresponding tax year or period pursuant to the provisions of 26 U.S.C. §§ 163, 264, and 265". Act 2026-604 (HB527) restyles the section and keeps this text. Federal amount
2025 Form 40 instructions, Schedule A lines 10a–14, PDF pp. 19–20: "limited in most cases to the same amount as currently allowable for federal purposes". The "in most cases" covers the Mortgage Interest Credit exception, which PE does not model.
North Carolina G.S. 105-153.5(a)(2)b: "the amount allowed as a deduction for interest paid or accrued during the taxable year under section 163(h) of the Code with respect to any qualified residence", plus property taxes, capped at $20,000. Federal amount
2025 Form D-401, Schedule A line 1, PDF p. 20 repeats it. S.L. 2026-31 §12(a), PDF p. 42 moves "Code" (G.S. 105-228.90(b)(7)) to July 5, 2025, effective when it became law. That date includes P.L. 119-21's permanent $750,000 limit, so 2026 matches federal.
Hawaii HRS 235-2.4(j)(3): "Section 163(h)(3)(F) (limiting mortgage interest)" is not operative. Act 35, SLH 2026, PDF p. 21 reletters it (i)(3) for taxable years after 2025 and keeps it. Pre-TCJA limits
2018 N-11 instructions, line 21c, PDF p. 19: Act 27, SLH 2018 does not adopt the lower dollar limit or the home equity suspension. 2025 N-11, line 21c, PDF p. 17: "See the 2017 federal Publication 936 to figure your deduction".
2017 Publication 936, Table 1 (PDF p. 11): $1,000,000 acquisition limit reduced by grandfathered debt (lines 3–6); home equity debt up to $100,000 (line 7); line 11 ratio "rounded to three places". Figure A note 3 (PDF p. 3): amounts over $1,000,000 "may qualify as home equity debt". PDF p. 13: deductible points take the same line 11 ratio.

The limits are halved for married filing separately.

Allocation gap-fill. The checked law does not prescribe decimal rounding. Treas. Reg. 1.163-10T(c)–(g) provides alternative allocation methods without a rounding rule. CCA 201201017, PDF p. 5, a nonprecedential memorandum, discusses reasonable methods and approximations under the later debt limits. Hawaii's HRS 235-2.5(b) authorizes adoption of Treasury regulations by rule; HAR 18-235-2.3(a)(3) adopts federal regulations through January 1, 1979, before that 1987 temporary regulation. N-11's direction to the 2017 Publication 936 worksheet therefore supplies an administrative gap-fill, rather than a statutory rounding requirement. PE retains that three-place worksheet rounding and separately floors the result at its federal deduction. The floor is PE's chosen safeguard; worksheet line 12 only multiplies interest by the rounded fraction. This wording update leaves the arithmetic unchanged.

Before and after

$40,000 of interest. Before = main f9b55fc4dd; after = this head.

Case Federal AL before → after NC line 1 before → after HI before → after
Single, $1.5M from 2020 (the witness) $20,000 $40,000 → $20,000 $40,000 → $20,000 $40,000 → $29,320
Same, 2026 $20,000 $40,000 → $20,000 $40,000 → $20,000 $40,000 → $29,320
Separate, $1.5M from 2020 $10,000 $40,000 → $14,680
Joint, $1.5M from 2016 $26,666.67 $40,000 → $26,666.67
Joint, $1.5M from 1986 (grandfathered) $40,000 $40,000 → $40,000 $40,000 → $40,000
Joint, $1.2M from 1985 + $300k from 2020 $32,000 $40,000 → $34,680
Single, $900k from 2020, $36,000 interest $30,000 $36,000 → $36,000

Hawaii's figures: $1,100,000 / $1,500,000 rounds to .733 (× $40,000 = $29,320). The $900k row is the control for Hawaii's own limit: it is above the federal $750,000 limit but below Hawaii's $1,000,000, so the full $36,000 stays deductible.

Rounding conventions. The federal, Alabama and North Carolina amounts follow PE's existing federal calculation, which uses the exact ratio. The 2025 Table 1 (line 14) rounds it to three places, which can move an amount by up to about 0.05% of the interest: $26,680 rather than $26,666.67 for the 2016 row. This PR doesn't change that convention. Hawaii uses the N-11 / 2017 worksheet as a gap-fill: line 11 rounds to three places, and PE uses half-up rounding at ties. The federal-floor safeguard is separate from worksheet line 12. The worksheet rounding matches rulespec-us#1556. source_conflicts/candidates.yaml (us:mortgage-interest-limit-ratio-rounding) now records both conventions, the code that follows each, and that settling the federal reading (rulespec-us#1413) for both would make the floor unnecessary.

North Carolina's $20,000 cap hides line 1 in some cases, so the deduction tests use smaller amounts. Single, $15,000 interest on $1.5M from 2020, $5,000 property tax: line 5 goes from $20,000 to $12,500. Separate spouses, one with $30,000 on $1.2M from 2020 and the other with $10,000 and no balance: before, the $40,000 total was prorated to $15,000 and $5,000. After, it is $9,375 and $10,000, under the shared cap.

Changes

  • al_investment_interest.py (al_interest_deduction) adds deductible_mortgage_interest instead of mortgage_interest, alongside investment interest and Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's deductible_mortgage_insurance_premiums. The references cite Form 40 (they said Form 1040) with PDF pages, each comment above its href, and keep Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's 2021 booklet (lines 10a–14) and Schedule A line 11 (premiums) entries.

  • nc_mortgage_and_property_tax_before_limitation reads deductible_mortgage_interest on line 1, then adds Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's conformed premiums from 2026. Its one SL 2026-31 reference covers both the $750,000 limit and the premium restoration.

  • New hi_mortgage_interest_deduction and two parameters, gov.states.hi.tax.income.deductions.itemized.interest.home_acquisition_debt_limit and .home_equity_debt_limit. They take effect 2018-01-01, when Hawaii's itemized sources start. The formula has three helpers:

    • _hi_qualified_loan_limit computes Table 1 lines 1–8. Grandfathered debt reuses main's _debt_by_vintage.
    • _hi_deductible_share computes line 11, rounded half up to three places in double precision.
    • _hi_allowed_interest uses the worksheet calculation with a PE federal-floor safeguard: line 12 multiplies interest paid (the federally deductible and non-deductible parts together) by line 11, then PE floors the result at its federal deduction. When federal law disallows none of the interest, it keeps the federal amount, so a directly supplied deduction is not limited a second time. The floor is PE's chosen approximation and is not prescribed by line 12.

    hi_interest_deduction adds the new variable instead of mortgage_interest, alongside investment interest and Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's hi_deductible_mortgage_insurance_premiums. It cites its 2022 N-11 source once, plus Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's Announcement 2021-01.

  • Tests: nine existing NC cases that put the uncapped mortgage_interest in as an input now use the canonical home_mortgage_interest. Their expected values are unchanged, and the renamed cases pass on main too. Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's case "Restored premiums share North Carolina's 20000 mortgage and tax cap" (2026) gets the same rename (home_mortgage_interest: 19_000): with no balance, all of it is federally deductible, so line 3 is $19,000 + $2,000 = $21,000 and the deduction is capped at $20,000. With mortgage_interest left in, line 1 would have been $0 and both outputs $2,000.

  • Hawaii boundary and filing-status cases (2025, 2020 debt), hand-checked from 2017 Pub. 936 Table 1:

    Case Line 8 / line 9 Hawaii Federal
    SINGLE, $44,000 on $1,100,000 equal, "stop here" $44,000 $30,000
    SINGLE, $44,000 on $1,101,000 .99909 → .999 $43,956 $29,972.75
    SEPARATE, $22,000 on $550,000 equal $22,000 $15,000
    HEAD_OF_HOUSEHOLD, $40,000 on $1,500,000 .733 $29,320 $20,000
    SURVIVING_SPOUSE, $40,000 on $1,500,000 .733 $29,320 $20,000

    Three-place rounding keeps the share at 1.000 until total debt passes $1,100,000 / .9995 ≈ $1,100,550; the YAML comment says so, and the property test checks $1,100,550 (1.000) and $1,100,551 (.999).

Invariants

  1. AL and NC never exceed the federal amount. Alabama's mortgage component and the mortgage-interest component of North Carolina's line 1 equal the federal deductible mortgage interest for every household, by construction: they add deductible_mortgage_interest. The YAML covers the cases where they differ from main: above the limit, a pre-2018 vintage, mixed vintages, separate filers, 2026, and spouses filing separately under the shared cap. It also covers the controls where they don't: within the limit, no balance, grandfathered debt.
  2. Hawaii lies between federal and gross. For every pair of loans, filing status and vintage: grandfathered debt ≤ Hawaii qualified loan limit ≤ total debt, and the Hawaii limit is at least the federal limit. The rounded share lies in [0, 1], within .0005 of the exact ratio, and at or above the federal share for the drawn balances (each loan up to $3M). PE's separate federal-floor safeguard ensures federal deductible ≤ Hawaii deduction ≤ interest paid, including when rounded Hawaii interest would fall below the unrounded federal amount. One limit applies after October 13, 1987: moving a loan between 2017 and 2018 never changes Hawaii's limit, and moving it into the grandfathered years never lowers it. The limit is order-invariant and monotone in balances. It matches two independent restatements, one line by line from 2017 Table 1 and one in the statute's order ((B)(ii), (C)(ii), (D) without (F)). test_hi_mortgage_debt_limit_invariants.py checks all of this with Hypothesis (400 examples), plus half-up rounding at .3125 and the 1.000 threshold at $1,100,550. It reads the Hawaii and federal limits from the parameter tree for all five filing statuses in 2018, 2025 and 2026, and a separate check ties the Hawaii parameters to the statute's $1,000,000 and $100,000 ($500,000 and $50,000 separate).
  3. No balance means no limit, as in the federal calculation. A tax unit that reports interest but no balance keeps all of it in all three states.
  4. A supplied deduction is not limited twice. For every deductible, non-deductible and line 11 value, PE's worksheet-based approximation lies between the federal deduction and the interest paid. It equals the federal deduction when nothing is federally disallowed. Otherwise it equals interest paid times line 11, floored at the federal amount. The property test checks this. In YAML, $20,000 supplied as deductible_mortgage_interest with $1.5M of debt stays $20,000 (it was $14,660 before review r1). hi/tax/income/integration.yaml (supplied deduction, no balance) is unchanged.
  5. Precision. Line 11 is divided and rounded in double precision, so stored balances give the same line 11 whether they arrive as single- or double-precision arrays. $1,100,000 / $1,128,784 = .97449999 gives .974, or $38,960 on $40,000; single-precision division gave .975 and $39,000. Core still stores inputs in single precision, which this PR doesn't change. A balance that single precision can't hold exactly is rounded before Hawaii sees it. Review r2's examples: $1,128,783.99 is stored as $1,128,784 and gives $38,960 where the worksheet gives $39,000; $17,054,263 gives $2,560 where it gives $2,600.

Mutation checks on the Hawaii helpers, all reverted:

  • Dropping line 7 (home equity) fails the property test, falsified by a $550,000 separate-filer loan.
  • Scaling the acquisition limit by 0.75 (as if the federal $750,000 limit applied) fails it too, falsified by a $500,000 separate-filer loan.
  • Removing the double-precision cast fails 2 tests.
  • Removing the pass-through fails 1 test.
  • Setting the Hawaii HEAD_OF_HOUSEHOLD acquisition limit to $500,000 fails 2 tests: the statutory-amount check and the Hawaii ≥ federal bound (falsified by a $750,000 loan).

Tests

Current verification at d830def93a, after merging upstream/main 86d3ae6c6d (which includes #10003) with a merge commit:

File Passed
al/.../itemized/al_interest_deduction.yaml (10 + #10003's 4) 14
nc/.../nc_mortgage_and_property_tax_before_limitation.yaml (9 + #10003's 5) 14
nc/.../nc_mortgage_and_property_tax_deduction.yaml 12
nc/.../nc_itemized_deductions.yaml 6
nc/.../itemized/nc_claim_of_right_deduction.yaml 17
hi/.../itemized/hi_mortgage_interest_deduction.yaml (17 + 5 new) 22
hi/.../itemized/hi_interest_deduction.yaml (#10003's, now adding hi_mortgage_interest_deduction) 7
hi/tax/income/integration.yaml 15
tests/core/test_hi_mortgage_debt_limit_invariants.py 4
tests/code_health/test_source_conflicts.py 103
tests/code_health/test_reference_urls.py 32
tests/code_health/test_no_group_variables_in_person_adds.py 10

Each file ran separately in the foreground, one process at a time, with all thread caps set to 4 and OMP_WAIT_POLICY=PASSIVE: 256 passed, 0 failed. Ruff 0.15.5 format and check pass on the changed Python files, and git diff --check passes.

Historical verification below is from the original reviewed head 6dadd9973d; each file ran alone with thread caps of 4.

File Main f9b55fc4dd Reviewed head 6dadd9973d
al/.../itemized/al_interest_deduction.yaml (new) 7 failed, 3 passed 10 passed
nc/.../nc_mortgage_and_property_tax_before_limitation.yaml 4 failed, 5 passed 9 passed
nc/.../nc_mortgage_and_property_tax_deduction.yaml 2 failed, 10 passed 12 passed
nc/.../nc_itemized_deductions.yaml (inputs renamed) 6 passed 6 passed
nc/.../itemized/nc_claim_of_right_deduction.yaml (input renamed) 17 passed 17 passed
hi/.../itemized/hi_mortgage_interest_deduction.yaml (new; on main the same cases assert hi_interest_deduction) 10 failed, 6 passed 16 passed
tests/core/test_hi_mortgage_debt_limit_invariants.py (new) helpers absent 3 passed

The cases that pass on main are the controls: within the limit, no balance, grandfathered debt, Hawaii's $900k and $1.05M rows, a supplied Hawaii deduction, and the renamed inputs. At the previous head 9fde8b6eae, review r1 reproduced Hawaii's supplied-deduction case at $14,660 and the $1,128,784 case at $39,000; both now pass.

Folder runs, one subdirectory per process (test_batched.py --mode per-subdir --workers 1):

  • Hawaii passes at 6dadd9973d: 74 files and 602 cases.
  • Alabama (60 files, 448 cases) and North Carolina (51 files, 374 cases) passed at 9fde8b6eae. Neither state's code changed after that, and their changed YAML files were rerun at 6dadd9973d above.

Other suites:

  • test_mortgage_debt_limit_invariants.py and test_nc_mortgage_and_property_tax_limitation_invariants.py pass.
  • The federal deductible_mortgage_interest.yaml (11) and deductible_mortgage_interest_tax_unit.yaml (18) pass.
  • In the code-health tests on references, parameters and test routing, 204 pass. Two fail for lack of the coverage module in the local venv, and they fail the same way on main.
  • uvx ruff@0.15.5 format --check, check and git diff --check pass.

The Python invariant test is pure NumPy over the helpers and builds no model. Measured at reviewed head 6dadd9973d locally on macOS, not in CI: under 1 s for the three tests, about 3.5 s for pytest, and 17 s and 1.0 GB peak footprint for the whole process. Almost all of that is import policyengine_us, which the core group's process already pays for test_mortgage_debt_limit_invariants.py. The test lands in the existing Rest Python core group by directory. No CI job, matrix entry or runner changes.

Independent review

GPT-6.1 Sol (subfleet run --task review --tier hard -s workspace-write), on the hub host under ~/reviews/us-hub/reviews-gen/us-10274/:

  • Round 1 (review-r1.md, head 9fde8b6eae): REQUEST_CHANGES. A supplied Hawaii deduction was limited twice, line 11 was rounded in single precision, Axiom parity was incomplete, the exact-ratio convention was unlabelled, and an assertion was missing. Everything is fixed in 6dadd9973d.
  • Round 2 (review-r2.md, head 6dadd9973d): APPROVE. It ran 94 single-file cases, all passing. Its two documentation nits are addressed in this description: the precision claim is narrowed, and the partly supplied components and the federal floor are now listed under known gaps. The subsequent statute-first update changes documentation and references, adds the floor-binding YAML witness, and merges upstream/main; it preserves the formula arithmetic.

DTrim99 (2026-10-21, head e81b3eaec0): REQUEST_CHANGES with no critical items. The law checks out in every claimed year, 29 expectations hand-check, and the two red checks came from main (fixed by #10334). Its two should-address items are done at d830def93a: the #10003 conflicts are resolved as its table says, including the NC case rename, and the Hawaii boundary and filing-status cases are added, with the property test now reading the parameters. Of its four suggestions, the ratio-rounding candidate is updated and the pre-2018 federal gap is listed under known gaps. The rulespec-us#1556 annotation goes to the hub, which owns the Axiom line. The floor's "PE's choice" label needed no change: hi_mortgage_interest_deduction.py merged without conflict.

Merge order with open PRs

Known gaps

  • Fair-market-value limit. Hawaii's home equity debt is also limited by each home's FMV less its acquisition debt. PE has no home-value input, so every home is treated as worth at least its mortgages, as in Apply Hawaii's pre-TCJA mortgage debt limits to the interest deduction #9950 and rulespec-us#1556's fixtures.
  • Partly supplied components. Line 10, interest paid, is the federally deductible plus non-deductible amounts. When a test supplies only one of them, the other is computed from home_mortgage_interest, so the sum is a reconstruction. Review r2's example: $40,000 paid on $940,000 of debt, with only the federal deduction ($31,920) supplied, gives $40,005.11 in Hawaii instead of $40,000. Supplying both, or neither, gives $40,000. This input precedence predates this PR.
  • PE federal-floor safeguard. PE separately floors Hawaii's worksheet calculation at its federal deduction; this is a chosen approximation, not worksheet line 12. With canonical inputs the floor binds when line 11's rounding undercuts PE's unrounded federal aggregate calculation. The new YAML witness uses $497,550,016 of grandfathered debt plus $2,449,984 of 2020 debt and $40,000 of interest: Hawaii's $497,650,016 limit gives a .995300032 ratio, rounded to .995, and worksheet interest of $39,800. The federal amount is $39,804.00128, so PE allows about $39,804 (one-cent test tolerance).
  • Alabama and North Carolina before 2018. PE's federal calculation has no pre-TCJA home equity allowance: before 2018, pre_tcja_cap and cap are both $1,000,000, and nothing models 163(h)(3)(C)'s $100,000. Alabama and North Carolina now read that federal amount, so they inherit the gap for tax years 2017 and earlier. For example, take a 2017 single filer with $40,000 of interest on $1,500,000 of 2010 debt. Federal law (2017 Pub. 936 Table 1) gives .733 × $40,000 = $29,320, while PE federal and now AL and NC give $26,666.67. Before this PR, AL and NC gave $40,000. These years are outside what the PR claims and tests, and the error is now smaller. A federal follow-up would fix all three at once. Hawaii uses its own limits, which include the $100,000 home equity allowance.
  • Home equity debt not used to buy or improve the home. PE has no such input. Federally after 2017 that interest isn't deductible, and in Hawaii it is, up to $100,000. Only debt above the acquisition limit reaches Hawaii's line 7 here.
  • Investment interest. It enters Alabama and Hawaii unchanged, with no IRC 163(d) limit (Limit investment interest deductions under §163(d) and Form 4952 #9977, held under d1054).
  • Alabama vehicle loan interest (2025–2028) is not modeled. A separate hub lane has drafted it (~/reviews/us-hub/al-vehicle-loan-interest, review requested changes, no PR yet).
  • States that decouple from 163(h)(3)(F) but read the capped federal amount under-allow; that is the opposite error. New York is one: its 2025 itemized deduction instructions say the federal changes to home mortgage and home equity interest "do not apply" (Form IT-196 lines 10 and 11) and point to the 2017 Publication 936. Yet PE's New York reads federal interest_deduction; review r1 computed $20,000 where New York allows $29,320 on the witness. Arkansas and others are unchecked. This PR doesn't change them; a follow-up audits every such state.

Impact

Real microsimulations on the default dataset, main f9b55fc4dd against 9fde8b6eae (2025 and 2026), one at a time under the shared heavy lock. All four runs exited 0 with a 14.3 GB peak footprint. Sums are weighted; records are tax units. 2025 was rerun at 6dadd9973d, the review-r1 fix. Every tax and net-income output is identical record by record; hi_interest_deduction differs by at most $0.004 per record, from the switch to double-precision arithmetic. 2026 was not rerun at 6dadd9973d because of disk pause #9. The impact was not rerun at the final head: after 9fde8b6eae the PR's own changes were that precision fix (2025 rerun identical) and the review-r2 items, and the rest were merges of main, which an independent review found change nothing the mortgage cap reads.

Output 2025 2026
state_income_tax +$67.96M (15 AL records; 18,456 weighted) +$72.79M (16 AL records; 18,588 weighted)
al_interest_deduction −$1.359bn −$1.456bn
household_net_income −$67.96M −$72.79M
nc_mortgage_and_property_tax_deduction −$40 (1 record, weight 0.019) −$52 (same record)
nc_income_tax $0 +$0.69
hi_interest_deduction (unweighted: 7 records, −$157,888 / −$178,194) −$67 (weights sum to 0.006) −$82
hi_income_tax +$5.65 +$7.01
federal income_tax, deductible_mortgage_interest_tax_unit unchanged unchanged
  • Alabama carries all but a few dollars of the change. Each changed record has a balance above its federal limit: $750,000, or $375,000 for one separate filer with $504,400 of debt. The tax change is 5.0% of the lower interest deduction, Alabama's top bracket rate (gov.states.al.tax.income.rates).
  • North Carolina: line 3 falls for 29 records in 2025 (31 in 2026), for example from $92,964 to $54,435. All but one were above $20,000 before and after, so their line 5 stays at $20,000. The exception is a separate filer with $439,646 of debt and weight 0.019, whose line 5 falls from $18,166 to $16,058.
  • Hawaii: the dataset's 7 Hawaii records above $1.1M carry a combined weight of 0.006. Their deduction falls by $157,888 in total (2025), but the population result rounds to dollars. The YAML shows the household effect.
  • nc_mortgage_and_property_tax_before_limitation changes for records in every state. It is computed everywhere so that a separately filing spouse in another state counts toward the shared cap, but it reaches tax only in North Carolina. No tax or deduction output changes for any record outside Alabama, North Carolina and Hawaii, and federal tax is unchanged.

Comparison script and per-year JSON: ~/reviews/us-hub/state-mortgage-federal-cap/ (compare.py, impact-2025.json, impact-2026.json) on the hub host.

axiom: HRS 235-2.4(j)(3)/(i)(3) TheAxiomFoundation/rulespec-us#1556 queued (updated 2026-10-19 to point here and add grandfathered debt, the supplied-deduction pass-through and seven companion cases) | Ala. Code 40-18-15(a)(2), N.C. Gen. Stat. 105-153.5(a)(2)b TheAxiomFoundation/rulespec-us#1815 queued (filed under d1142; composes 26 U.S.C. 163(h)(3), #1413 and #1673)

🤖 Generated with Claude Code

MaxGhenis and others added 3 commits October 19, 2026 08:44
…unts their laws allow

Alabama (Code 40-18-15(a)(2)) and North Carolina (G.S. 105-153.5(a)(2)b)
allow only the mortgage interest federal law allows, so they now read
deductible_mortgage_interest, after the 26 U.S.C. 163(h)(3) acquisition-debt
limits, instead of uncapped mortgage_interest.

Hawaii makes IRC 163(h)(3)(F) inoperative (HRS 235-2.4(j)(3), (i)(3) from
2026 under Act 35), so it keeps the pre-TCJA limits for debt incurred at any
time: $1,000,000 of acquisition debt plus up to $100,000 of home equity debt
($500,000 / $50,000 separate), per 2017 Publication 936 Table 1. The new
hi_mortgage_interest_deduction applies them to gross interest, reusing the
federal vintage split for grandfathered debt.

With $40,000 of interest on $1.5M of 2020 debt, main allowed $40,000 in all
three states; now AL and NC allow the federal $20,000 and HI $29,333.33.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…36 Table 1 requires

The 2025 N-11 instructions (line 21c) send Hawaii filers to the 2017
Publication 936 worksheet, whose line 11 rounds the qualified-loan-limit
ratio to three places. TheAxiomFoundation/rulespec-us#1556 encodes the same
rounding, so PE and Axiom agree. Its three companion cases are added to the
Hawaii YAML, and the property test now covers the rounded share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1 (GPT-6.1 Sol) findings:
- Hawaii multiplied a directly supplied deductible_mortgage_interest by the
  worksheet share again ($20,000 supplied on $1.5M of debt gave $14,660).
  Hawaii now starts from interest paid as the federally deductible plus
  non-deductible parts, keeps the federal amount when federal law disallows
  nothing, and never goes below it (_hi_allowed_interest).
- In single precision $1,100,000 / $1,128,784 = .97449999 became .9745 and
  rounded up; the ratio is now computed in double precision.
- Alabama and North Carolina YAML headers say the expectations follow PE's
  exact federal ratio, not the worksheet's three-place rounding.
- Alabama's spouse case now asserts al_itemized_deductions.
- hi_interest_deduction cites the 2022 N-11 once, with both pages.

The property test now covers single-precision inputs and line 12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub (session local_46e50d89-c1b5-4986-bd4e-7ada4b70bf0e)

🤖 Generated with Claude Code

@DTrim99

DTrim99 commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Limit Alabama, North Carolina and Hawaii mortgage interest to the amounts their laws allow

PR #10274 (author: MaxGhenis). Head e81b3eaec0. The branch is 5 commits ahead of main and 11 behind. First review.

Summary

The PR fixes a real over-allowance. Before it, Alabama, North Carolina and Hawaii all added uncapped mortgage_interest, so they allowed interest on acquisition debt above the IRC 163(h)(3) limits. On the law, all three changes are right in every year the PR claims (2018–2026), including where OBBBA made TCJA's $750,000 limit permanent.

  • Alabama. It now adds deductible_mortgage_interest. Ala. Code 40-18-15(a)(2) limits interest to "the amount allowable as an interest deduction for federal income tax purposes in the corresponding tax year". That is rolling conformity, so the 2026 amount follows P.L. 119-21's permanent limit.

  • North Carolina. Line 1 now reads deductible_mortgage_interest. G.S. 105-153.5(a)(2)b allows the interest "allowed as a deduction ... under section 163(h) of the Code". S.L. 2026-31 §12(a) moves "Code" to July 5, 2025, so 2026 keeps the $750,000 limit.

  • Hawaii. The new hi_mortgage_interest_deduction applies the pre-TCJA limits. HRS 235-2.4(j)(3) makes 163(h)(3)(F) inoperative, and Act 35, SLH 2026 keeps it as (i)(3). The formula is the 2017 Publication 936 Table 1 worksheet, which the N-11 instructions point to:

    • acquisition debt up to $1,000,000, reduced by grandfathered debt;
    • up to $100,000 of excess debt as home equity debt;
    • line 11 rounded to three places.

    On top of the worksheet, PE floors the result at its federal deduction. That floor also lets a directly supplied deduction pass through unchanged.

I hand-checked 29 YAML expectations across the three states and found no error. The CI failure is caused by main, not this PR. But the branch now conflicts with main in five files, because #10003 merged after this branch's last merge. One of #10003's North Carolina cases has to change its input when the conflicts are resolved, or it fails.

Open items:

Critical (must fix)

None.

Should address

1. The branch conflicts with main in five files (#10003, merged 2026-10-21 01:47 UTC), and one #10003 case must change its input.

git merge-tree --write-tree PolicyEngine/main e81b3eaec0 reports five conflicts:

File Conflict
variables/gov/states/al/tax/income/deductions/itemized/al_investment_interest.py content
variables/gov/states/hi/tax/income/deductions/itemized/hi_interest_deduction.py content
variables/gov/states/nc/tax/income/deductions/nc_mortgage_and_property_tax_before_limitation.py content
tests/.../al/tax/income/deductions/itemized/al_interest_deduction.yaml add/add
tests/.../nc/tax/income/deductions/nc_mortgage_and_property_tax_before_limitation.yaml content

The PR body's merge guide is right. Now that #10003 has landed first, this PR has to carry it out:

I checked the files that merge cleanly too:

Please also update the PR body's "Merge order" section, which still calls #10003 "approved". Then rerun CI on the merged head.

2. Hawaii has no YAML case at its own boundary, and none for HEAD_OF_HOUSEHOLD or SURVIVING_SPOUSE.

hi_mortgage_interest_deduction.yaml covers:

  • $900,000 (under $1,000,000);
  • $1,050,000 (inside the home equity band);
  • $1,500,000 and $1,300,000 (above it);
  • separate filers at $600,000 and $1,500,000.

The changed logic's own boundary isn't tested: exactly $1,100,000 ($550,000 separate), where line 8 equals line 9. The HEAD_OF_HOUSEHOLD and SURVIVING_SPOUSE parameter rows aren't exercised anywhere. The property test hard-codes LIMITS for "other" and "separate" and never reads the parameter. rulespec-us#1556 asks for the same controls: "Add companion controls for HEAD_OF_HOUSEHOLD and SURVIVING_SPOUSE limits equal to joint/single and for the exact 1.1m boundary."

Suggested cases, all 2025 with 2020 debt, computed by hand from Table 1 (2017 Pub. 936, PDF p. 11):

Case Inputs Line 8 / line 9 Hawaii Federal
Boundary SINGLE, $44,000, $1,100,000 1.000 (line 8 ≥ line 9, "stop here") 44,000 30,000
Just over SINGLE, $44,000, $1,101,000 .99909 → .999 43,956 29,972.75
Separate boundary SEPARATE, $22,000, $550,000 1.000 22,000 15,000
Head of household HEAD_OF_HOUSEHOLD, $40,000, $1,500,000 .733 29,320 20,000
Surviving spouse SURVIVING_SPOUSE, $40,000, $1,500,000 .733 29,320 20,000

The "just over" row also shows that three-place rounding keeps the share at 1.000 until total debt passes about $1,100,550. That is worth stating in a comment.

Suggestions

1. Mark the rulespec-us#1556 cases that depend on #9950. Its 2026-10-19 update correctly points the issue at this PR and adds the seven cases this PR tests. But the original body still lists #9950-era cases that exclude a dependent's payments:

  • Cases 21/25 ("dependent payment excluded");
  • Cases 24/27 (a dependent's 12,000 "excluded");
  • Cases 23/26/28 ("Only a dependent pays/reports 12,000 ... 0").

This head doesn't reproduce them. home_mortgage_interest_tax_unit still pools every member's interest, and home_mortgage_interest_share splits it between head and spouse. For example, a dependent's $12,000 on $1,500,000 gives Hawaii .733 × $12,000 = $8,796, not $0. The filer-only change is held under #9950, as the update says.

Add one line to #1556 saying those case groups track #9950 and aren't expected to match #10274. While there, add the floor-binding witness ($497,550,016 grandfathered plus $2,449,984 from 2020, giving $39,804) and the controls in Should #2.

2. AL and NC now inherit a federal gap for tax years 2017 and earlier. PE's federal calculation has no pre-TCJA home equity allowance. pre_tcja_cap and cap are both $1,000,000 before 2018, with nothing for 163(h)(3)(C). Pre-2018 federal law allowed up to $100,000 of excess debt as home equity debt (2017 Pub. 936, Figure A note 3, PDF p. 3).

Example: 2017, single, $40,000 on $1,500,000 from 2010.

Amount
Federal law (.733) $29,320
PE federal, and now AL and NC $26,666.67
AL and NC before this PR $40,000

These years are outside what the PR claims and tests, and the error is now smaller. List them under "Known gaps", or open a federal follow-up so that one fix covers all three.

3. Settle the rounding convention in source_conflicts/candidates.yaml. The entry us:mortgage-interest-limit-ratio-rounding lists this PR, with follows: unknown. Its note "Code not yet on main: deductible_mortgage_interest" is stale; the variable is on main.

After this PR, PE treats the question two ways:

  • The federal, Alabama and North Carolina amounts use the exact ratio.
  • Hawaii uses the worksheet's three places, plus a federal floor that exists only to bridge the two conventions.

Under the repository's rule that forms fill gaps where the statute is silent, the worksheet reading applies to both. Update the candidate to say what each part follows, or resolve it when #1413 picks the federal convention. Unifying the convention would make the Hawaii floor unnecessary.

4. The Hawaii floor has to be documented again at the next change. It binds only when the gap between Hawaii's and the federal limit is under 0.05% of total debt. With canonical inputs, that means more than about $200 million of debt ($100 million for a separate filer). Its docstrings already label it as PE's choice, not worksheet line 12. Keep that label in the merged reference tuple when resolving Should #1.

Verified correct

Law, every claimed year.

  • Alabama.

    • Ala. Code 40-18-15(a)(2): interest "limited to the amount allowable as an interest deduction for federal income tax purposes in the corresponding tax year or period pursuant to the provisions of 26 U.S.C. §§ 163, 264, and 265".
    • 2025 Form 40 booklet, PDF pp. 19–20: "limited in most cases to the same amount as currently allowable for federal purposes". It adds that a filer with the federal Mortgage Interest Credit deducts "the total interest you paid (before the credit)". PE doesn't model that credit, and the PR says so.
    • The federal limits apply in every year: the $750,000 limit for post-2017 debt from 2018 to 2025, made permanent for 2026 by P.L. 119-21.
  • North Carolina.

    • G.S. 105-153.5(a)(2)b: "The amount allowed as a deduction for interest paid or accrued during the taxable year under section 163(h) of the Code with respect to any qualified residence plus ... section 164 ... may not exceed twenty thousand dollars ($20,000)".
    • S.L. 2026-31 §12(a), PDF p. 42, rewrites G.S. 105-228.90(b)(7) from "January 1, 2023" to "July 5, 2025". §12(f): "effective when it becomes law".
    • Under either Code date, the $750,000 limit applies through 2025. Only the July 5, 2025 Code keeps it for 2026, so the PR's 2026 case is right.
  • Hawaii.

    • HRS 235-2.4(j) (hrs_235.pdf, PDF p. 11; current HRS HTML): "(3) Section 163(h)(3)(F) (limiting mortgage interest)" is not operative.
    • Act 35, SLH 2026 (signed copy PDF p. 21; HB2329 CD1 PDF p. 20) keeps paragraph (3) and reletters the subsection as (i).
    • N-11 instructions, line 21c:
      • 2018, PDF p. 19: "Act 27, Session Laws of Hawaii 2018, does not adopt the federal provisions that (1) suspends the deduction for interest paid on home equity loans, and (2) lowers the dollar limit".
      • 2025, PDF p. 17: "See the 2017 federal Publication 936 to figure your deduction".
    • The parameters start 2018-01-01 and extrapolate backward, which matches federal law before 2018.
  • Worksheet. 2017 Publication 936 Table 1 (PDF p. 11):

    • line 3 is $1,000,000 ($500,000 separate);
    • line 7 is "the smaller of $100,000 ($50,000 if married filing separately) or your limited amount";
    • line 11 is "rounded to three places";
    • line 12 is interest × line 11.

    Figure A note 3 (PDF p. 3) says "Amounts over the $1,000,000 limit ... may qualify as home equity debt". _hi_qualified_loan_limit encodes lines 1–8 exactly: grandfathered debt reduces only the acquisition limit, never the home equity limit.

Hand-checked expectations (29 checked; a selection):

State / case Arithmetic Expected
AL single, $40k, $1.5M from 2020 40,000 × 750k / 1.5M 20,000 ✓
AL joint, $1.5M from 2016 40,000 × 1M / 1.5M 26,666.67 ✓
AL joint, $1.5M from 1986 (grandfathered) limit = 1.5M, share 1 40,000 ✓
AL joint, $900k (2020) + $800k (2016), $42,500 limit 800k; 42,500 × 8/17 20,000 ✓
AL separate, $24k, $600k from 2020 24,000 × 375/600 15,000 ✓
AL 2026, $1.5M from 2020 $750k limit permanent 20,000 ✓
AL spouses 30k/10k 20,000 split 3:1 [15,000, 5,000]; 20,000 ✓
HI single, $1.5M from 2020 round(1.1/1.5, 3) = .733 × 40,000 29,320 ✓
HI single, $900k line 8 = line 9 36,000 ✓ (federal 30,000)
HI joint, $1.05M line 7 = 50k; line 8 = line 9 42,000 ✓
HI joint, $1.2M (1985) + $300k (2020) line 6 = 1.2M, line 7 = 100k; .867 34,680 ✓ (federal 32,000)
HI separate, $1.5M (500k + 50k) / 1.5M = .367 14,680 ✓ (federal 10,000)
HI separate, $600k, $30k 550/600 = .917 27,510 ✓
HI joint, $800k + $500k, 2024, $65k 1.1/1.3 = .846 54,990 ✓
HI $1,128,784 .97449999 → .974 (float64) 38,960 ✓
HI floor witness worksheet .995 → 39,800; federal 39,804.00 39,804 ✓
HI supplied deduction $20k non-deductible = 0, so it passes through 20,000 ✓
NC single, $15k + $5k tax, $1.5M 7,500 + 5,000 12,500 ✓
NC joint, $900k + $800k, $17k 17,000 × 8/17 8,000 ✓
NC separate spouses 30,000 × 375/1,200 = 9,375; 10,000 (no balance); 19,375 < 20,000 [9,375, 10,000] ✓
NC 2026, $1.5M July 5, 2025 Code 20,000 ✓

The floor witness's balances are exact in single precision (497,550,016 is a multiple of 32), so the case doesn't depend on storage rounding.

Code.

  • Vectorization. _hi_deductible_share uses np.divide(..., where=debt > 0) in float64. The other helpers use min_, max_ and where. The YAML includes multi-person and separate-filer households, and CI's microsimulation job passed.

  • NH Add New Hampshire state supplementation for 2026 #10156 pattern: not present.

    • The only parameter keys are filing_status[...], a federal variable with all five keys in both parameters.
    • No state-gated variable is used as a key.
    • nc_mortgage_and_property_tax_before_limitation is still computed everywhere, but its only consumers, nc_mortgage_and_property_tax_limitation and nc_mortgage_and_property_tax_deduction, are defined_for = StateCode.NC.
    • al_interest_deduction and hi_interest_deduction are state-gated. Their only callers are the AL and HI itemized sources.yaml.
    • No other state reads a changed variable.
  • References. Every new href resolves and shows the cited text on the cited page:

    • 2017 Pub. 936, pp. 3, 10, 11, 13;
    • N-11 instructions, 2018 p. 19 and 2025 p. 17;
    • hrs_235.pdf, p. 11;
    • Act 35, p. 20 (HB2329 CD1) and p. 21 (signed copy);
    • SL 2026-31, p. 42;
    • AL booklet, pp. 19–20.

    Multi-page titles follow the house format, e.g. "... #page 10-11" (quoted).

  • Changelog. changelog.d/state-mortgage-interest-federal-cap.fixed.md is top-level and typed fixed.

  • Python test. test_hi_mortgage_debt_limit_invariants.py is pure NumPy over the helpers and builds no model. Its for-all properties (order, vintage, monotonicity, bounds, half-up rounding, single vs. double precision) are something YAML can't state. CI's Rest shard-1 ran its 3 tests, all passing.

  • Renamed NC inputs. The renamed inputs (mortgage_interest → home_mortgage_interest, no balance) leave every expectation unchanged.

  • Source-conflict ratchet (Tie source-conflict markers to the register shared with Axiom #10287). I applied the test's exact CONFLICT_COMMENT_RE to every Python comment token and YAML comment line in the six scanned files the PR adds or edits, and in Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's versions of the three conflicting formulas. There were 0 matches. None of these files is in KNOWN_UNMARKED. So the guard passes on the merged tree whichever way the conflicts are resolved.

Axiom line assessment

The line reads: axiom: HRS 235-2.4(j)(3)/(i)(3) rulespec-us#1556 queued | Ala. Code 40-18-15(a)(2), N.C. Gen. Stat. 105-153.5(a)(2)b rulespec-us#1815 queued. Both entries are valid.

  • rulespec-us#1556.
    • Status: OPEN, labelled pe-parity, updated 2026-10-19.
    • Dispatch-ready: it has a module path (us-hi/statutes/235-2.4/j/3.yaml, with an i/3 alternative), corpus rows with ids and hashes, verbatim HRS, Act 35, 163(h)(3), N-11 and 2017 Pub. 936 text, required outputs, and companion tests computed by hand from the worksheet.
    • Blockers recorded: the signed encoder runs only in the engineering hub, and the pinned corpus lacks 2017 Pub. 936 and the N-11 and Act 35 scopes.
    • Matches the head: the update covers grandfathered debt (composing Land value tax #1673), half-up rounding in double precision, and the pass-through and "never goes below" floor. All seven of its new cases equal this PR's YAML.
    • Caveat: the stale Apply Hawaii's pre-TCJA mortgage debt limits to the interest deduction #9950 dependent cases (Suggestion 1).
  • rulespec-us#1815.
    • Status: OPEN, labelled pe-parity, updated 2026-10-19.
    • Dispatch-ready: it has module paths for AL and NC, corpus citations (including G.S. 105-228.90(b)(7) before and after S.L. 2026-31), verbatim statutes and instructions, required outputs, paste-ready review_finding text, and 13 companion cases that match this PR's AL and NC YAML (exact ratio, with worksheet values beside them).
    • Blockers recorded: the signed-encoder handoff under d1142, and the prerequisites Maryland Retirement Tax Elimination Act #1413 (163(h)(3) limits) and Land value tax #1673 (grandfathered debt). Both prerequisites are OPEN and labelled pe-parity.

CI status

gh pr checks 10274 at e81b3eaec0: 25 pass, 2 fail, none pending. Run 39524375365 was created 2026-10-21 00:56 UTC on the pull_request merge ref. That ref included main with #10287 (merged 22:02 UTC), but not #10003 (01:47) or #10334 (13:24).

Branch status

5 commits ahead of main, 11 behind. git merge-tree --write-tree PolicyEngine/main e81b3eaec0 exits 1 with the five conflicts in Should #1. All of them come from #10003, which is now on main, not from a sibling PR. No file is under tests/policy/baseline/partners/**.

Verdict: REQUEST_CHANGES

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The law is right in every claimed year (AL and NC follow federal 163(h); HI keeps the pre-TCJA limits under HRS 235-2.4), and 29 expectations hand-check. The two red checks are main-caused (the FL/SD LIHEAP ratchet entries, fixed by #10334). Two should-address items. (1) Five conflicts with #10003, now on main; when resolving, its NC case must switch to home_mortgage_interest or it gives 2,000 instead of 21,000/20,000. (2) Add HI cases at the $1.1M/$550k boundary and for HoH/surviving spouse. Four suggestions. Full report in the comment above.

MaxGhenis and others added 2 commits October 22, 2026 03:10
Resolve the five conflicts with #10003 (Kentucky cap plus premium inputs):

- Alabama adds deductible_mortgage_interest, investment interest and the
  federal premium deduction; #10003's Form 40 references keep their pages,
  with comments above their hrefs.
- Hawaii adds hi_mortgage_interest_deduction with #10003's premium
  deduction, and keeps the single 2022 N-11 entry and Announcement 2021-01.
- North Carolina line 1 reads deductible_mortgage_interest, then #10003's
  premium block; one SL 2026-31 reference covers the $750,000 limit and the
  premium restoration.
- Both YAML files keep both sides. #10003's case "Restored premiums share
  North Carolina's 20000 mortgage and tax cap" now enters
  home_mortgage_interest, since line 1 no longer reads the uncapped
  mortgage_interest: $19,000 + $2,000 = $21,000, capped at $20,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Five 2025 cases on 2020 debt, hand-checked from 2017 Publication 936
  Table 1: exactly $1,100,000 (line 8 equals line 9, all deductible),
  $1,101,000 (.999), a separate filer at exactly $550,000, and head of
  household and surviving spouse at $1,500,000 (.733). A comment notes that
  three-place rounding keeps the share at 1.000 until total debt passes
  about $1,100,550.
- The property test reads the Hawaii and federal limits from the parameter
  tree for all five filing statuses in 2018, 2025 and 2026, ties the Hawaii
  parameters to the statute's dollar amounts, and checks the 1.000 share
  threshold at $1,100,550 and $1,100,551 in single and double precision.
- The ratio-rounding candidate now says what each part follows: the
  federal, Alabama and North Carolina amounts use the exact ratio; Hawaii
  rounds as a worksheet gap-fill and floors at the federal amount. It drops
  the stale "not yet on main" note and lists the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Thanks, @DTrim99. All of this is at d830def93a, which merges main 86d3ae6c6d (#10003 and #10334) in d2fd7fa127.

Should address

  1. Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003 conflicts: resolved as your table says.
    • AL: adds lists deductible mortgage interest, investment interest and the federal premium deduction (al_investment_interest.py:38). Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's 21f40 references are kept, with comments above their hrefs (:20-26).
    • HI: adds lists investment interest, hi_mortgage_interest_deduction and hi_deductible_mortgage_insurance_premiums (hi_interest_deduction.py:20). It keeps the single 2022 N-11 entry plus Announcement 2021-01 (:10-15).
    • NC: line 1 reads deductible_mortgage_interest, then the premium block (nc_mortgage_and_property_tax_before_limitation.py:30). One SL 2026-31 reference covers both the $750,000 limit and the premium restoration (:12-15).
    • Both YAML files keep both sides. The "Restored premiums…" case now enters home_mortgage_interest: 19_000 and still expects $21,000 / $20,000 (nc_mortgage_and_property_tax_before_limitation.yaml:174-185).
    • The "Merge order" section now records Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003 as merged.
  2. Hawaii cases: your five cases are added, with your expected values (hi_mortgage_interest_deduction.yaml:130-210).
    • The "just over" case notes that the share stays 1.000 until debt passes about $1,100,550.
    • The property test now reads both parameters for all five filing statuses in 2018, 2025 and 2026 (test_hi_mortgage_debt_limit_invariants.py:77-101). It ties Hawaii's values to the statute (:179) and checks $1,100,550 → 1.000 and $1,100,551 → .999 (:283).
    • A wrong head-of-household row now fails two tests.

Suggestions

  1. Update PA SNAP net income limit to 200% #1556 annotation: left to the hub, which owns the Axiom issues. I agree that the dependent-exclusion cases track Apply Hawaii's pre-TCJA mortgage debt limits to the interest deduction #9950.
  2. Pre-2018 federal gap: added to "Known gaps" with your 2017 example, and proposed as a federal follow-up.
  3. Rounding candidate: updated (source_conflicts/candidates.yaml:5912).
    • The stale note is gone; the code paths and source URLs are added.
    • The 2017 worksheet is a source, and the years start in 2018.
    • The note says what each part follows. follows stays unknown until Maryland Retirement Tax Elimination Act #1413 picks the federal convention.
  4. Floor label: unchanged. hi_mortgage_interest_deduction.py merged cleanly, so it still calls the floor PE's choice, not worksheet line 12.

Tests: 256 passed across 12 files, each run alone.

An independent GPT-6.1 Sol delta review approved this head (d830def93a), with no findings: 208 local tests and 27 CI checks pass.

@MaxGhenis
MaxGhenis requested a review from DTrim99 October 22, 2026 13:17
@DTrim99

DTrim99 commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

PR Review (round 2): Limit Alabama, North Carolina and Hawaii mortgage interest to the amounts their laws allow

PR #10274 (author: MaxGhenis). Head d830def93a. Last reviewed at e81b3eaec0. Since then the branch has two new commits: the merge d2fd7fa127, which brings in main at 86d3ae6c6d (including #10003 and #10334) and resolves five conflicts by hand, and the author commit d830def93a (+269 lines: Hawaii YAML, the property test and source_conflicts/candidates.yaml). The branch is 7 commits ahead of main and 1 behind.

Summary

Both should-address items from round 1 are fixed.

CI is 27/27 green at this head. The run started after #10287 and #10334, and the source-conflict ratchet passed. The branch merges cleanly with current main. I found no new problems.

Open items: none critical, none should-address, and one suggestion (prior Suggestion 1).

Prior findings

Finding Status Evidence
Should 1: five conflicts with #10003; the NC case "Restored premiums share North Carolina's 20000 mortgage and tax cap" must enter home_mortgage_interest Fixed All five blocks resolved as requested (details under Verified). The NC case now enters home_mortgage_interest: 19_000, with a comment giving the arithmetic. Traced on the head: $21,000 / $20,000. The PR body's "Merge order" now records #10003 as merged.
Should 2: no Hawaii case at $1,100,000 / $550,000, or for HEAD_OF_HOUSEHOLD / SURVIVING_SPOUSE Fixed hi_mortgage_interest_deduction.yaml adds five 2025 cases: exactly $1,100,000; $1,101,000; separate filer at exactly $550,000; head of household; surviving spouse. Each checks the federal and the Hawaii amount, and all ten match by hand (table below). The "just over" case says the share stays 1.000 until debt passes about $1,100,550. The property test now builds its limits from the Hawaii and federal parameters for every filing status in 2018, 2025 and 2026, and ties the Hawaii values to the statute's dollar amounts. CI ran all 4 property tests green.
Suggestion 1: mark #1556's dependent-exclusion cases as tracking #9950; add the floor witness and the Should 2 controls Open (deferred, non-blocking) The author agrees the cases track #9950 and has left the edit to the hub that owns the Axiom issues. #1556 is unchanged since 2026-10-19, and its Cases 21/25, 24/27 and 23/26/28 are still unmarked. Its update section already says "where they conflict, this section governs", so this is clarity, not a parity defect.
Suggestion 2: AL and NC inherit the federal gap for tax years 2017 and earlier Fixed (documented) "Known gaps" now lists it with round 1's 2017 example ($29,320 under the law, $26,666.67 in PE, $40,000 before this PR) and proposes a federal follow-up. The suggestion asked for either a listing or a follow-up, so this is enough.
Suggestion 3: settle us:mortgage-interest-limit-ratio-rounding Fixed The entry now covers 2018 onward. It adds statute, 2025 worksheet and 2017 worksheet URLs and lists the four code paths. Its note says the federal, Alabama and North Carolina amounts use the exact ratio, while Hawaii rounds as a worksheet gap-fill and floors at the federal amount. follows: unknown stays until rulespec-us#1413 picks a convention. The stale "not yet on main" note is gone. The entry passes the schema checks (test_candidate_fields and test_candidates_are_public both ran green in CI).
Suggestion 4: keep the floor's "PE's choice" label Fixed (no change needed) hi_mortgage_interest_deduction.py merged without conflict and is identical to round 1. Lines 60–65 still say the floor "is PE's chosen approximation, not worksheet line 12". The 2017 Pub. 936 reference comment still says "without PE's floor".

New findings

None.

Verified

The five merge-resolution blocks (merge d2fd7fa127):

  1. al_interest_deduction.yaml (add/add conflict). This PR's ten cases are byte-identical to e81b3eaec0, and Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's four premium cases are byte-identical to main. Between them is a new section comment citing 26 U.S.C. 163(h)(3)(E) and 2021 Schedule A (Form 40) line 11.
  2. nc_mortgage_and_property_tax_before_limitation.yaml. It keeps this PR's three renamed and six new cases, and Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's five premium cases. In the "Restored premiums" case, mortgage_interest becomes home_mortgage_interest, and its expected values are unchanged. The other four premium cases enter no interest, so they don't change.
  3. al_investment_interest.py. adds is now deductible_mortgage_interest, investment_interest_expense and deductible_mortgage_insurance_premiums.
  4. hi_interest_deduction.py. adds is now investment_interest_expense, hi_mortgage_interest_deduction and hi_deductible_mortgage_insurance_premiums. It keeps the single 2022 N-11 entry and Announcement 2021-01, now labelled. hi_deductible_mortgage_insurance_premiums reads only premiums and hi_agi, so nothing is counted twice with the new interest variable.
  5. nc_mortgage_and_property_tax_before_limitation.py.
    • Line 1 reads deductible_mortgage_interest, followed unchanged by Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's mortgage_insurance_premiums_allowed block.
    • There is one SL 2026-31 reference. Its comment covers "the permanent $750,000 acquisition-debt limit and the federal restoration of qualified premiums from 2026".
    • Federal deductible_mortgage_insurance_premiums is a separate tax-unit variable from deductible_mortgage_interest, so NC and AL don't double-count premiums.

git diff 86d3ae6c6d d830def93a touches exactly this PR's 15 files, the same 15 as at e81b3eaec0. So the merge kept all of #10003's other changes.

Hand-checks of every new or changed expectation:

Case (period) Arithmetic Expected
NC "Restored premiums" (2026), single, $19,000 interest, no balance, $1,200 + $800 premiums, AGI $80,000 No balance gives a share of 1, so deductible_mortgage_interest is 19,000. Premiums are allowed in 2026 (parameter true from 2026-01-01; federal in_effect true from 2026). AGI is below the $100,000 phase-out start, so premiums are 2,000. Property tax 0. Line 3 = 19,000 + 2,000. 21,000 ✓
↳ same case, nc_mortgage_and_property_tax_deduction Single return, so the limitation is the $20,000 cap: min(21,000, 20,000). 20,000 ✓
HI SINGLE, $44,000, $1,100,000 (2020): federal 44,000 × 750,000 / 1,100,000 30,000 ✓
↳ Hawaii line 6 = min(max(0, 1M), 1.1M) = 1M; line 7 = min(100k, 100k); line 8 = 1.1M = line 9; share 1.000; floor not binding 44,000 ✓
HI SINGLE, $44,000, $1,101,000: federal 33,000,000,000 / 1,101,000 = 29,972.752 (within 0.01) 29,972.75 ✓
↳ Hawaii line 7 = min(101k, 100k) = 100k; 1.1M / 1.101M = .99909, which rounds to .999; 44,000 × .999 43,956 ✓
HI SEPARATE, $22,000, $550,000: federal 22,000 × 375,000 / 550,000 15,000 ✓
↳ Hawaii line 6 = 500k; line 7 = min(50k, 50k); line 8 = 550k = line 9; share 1.000 22,000 ✓
HI HEAD_OF_HOUSEHOLD, $40,000, $1,500,000: federal HOH cap = 750,000; 40,000 × .5 20,000 ✓
↳ Hawaii HOH parameters 1,000,000 / 100,000; 1.1M / 1.5M = .7333, which rounds to .733; × 40,000 29,320 ✓
HI SURVIVING_SPOUSE, $40,000, $1,500,000: federal cap = 750,000 20,000 ✓
↳ Hawaii parameters 1,000,000 / 100,000; .733 × 40,000 29,320 ✓
Property test: 1.000 threshold 1.1M / 1,100,550 = .99950025, giving floor(999.50025 + .5) = 1000, so 1.000; 1.1M / 1,100,551 = .99949934, giving 999, so .999; 1,101,000 gives .999. All balances are exact in float32. [1, 1, .999, .999] ✓
Property test: statutory amounts Every (year, status) in 2018/2025/2026 × 5 statuses: Hawaii (1,000,000, 100,000), or (500,000, 50,000) for SEPARATE, matching both parameter files ✓
AL / NC #10003 premium cases on the new formulas (2021, 2022, 2026; AGI $80,000 and $100,001) No interest is entered, so deductible_mortgage_interest = 0. Premiums: 2,000; one $1,000 increment gives 10% off, so 1,800; 2022 is out of effect, so 0. NC: excluded through 2021, so 0; included in 2026, so 2,000 or 1,800. unchanged ✓

The float32 effect on the federal ratios is at most about 0.004 at these sizes, inside each case's 0.01 margin. CI ran the YAML files with the expected case counts: the Hawaii mortgage file 22 (17 + 5), NC line 3 14, AL 14, all passing.

Property test cost. The new from policyengine_us.system import system adds no model construction: importing any policyengine_us submodule already runs the package __init__, which builds the module-level system. The test reads the limits once, at import: three instants, each for five filing statuses. In CI the four tests took about 1.7 s in total (1.05 s and 0.63 s for the two Hypothesis tests).

Source-conflict ratchet (#10287).

  • The author commit touches only tests and candidates.yaml, which are outside the scanned trees (variables, parameters, reforms).
  • I applied CONFLICT_COMMENT_RE to the comments in every scanned file this PR changes, on the tree merged with current main: the three resolved formulas, hi_mortgage_interest_deduction.py and both Hawaii parameters. There were 0 matches, and none of these files is in KNOWN_UNMARKED.
  • test_conflict_sounding_comments_do_not_grow passed in this head's CI run.
  • Take the 2020 charitable deduction for non-itemizers above the line #10186, the one commit on main since the merge, adds one non-PR file to KNOWN_UNMARKED and one candidates.yaml entry. The merged candidates.yaml has no duplicate ids.

Other checks.

  • NH Add New Hampshire state supplementation for 2026 #10156 pattern: still absent. No new parameter keys are added; the new cases use only the federal filing_status key, which has all five values in all four parameters.
  • Partner tests: no file under tests/policy/baseline/partners/** is touched.
  • Leftover mortgage_interest inputs: none remain anywhere in the AL, HI or NC test trees on the merged tree.

Axiom line assessment

The line is unchanged: axiom: HRS 235-2.4(j)(3)/(i)(3) rulespec-us#1556 queued | Ala. Code 40-18-15(a)(2), N.C. Gen. Stat. 105-153.5(a)(2)b rulespec-us#1815 queued. Both entries are still valid.

  • rulespec-us#1556: OPEN, labelled pe-parity, last updated 2026-10-19, no comments.
    • Its seven 2026-10-19 companion cases are all still in the Hawaii YAML.
    • The five new cases carry out the issue's own request: "Add companion controls for HEAD_OF_HOUSEHOLD and SURVIVING_SPOUSE limits equal to joint/single and for the exact 1.1m boundary". The exact-boundary logic also agrees with its Case 5 (1.1M of debt, share 1).
    • Only caveat: the unmarked Apply Hawaii's pre-TCJA mortgage debt limits to the interest deduction #9950 dependent cases (Suggestion 1).
  • rulespec-us#1815: OPEN, labelled pe-parity, last updated 2026-10-19. The AL and NC cases it mirrors are byte-identical at this head; only Cap Kentucky qualified residence interest at principal-residence interest from 2026 #10003's premium cases were added, and those are outside its scope. It still matches.

CI status

gh pr checks 10274 at d830def93a: 27 pass, 0 fail, 0 pending (rechecked at the end of this review). Run 39742624915 is a pull_request run created 2026-10-22 07:44 UTC on head d830def93a, after #10287 and #10334. It includes:

  • all four baseline state shards, which ran the AL, HI and NC files;
  • both Rest Python jobs: the property test's 4 tests, and the full test_source_conflicts.py including the ratchet and the candidate checks;
  • Microsimulation, Household API Partners and PR validation.

Branch status

7 commits ahead of main, 1 behind: #10186, the 2020 above-the-line charitable deduction. It touches no file in this PR except candidates.yaml, where it adds a separate entry. git merge-tree --write-tree PolicyEngine/main d830def93a exits 0 (tree bd3390e513), with no conflicts. Branch note: the draft #9950, held, still carries Hawaii files that this PR supersedes; the PR body says it will drop them.

Verdict: APPROVE

@DTrim99 DTrim99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Round 2: both should items are fixed. All five #10003 merge blocks are correct, the NC 'Restored premiums' case now uses home_mortgage_interest (21,000 before the cap, 20,000 after), and five new HI cases cover the $1.1M/$550k boundaries, HoH and surviving spouse. Axiom issues still match, and CI is green after #10287/#10334. One deferred suggestion. Full report in the comment above.

MaxGhenis and others added 2 commits October 22, 2026 10:30
Main's #10186 (2020 above-the-line charitable deduction) changed North Carolina additions and the source-conflict register; the merge is clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis merged commit cbb16a3 into main Oct 23, 2026
27 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, us#10274 at c76601cd7d7bacf77fcbd60e9a4572d495f1be6e (squash): Limit Alabama, North Carolina and Hawaii mortgage interest to the amounts their laws allow.

@MaxGhenis
MaxGhenis deleted the state-mortgage-interest-federal-cap branch October 23, 2026 04:07
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.

2 participants