Skip to content

Tax Maryland's capital gains surtax on net capital gain as the Internal Revenue Code defines it - #9898

Open
MaxGhenis wants to merge 1 commit into
mainfrom
md-capital-gains-surtax-net-capital-gain
Open

MaxGhenis wants to merge 1 commit into
mainfrom
md-capital-gains-surtax-net-capital-gain

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong

Maryland's 2025 capital gains surtax is 2% of "net capital gain, as defined and determined under the Internal Revenue Code" included in Maryland AGI, less gain from excepted assets, for filers with federal AGI over $350,000. md_capital_gains_surtax instead took max(short_term_capital_gains + long_term_capital_gains − limited_capital_loss, 0) over every tax unit member, and md_capital_gains_surtax_applies tested Maryland AGI. That left four defects:

  1. Net short-term gains were taxed. Under 26 U.S.C. 1222(11), net capital gain is the net long-term capital gain less the net short-term capital loss. A net short-term gain adds nothing, and a net long-term loss leaves nothing.
  2. The capital loss deduction was subtracted a second time. The gains it was subtracted from already include the losses. Since Net capital gain distributions inside the capital loss limit in AGI #9788 this only moved the result when a dependent's gains were in the sum, or when capital_losses was supplied as an input.
  3. Capital gain distributions were left out. non_sch_d_capital_gains (Form 1099-DIV box 2a reported without Schedule D) are long-term capital gains under 852(b)(3)(B). Dependents' gains were summed in, as Leave dependents' capital income out of state lines on the filers' return #9894 also finds.
  4. The threshold read Maryland AGI. (a)(4) says federal AGI, so Maryland subtractions or additions moved filers across it.

Every number below is from running main (b79705b4bd) and this branch (963ae33e10), TY2025:

Case (MD) Federal AGI MD AGI Surtax, main → branch
Long-term 100,000 + short-term 50,000 500,000 500,000 3,000 → 2,000
Short-term 80,000 only 450,000 450,000 1,600 → 0
Long-term 500,000 + short-term 200,000 1,000,000 1,000,000 14,000 → 10,000
Long-term −10,000 + short-term 50,000 450,000 450,000 800 → 0
Joint: spouse A long-term 100,000, spouse B short-term 30,000 450,000 448,800 2,600 → 2,000
Distributions 20,000, wages 400,000 420,000 420,000 0 → 400
Distributions 10,000, short-term −4,000 400,000 400,000 0 → 120
Head long-term 10,000, wages 400,000; dependent child long-term 300,000 410,000 410,000 6,200 → 200
Head long-term 100,000, wages 400,000; dependent child short-term −50,000 500,000 500,000 1,000 → 2,000
Long-term 100,000; Maryland subtractions 20,000 360,000 340,000 0 → 2,000
Long-term 100,000; Maryland additions 20,000 340,000 360,000 2,000 → 0
Joint: spouse A long-term 100,000, spouse B short-term −20,000 (control) 450,000 450,000 1,600 → 1,600

In every row, federal AGI and Maryland AGI are the same on main and the branch, and md_income_tax_before_credits moves by exactly the change in the surtax.

Law and forms

