Atrium — shared contracts and the typesetting engine
    Preparing search index...

    Interface Budget

    The deterministic step budget (D38), threaded through macro expansion and document building. A count, not a clock: the same document costs the same number of steps on every machine, so "this compile was stopped" is reproducible and testable in a way a timeout never is.

    Macro expansion is the budget's main consumer, because it is the only place in this chunk where the work is not bounded by the size of the input: \newcommand{\x}{\x} produces nodes forever, and the budget is what stops it. Everything else spends a step per node mostly so a pathological input (a megabyte of nested groups) also has a ceiling.

    interface Budget {
        cancelled: boolean;
        remaining: number;
        reported: boolean;
        signal: AbortLike | null;
        spent: number;
        stopped: boolean;
    }
    Index
    cancelled: boolean

    Set when signal.aborted was what stopped it, rather than the count.

    remaining: number

    Steps still available. Never goes below zero.

    reported: boolean

    Latched by whichever stage reported the stop. Shared across stages so a runaway macro produces one diagnostic and not one per stage it unwinds through.

    signal: AbortLike | null
    spent: number

    Steps consumed so far — reported as CompileStats.steps.

    stopped: boolean

    Latched once the budget or the signal stops the run.