Tax loss carryforward used against gains annual
Capital-loss carryforward applied against gains and ordinary income in the projection year.
Field: capitalLossUsedAgainstGains Unit: US dollars Basis: nominal dollars Computed by: Engine Status: Complete chain
Appears in: results-table (Capital-loss carryforward callout "offset $X of realized gains")
Calculation records
-
Capital-loss carryforward netting Composition record, justified by derivation
Purpose: Spend a capital-loss pool against current gains first, then report the annual ordinary-offset slice on the capital-gain line.
Statement: tax/federalTax.ts#applyCapitalLossCarryforward applies an annual capital-loss pool first against current gains, then reports up to the annual ordinary-offset limit as a negative capital-gain-line amount without changing ordinary income, and carries the unused pool forward. The offset is not capped by ordinary income. Units: nominal USD. Rounding: none.
Formula:
usedAgainstGains = min(C, max(G, 0)); availableLoss = C - usedAgainstGains + max(-G, 0); usedAgainstOrdinary = min(availableLoss, L); netCapitalGain = max(G, 0) - usedAgainstGains - usedAgainstOrdinary; remaining = availableLoss - usedAgainstOrdinary-
C: Opening carryforward pool (unit: usd) (domain: nonnegative after the max(0, .) floor) -
G: Signed current capital result; a loss is negative (unit: usd) (domain: any finite number) -
L: Annual ordinary-offset limit, year2026.federalTax.capitalLossOrdinaryOffsetLimit (unit: usd/year) (domain: nonnegative after the max(0, .) floor)
Timing: one tax year; the projection threads the depleting pool year to year
Rounding: none
Limits:
- Ordinary income is never reduced directly: the deductible loss rides the capital-gain line, so subtracting the offset from ordinary income instead publishes a different AGI cascade
- One pool, no short-term / long-term split, and the section 1212 preservation of a deduction wasted in a year with no taxable income to absorb it is not modeled; both are stated planning simplifications on the function
Provenance: derived by
codex, implemented byclaude.Independent review:
cursorGates (6 of 6 pass): fixture registers a test: pass; pins resolve: pass; families exist: pass; worksheet exists: pass; mutation receipt exists: pass; provenance independent: pass
Worksheet: capital-loss-carryforward-netting.md Mutation receipt: capital-loss-carryforward-netting.mutation.md
Evidence tests: federalTax.evidence.test.ts
Implemented in: federalTax.ts
Is the number of: tax-loss-carryforward-remaining-annual, tax-loss-carryforward-used-against-gains-annual, tax-loss-carryforward-used-against-ordinary-annual
Feeds: tax-total-annual, display-loss-carryforward-used-annual, display-tax-free-gains-room-annual
-
Engine source: engine/src/projection/internal/types/result.ts
(YearResult.capitalLossUsedAgainstGains)
The evidence links on this page (each record's worksheet, mutation receipt, evidence tests
and implementation, and the source links) are pinned to engine commit
2624dbdba9fd, committed 2026-10-11.
The live calculation index and
output-family census links point at the repository's main
branch, so you can check this snapshot against them.