I read each of these this session:

  • Md. Code, Tax-General § 10-105, current text:
    • (a)(3)(i): "if the Maryland adjusted gross income of an individual ... includes any amount of net capital gain, as defined and determined under the Internal Revenue Code, the State income tax for the individual is the sum of ... an additional 2% of the amount of net capital gain included in the individual's Maryland adjusted gross income".
    • (a)(3)(ii): capital gain from six asset types is "not subject to the additional 2% tax", "to the extent included in calculating net capital gain for federal income tax purposes".
    • (a)(4): the tax applies to individuals "with a federal adjusted gross income in excess of $350,000".
  • 2025 Md. Laws ch. 604 (HB 352), § 3, enrolled pages 163–164. The amendments strike "taxable income" for "adjusted gross income", "1%" for "2%", and the "taxable years 2025 through 2028" limit in (4). So the tax has no end date, and surtax_applies stays true from 2025.
  • 26 U.S.C. 1222(11): "the excess of the net long-term capital gain for the taxable year over the net short-term capital loss for such year".
  • Technical Bulletin No. 58 (Dec. 29, 2025):
    • Section I quotes 1222(11) (footnote 2) and says the tax applies to FAGI over $350,000 "regardless of filing status".
    • Section III.A, page 3, works Jane McDonald's return on Form 502CG: line 1 610,000, line 1a 50,000, line 2 400,000, line 4 42,000, line 8 442,000, line 9 168,000.
  • 2025 Form 502CG: line 1 is net capital gain income included in Maryland AGI; lines 2–7 are the excepted assets; line 8 is their sum; line 9 is line 1 − line 8, "If less than 0 enter 0". The general instructions apply the form to "a federal adjusted gross income of more than $350,000 on Line 1 of Form 502".
  • 2025 Form 502 and the resident instructions: line 21b is line 20a (Form 502CG line 9) × .02. Line 27 subtracts credits from lines 21 through 21b, so keeping the surtax in md_income_tax_before_credits is right.

Where the form and the statute differ. Form 502CG line 1 points to Form 502 line 1c, which the instructions (p. 13) fill from "Line 7a of the federal Form 1040". That figure counts a net short-term gain; 1222(11) net capital gain does not. This PR follows the statute and TB-58. The YAML comments give the line 7a figure wherever the two differ. A filer who copies line 1c onto Form 502CG line 1 with a net short-term gain would pay more than the model computes.

What changed

  • md_net_capital_gain (new; Form 502CG line 1). It is max(0, min(L15, L16)) over the head and spouse, where L15 = Σ(long-term gains + max(0, distributions reported without Schedule D)), Schedule D line 15; and L16 = L15 + Σ short-term gains, line 16. That is the smaller of lines 15 and 16, as on the Schedule D Tax Worksheet's line 7.
    • Dependents' items are left out (tax_unit_non_dep_add and a per-person filer mask).
    • Distributions are floored per person, as in irs_gross_income.
    • Qualified dividends are not included: 1(h)(11) adds them only for 1(h).
    • Schedule D line 13 distributions and long-term loss carryovers are memo items already inside long_term_capital_gains, so they are not added again (YAML cases for both).
  • md_capital_gains_surtax_excepted_gain (new input, TaxUnit, default 0; Form 502CG line 8). Before, the formula listed the six exceptions as unimplemented comments. The model has no data for them, so microsimulation results don't change. Household users can now enter lines 2–7.
  • md_capital_gains_surtax: surtax_rate × max(0, md_net_capital_gain − excepted gain), which is Form 502CG line 9 times 2% (Form 502 line 21b).
  • md_capital_gains_surtax_applies: adjusted_gross_income > surtax_threshold.
  • Parameters: the threshold's description and label now say federal AGI. All three files cite § 10-105(a)(3)/(4), the ch. 604 pages, and the 2025 form lines. No values change.

Invariants

These hold for every input and are tested in test_md_capital_gains_surtax_invariants.py:

  1. md_net_capital_gain = max(0, min(L15, L16)), with L15 and L16 computed in the test from the inputs.
  2. Differential. For a return with no dependents and no negative distributions, md_net_capital_gain = net_capital_gain − qualified dividends. The federal net_capital_gain implements 1222(11) separately, as max(0, LT + D − max(0, −ST)).
  3. md_net_capital_gain ≤ max(0, filer_loss_limited_net_capital_gains): it never exceeds the filers' Form 1040 line 7a gain, so all of it is in federal, and hence Maryland, AGI.
  4. md_capital_gains_surtax_applies ⇔ adjusted_gross_income > 350,000. The surtax is then 0.02 × max(0, NCG − excepted), and 0 otherwise. It always lies in [0, 0.02 × NCG].
  5. Dependent invariance: changing a dependent's long- or short-term gains or distributions changes neither md_net_capital_gain nor the surtax.
  6. Monotonicity: raising a filer's long-term gain, short-term gain or distributions by x raises md_net_capital_gain by between 0 and x. With a nonnegative short-term total, a further short-term gain adds 0. Raising the excepted gain never raises the surtax.
  7. Neutralizing md_capital_gains_surtax lowers md_income_tax_before_credits by exactly the surtax.

Tests

  • YAML. 22 cases in md_capital_gains_surtax.yaml (rewritten with Schedule D and Form 502CG line comments), 7 in the new md_net_capital_gain.yaml, and 5 in the new md_capital_gains_surtax_applies.yaml, 34 in all.
    • The TB-58 example is a case: line 9 is 168,000, so the surtax is 3,360. On main, which has no excepted-gain input, it is 12,200.
    • Five existing expectations change, each to the 1222(11) amount:
      • long-term 100,000 + short-term 50,000: 3,000 → 2,000;
      • short-term 80,000 only: 1,600 → 0;
      • long-term 500,000 + short-term 200,000: 14,000 → 10,000;
      • the old "with capital losses" case supplied capital_losses: 80_000 next to positive gains, an input that contradicts them. It now states the intended net loss as short-term −55,000, giving 0;
      • the old "limitation test" now uses the excepted-gain input.
    • Run on main, with the lines that name the two new variables removed, 14 of the 27 surtax and threshold cases fail, three of them because main has no excepted-gain input. All 14 pass here, and the other 13 pass on both.
  • Python property tests: a deterministic grid (240 households, each with twins for the paired properties) plus Hypothesis (25 examples, ≤ 8 households each). The file's importorskip makes the Hypothesis test skip where Hypothesis isn't installed.
  • I ran the three YAML files, the property file and test_parameter_files.py locally. All pass. CI runs the full suites.

Microsimulation

Running: base b79705b4bd against this branch, 2026 and 2025, on the default dataset, with lockrun.sh and compare.py under the shared heavy lock. Results will be added here.

Relation to other PRs

Not in this PR

  • Maryland subtractions that remove capital gain from Maryland AGI: gain on U.S. obligations (Form 502SU ab), MDOT acquisitions of part of a residence (jj), and race-course sales. None of them is modeled, so the federal amount is the amount "included in Maryland AGI".
  • Nonresidents (Form 505 line 7 column 2) and fiduciaries (Form 504CG), which the model doesn't cover.

axiom: TheAxiomFoundation/rulespec-us#1518 queued for Md. Code, Tax-General § 10-105(a)(3)–(4). us-md/statutes/gtg/10-105.yaml encodes the 2% rate and the $350,000 federal AGI threshold but defers additional_capital_gain_tax. The issue is dispatch-ready: verbatim law, required outputs, a pasteable review_finding, and 11 companion tests from the statute, TB-58 and Form 502CG. It is blocked only because the OpenAI-billed signed re-encode needs approval. The base it imports, us:statutes/26/1222#net_capital_gain (§ 1222(11)), is already encoded; capital gain distributions as long-term gain (852(b)(3)(B)) remain TheAxiomFoundation/rulespec-us#1490, queued.

🤖 Generated with Claude Code

Md. Code, Tax-General 10-105(a)(3) taxes an additional 2% of "net capital
gain, as defined and determined under the Internal Revenue Code" included
in Maryland AGI, less gain from excepted assets; (a)(4) applies it when
federal AGI is over $350,000. Technical Bulletin No. 58 gives the IRC
1222(11) definition: net long-term capital gain over net short-term
capital loss.

The model summed every tax unit member's long- and short-term gains,
subtracted the capital loss deduction again, left out capital gain
distributions, and tested Maryland AGI against the threshold.

- md_net_capital_gain (new, Form 502CG line 1): the head and spouse's
  max(0, min(Schedule D line 15, line 16)), with distributions reported
  without Schedule D floored per person. A net short-term gain and
  qualified dividends are not part of it.
- md_capital_gains_surtax_excepted_gain (new input, Form 502CG line 8).
- md_capital_gains_surtax: 2% of max(0, line 1 - line 8) (line 9).
- md_capital_gains_surtax_applies: federal AGI over the threshold.
- Parameter references to the statute, ch. 604 and the 2025 forms.

Tests: YAML cases with Schedule D and Form 502CG line comments, including
the Technical Bulletin 58 example (line 9 = $168,000); property tests
with a differential against the federal net_capital_gain.

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

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (909176a) to head (963ae33).
⚠️ Report is 246 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #9898   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           76        58   -18     
  Branches         2         1    -1     
=========================================
- Hits            76        58   -18     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DTrim99

DTrim99 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

PR Review: Tax Maryland's capital gains surtax on net capital gain as the Internal Revenue Code defines it

PR #9898 (author: MaxGhenis, head 963ae33e10, merge-base b79705b4bd). 12 files, 1 commit.

Summary

The PR rebuilds Maryland's 2% capital gains surtax (Form 502 line 21b) on the statutory base.

  • New base. md_net_capital_gain is IRC § 1222(11) net capital gain over the head and spouse: max(0, min(Schedule D line 15, line 16)), with capital gain distributions reported without Schedule D floored per person.
  • New input. md_capital_gains_surtax_excepted_gain holds the excepted-asset gain (Form 502CG line 8).
  • Threshold. md_capital_gains_surtax_applies now tests federal AGI instead of Maryland AGI.
  • Parameters. The parameter values don't change.

The law and the code agree:

  • Md. Code, Tax-General § 10-105(a)(3)–(4), 2025 Md. Laws ch. 604, Technical Bulletin No. 58 and Form 502CG all support the rate, the threshold, the years, the § 1222(11) base, the treatment of qualified dividends and distributions, the exclusion of dependents and the line 9 arithmetic.
  • All 34 YAML cases pass at the head.
  • The property tests pass, and CI is green (37/37).
  • The only reader of the changed variables is md_income_tax_before_credits, which is the right place. The local tax base is untouched.

Two documentation-level items need a fix before approval:

  1. Two new variable references use PDF anchors that don't show what their titles cite.
  2. A test-file comment, repeated in the PR body, says the deterministic grid "runs without Hypothesis". In fact the module-level importorskip skips the whole file.

Neither changes a result.

Critical (must fix)

None.

Should address

1. Two new variable references point to pages that don't show what the title cites.

  • policyengine_us/variables/gov/states/md/tax/income/capital_gains/md_capital_gains_surtax.py:31-32
  • policyengine_us/variables/gov/states/md/tax/income/capital_gains/md_capital_gains_surtax_excepted_gain.py:31-32
  • PR body. It has the same off-by-one: it cites resident-booklet.pdf#page=21 for "line 21b is line 20a × .02".
  • Fix. Use one reference per page.
    • Booklet: "2025 Maryland Resident Income Tax Instructions, line 20a" at #page=21 and "... line 21b" at #page=22. Or keep only the #page=22 "line 21b" entry.
    • TB-58: "Technical Bulletin No. 58, section II" at #page=1 and "Technical Bulletin No. 58, section III.A example" at #page=3.
  • Impact: references only. No result changes.

