Skip to content

Test a Form 4952 election with section 911(f) stacking end to end - #9800

Merged
MaxGhenis merged 4 commits into
mainfrom
form-4952-911-combined-property
Oct 5, 2026
Merged

MaxGhenis merged 4 commits into
mainfrom
form-4952-911-combined-property

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds policyengine_us/tests/test_form_4952_section_911_interaction.py, an end-to-end property test of a Form 4952 line 4g election (#9781) together with section 911(f) stacking (#9761) on generated households. Until now, test_form_4952_election_worksheet.py tested elections without an exclusion, and test_section_911_tax_stacking.py tested exclusions without an election. The only combined check was a YAML case with supplied excess values (low finding 2 of the #9781 delta review).

Test-only. No formula, parameter or expected output changes.

How it checks the interaction

On a return the two meet in the Schedule D Tax Worksheet. A filer with an amount on Form 4952 line 4g must use it (2025 Instructions for Schedule D, p. 15). The Foreign Earned Income Tax Worksheet measures the capital gain excess from worksheet line 10 and takes it from line 9 before line 6 (2025 Instructions for Form 1040, p. 37). The AMT does the same from Form 6251 line 6 (2025 Instructions for Form 6251, Part III, "Form 2555").

The model reaches these amounts by two routes:

  • the worksheet route: dwks09, dwks10 and schedule_d_tax_worksheet_after_capital_gain_excess;
  • the section 1(h) route: net_capital_gain and the section_911_* variables.

The test reuses the existing transcriptions instead of copying them: the Schedule D Tax Worksheet lines 2–10 from the #9781 test, and the Foreign Earned Income Tax Worksheet, Qualified Dividends and Capital Gain Tax Worksheet and Form 6251 from the #9761 test. I read the 2025 Schedule D Tax Worksheet before relying on that. With Schedule D lines 18 and 19 zero, its lines 14–47 match the QDCG worksheet line for line, with worksheet line 6 as line 2 and line 9 as line 3. Form 6251 line 27 (worksheet line 21) then equals line 20 (worksheet line 14).

Invariants

Notation: G is the section 1222(11) gain (capital gain distributions included), D qualified dividends, E the election, X the exclusion, T taxable income, and N = max(0, G − E) + max(0, D − max(0, E − G)).

  1. Closed forms.
    • net_capital_gain = dwks10 = N.
    • Worksheet line 6 = min(D, N).
    • With an exclusion, the capital gain excess is max(0, N − T), section_911_net_capital_gain is min(N, T) and section_911_qualified_dividend_income is min(D, N, T).
    • Without an excess, section_911_qualified_dividend_income = min(D, net_capital_gain), bit for bit.
    • The gain other than dividends plus the dividends left equals section_911_net_capital_gain (§911(f)(2)(A)(i)–(ii) ordering).
  2. The two routes agree.
    • The worksheet's excess, line 10, line 9, line 10 − line 9, line 13 and Schedule D line 19 equal the section 1(h) excess, net capital gain, gain other than dividends, qualified dividends, adjusted net capital gain and unrecaptured §1250 gain.
    • The reduced lines 6 and 9 equal footnote modifications 1 and 2 applied to the transcribed worksheet.
    • The AMT excess is max(0, N − max(0, Form 6251 line 6)).
  3. Zero inputs change nothing.
  4. Monotonicity.
    • E and X change taxable income only through the itemization choice (see below).
    • As E rises, net_capital_gain and dwks10 never rise, and net capital gain falls by at most the extra amount elected.
    • While the itemization choice holds, the section 911 net capital gain, the section 911 dividends and both excesses never rise either.
    • While the choice holds, the regular tax and income_tax_before_credits never fall as X rises, and stacking never lowers them.
    • income_tax, the amount the itemization choice minimizes, never falls as X rises, even when the choice flips, for households without dependents.
  5. Worksheet lines. dwks10 == net_capital_gain, exactly for whole dollars and within single-precision rounding with cents. The model's lines 6, 9 and 10 equal the Apply the Form 4952 election in Schedule D Tax Worksheet lines 3-10 #9781 transcription.
  6. End to end against the 2025 forms. The regular tax matches the Foreign Earned Income Tax Worksheet fed by Schedule D Tax Worksheet lines 6 and 9. The AMT matches Form 6251 line 7 through its own worksheet.

Found by the test: the election and the exclusion can change taxable income, through the itemization choice. tax_unit_itemizes picks whichever choice gives the lower income_tax. A filer in the AMT can lower the tax by itemizing deductions smaller than the standard deduction, because they reduce AMTI. Minimized example (2025, single, Texas, $971,091 long-term gain, $1 charitable gift):

  • With no election, the filer itemizes $1,915 (Texas sales tax plus the gift), and taxable income is $969,176.
  • Electing $1,917 raises the regular tax above the tentative minimum tax, so the filer takes the standard deduction and taxable income falls to $955,341.
  • income_tax_before_credits still rises, from $159,912.70 to $159,912.89.

This is the model working as designed, but it means a "taxable income never changes" assertion is too strong. #9761's test makes that assertion across exclusion variants, so it may be latently fragile for itemizers near the AMT. Property 4 compares amounts that depend on taxable income only between variants with the same itemization choice. It checks income_tax across a flip, for households without dependents. For them no credit applies except the EITC. Neither the EITC (eitc_relevant_investment_income) nor the net investment income tax (net_investment_income, niit_magi) reads the election or the itemization choice, and today neither reads the exclusion. The property still holds if the exclusion later denies the EITC or raises NIIT MAGI. This example and a joint filer with split cents dividends are pinned as @hypothesis.examples.

Intended exception, not a bug: the tax is not monotone in the election. From the 0% capital gains threshold to the top of the 12% bracket (2025: $48,350 to $48,475 single), gain is taxed at 15% and ordinary income at 12%. Electing a dollar there lowers the tax by 3 cents, on the return as in the model. test_election_can_lower_the_tax_where_15_percent_exceeds_12 shows $125 more elected lowering both the model's tax and the worksheet's line 47 by exactly $3.75, with and without an exclusion. The property test asserts the bound instead: the tax falls by at most (15% − 12%) × the overlap width, which rate_overlap computes from the parameters ($3.75 single, $7.50 joint, $3.00 head of household in 2025). The same bound replaces #9761's fixed $7.50 allowance for the omitted worksheet line 47 cap.

Scope

The tax comparisons (4 and 6) use households without 28-percent rate or unrecaptured §1250 gain, as in #9761's test. The gain-level properties (1–3, 5) include them.

While writing this I confirmed a pre-existing bug, which this PR does not fix. capital_gains_tax taxes 28-percent rate gain at 28% in full, even where it exceeds taxable income or the gain an election leaves; Schedule D Tax Worksheet line 12 limits it to line 9. Examples (2025, single):

Case Model income_tax Correct
$10,000 collectibles gain, no other income $2,800 $0
$100,000 of wages and a $100,000 collectibles gain, all elected $65,067 $37,067

The fix is tracked as a separate follow-up.

Tests

  • Grid (439 households × 5 variants, 2,195 tax units in one simulation): coverage assertions confirm it reaches an excess that cuts into dividends, an election that reaches dividends, AMT, the AMT excess, the capital gains tax and zero taxable income, all with both an election and an exclusion.
  • Three Hypothesis tests (derandomize=True, like Apply the Form 4952 election in Schedule D Tax Worksheet lines 3-10 #9781's test): invariants over 2018, 2022, 2025 and 2026; the 2025 forms differential; and the zero-input bitwise check. Strategies target elections at G and G + D, and include cents and itemizers.
  • Runtime: the file takes about 60 s locally on a heavily loaded machine (grid 18 s, invariants 16 s, zero inputs 5 s, forms 3 s, overlap example 1 s). It runs in the Makefile's remaining Rest group.

axiom: n/a: test-only change; no policy logic modified

🤖 Generated with Claude Code

MaxGhenis and others added 4 commits October 5, 2026 13:42
Neither the Form 4952 line 4g election test (#9781) nor the section 911(f)
stacking test (#9761) covered households with both. The new Hypothesis
tests check, on generated households with an election and an exclusion:

- closed forms for net capital gain and the section 911 amounts after the
  election (min(D, N), min(N, T), min(D, N, T));
- that the Schedule D Tax Worksheet route and the section 1(h) route give
  the same capital gain excess and reduced amounts, regular tax and AMT;
- that a zero election or exclusion matches the situation without that
  input, bit for bit;
- monotonicity in both amounts, with the intended 12%/15% overlap
  exception in the election bounded from the parameters;
- the regular tax and AMT against the transcribed 2025 Schedule D Tax
  Worksheet, Foreign Earned Income Tax Worksheet and Form 6251.

The election and the exclusion can change taxable income through the
choice to itemize (an AMT filer may itemize below the standard deduction),
so amounts that depend on taxable income are compared only where that
choice holds; income_tax, which it minimizes, is compared across it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Gains and worksheet lines 6-10 do not depend on taxable income, so they
  are checked exactly for every whole-dollar household, itemizers with
  fractional taxable income included (property 5 as stated).
- The AMT capital gain excess has one route; check it once against its
  closed form instead of against itself.
- Correct the wages in the 12%/15% overlap example and an inverted grid
  comment; say the zero-input test guards against leakage between
  households.

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

Copy link
Copy Markdown
Contributor Author

Hand-off to the US + core hub.

  • Head: 33f7ef802d83fef1dd830d3eb8fa947318c72cc6. The PR is test-only: one new test file and a changelog fragment.
  • Independent review (Opus 5.5 on Subfleet, read-only; files in ~/reviews/us-hub/form-4952-911-combined-property/):
    • r1 approved 3ec4d6851a with six non-blocking findings. All six were addressed in 143a9dcef8.
    • r2 approved 143a9dcef8.
    • r3 approved 8253050b31 and r4 approved 33f7ef802d. Both of those commits are docstring-only and apply the reviewer's own wording.
    • Review files: review-r1.md, review-r2-delta.md, review-r3-delta.md, review-r4-delta.md.
  • Passed locally:
    • The new file: 5 tests, about 60 s.
    • In one pytest process with test_form_4952_election_worksheet.py, test_section_911_tax_stacking.py and code_health/test_rest_python_groups.py: 29 passed.
    • ruff format and ruff check are clean.
  • Pending: CI. The Pull request workflow is queued for a runner. Earlier runs were cancelled by later pushes; none failed.
  • Depends on: nothing. There is no hold and no decision for Max (test-only; axiom: n/a).
  • Follow-ups (not part of this PR): writing these tests surfaced two pre-existing model bugs, each confirmed with a reproducer and queued as a separate task:
    • capital_gains_tax taxes 28-percent rate gain in full beyond taxable income or the gain an election leaves. Example: a $10,000 collectibles gain with $0 taxable income is taxed $2,800.
    • niit_magi doesn't add back the §911 exclusion (§1411(d)). Example: $150k wages, $50k dividends and $100k excluded give $0 NIIT instead of $1,900.

@MaxGhenis
MaxGhenis merged commit 58fd0a9 into main Oct 5, 2026
86 of 105 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Landed by the US + core hub, after session 0b809666 handed it off, at head 33f7ef802d83fef1dd830d3eb8fa947318c72cc6. Squash merge, --admin --match-head-commit; the only block was the required approving review, which no one else can give on Max's PRs.

Gates:

  • Reviews: independent Opus 5.5 reviews approved r1 through r4. r4 is at this head; r3 and r4 covered docstring-only commits. The reviews are in ~/reviews/us-hub/form-4952-911-combined-property/.
  • CI: the first full run sat in the queue about two hours, and 12 jobs were cancelled without a runner; none was a test failure. The hub re-ran the cancelled jobs on this head, and gh pr checks now exits 0 with every check run successful.
  • Combined with main: main took Use the married-filing-separately breakpoint on Form 6251 Part III line 18 #9780 (Part III line 18) and Use Louisiana's RIB 26-019 2026 standard deduction and retirement exemption #9791 after this PR's CI started. The hub ran the new file plus test_form_4952_election_worksheet.py, test_section_911_tax_stacking.py and test_rest_python_groups.py on the tree GitHub's merge produces: 29 passed, Hypothesis included.
  • Scope: test-only (one test file and a changelog fragment), so there is no model impact and no Axiom item.

The two pre-existing bugs these tests surfaced (capital_gains_tax on 28-percent gain beyond taxable income, and niit_magi missing the §911 add-back) are queued as separate tasks by the authoring session.

@MaxGhenis
MaxGhenis deleted the form-4952-911-combined-property branch October 5, 2026 22:33
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
…worksheets

- rate_gain_with_form_4952_election.yaml: the reproducer (no taxable income;
  taxable income below the gain; half and all of a collectibles gain elected;
  no election) and an election above the 24% bracket that leaves 28% on line
  9 only, with Schedule D Tax Worksheet lines.
- test_section_1h_regular_tax.py: for every household and year (2018 to 2030)
  with elections and both gains, the regular tax is at most line 46 figured
  from the rate parameters, exactly zero with no taxable income, and not
  negative; and electing more lowers it by at most the 12/15 rate overlap
  plus 3% of the smaller of the extra amount elected and the unrecaptured
  section 1250 gain.
  Pins the intended exception where an election moves gain from 28 to 25
  percent (section 1(h)(1)(E)(ii) measures its excess with net capital gain,
  which section 1(h)(2) reduces): $68,874 to $67,374 on $50,000 elected. A
  2025 differential compares Form 6251 Part III and line 11 after an election
  with nonzero Schedule D lines 18 and 19.
- test_form_6251_part_iii.py: the Schedule D Tax Worksheet transcription takes
  amounts, Form 4952 lines 4g and 4e, and the Foreign Earned Income Tax
  Worksheet footnote's four modifications.
- test_section_911_tax_stacking.py and test_form_4952_section_911_interaction.py:
  households with 28-percent rate and unrecaptured section 1250 gain are now
  compared with the forms (through the Schedule D Tax Worksheet and Form 6251
  Part III with the AMT capital gain excess), including rows that reach
  modification 4, and kept in the monotonicity properties, with the corrected
  election bound in place of #9800's overlap-only bound.
- Harris, Biden 2025 budget and additional tax bracket reforms: a case each
  where the line 47 limit binds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
…worksheets

- rate_gain_with_form_4952_election.yaml: the reproducer (no taxable income;
  taxable income below the gain; half and all of a collectibles gain elected;
  no election) and an election above the 24% bracket that leaves 28% on line
  9 only, with Schedule D Tax Worksheet lines.
- test_section_1h_regular_tax.py: for every household and year (2018 to 2030)
  with elections and both gains, the regular tax is at most line 46 figured
  from the rate parameters, exactly zero with no taxable income, and not
  negative; and electing more lowers it by at most the 12/15 rate overlap
  plus 3% of the smaller of the extra amount elected and the unrecaptured
  section 1250 gain.
  Pins the intended exception where an election moves gain from 28 to 25
  percent (section 1(h)(1)(E)(ii) measures its excess with net capital gain,
  which section 1(h)(2) reduces): $68,874 to $67,374 on $50,000 elected. A
  2025 differential compares Form 6251 Part III and line 11 after an election
  with nonzero Schedule D lines 18 and 19.
- test_form_6251_part_iii.py: the Schedule D Tax Worksheet transcription takes
  amounts, Form 4952 lines 4g and 4e, and the Foreign Earned Income Tax
  Worksheet footnote's four modifications.
- test_section_911_tax_stacking.py and test_form_4952_section_911_interaction.py:
  households with 28-percent rate and unrecaptured section 1250 gain are now
  compared with the forms (through the Schedule D Tax Worksheet and Form 6251
  Part III with the AMT capital gain excess), including rows that reach
  modification 4, and kept in the monotonicity properties, with the corrected
  election bound in place of #9800's overlap-only bound.
- Harris, Biden 2025 budget and additional tax bracket reforms: a case each
  where the line 47 limit binds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
…worksheets

- rate_gain_with_form_4952_election.yaml: the reproducer (no taxable income;
  taxable income below the gain; half and all of a collectibles gain elected;
  no election) and an election above the 24% bracket that leaves 28% on line
  9 only, with Schedule D Tax Worksheet lines.
- test_section_1h_regular_tax.py: for every household and year (2018 to 2030)
  with elections and both gains, the regular tax is at most line 46 figured
  from the rate parameters, exactly zero with no taxable income, and not
  negative; and electing more lowers it by at most the 12/15 rate overlap
  plus 3% of the smaller of the extra amount elected and the unrecaptured
  section 1250 gain.
  Pins the intended exception where an election moves gain from 28 to 25
  percent (section 1(h)(1)(E)(ii) measures its excess with net capital gain,
  which section 1(h)(2) reduces): $68,874 to $67,374 on $50,000 elected. A
  2025 differential compares Form 6251 Part III and line 11 after an election
  with nonzero Schedule D lines 18 and 19.
- test_form_6251_part_iii.py: the Schedule D Tax Worksheet transcription takes
  amounts, Form 4952 lines 4g and 4e, and the Foreign Earned Income Tax
  Worksheet footnote's four modifications.
- test_section_911_tax_stacking.py and test_form_4952_section_911_interaction.py:
  households with 28-percent rate and unrecaptured section 1250 gain are now
  compared with the forms (through the Schedule D Tax Worksheet and Form 6251
  Part III with the AMT capital gain excess), including rows that reach
  modification 4, and kept in the monotonicity properties, with the corrected
  election bound in place of #9800's overlap-only bound.
- Harris, Biden 2025 budget and additional tax bracket reforms: a case each
  where the line 47 limit binds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 6, 2026
…worksheets

- rate_gain_with_form_4952_election.yaml: the reproducer (no taxable income;
  taxable income below the gain; half and all of a collectibles gain elected;
  no election) and an election above the 24% bracket that leaves 28% on line
  9 only, with Schedule D Tax Worksheet lines.
- test_section_1h_regular_tax.py: for every household and year (2018 to 2030)
  with elections and both gains, the regular tax is at most line 46 figured
  from the rate parameters, exactly zero with no taxable income, and not
  negative; and electing more lowers it by at most the 12/15 rate overlap
  plus 3% of the smaller of the extra amount elected and the unrecaptured
  section 1250 gain.
  Pins the intended exception where an election moves gain from 28 to 25
  percent (section 1(h)(1)(E)(ii) measures its excess with net capital gain,
  which section 1(h)(2) reduces): $68,874 to $67,374 on $50,000 elected. A
  2025 differential compares Form 6251 Part III and line 11 after an election
  with nonzero Schedule D lines 18 and 19.
- test_form_6251_part_iii.py: the Schedule D Tax Worksheet transcription takes
  amounts, Form 4952 lines 4g and 4e, and the Foreign Earned Income Tax
  Worksheet footnote's four modifications.
- test_section_911_tax_stacking.py and test_form_4952_section_911_interaction.py:
  households with 28-percent rate and unrecaptured section 1250 gain are now
  compared with the forms (through the Schedule D Tax Worksheet and Form 6251
  Part III with the AMT capital gain excess), including rows that reach
  modification 4, and kept in the monotonicity properties, with the corrected
  election bound in place of #9800's overlap-only bound.
- Harris, Biden 2025 budget and additional tax bracket reforms: a case each
  where the line 47 limit binds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis added a commit that referenced this pull request Oct 7, 2026
…worksheets (#9893)

* Cap the regular tax at the tax on all taxable income and use it on Form 6251 line 10

26 U.S.C. 1(h)(1) says the tax "shall not exceed" the sum of the
subparagraph (A) to (F) amounts, and Schedule D Tax Worksheet line 47
takes the smaller of line 45 and line 46 (the tax on all of line 1).
capital_gains_tax now stops at tax_on_taxable_income_at_main_rates (new,
line 46) less income_tax_main_rates. The cap binds where gain taxed at
15 percent falls in the 12 percent bracket: up to $3.75 single and $7.50
joint in 2025, and $28.50 and $57 in 2026. The Biden and Harris capital
gains reforms apply the same limit, and the additional_tax_bracket
reform figures line 46 on its own schedule.

regular_tax_before_credits was a second Schedule D Tax Worksheet
(2017 numbering) whose result was min(worksheet tax including the gains,
income_tax_main_rates excluding them). Form 6251 line 10 then added
capital_gains_tax. Whenever the worksheet path fell below the main-rates
path, line 10 understated the regular tax: before #9781 that happened for
18 dataset tax units in 2025 ($328M weighted), because dwks10 ignored
the Form 4952 line 4g election and because the worksheet took line 28 as
min(line 21, line 22) instead of their sum. regular_tax_before_credits
is now income_tax_main_rates plus capital_gains_tax, the regular tax
income_tax_before_credits charges, and Form 6251 line 10 uses it alone.

Tests: real-unit regression cases for tax units 1101624, 1004930,
1156248 and 1032460; line 45/46 boundary cases for 2025 and 2026
(single, joint, head of household, Form 2555); the existing worksheet
property tests now compare with line 47 and Foreign Earned Income Tax
Worksheet line 25 exactly.

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

* Cite Rev. Proc. 2025-32 section 4 for 2026 amounts

Section 3 of Rev. Proc. 2025-32 modifies 2025 items (only .01, the
standard deduction, and .02, section 179); the 2026 adjusted items are
section 4. The 2026 AMT breakpoints are section 4.10 (PDF page 16) and
the 2026 additional standard deduction for the aged or blind is section
4.14(3) (PDF page 18). Also give the dependent standard deduction
citation its section number (4.14(2)).

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

* Add property and differential tests for the regular tax and the line 47 limit

test_regular_tax_before_credits.py transcribes the 2025 Schedule D Tax
Worksheet, lines 1 to 47, with every skip instruction, the Form 4952
election, capital gain distributions, short-term losses and Schedule D
lines 18 and 19. The regular rates come from the 2025 Tax Computation
Worksheet rows. 2026 runs on Rev. Proc. 2025-32's tables and capital gains
amounts. The model matches lines 10, 13, 14, 21, 44, 46 and 47 for a grid,
households at the 0 percent amount, and Hypothesis draws.

Properties, 2018 to 2035:
- 0 <= regular tax <= line 46;
- 0 <= capital_gains_tax <= line 46 - income_tax_main_rates;
- regular_tax_before_credits = main rates + capital gains tax;
- income_tax_before_credits = regular + AMT;
- the AMT is line 9 less line 10;
- without net capital gain, the regular tax is line 46;
- the worksheet lines (dwks10, dwks13, line 18 <= 21 <= 14);
- the tax is monotone in wages, gains and dividends;
- results are independent of batch order.

The limit binds at the top of the 12 percent bracket in every year and
filing status, with the published band widths for 2018 to 2026.

The monotonicity check sets aside households with capital gain
distributions and a Schedule D net loss, a known defect it found. Gross
income adds non_sch_d_capital_gains outside the loss limit, while
net_capital_gain nets them (a 2018 single filer's tax falls $0.12 with $1
more gain). No dataset tax unit has both. It is left for a follow-up.

Also adds 2026 joint, separate and non-binding line 45/46 YAML cases,
from the same Rev. Proc. 2025-32 figures as the Axiom companion tests.

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

* Align the merged tests with main: #9831's reform variables and #9788's netting

- test_additional_tax_bracket_unset_bracket.py (#9831) listed
  regular_tax_before_credits among the variables the reform replaces. On
  this branch the reform replaces tax_on_taxable_income_at_main_rates
  instead, and regular_tax_before_credits is income_tax_main_rates plus
  capital_gains_tax. The default-system leak check now covers the three
  replaced variables, and the finite and monotone checks cover the reform's
  three taxes: income_tax_main_rates, tax_on_taxable_income_at_main_rates
  and regular_tax_before_credits.
- test_regular_tax_before_credits.py set aside households with capital gain
  distributions and a Schedule D net loss in the monotonicity property.
  #9788 nets the distributions inside the capital loss limit in AGI, so the
  property now holds for every household. The exclusion is gone, and the
  minimized counterexample (2018 single, $50,000 of distributions, a
  $40,273 short-term loss, $1 more long-term gain) is an explicit example;
  it failed before #9788 (the regular tax fell by $0.12) and passes now.

Both files pass after the merge: 9 and 6 tests.

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

* Say in the changelog that regular_tax_before_credits now includes the capital gains tax

PolicyEngine/salt-amt-calculator's API reads regular_tax_before_credits as
its regular tax, so the meaning change belongs in the release note.

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

* Point three Rev. Proc. 2025-32 links at the pages with their 2026 amounts

Three links pointed into the wrong section of Rev. Proc. 2025-32:

- the capital gains rate thresholds linked page 12, which is section 4.02
  (kiddie tax). Section 4.03 and its 2026 amounts (49,450, 98,900, 66,200,
  545,500, 613,700, 579,600 and 306,850) are on page 13;
- the child tax credit amount ($2,200) and refundable maximum ($1,700)
  linked page 13, which holds sections 4.03 and 4.04. Section 4.05 and its
  amounts are on page 14.

The other parameter links to the Rev. Proc. land on the page that has the
2026 amounts or on the page where their section starts.

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

* Test 28-percent rate gain with a Form 4952 election against the 2025 worksheets

- rate_gain_with_form_4952_election.yaml: the reproducer (no taxable income;
  taxable income below the gain; half and all of a collectibles gain elected;
  no election) and an election above the 24% bracket that leaves 28% on line
  9 only, with Schedule D Tax Worksheet lines.
- test_section_1h_regular_tax.py: for every household and year (2018 to 2030)
  with elections and both gains, the regular tax is at most line 46 figured
  from the rate parameters, exactly zero with no taxable income, and not
  negative; and electing more lowers it by at most the 12/15 rate overlap
  plus 3% of the smaller of the extra amount elected and the unrecaptured
  section 1250 gain.
  Pins the intended exception where an election moves gain from 28 to 25
  percent (section 1(h)(1)(E)(ii) measures its excess with net capital gain,
  which section 1(h)(2) reduces): $68,874 to $67,374 on $50,000 elected. A
  2025 differential compares Form 6251 Part III and line 11 after an election
  with nonzero Schedule D lines 18 and 19.
- test_form_6251_part_iii.py: the Schedule D Tax Worksheet transcription takes
  amounts, Form 4952 lines 4g and 4e, and the Foreign Earned Income Tax
  Worksheet footnote's four modifications.
- test_section_911_tax_stacking.py and test_form_4952_section_911_interaction.py:
  households with 28-percent rate and unrecaptured section 1250 gain are now
  compared with the forms (through the Schedule D Tax Worksheet and Form 6251
  Part III with the AMT capital gain excess), including rows that reach
  modification 4, and kept in the monotonicity properties, with the corrected
  election bound in place of #9800's overlap-only bound.
- Harris, Biden 2025 budget and additional tax bracket reforms: a case each
  where the line 47 limit binds.

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

* Tighten reach assertions and fix a stale docstring (hard-tier review)

- test_section_1h_regular_tax.py: the grid reaches 28% tax after an election
  only if some elected household has a positive Schedule D Tax Worksheet line
  42; a positive capital gains tax could be all at 25%.
- test_section_911_tax_stacking.py, test_form_4952_section_911_interaction.py:
  floor the unrecaptured section 1250 gain after modification 4 at zero, so a
  household whose line 9 the excess exhausts does not count as reaching it.
- test_form_6251_part_iii.py: the transcription, not the model, leaves out the
  short-term loss netting (#9841 added it to the model).

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant