Calculation catalog › Cash flow and summary

Sustainable spending result simulation count

Number of deterministic projections evaluated by the spending solver.

Field: simulationCount Unit: count Basis: no dollar basis Computed by: Engine Status: Complete chain

Appears in: solver-page (simulations run); scenarios-page (Spending capacity simulation count column)

Calculation records

  • Sustainable-spending simulation count: the probe sequence, counted Model record, justified by derivation

    Purpose: How many full-projection probes the sustainable-spending solve actually ran.

    Statement: decisions/spendingSolver.ts#solveMaxSustainableSpending counts one probe at the seed (the patched plan's own base spending rounded to a whole dollar, floored at 0, and raised to the required spending floor rounded up when it would fall below it, since the plan checks refuse a base below that floor). When the seed is feasible it counts one probe per doubling from max(2 x seed, $20,000), doubling again after each feasible one, until a probe fails or the budget or the $100,000,000 unbounded ceiling is reached; when the seed is infeasible and above the required spending floor it counts one further probe at that floor (expenses.requiredAnnual rounded up, 0 when the plan has none). It then counts one bisection probe per halving while the bracket is strictly wider than resolutionDollars and simulationCount is below maxSimulations. Under a withdrawal-rate or risk-based guardrail policy, when the level that passed is not a whole $100, rounded down it is not below the required spending floor, and the search did not already probe that rounded level, it counts one more run after the search, at that rounded level, outside maxSimulations (the record solved-spending-rounding). Units: probes (whole projections). Rounding: none; the value is an integer.

    Formula: count = 1 + doublings + bisections (+ 1 under guardrails when the answer rounded down to $100 was not already probed and is not below the floor), or 2 when a seed above the floor and the floor both fail

    • seed: max(0, round(base spending of the patched plan), ceil(expenses.requiredAnnual)) (unit: usd/year) (domain: nonnegative)
    • floor: ceil(expenses.requiredAnnual), 0 when the plan has no required spending; never above the seed (unit: usd/year) (domain: nonnegative)
    • resolution: Bracket width the bisection stops at (unit: usd/year) (domain: positive)
    • budget: maxSimulations, the hard probe cap (unit: probes) (domain: positive integer)
    • count: Projections the solve ran (unit: probes) (domain: nonnegative integer)

    Timing: once per solve; every probe is a complete simulatePlan run

    Rounding: none; integer

    Limits:

    • The worksheet supplies probe feasibility as test evidence; the evidence therefore builds a plan whose feasibility frontier really does fall between $22,500 and $25,000: four projection years, one $95,000 cash account, zero return and zero inflation, no income and no tax, so a level S is feasible exactly when 4S <= $95,000 (frontier $23,750)
    • The infeasible-seed case counts 2 only when the floor probe ALSO fails; the test plan has no required spending, so its floor is 0, and the evidence forces the failure with a $60,000 uninflated one-time goal the $5,000 portfolio cannot fund, because a feasible floor would open the bisection and raise the count
    • The count is not a measure of accuracy: it rises with the budget and falls with a looser resolution. An amortized-spending (ABW) plan returns 0 without probing; a diagnostic seed probe (an invalid basePatch) returns 1, and a seed already at the floor that fails returns 1

    Provenance: derived by claude, implemented by claude-subagent.

    Independent review: codex

    Gates (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: sustainable-spending-result-simulation-count.md Mutation receipt: sustainable-spending-result-simulation-count.mutation.md

    Evidence tests: spendingSolver.simulationCount.evidence.test.ts

    Implemented in: spendingSolver.ts

    Is the number of: sustainable-spending-result-simulation-count

Records that feed this number

  • Sustainable spending bisection Model record, justified by derivation

    Purpose: Find a feasible lower bound for constant annual base spending within a simulation budget.

    Statement: decisions/spendingSolver.ts#solveMaxSustainableSpending finds a lower-bound maximum feasible annual base spending in today's dollars using deterministic integer-dollar bracketing and bisection, where feasibility means no depletion and nominal ending after-tax estate at least the inflated today-dollar floor. Each bisection probe is the half-sum of the bracket rounded to the nearest dollar, a half rounded up. The highest level that passed, a whole number of dollars, is published as feasibleBaseAnnual; the published answer maxBaseAnnual is that level rounded down to $100 when that level is known to pass (the record solved-spending-rounding), and spendingSlackDollars is measured from maxBaseAnnual.

    Formula: probe integer midpoint; keep feasible lower and infeasible upper until upper-lower <= resolution; feasibleBaseAnnual = best feasible lower; maxBaseAnnual = its $100 floor when that level is known to pass, else feasibleBaseAnnual

    • spending: Probed annual base spending (unit: today USD/year) (domain: nonnegative integer)
    • resolution: Maximum bracket width (unit: USD/year) (domain: positive)

    Timing: whole-plan deterministic evaluations

    Rounding: integer-dollar midpoint

    Limits:

    • simulationCount has its own record (sustainable-spending-result-simulation-count); the count enters the published result, so this record feeds its family rather than computing it.
    • The public API generates its own bracket. Evidence seeds 40000, brackets at 80000, and verifies the first two midpoints reach the worksheet bracket 60000/70000 before checking its four probes and 62500 result, then runs the same search at a $100 resolution, which probes three more levels and passes 62969. It isolates the stated feasible predicate with an evaluation double, not an invented ledger oracle. Monotone feasibility is assumed at fixed-target spending (under guardrails it does not hold; see below); budgets can stop convergence.
    • A Marketplace year whose premium tax credit the ledger could not price (aca.readiness nonActionable) counts its full premium, as the ledger funds it; the credit lies between 0 and that premium (26 U.S.C. 36B(b)(2)). The solver always evaluates its probes with nonActionableAca 'disclose' (its options leave callers no way to ask for 'refuse'), so such a year is a disclosed limit, not a refusal. Those years of the run the result rests on (the best feasible probe; with no answer, the probe the failure diagnostic describes: the floor probe when it ran, else the seed), the codes that blocked pricing (every code but the informational ones, INFORMATIONAL_ACA_SUPPORT_CODES, the list the ledger's readiness reads) and acaGrossPremiumDirection are published, and the last diagnostic names them.
    • acaGrossPremiumDirection is 'conservative' only at fixed-target spending: at fixed spending a lower premium lowers what that year must withdraw, so a credit would likely leave room to spend more. That is measured, not proven for every plan: an independent check priced the stand-in years in a counterfactual and re-solved the 20 fixed-target example answers at $1 resolution (about 6,700 grid points) without finding a credit-priced answer below the gross one (gaps 0 to $6,357 a year). Under guardrails it is 'uncertain': a lower cost keeps the withdrawal rate under the upper guardrail longer, so cuts start later, and the same check found credit-priced ledgers that solve lower (the aggressive-saver example under 125/90/20 guardrails with raises: $76,707 on the gross premium, $75,170 with the credit priced) or deplete at the gross answer (the barista-fire example under the same 125/90/20 guardrails with raises).
    • Under an adaptive spending policy (guardrails) feasibility is not monotone in the base amount, so the answer is a level the search found feasible and a higher feasible level can exist. Measured with no Marketplace year at all: the example-couple plan with no Marketplace premium or credit, withdrawal-rate guardrails (upper 125%) and an $86,400 required floor depletes in 2059 at a base of $164,391 and never depletes at $166,971, because the higher base makes its first cut a year earlier (2030 against 2031). The independent check of 2026-09-26 also found it on Marketplace plans, under both the gross-premium and the credit-priced ledgers.
    • The published answer is rounded down to $100 (owner decision R4, the record solved-spending-rounding). In this record's first evidence case the level that passed, $62,500, is already a whole $100, so it is both feasibleBaseAnnual and the published answer; in the second the level that passed is $62,969 and the published answer $62,900, so the two figures differ and each is asserted.
    • When the seed is infeasible the downward bracket starts at the required spending floor (expenses.requiredAnnual rounded up, 0 when the plan has none), the lowest level the plan checks accept; no probe goes below it, and a failure there is reported as the floor failing, naming the constraint that failed. The seed itself is raised to that floor when the base spending would round below it. zeroSpendingDepletes is true only when a probe at 0 ran and depleted.

    Provenance: derived by codex, implemented by claude-subagent.

    Independent review: grok

    Gates (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: sustainable-spending-bisection.md Mutation receipt: sustainable-spending-bisection.mutation.md

    Evidence tests: spendingSolver.evidence.test.ts

    Implemented in: spendingSolver.ts

    Is the number of: sustainable-spending-result-max-base-annual, sustainable-spending-result-spending-slack-dollars, sustainable-spending-result-feasible-base-annual

    Feeds: sustainable-spending-result-simulation-count, solved-initial-withdrawal-rate-pct, solved-spending-rounded-to-hundred

Engine source: engine/src/decisions/spendingSolver.ts (SustainableSpendingResult.simulationCount)

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.