2. The test file says the deterministic grid "runs without Hypothesis", but without Hypothesis the whole file is skipped.

  • Where: policyengine_us/tests/test_md_capital_gains_surtax_invariants.py:232 ("# A deterministic grid (runs without Hypothesis).") and :291-292 (module-level pytest.importorskip("hypothesis")).
  • What happens. pytest.importorskip at module level raises Skipped during import, so pytest skips every test in the module. That includes test_grid and test_cases_where_the_form_1040_line_7a_gain_differs, which sit above the call.
  • Reproduced at the head in an environment without Hypothesis: pytest --collect-only reports "SKIPPED [1] ...test_md_capital_gains_surtax_invariants.py:291: could not import 'hypothesis'" and "no tests collected".
  • The PR body says the same: "The file's importorskip makes the Hypothesis test skip where Hypothesis isn't installed."
  • CI is unaffected. CI installs the dev extra (pyproject.toml:57, hypothesis>=6.100.0), so all three tests run there. The claim misleads only someone who runs the file without dev extras.
  • Fix (either):
    • Make the claim true. Move test_properties and its strategies into a separate module (for example test_md_capital_gains_surtax_properties.py) that keeps the module-level importorskip. Then test_grid and the line-7a test always run.
    • Or drop "(runs without Hypothesis)" and correct the PR-body sentence to "the file is skipped where Hypothesis isn't installed".
  • Sibling with the same comment: test_capital_gain_distributions_loss_limit.py:165 (pre-existing, Net capital gain distributions inside the capital loss limit in AGI #9788). Fix both if convenient.

Suggestions

  1. Cite the effective-date section for surtax_applies.
    • Where: policyengine_us/parameters/gov/states/md/tax/income/capital_gains/surtax_applies.yaml:9-10.
    • 2025-01-01: true with no end date rests on two provisions of ch. 604:
    • The cited #page=163 shows neither. Add 2025 Md. Laws ch. 604, § 34 at #page=200. The 2025 booklet reference already corroborates 2025, so this is optional.
  2. Fix the oracle mapping in rulespec-us#1518.
    • The issue defines output 2, additional_capital_gain_tax_applies, as "federal adjusted gross income is more than ... threshold, and net capital gain is more than zero". It marks cases B, C and E not_holds for that reason.
    • "Step 2. Oracle coverage" then says to "Map outputs 2 and 4 to" md_capital_gains_surtax_applies and md_capital_gains_surtax.
    • PE's md_capital_gains_surtax_applies tests federal AGI only, so it returns true for B, C and E. The result is a spurious parity mismatch.
    • Fix: map output 2 to md_capital_gains_surtax_applies & (md_net_capital_gain > 0), or compare outputs 3 and 4 only.
    • This doesn't affect whether the axiom line is valid.
  3. Harden the Hypothesis settings.
    • Where: test_md_capital_gains_surtax_invariants.py:321, @hypothesis.settings(max_examples=25, deadline=None).
    • Evidence. In three local runs at the head with a cold .hypothesis cache, one failed with FailedHealthCheck: Input generation is slow: Hypothesis only generated 2 valid inputs after 72.54 seconds. The other two passed. CI passed, and the local Windows environment likely inflated the first-draw time.
    • The test is also not derandomized, so each CI run draws new examples, and a rare failure on an unrelated PR would not be reproducible.
    • Most siblings use derandomize=True and suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large]: test_capital_gain_rate_group_netting.py:426-433, test_form_4952_section_911_interaction.py:958-963 and test_ctc_credit_limit_worksheets.py:217-221. Match them.
  4. Floor the excepted gain at zero.
    • Where: md_capital_gains_surtax.py:42-44.
    • The statute excepts "any amount of capital gain from the sale or exchange of the following assets" (§ 10-105(a)(3)(ii)). Form 502CG lines 2–7 are each "Net capital gain income from the sale or exchange of ...", and line 9 is "Net capital gain income subject to additional tax (subtract Line 8 from Line 1 ...)" (https://www.marylandcomptroller.gov/content/dam/mdcomp/tax/forms/2025/502cg.pdf#page=1). So line 9 cannot exceed line 1.
    • A negative input currently raises the surtax. Probe at the head: LT 100,000, wages 400,000, excepted −50,000 gives 3,000, which is 3% of line 1.
    • Fix: excepted = max_(0, tax_unit("md_capital_gains_surtax_excepted_gain", period)). The PR already gives the same "never negative" reason for flooring non_sch_d_capital_gains.
  5. Don't hard-code parameter values in documentation strings.
    • Where: md_capital_gains_surtax.py:11-15 ("additional 2% tax", "over $350,000", "times 2%").
    • These go stale if the rate or threshold parameters change. md_capital_gains_surtax_applies already says "more than the threshold".
    • Suggested wording: "the additional tax rate" and "federal adjusted gross income over the threshold".
    • The statutory descriptions in md_capital_gains_surtax_excepted_gain.py ("$1,500,000", "12 months") describe the exception categories, aren't used in logic, and are fine.
  6. State the form-versus-statute choice in md_net_capital_gain's documentation, not only in the code comment.
    • Where: md_net_capital_gain.py:9-20; the code comment is at :62-69.
    • The documentation calls the variable "Form 502CG line 1" without qualification.
    • The form's line 1 instruction says "Residents use Line 1c of Form 502" (502CG #page=2). Line 1c is "the amount of net capital gain or loss reported as taxable income on Line 7a of the federal Form 1040" (booklet #page=13), which also counts a net short-term gain.
    • Suggested addition: "This follows the statute and Technical Bulletin 58 section I rather than the Form 502 line 1c figure, which also counts a net short-term capital gain."
  7. Make the surtax_rate.yaml:1 description specific (existing text in a file the PR touches).
    • Current: "applies this surtax rate to net capital gains for high earners".
    • Suggested: "Maryland applies this additional rate to net capital gain included in Maryland adjusted gross income for filers with federal adjusted gross income above the threshold."
  8. Optional tests.
    • A post-2028 year, such as 2029, to pin the struck "2025 through 2028" sunset. Probe at the head: LT 100,000 plus wages 400,000 gives 2,000 in 2028, 2029 and 2030.
    • A head-of-household case. Probe: head with wages 380,000 and LT 30,000 plus a child gives FAGI 410,000 and a surtax of 600.
  9. PR body housekeeping.
    • The "Microsimulation" section still says "Results will be added here". Fill it in or remove it.
    • The axiom line runs on into a paragraph; keep it to one line.

Verified correct

  • The base is § 1222(11) and nothing else.
    • For L16 = L15 + net ST, max(0, min(L15, L16)) equals max(0, L15) when net ST ≥ 0 and max(0, L15 + ST) when net ST < 0. That is "the excess of the net long-term capital gain ... over the net short-term capital loss" (26 U.S.C. 1222(11)).
    • It matches Schedule D Tax Worksheet line 7, "the smaller of line 15 or line 16" (https://www.irs.gov/pub/irs-prior/i1040sd--2025.pdf#page=15), and TB-58 § I (#page=1).
  • Qualified dividends are excluded. § 1(h)(11)(A) applies "For purposes of this subsection" only.
  • Capital gain distributions are included, with the same per-person floor as filer_loss_limited_net_capital_gains and irs_gross_income.
  • Nothing is double counted.
    • The Schedule D line 13 distributions and the long-term loss carryover are memo items inside long_term_capital_gains. YAML cases cover both.
    • The old second subtraction of limited_capital_loss is gone.
  • Dependents are left out. The PR uses tax_unit_non_dep_add plus a filer mask, consistent with federal AGI.
  • Threshold.
    • It is federal AGI, strictly "in excess of" $350,000, with one value for every filing status (§ 10-105(a)(4); TB-58 p. 1 "regardless of filing status"; 502CG p. 2).
    • Tests pin $350,000 → 0 and $350,001 → 2,000, a joint return at $351,000 → 800, and Maryland additions and subtractions moving Maryland AGI across the threshold while federal AGI does not.
  • Excepted gain and line 9.
    • Line 9 = max(0, line 1 − line 8) (502CG #page=1).
    • The TB-58 example reproduces exactly: (610,000 − 442,000) × 0.02 = 3,360.
  • Callers (grep at the head).
    • md_capital_gains_surtax is read only by md_income_tax_before_credits.py:38.
    • md_capital_gains_surtax_applies is only its defined_for.
    • The two new variables feed only the surtax.
    • No other state or federal variable uses the redefined variables. The federal net_capital_gain and schedule_d_tax_worksheet_form_4952_lines keep their own § 1222(11) logic and are untouched.
  • Credits and local tax.
    • The MD EITC, poverty-line, CDCC and senior credits read md_income_tax_before_credits. This matches Form 502 line 27 and the booklet's credit worksheets ("sum of Lines 21 through 21b", booklet #page=22).
    • The county taxes read md_taxable_income, so the surtax never reaches the local base. This matches the DLS fiscal note's "Local Effect: None".
  • Code patterns.
    • The code is vectorized (max_, min_, masked sums) and contains no hard-coded policy values.
    • Both new variables use defined_for = StateCode.MD. Entities are TaxUnit and periods are YEAR.
    • References are lists of dicts with no page text in titles. Parameter values use 350_000 formatting, and the threshold description follows the house template.
    • The changelog fragment changelog.d/md-capital-gains-surtax-net-capital-gain.fixed.md is top-level and fixed.
  • Parameter values against the sources.
    • 0.02: ch. 604 #page=163; Form 502 line 21b ".02".
    • 350,000: ch. 604 #page=164; 502CG #page=2.
    • true from 2025 with no end date: ch. 604 § 34 #page=200 and the struck sunset at #page=164.
  • Tests.
    • All 34 YAML cases pass at the head (22 + 5 + 7). All periods are plain (2024, 2025).
    • The property file passes 3/3 on warm runs: the grid takes 67 s and the Hypothesis test 153 s.
    • The five changed expectations are each the § 1222(11) amount (3,000 → 2,000; 1,600 → 0; 14,000 → 10,000; 1,440 → 0 with the contradictory capital_losses input restated as ST −55,000; and 6,000 → 2,000 via the excepted-gain input).
  • Hand checks:
    • LT 100,000 + ST 50,000: L15 100,000, L16 150,000, so 100,000 × 0.02 = 2,000.
    • LT 50,000, ST −55,000: L16 = −5,000, so 0.
    • Distributions 10,000, ST −4,000: L15 10,000, L16 6,000, so 120.
    • LT 120,000, ST −70,000, excepted 80,000: line 1 50,000, line 9 = max(0, −30,000) = 0.
    • Spouses A LT −30,000 and B LT 100,000 / ST −10,000: L15 70,000, L16 60,000, so md_net_capital_gain = 60,000.
    • Joint FAGI 351,000, LT 40,000: 800.
    • FAGI 360,000 with Maryland subtractions of 20,000: Maryland AGI 340,000, but the surtax applies, so 2,000.
    • TB-58: 3,360.

Axiom line assessment

Valid queued.

CI status

All green: 37/37 checks pass (gh pr checks 9898). These include all 22 Full Suite jobs (Microsimulation among them), Household API Partners, Lint, and codecov patch/project (100%). The PR touches no partner test files.

Branch status

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 surtax base is right: net capital gain under IRC § 1222(11), the treatment of capital gain distributions and qualified dividends, the strict federal AGI threshold, and line 9 (TB-58 gives 3,360) all check out, local tax is untouched, and rulespec-us#1518 is dispatch-ready. Two should items (see the comment above): S1, two reference anchors don't show what their titles cite (booklet line 21b is on #page=22, and the TB-58 example is on p. 3), so use one reference per page and fix the PR body's anchor too; and S2, the invariants file says the grid runs without Hypothesis, but the module-level importorskip skips the whole file, so split the module or correct the comment and the PR body.

This branch has not been deployed

No deployments
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