ac-bench
Reference

Reference

@ac-bench/core 0.5.0

The plugin contracts: measure, reporter and runtime plugins, the archive, gate declarations.

Install
npm install @ac-bench/core

Generated by TypeDoc from the package's exports:@ac-bench/core/plugin, @ac-bench/core/runner.

@ac-bench/core/plugin

Functions

Classes

Constants

Types

functioncollectConditionsconditions.ts:161

collectConditions(snapshot: ConditionSnapshot): CollectedCondition[]

Groups a run’s case-result and case-execution data by the condition that produced them, in the order the conditions started.

Two conditions of one measure, or two that declare a case with the same title, stay two conditions. Data written outside any measured condition is ignored.

functioncollectedConditionFramecondition-frame.ts:37

collectedConditionFrame(plugin: MeasurePlugin, condition: CollectedCondition): DataFrame

The frame a reporter renders for one collected condition.

A condition with no case result — one that failed before any case reported — is an empty table under its heading: none of the measure’s callbacks run, as a measure owes no conclusion about nothing and may refuse to draw one.

functionconditionFramecondition-frame.ts:59

conditionFrame(plugin: MeasurePlugin, input: {
  results: unknown[];
  title: string;
}): DataFrame

The authoritative frame for a whole condition: one row per case result, the columns the measure derives from the set, then the measure’s own last word.

The single construction path every renderer uses. A live view holding only some of the rows calls caseRow/deriveFields itself with what it has and skips the last step, because an unfinished condition has nothing to conclude.

functionconditionHeadingconditions.ts:226

conditionHeading(condition: Pick<ConditionIdentity, "file" | "runtime" | "titles" | "conditionPath">): string

The heading of a condition on one line: its titles, then where it lives — the file and the condition’s path in it, and the runtime when it is not the Node default. Sibling conditions that share their titles differ by the path.

functionconditionKeyconditions.ts:59

conditionKey(runtime: string, file: string, conditionPath: readonly number[], titles: readonly string[]): string

The cross-run identity of a condition: a JSON tuple, so no title or file name can imitate another part.

functioncountVerdictsgate-frame.ts:75

countVerdicts(verdicts: readonly _ReadonlyObjectDeep<{
  adjustedPValue: number | null;
  degreesOfFreedom: number | null;
  dispersion: number | null;
  escalatedReplicates: number;
  estimate: number | null;
  estimator: "paired" | "unpaired" | "single" | null;
  executions: number[];
  id: string;
  interval: {
    level: number;
    lower: number;
    upper: number;
  } | null;
  kind: "ratio" | "difference" | "bound" | "baseline";
  message: string;
  metric: {
    direction: "lower-is-better" | "higher-is-better";
    name: string;
    scale: "log" | "linear";
    unit: {
      scale: number;
      symbol: string;
    };
  };
  origin: "config" | "suite" | "cli";
  pValue: number | null;
  rationale?: string;
  reason: "decided" | "interval-contains-threshold" | "multiplicity" | "dispersion-exceeds-limit" | "too-few-executions" | "no-threshold" | "case-failed" | "case-filtered" | "metric-unavailable" | "non-positive-value" | "runtime-unsupported" | "runtime-unavailable" | "baseline-case-missing" | "baseline-environment-mismatch";
  runtime: string;
  subjects: {
    caseTitle: string;
    conditionTitles: string[];
    file: string;
    runtime: string;
  }[];
  threshold: {
    max?: number;
    min?: number;
  };
  verdict: "pass" | "fail" | "inconclusive" | "reported" | "skipped" | "not-applicable" | "error" | "incomparable";
}, never>[]): string

How many verdicts of each kind, most serious first, as one line.

functiondefaultGateIdgate.ts:325

defaultGateId(declaration: SuiteGateDeclaration | ConfigGateDeclaration): string

The id a declaration gets when it names none: <kind>:<titles>[@<metric>], e.g. ratio:new/three, ratio:new/three,f64 against several denominators, bound:fused, difference:a/b, baseline:<subjects> (* for every case).

The id is injective on what a declaration names: a title, a condition segment, a file or a metric has \ / , @ > # ^ * ! escaped with a backslash, so those characters only ever act as separators or markers. A reference reads [file#]segment > … > case; a sibling { case } reads ^case; an object reference with an empty condition (a case at the root, where a bare title matches at any depth) reads [file#]>case; an empty list of references reads !. A string reference and the object form naming the same segments give the same id, since they name the same cases; any two declarations naming different cases, metrics or kinds give different ids.

functiondefineMeasurePluginplugin.ts:289

defineMeasurePlugin<TCase, TCondition>(spec: MeasurePluginSpec<TCase, TCondition>): MeasurePlugin

Builds the type-erased MeasurePlugin a MeasureRegistry stores, from the fully-typed MeasurePluginSpec a measure package writes.

Every erased method re-validates its argument through parseCaseResult/ parseConditionResult before dispatching, rather than casting — a payload that crossed a process boundary (or, in this slice, was merely grouped by measure id from a shared event stream) is never trusted without that check. toJsonCase/toJsonCondition each validate against their own shape rather than guessing which one a value is from a member it happens to have.

functiondefineReporterPluginreporter-plugin.ts:79

defineReporterPlugin(spec: ReporterPluginSpec): ReporterPlugin

Brands a reporter spec as a ReporterPlugin.

A reporter carries no options of its own: whatever it needs is applied where the plugin is constructed, so a package with options exports a factory returning this, and one without exports the result directly.

functionfallbackPluginfallback-plugin.ts:30

fallbackPlugin(id: string): MeasurePlugin

Plugin used for a measure id no registered plugin declares. A plugin id typo must not lose a measurement that already cost minutes to produce: the data is still shown, just without measure-specific formatting.

functionfindConditionScopeconditions.ts:113

findConditionScope(scopeId: string | null, lookup: (id: string) => ScopeRecord | undefined): ScopeRecord | null

The nearest scope at or above scopeId that is a measured condition.

A child’s own scopes hang beneath the parent’s unit scope, so an execution is attributed to its condition by ancestry.

functiongateVerdictFramegate-frame.ts:28

gateVerdictFrame(verdicts: readonly _ReadonlyObjectDeep<{
  adjustedPValue: number | null;
  degreesOfFreedom: number | null;
  dispersion: number | null;
  escalatedReplicates: number;
  estimate: number | null;
  estimator: "paired" | "unpaired" | "single" | null;
  executions: number[];
  id: string;
  interval: {
    level: number;
    lower: number;
    upper: number;
  } | null;
  kind: "ratio" | "difference" | "bound" | "baseline";
  message: string;
  metric: {
    direction: "lower-is-better" | "higher-is-better";
    name: string;
    scale: "log" | "linear";
    unit: {
      scale: number;
      symbol: string;
    };
  };
  origin: "config" | "suite" | "cli";
  pValue: number | null;
  rationale?: string;
  reason: "decided" | "interval-contains-threshold" | "multiplicity" | "dispersion-exceeds-limit" | "too-few-executions" | "no-threshold" | "case-failed" | "case-filtered" | "metric-unavailable" | "non-positive-value" | "runtime-unsupported" | "runtime-unavailable" | "baseline-case-missing" | "baseline-environment-mismatch";
  runtime: string;
  subjects: {
    caseTitle: string;
    conditionTitles: string[];
    file: string;
    runtime: string;
  }[];
  threshold: {
    max?: number;
    min?: number;
  };
  verdict: "pass" | "fail" | "inconclusive" | "reported" | "skipped" | "not-applicable" | "error" | "incomparable";
}, never>[], options?: {
  readonly title?: string | null;
}): DataFrame

The verdicts of a run as one frame every reporter renders the same way: the gate, its runtime, the verdict, the estimate with its interval and level, the threshold, the dispersion, the executions per subject and the reason. Rows keep the order of verdicts.

functionisMeasurePluginregistry.ts:13

isMeasurePlugin(value: unknown): value is MeasurePlugin

Checks the MEASURE_PLUGIN_TAG brand rather than validating each member’s shape — a dynamically-loaded module’s default export either went through defineMeasurePlugin/fallbackAdapter, or it did not.

functionparseMeasureDatameasure-data.ts:155

parseMeasureData(value: unknown): {
  conditionTitle: string;
  kind: "condition-result";
  measure: string;
  result: unknown;
} | {
  arm: "shared" | "isolated";
  caseTitle: string;
  kind: "case-execution";
  measure: string;
  replicate: number;
  result: unknown;
} | {
  caseTitle: string;
  kind: "case-result";
  measure: string;
  result: unknown;
} | {
  file: string;
  kind: "load-error";
  message: string;
} | {
  kind: "run-description";
  machine: {
    architecture: string;
    availableParallelism: number;
    cpuGovernor: string | null;
    cpuModel: string;
    kernelRelease: string;
    logicalCores: number;
    memoryGiB: number;
    os: string;
    physicalCores: number | null;
  };
  run: {
    argv: string[];
    id: string;
    mode: string | null;
    orderSeed: number;
    plan: {
      cooldown: boolean;
      isolatedRuns: number;
      maxReplicates: number;
      replicates: number;
      retryOnInstability: number;
      rounds: number;
    };
    startedAt: string;
    tool: {
      name: "@ac-bench/lib";
      version: string;
    };
  };
} | {
  kind: "runtime-description";
  runtime: {
    capabilities: {
      allocationCounter: "v8-total-allocated" | "gc-profiler" | "heap-growth" | "browser-heap-growth" | null;
      cpuTime: boolean;
      forcedCollection: boolean;
    };
    clock: {
      readCostMs: number;
      resolutionMs: number;
      source: "performance.now";
    };
    crossOriginIsolated: boolean | null;
    device: {
      model: string;
      os: string;
      osVersion: string;
    } | null;
    engine: "v8" | "spidermonkey" | "javascriptcore";
    flags: string[];
    headless: boolean | null;
    id: string;
    isolation: "browser" | "process" | "context" | "reload";
    kind: "node" | "browser";
    product: string;
    userAgent: string | null;
    version: string;
  };
} | {
  gate: {
    conditionPath: number[];
    declaration: {
      denominators: string[];
      id?: string;
      kind: "ratio";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      numerator: string;
      rationale?: string;
      runtimes?: string[];
    } | {
      id?: string;
      kind: "difference";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      rationale?: string;
      reference: string;
      runtimes?: string[];
      subject: string;
    } | {
      id?: string;
      kind: "bound";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      rationale?: string;
      runtimes?: string[];
      subject: string;
    };
    file: string;
    origin: "suite";
  } | {
    declaration: {
      denominators: (string | {
        case: string;
        condition: string | ...[];
        file?: string;
      } | {
        case: string;
      })[];
      id?: string;
      kind: "ratio";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      numerator: string | {
        case: string;
        condition: string | string[];
        file?: string;
      } | {
        case: string;
      };
      rationale?: string;
      runtimes?: string[];
    } | {
      id?: string;
      kind: "difference";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      rationale?: string;
      reference: string | {
        case: string;
        condition: string | string[];
        file?: string;
      } | {
        case: string;
      };
      runtimes?: string[];
      subject: string | {
        case: string;
        condition: string | string[];
        file?: string;
      } | {
        case: string;
      };
    } | {
      id?: string;
      kind: "bound";
      max?: number;
      maxDispersion?: number;
      metric?: string;
      min?: number;
      rationale?: string;
      runtimes?: string[];
      subject: string | {
        case: string;
        condition: string | string[];
        file?: string;
      } | {
        case: string;
      };
    } | {
      id?: string;
      kind: "baseline";
      maxDispersion?: number;
      maxRegression?: number;
      metric?: string;
      normalizeBy?: string | {
        case: string;
        condition: string | string[];
        file?: string;
      } | {
        case: string;
      };
      rationale?: string;
      runtimes?: string[];
      subjects?: (string | {
        case: string;
        condition: ... | ...;
        file?: ... | ...;
      } | {
        case: string;
      })[];
    };
    origin: "config" | "cli";
  };
  kind: "gate-declaration";
} | {
  kind: "gate-verdict";
  verdict: {
    adjustedPValue: number | null;
    degreesOfFreedom: number | null;
    dispersion: number | null;
    escalatedReplicates: number;
    estimate: number | null;
    estimator: "paired" | "unpaired" | "single" | null;
    executions: number[];
    id: string;
    interval: {
      level: number;
      lower: number;
      upper: number;
    } | null;
    kind: "ratio" | "difference" | "bound" | "baseline";
    message: string;
    metric: {
      direction: "lower-is-better" | "higher-is-better";
      name: string;
      scale: "log" | "linear";
      unit: {
        scale: number;
        symbol: string;
      };
    };
    origin: "config" | "suite" | "cli";
    pValue: number | null;
    rationale?: string;
    reason: "decided" | "interval-contains-threshold" | "multiplicity" | "dispersion-exceeds-limit" | "too-few-executions" | "no-threshold" | "case-failed" | "case-filtered" | "metric-unavailable" | "non-positive-value" | "runtime-unsupported" | "runtime-unavailable" | "baseline-case-missing" | "baseline-environment-mismatch";
    runtime: string;
    subjects: {
      caseTitle: string;
      conditionTitles: string[];
      file: string;
      runtime: string;
    }[];
    threshold: {
      max?: number;
      min?: number;
    };
    verdict: "pass" | "fail" | "inconclusive" | "reported" | "skipped" | "not-applicable" | "error" | "incomparable";
  };
} | {
  completedUnits: number;
  kind: "run-progress";
  totalUnits: number;
} | {
  cases: {
    selected: boolean;
    title: string;
  }[];
  conditionPath: number[];
  file: string;
  kind: "unit-declaration";
  measure: string;
  runtime: string;
  titles: string[];
}

Validates a data payload that crossed the child/parent boundary.

functionpartitionPluginspartition-plugins.ts:21

partitionPlugins(plugins: readonly BenchPlugin[]): {
  readonly measures: readonly MeasurePlugin[];
  readonly reporters: readonly ReporterPlugin[];
  readonly runtimes: readonly BrandedRuntimePlugin[];
}

Sorts a mixed plugin list into the typed lists the programmatic API takes, preserving each kind’s declaration order.

Runtimes come back as their brand only: @ac-bench/lib’s isRuntimePlugin narrows them to what it can create.

Throws An entry went through none of defineMeasurePlugin, defineReporterPlugin and defineRuntimePlugin.

functionvalidateGateDeclarationgate.ts:402

validateGateDeclaration(declaration: SuiteGateDeclaration | ConfigGateDeclaration): void

Checks what a declaration says before any case is looked at.

Throws On min above max, a non-finite bound, a ratio bound that is not positive, a ratio without denominator, a non-positive maxDispersion, an empty id, or a negative or non-finite maxRegression.

classArchiveBuilderarchive.ts:254

class ArchiveBuilder implements ISink<MeasureData>

A sink that folds a run’s events into a BenchArchive as they arrive.

Each case-execution is reduced to its identity and dropped, and each case-result to the measure’s JSON form, so memory does not grow with the samples a run collects.

new (options: ArchiveBuilderOptions): ArchiveBuilder
get described(): boolean

Whether a run-description arrived, so ArchiveBuilder.build can answer.

build(): BenchArchive

The archive of everything observed so far.

Throws When no run-description was written: an archive nobody can place is worse than none.

close(): void
flush(): void
settled(): ArchivedCondition[]

Every condition whose scope has ended since the last call, archived as ArchiveBuilder.build will archive it: a writer that streams the archive writes each once it settles, so a run that crashes keeps what it measured.

write(event: ReportEvent<{ conditionTitle: string; kind: "condition-result"; measure: string; result: unknown; } | { arm: "shared" | "isolated"; caseTitle: string; kind: "case-execution"; measure: string; replicate: number; result: unknown; } | { caseTitle: string; kind: "case-result"; measure: string; result: unknown; } | { file: string; kind: "load-error"; message: string; } | { kind: "run-description"; machine: { architecture: string; availableParallelism: number; cpuGovernor: string | null; cpuModel: string; kernelRelease: string; logicalCores: number; memoryGiB: number; os: string; physicalCores: number | null; }; run: { argv: string[]; id: string; mode: string | null; orderSeed: number; plan: { cooldown: boolean; isolatedRuns: number; maxReplicates: number; replicates: number; retryOnInstability: number; rounds: number; }; startedAt: string; tool: { name: "@ac-bench/lib"; version: string; }; }; } | { kind: "runtime-description"; runtime: { capabilities: { allocationCounter: "v8-total-allocated" | "gc-profiler" | "heap-growth" | "browser-heap-growth" | null; cpuTime: boolean; forcedCollection: boolean; }; clock: { readCostMs: number; resolutionMs: number; source: "performance.now"; }; crossOriginIsolated: boolean | null; device: { model: string; os: string; osVersion: string; } | null; engine: "v8" | "spidermonkey" | "javascriptcore"; flags: string[]; headless: boolean | null; id: string; isolation: "browser" | "process" | "context" | "reload"; kind: "node" | "browser"; product: string; userAgent: string | null; version: string; }; } | { gate: { conditionPath: number[]; declaration: { denominators: string[]; id?: string; kind: "ratio"; max?: number; maxDispersion?: number; metric?: string; min?: number; numerator: string; rationale?: string; runtimes?: string[]; } | { id?: string; kind: "difference"; max?: number; maxDispersion?: number; metric?: string; min?: number; rationale?: string; reference: string; runtimes?: string[]; subject: string; } | { id?: string; kind: "bound"; max?: number; maxDispersion?: number; metric?: string; min?: number; rationale?: string; runtimes?: string[]; subject: string; }; file: string; origin: "suite"; } | { declaration: { denominators: (string | { case: string; condition: ... | ...; file?: ... | ...; } | { case: string; })[]; id?: string; kind: "ratio"; max?: number; maxDispersion?: number; metric?: string; min?: number; numerator: string | { case: string; condition: string | ...[]; file?: string; } | { case: string; }; rationale?: string; runtimes?: string[]; } | { id?: string; kind: "difference"; max?: number; maxDispersion?: number; metric?: string; min?: number; rationale?: string; reference: string | { case: string; condition: string | ...[]; file?: string; } | { case: string; }; runtimes?: string[]; subject: string | { case: string; condition: string | ...[]; file?: string; } | { case: string; }; } | { id?: string; kind: "bound"; max?: number; maxDispersion?: number; metric?: string; min?: number; rationale?: string; runtimes?: string[]; subject: string | { case: string; condition: string | ...[]; file?: string; } | { case: string; }; } | { id?: string; kind: "baseline"; maxDispersion?: number; maxRegression?: number; metric?: string; normalizeBy?: string | { case: string; condition: string | ...[]; file?: string; } | { case: string; }; rationale?: string; runtimes?: string[]; subjects?: (string | { case: ...; condition: ...; file?: ...; } | { case: ...; })[]; }; origin: "config" | "cli"; }; kind: "gate-declaration"; } | { kind: "gate-verdict"; verdict: { adjustedPValue: number | null; degreesOfFreedom: number | null; dispersion: number | null; escalatedReplicates: number; estimate: number | null; estimator: "paired" | "unpaired" | "single" | null; executions: number[]; id: string; interval: { level: number; lower: number; upper: number; } | null; kind: "ratio" | "difference" | "bound" | "baseline"; message: string; metric: { direction: "lower-is-better" | "higher-is-better"; name: string; scale: "log" | "linear"; unit: { scale: number; symbol: string; }; }; origin: "config" | "suite" | "cli"; pValue: number | null; rationale?: string; reason: "decided" | "interval-contains-threshold" | "multiplicity" | "dispersion-exceeds-limit" | "too-few-executions" | "no-threshold" | "case-failed" | "case-filtered" | "metric-unavailable" | "non-positive-value" | "runtime-unsupported" | "runtime-unavailable" | "baseline-case-missing" | "baseline-environment-mismatch"; runtime: string; subjects: { caseTitle: string; conditionTitles: string[]; file: string; runtime: string; }[]; threshold: { max?: number; min?: number; }; verdict: "pass" | "fail" | "inconclusive" | "reported" | "skipped" | "not-applicable" | "error" | "incomparable"; }; } | { completedUnits: number; kind: "run-progress"; totalUnits: number; } | { cases: { selected: boolean; title: string; }[]; conditionPath: number[]; file: string; kind: "unit-declaration"; measure: string; runtime: string; titles: string[]; }>): void

classGateReferenceErrorgate.ts:278

class GateReferenceError extends Error

A gate names a case that does not resolve to exactly one: unknown, ambiguous between an inherited and an own case, or a duplicate gate id in one fork unit.

new (declaration: LocatedGateDeclaration, reference: unknown, matches: readonly _ReadonlyObjectDeep<{ caseTitle: string; conditionTitles: string[]; file: string; runtime: string; }, never>[], message: string): GateReferenceError
readonly declaration: LocatedGateDeclaration
readonly matches: readonly _ReadonlyObjectDeep<{ caseTitle: string; conditionTitles: string[]; file: string; runtime: string; }, never>[]

Zero or more than one, as the message says.

readonly reference: unknown

What was named: a title, a CaseReference or a gate id.

constarchivedCaseSchemaarchive.ts:89

const archivedCaseSchema: ZodMiniObject<{
  executions: ZodMiniArray<ZodMiniObject<{
    arm: ZodMiniEnum<{
      isolated: "isolated";
      shared: "shared";
    }>;
    attempt: ZodMiniInt;
    disposition: ZodMiniEnum<{
      discarded: "discarded";
      kept: "kept";
    }>;
    observations: ZodMiniRecord<ZodMiniString<string>, ZodMiniObject<{
      dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
      samples: ZodMiniNumber<number>;
      value: ZodMiniNumber<number>;
      variance: ZodMiniNumber<number>;
    }, $strip>>;
    processKey: ZodMiniNullable<ZodMiniString<string>>;
    replicate: ZodMiniInt;
  }, $strip>>;
  result: ZodMiniUnknown;
  selected: ZodMiniBoolean<boolean>;
  status: ZodMiniEnum<{
    failed: "failed";
    measured: "measured";
    not-run: "not-run";
    unsupported: "unsupported";
  }>;
  title: ZodMiniString<string>;
}, $strip>

constarchivedConditionSchemaarchive.ts:119

const archivedConditionSchema: ZodMiniObject<{
  cases: ZodMiniArray<ZodMiniObject<{
    executions: ZodMiniArray<ZodMiniObject<{
      arm: ZodMiniEnum<{
        isolated: "isolated";
        shared: "shared";
      }>;
      attempt: ZodMiniInt;
      disposition: ZodMiniEnum<{
        discarded: "discarded";
        kept: "kept";
      }>;
      observations: ZodMiniRecord<ZodMiniString<string>, ZodMiniObject<{
        dispersion: ...;
        samples: ...;
        value: ...;
        variance: ...;
      }, $strip>>;
      processKey: ZodMiniNullable<ZodMiniString<string>>;
      replicate: ZodMiniInt;
    }, $strip>>;
    result: ZodMiniUnknown;
    selected: ZodMiniBoolean<boolean>;
    status: ZodMiniEnum<{
      failed: "failed";
      measured: "measured";
      not-run: "not-run";
      unsupported: "unsupported";
    }>;
    title: ZodMiniString<string>;
  }, $strip>>;
  conditionPath: ZodMiniArray<ZodMiniInt>;
  file: ZodMiniString<string>;
  key: ZodMiniString<string>;
  measure: ZodMiniString<string>;
  metrics: ZodMiniArray<ZodMiniObject<{
    direction: ZodMiniEnum<{
      higher-is-better: "higher-is-better";
      lower-is-better: "lower-is-better";
    }>;
    name: ZodMiniString<string>;
    scale: ZodMiniEnum<{
      linear: "linear";
      log: "log";
    }>;
    unit: ZodMiniObject<{
      scale: ZodMiniNumber<number>;
      symbol: ZodMiniString<string>;
    }, $strip>;
  }, $strip>>;
  runtime: ZodMiniString<string>;
  status: ZodMiniEnum<{
    cancelled: "cancelled";
    failed: "failed";
    ok: "ok";
    skipped: "skipped";
  }>;
  titles: ZodMiniArray<ZodMiniString<string>>;
}, $strip>

constarchivedExecutionSchemaarchive.ts:63

const archivedExecutionSchema: ZodMiniObject<{
  arm: ZodMiniEnum<{
    isolated: "isolated";
    shared: "shared";
  }>;
  attempt: ZodMiniInt;
  disposition: ZodMiniEnum<{
    discarded: "discarded";
    kept: "kept";
  }>;
  observations: ZodMiniRecord<ZodMiniString<string>, ZodMiniObject<{
    dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
    samples: ZodMiniNumber<number>;
    value: ZodMiniNumber<number>;
    variance: ZodMiniNumber<number>;
  }, $strip>>;
  processKey: ZodMiniNullable<ZodMiniString<string>>;
  replicate: ZodMiniInt;
}, $strip>

One process’s measurement of one case: the evidence, not the pooled answer.

constATTR_BENCH_UNSUPPORTEDconditions.ts:38

const ATTR_BENCH_UNSUPPORTED: "benchUnsupported"

On a condition scope the parent skipped without forking: why its measure does not run in the condition’s runtime. Its cases are archived "unsupported".

constbenchArchiveSchemaarchive.ts:144

const benchArchiveSchema: ZodMiniObject<{
  conditions: ZodMiniArray<ZodMiniObject<{
    cases: ZodMiniArray<ZodMiniObject<{
      executions: ZodMiniArray<ZodMiniObject<{
        arm: ...;
        attempt: ...;
        disposition: ...;
        observations: ...;
        processKey: ...;
        replicate: ...;
      }, $strip>>;
      result: ZodMiniUnknown;
      selected: ZodMiniBoolean<boolean>;
      status: ZodMiniEnum<{
        failed: "failed";
        measured: "measured";
        not-run: "not-run";
        unsupported: "unsupported";
      }>;
      title: ZodMiniString<string>;
    }, $strip>>;
    conditionPath: ZodMiniArray<ZodMiniInt>;
    file: ZodMiniString<string>;
    key: ZodMiniString<string>;
    measure: ZodMiniString<string>;
    metrics: ZodMiniArray<ZodMiniObject<{
      direction: ZodMiniEnum<{
        higher-is-better: "higher-is-better";
        lower-is-better: "lower-is-better";
      }>;
      name: ZodMiniString<string>;
      scale: ZodMiniEnum<{
        linear: "linear";
        log: "log";
      }>;
      unit: ZodMiniObject<{
        scale: ZodMiniNumber<...>;
        symbol: ZodMiniString<...>;
      }, $strip>;
    }, $strip>>;
    runtime: ZodMiniString<string>;
    status: ZodMiniEnum<{
      cancelled: "cancelled";
      failed: "failed";
      ok: "ok";
      skipped: "skipped";
    }>;
    titles: ZodMiniArray<ZodMiniString<string>>;
  }, $strip>>;
  diagnostics: ZodMiniArray<ZodMiniObject<{
    attributes: ZodMiniOptional<ZodMiniRecord<ZodMiniString<string>, ZodMiniUnknown>>;
    code: ZodMiniOptional<ZodMiniString<string>>;
    message: ZodMiniString<string>;
    severity: ZodMiniEnum<{
      error: "error";
      info: "info";
      warning: "warning";
    }>;
    source: ZodMiniOptional<ZodMiniType<SourceLocation, unknown, $ZodTypeInternals<SourceLocation, unknown>>>;
  }, $strip>>;
  format: ZodMiniLiteral<"ac-bench-archive">;
  gates: ZodMiniArray<ZodMiniDiscriminatedUnion<[ZodMiniObject<{
    conditionPath: ZodMiniArray<ZodMiniInt>;
    declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
      denominators: ...;
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      numerator: ...;
      rationale: ...;
      runtimes: ...;
    }, $strip>, ZodMiniObject<{
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      rationale: ...;
      reference: ...;
      runtimes: ...;
      subject: ...;
    }, $strip>, ZodMiniObject<{
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      rationale: ...;
      runtimes: ...;
      subject: ...;
    }, $strip>], "kind">;
    file: ZodMiniString<string>;
    origin: ZodMiniLiteral<"suite">;
  }, $strip>, ZodMiniObject<{
    declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
      denominators: ...;
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      numerator: ...;
      rationale: ...;
      runtimes: ...;
    }, $strip>, ZodMiniObject<{
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      rationale: ...;
      reference: ...;
      runtimes: ...;
      subject: ...;
    }, $strip>, ZodMiniObject<{
      id: ...;
      kind: ...;
      max: ...;
      maxDispersion: ...;
      metric: ...;
      min: ...;
      rationale: ...;
      runtimes: ...;
      subject: ...;
    }, $strip>, ZodMiniObject<{
      id: ...;
      kind: ...;
      maxDispersion: ...;
      maxRegression: ...;
      metric: ...;
      normalizeBy: ...;
      rationale: ...;
      runtimes: ...;
      subjects: ...;
    }, $strip>], "kind">;
    origin: ZodMiniEnum<{
      cli: "cli";
      config: "config";
    }>;
  }, $strip>], "origin">>;
  machine: ZodMiniObject<{
    architecture: ZodMiniString<string>;
    availableParallelism: ZodMiniInt;
    cpuGovernor: ZodMiniNullable<ZodMiniString<string>>;
    cpuModel: ZodMiniString<string>;
    kernelRelease: ZodMiniString<string>;
    logicalCores: ZodMiniInt;
    memoryGiB: ZodMiniInt;
    os: ZodMiniString<string>;
    physicalCores: ZodMiniNullable<ZodMiniInt>;
  }, $strip>;
  run: ZodMiniObject<{
    argv: ZodMiniArray<ZodMiniString<string>>;
    endedAt: ZodMiniISODateTime;
    id: ZodMiniString<string>;
    mode: ZodMiniNullable<ZodMiniString<string>>;
    orderSeed: ZodMiniInt;
    plan: ZodMiniObject<{
      cooldown: ZodMiniBoolean<boolean>;
      isolatedRuns: ZodMiniInt;
      maxReplicates: ZodMiniInt;
      replicates: ZodMiniInt;
      retryOnInstability: ZodMiniInt;
      rounds: ZodMiniInt;
    }, $strip>;
    startedAt: ZodMiniISODateTime;
    tool: ZodMiniObject<{
      name: ZodMiniLiteral<"@ac-bench/lib">;
      version: ZodMiniString<string>;
    }, $strip>;
  }, $strip>;
  runtimes: ZodMiniArray<ZodMiniObject<{
    capabilities: ZodMiniObject<{
      allocationCounter: ZodMiniNullable<ZodMiniEnum<{
        browser-heap-growth: "browser-heap-growth";
        gc-profiler: "gc-profiler";
        heap-growth: "heap-growth";
        v8-total-allocated: "v8-total-allocated";
      }>>;
      cpuTime: ZodMiniBoolean<boolean>;
      forcedCollection: ZodMiniBoolean<boolean>;
    }, $strip>;
    clock: ZodMiniObject<{
      readCostMs: ZodMiniNumber<number>;
      resolutionMs: ZodMiniNumber<number>;
      source: ZodMiniLiteral<"performance.now">;
    }, $strip>;
    crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    device: ZodMiniNullable<ZodMiniObject<{
      model: ZodMiniString<string>;
      os: ZodMiniString<string>;
      osVersion: ZodMiniString<string>;
    }, $strip>>;
    engine: ZodMiniEnum<{
      javascriptcore: "javascriptcore";
      spidermonkey: "spidermonkey";
      v8: "v8";
    }>;
    flags: ZodMiniArray<ZodMiniString<string>>;
    headless: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    id: ZodMiniString<string>;
    isolation: ZodMiniEnum<{
      browser: "browser";
      context: "context";
      process: "process";
      reload: "reload";
    }>;
    kind: ZodMiniEnum<{
      browser: "browser";
      node: "node";
    }>;
    product: ZodMiniString<string>;
    userAgent: ZodMiniNullable<ZodMiniString<string>>;
    version: ZodMiniString<string>;
  }, $strip>>;
  verdicts: ZodMiniArray<ZodMiniObject<{
    adjustedPValue: ZodMiniNullable<ZodMiniNumber<number>>;
    degreesOfFreedom: ZodMiniNullable<ZodMiniNumber<number>>;
    dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
    escalatedReplicates: ZodMiniInt;
    estimate: ZodMiniNullable<ZodMiniNumber<number>>;
    estimator: ZodMiniNullable<ZodMiniEnum<{
      paired: "paired";
      single: "single";
      unpaired: "unpaired";
    }>>;
    executions: ZodMiniArray<ZodMiniInt>;
    id: ZodMiniString<string>;
    interval: ZodMiniNullable<ZodMiniObject<{
      level: ZodMiniNumber<number>;
      lower: ZodMiniNumber<number>;
      upper: ZodMiniNumber<number>;
    }, $strip>>;
    kind: ZodMiniEnum<{
      baseline: "baseline";
      bound: "bound";
      difference: "difference";
      ratio: "ratio";
    }>;
    message: ZodMiniString<string>;
    metric: ZodMiniObject<{
      direction: ZodMiniEnum<{
        higher-is-better: "higher-is-better";
        lower-is-better: "lower-is-better";
      }>;
      name: ZodMiniString<string>;
      scale: ZodMiniEnum<{
        linear: "linear";
        log: "log";
      }>;
      unit: ZodMiniObject<{
        scale: ZodMiniNumber<number>;
        symbol: ZodMiniString<string>;
      }, $strip>;
    }, $strip>;
    origin: ZodMiniEnum<{
      cli: "cli";
      config: "config";
      suite: "suite";
    }>;
    pValue: ZodMiniNullable<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    reason: ZodMiniEnum<{
      baseline-case-missing: "baseline-case-missing";
      baseline-environment-mismatch: "baseline-environment-mismatch";
      case-failed: "case-failed";
      case-filtered: "case-filtered";
      decided: "decided";
      dispersion-exceeds-limit: "dispersion-exceeds-limit";
      interval-contains-threshold: "interval-contains-threshold";
      metric-unavailable: "metric-unavailable";
      multiplicity: "multiplicity";
      no-threshold: "no-threshold";
      non-positive-value: "non-positive-value";
      runtime-unavailable: "runtime-unavailable";
      runtime-unsupported: "runtime-unsupported";
      too-few-executions: "too-few-executions";
    }>;
    runtime: ZodMiniString<string>;
    subjects: ZodMiniArray<ZodMiniObject<{
      caseTitle: ZodMiniString<string>;
      conditionTitles: ZodMiniArray<ZodMiniString<string>>;
      file: ZodMiniString<string>;
      runtime: ZodMiniString<string>;
    }, $strip>>;
    threshold: ZodMiniObject<{
      max: ZodMiniOptional<ZodMiniNumber<number>>;
      min: ZodMiniOptional<ZodMiniNumber<number>>;
    }, $strip>;
    verdict: ZodMiniEnum<{
      error: "error";
      fail: "fail";
      incomparable: "incomparable";
      inconclusive: "inconclusive";
      not-applicable: "not-applicable";
      pass: "pass";
      reported: "reported";
      skipped: "skipped";
    }>;
  }, $strip>>;
  version: ZodMiniLiteral<1>;
}, $strip>

Validates a document read back as a BenchArchive: offline evaluation and baselines parse with it rather than trusting a file.

constcaseKeySchemagate.ts:135

const caseKeySchema: ZodMiniObject<{
  caseTitle: ZodMiniString<string>;
  conditionTitles: ZodMiniArray<ZodMiniString<string>>;
  file: ZodMiniString<string>;
  runtime: ZodMiniString<string>;
}, $strip>

One case, wherever it ran.

constcaseReferenceSchemagate.ts:64

const caseReferenceSchema: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
  case: ZodMiniString<string>;
  condition: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniArray<ZodMiniString<string>>]>;
  file: ZodMiniOptional<ZodMiniString<string>>;
}, $strip>, ZodMiniObject<{
  case: ZodMiniString<string>;
}, $strip>]>

A case named from outside its suite. Every segment is a glob (@ac-kit/format-glob): a string is "condition > … > case", split on " > "; the object form names titles that contain it; { case } alone names a case of the same fork unit as the gate’s first subject.

constchildEnvironmentSchemarun-description.ts:134

const childEnvironmentSchema: ZodMiniObject<{
  capabilities: ZodMiniObject<{
    allocationCounter: ZodMiniNullable<ZodMiniEnum<{
      browser-heap-growth: "browser-heap-growth";
      gc-profiler: "gc-profiler";
      heap-growth: "heap-growth";
      v8-total-allocated: "v8-total-allocated";
    }>>;
    cpuTime: ZodMiniBoolean<boolean>;
    forcedCollection: ZodMiniBoolean<boolean>;
  }, $strip>;
  clock: ZodMiniObject<{
    readCostMs: ZodMiniNumber<number>;
    resolutionMs: ZodMiniNumber<number>;
    source: ZodMiniLiteral<"performance.now">;
  }, $strip>;
  crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
  engineVersion: ZodMiniString<string>;
  userAgent: ZodMiniNullable<ZodMiniString<string>>;
}, $strip>

The half of a RuntimeDescription only a running child can measure: what its hello carries.

constclockDescriptionSchemarun-description.ts:88

const clockDescriptionSchema: ZodMiniObject<{
  readCostMs: ZodMiniNumber<number>;
  resolutionMs: ZodMiniNumber<number>;
  source: ZodMiniLiteral<"performance.now">;
}, $strip>

constconfigGateDeclarationSchemagate.ts:77

const configGateDeclarationSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  denominators: ZodMiniArray<ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [..., ...]>;
    file: ZodMiniOptional<ZodMiniString<...>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>>;
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"ratio">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  numerator: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniArray<...>]>;
    file: ZodMiniOptional<ZodMiniString<string>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
}, $strip>, ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"difference">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  reference: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniArray<...>]>;
    file: ZodMiniOptional<ZodMiniString<string>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  subject: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniArray<...>]>;
    file: ZodMiniOptional<ZodMiniString<string>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>;
}, $strip>, ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"bound">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  subject: ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniArray<...>]>;
    file: ZodMiniOptional<ZodMiniString<string>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>;
}, $strip>, ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"baseline">;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  maxRegression: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  normalizeBy: ZodMiniOptional<ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<string>;
    condition: ZodMiniUnion<readonly [..., ...]>;
    file: ZodMiniOptional<ZodMiniString<...>>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<string>;
  }, $strip>]>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  subjects: ZodMiniOptional<ZodMiniArray<ZodMiniUnion<readonly [ZodMiniString<string>, ZodMiniObject<{
    case: ZodMiniString<...>;
    condition: ZodMiniUnion<...>;
    file: ZodMiniOptional<...>;
  }, $strip>, ZodMiniObject<{
    case: ZodMiniString<...>;
  }, $strip>]>>>;
}, $strip>], "kind">

constgateDeclarationDataSchemameasure-data.ts:102

const gateDeclarationDataSchema: ZodMiniObject<{
  gate: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
    conditionPath: ZodMiniArray<ZodMiniInt>;
    declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
      denominators: ZodMiniArray<...>;
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      numerator: ZodMiniString<...>;
      rationale: ZodMiniOptional<...>;
      runtimes: ZodMiniOptional<...>;
    }, $strip>, ZodMiniObject<{
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      rationale: ZodMiniOptional<...>;
      reference: ZodMiniString<...>;
      runtimes: ZodMiniOptional<...>;
      subject: ZodMiniString<...>;
    }, $strip>, ZodMiniObject<{
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      rationale: ZodMiniOptional<...>;
      runtimes: ZodMiniOptional<...>;
      subject: ZodMiniString<...>;
    }, $strip>], "kind">;
    file: ZodMiniString<string>;
    origin: ZodMiniLiteral<"suite">;
  }, $strip>, ZodMiniObject<{
    declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
      denominators: ZodMiniArray<...>;
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      numerator: ZodMiniUnion<...>;
      rationale: ZodMiniOptional<...>;
      runtimes: ZodMiniOptional<...>;
    }, $strip>, ZodMiniObject<{
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      rationale: ZodMiniOptional<...>;
      reference: ZodMiniUnion<...>;
      runtimes: ZodMiniOptional<...>;
      subject: ZodMiniUnion<...>;
    }, $strip>, ZodMiniObject<{
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      max: ZodMiniOptional<...>;
      maxDispersion: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      min: ZodMiniOptional<...>;
      rationale: ZodMiniOptional<...>;
      runtimes: ZodMiniOptional<...>;
      subject: ZodMiniUnion<...>;
    }, $strip>, ZodMiniObject<{
      id: ZodMiniOptional<...>;
      kind: ZodMiniLiteral<...>;
      maxDispersion: ZodMiniOptional<...>;
      maxRegression: ZodMiniOptional<...>;
      metric: ZodMiniOptional<...>;
      normalizeBy: ZodMiniOptional<...>;
      rationale: ZodMiniOptional<...>;
      runtimes: ZodMiniOptional<...>;
      subjects: ZodMiniOptional<...>;
    }, $strip>], "kind">;
    origin: ZodMiniEnum<{
      cli: "cli";
      config: "config";
    }>;
  }, $strip>], "origin">;
  kind: ZodMiniLiteral<"gate-declaration">;
}, $strip>

Emitted by the parent once per gate a bench file declares, when the file’s conditions are discovered, so a reporter can keep every gate the run knew.

constgateMetricDescriptorSchemagate.ts:190

const gateMetricDescriptorSchema: ZodMiniObject<{
  direction: ZodMiniEnum<{
    higher-is-better: "higher-is-better";
    lower-is-better: "lower-is-better";
  }>;
  name: ZodMiniString<string>;
  scale: ZodMiniEnum<{
    linear: "linear";
    log: "log";
  }>;
  unit: ZodMiniObject<{
    scale: ZodMiniNumber<number>;
    symbol: ZodMiniString<string>;
  }, $strip>;
}, $strip>

What a gate needs to know about a metric without reading a result.

constgateMetricScaleSchemagate.ts:184

const gateMetricScaleSchema: ZodMiniEnum<{
  linear: "linear";
  log: "log";
}>
  • "log" — positive, multiplicative noise: durations. Ratios are taken in logs.
  • "linear" — may be zero; additive: bytes, counts. Ratios are refused.

constgateObservationSchemagate.ts:206

const gateObservationSchema: ZodMiniObject<{
  dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
  samples: ZodMiniNumber<number>;
  value: ZodMiniNumber<number>;
  variance: ZodMiniNumber<number>;
}, $strip>

What one execution says about one metric of one case: a value, the variance of that value, the dispersion of the samples behind it.

constgateReasonSchemagate.ts:161

const gateReasonSchema: ZodMiniEnum<{
  baseline-case-missing: "baseline-case-missing";
  baseline-environment-mismatch: "baseline-environment-mismatch";
  case-failed: "case-failed";
  case-filtered: "case-filtered";
  decided: "decided";
  dispersion-exceeds-limit: "dispersion-exceeds-limit";
  interval-contains-threshold: "interval-contains-threshold";
  metric-unavailable: "metric-unavailable";
  multiplicity: "multiplicity";
  no-threshold: "no-threshold";
  non-positive-value: "non-positive-value";
  runtime-unavailable: "runtime-unavailable";
  runtime-unsupported: "runtime-unsupported";
  too-few-executions: "too-few-executions";
}>

constgateSettingsSchemagate.ts:30

const gateSettingsSchema: ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
}, $strip>

constgateThresholdSchemagate.ts:7

const gateThresholdSchema: ZodMiniObject<{
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
}, $strip>

Bounds on the gated value. Neither bound: the gate only reports.

constgateVerdictDataSchemameasure-data.ts:92

const gateVerdictDataSchema: ZodMiniObject<{
  kind: ZodMiniLiteral<"gate-verdict">;
  verdict: ZodMiniObject<{
    adjustedPValue: ZodMiniNullable<ZodMiniNumber<number>>;
    degreesOfFreedom: ZodMiniNullable<ZodMiniNumber<number>>;
    dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
    escalatedReplicates: ZodMiniInt;
    estimate: ZodMiniNullable<ZodMiniNumber<number>>;
    estimator: ZodMiniNullable<ZodMiniEnum<{
      paired: "paired";
      single: "single";
      unpaired: "unpaired";
    }>>;
    executions: ZodMiniArray<ZodMiniInt>;
    id: ZodMiniString<string>;
    interval: ZodMiniNullable<ZodMiniObject<{
      level: ZodMiniNumber<number>;
      lower: ZodMiniNumber<number>;
      upper: ZodMiniNumber<number>;
    }, $strip>>;
    kind: ZodMiniEnum<{
      baseline: "baseline";
      bound: "bound";
      difference: "difference";
      ratio: "ratio";
    }>;
    message: ZodMiniString<string>;
    metric: ZodMiniObject<{
      direction: ZodMiniEnum<{
        higher-is-better: "higher-is-better";
        lower-is-better: "lower-is-better";
      }>;
      name: ZodMiniString<string>;
      scale: ZodMiniEnum<{
        linear: "linear";
        log: "log";
      }>;
      unit: ZodMiniObject<{
        scale: ZodMiniNumber<number>;
        symbol: ZodMiniString<string>;
      }, $strip>;
    }, $strip>;
    origin: ZodMiniEnum<{
      cli: "cli";
      config: "config";
      suite: "suite";
    }>;
    pValue: ZodMiniNullable<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    reason: ZodMiniEnum<{
      baseline-case-missing: "baseline-case-missing";
      baseline-environment-mismatch: "baseline-environment-mismatch";
      case-failed: "case-failed";
      case-filtered: "case-filtered";
      decided: "decided";
      dispersion-exceeds-limit: "dispersion-exceeds-limit";
      interval-contains-threshold: "interval-contains-threshold";
      metric-unavailable: "metric-unavailable";
      multiplicity: "multiplicity";
      no-threshold: "no-threshold";
      non-positive-value: "non-positive-value";
      runtime-unavailable: "runtime-unavailable";
      runtime-unsupported: "runtime-unsupported";
      too-few-executions: "too-few-executions";
    }>;
    runtime: ZodMiniString<string>;
    subjects: ZodMiniArray<ZodMiniObject<{
      caseTitle: ZodMiniString<string>;
      conditionTitles: ZodMiniArray<ZodMiniString<string>>;
      file: ZodMiniString<string>;
      runtime: ZodMiniString<string>;
    }, $strip>>;
    threshold: ZodMiniObject<{
      max: ZodMiniOptional<ZodMiniNumber<number>>;
      min: ZodMiniOptional<ZodMiniNumber<number>>;
    }, $strip>;
    verdict: ZodMiniEnum<{
      error: "error";
      fail: "fail";
      incomparable: "incomparable";
      inconclusive: "inconclusive";
      not-applicable: "not-applicable";
      pass: "pass";
      reported: "reported";
      skipped: "skipped";
    }>;
  }, $strip>;
}, $strip>

Emitted by the parent once the whole family of gates is decided: Holm needs every hypothesis of the run, so verdicts come after every condition closed.

constgateVerdictKindSchemagate.ts:144

const gateVerdictKindSchema: ZodMiniEnum<{
  error: "error";
  fail: "fail";
  incomparable: "incomparable";
  inconclusive: "inconclusive";
  not-applicable: "not-applicable";
  pass: "pass";
  reported: "reported";
  skipped: "skipped";
}>

constgateVerdictSchemagate.ts:223

const gateVerdictSchema: ZodMiniObject<{
  adjustedPValue: ZodMiniNullable<ZodMiniNumber<number>>;
  degreesOfFreedom: ZodMiniNullable<ZodMiniNumber<number>>;
  dispersion: ZodMiniNullable<ZodMiniNumber<number>>;
  escalatedReplicates: ZodMiniInt;
  estimate: ZodMiniNullable<ZodMiniNumber<number>>;
  estimator: ZodMiniNullable<ZodMiniEnum<{
    paired: "paired";
    single: "single";
    unpaired: "unpaired";
  }>>;
  executions: ZodMiniArray<ZodMiniInt>;
  id: ZodMiniString<string>;
  interval: ZodMiniNullable<ZodMiniObject<{
    level: ZodMiniNumber<number>;
    lower: ZodMiniNumber<number>;
    upper: ZodMiniNumber<number>;
  }, $strip>>;
  kind: ZodMiniEnum<{
    baseline: "baseline";
    bound: "bound";
    difference: "difference";
    ratio: "ratio";
  }>;
  message: ZodMiniString<string>;
  metric: ZodMiniObject<{
    direction: ZodMiniEnum<{
      higher-is-better: "higher-is-better";
      lower-is-better: "lower-is-better";
    }>;
    name: ZodMiniString<string>;
    scale: ZodMiniEnum<{
      linear: "linear";
      log: "log";
    }>;
    unit: ZodMiniObject<{
      scale: ZodMiniNumber<number>;
      symbol: ZodMiniString<string>;
    }, $strip>;
  }, $strip>;
  origin: ZodMiniEnum<{
    cli: "cli";
    config: "config";
    suite: "suite";
  }>;
  pValue: ZodMiniNullable<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  reason: ZodMiniEnum<{
    baseline-case-missing: "baseline-case-missing";
    baseline-environment-mismatch: "baseline-environment-mismatch";
    case-failed: "case-failed";
    case-filtered: "case-filtered";
    decided: "decided";
    dispersion-exceeds-limit: "dispersion-exceeds-limit";
    interval-contains-threshold: "interval-contains-threshold";
    metric-unavailable: "metric-unavailable";
    multiplicity: "multiplicity";
    no-threshold: "no-threshold";
    non-positive-value: "non-positive-value";
    runtime-unavailable: "runtime-unavailable";
    runtime-unsupported: "runtime-unsupported";
    too-few-executions: "too-few-executions";
  }>;
  runtime: ZodMiniString<string>;
  subjects: ZodMiniArray<ZodMiniObject<{
    caseTitle: ZodMiniString<string>;
    conditionTitles: ZodMiniArray<ZodMiniString<string>>;
    file: ZodMiniString<string>;
    runtime: ZodMiniString<string>;
  }, $strip>>;
  threshold: ZodMiniObject<{
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
  }, $strip>;
  verdict: ZodMiniEnum<{
    error: "error";
    fail: "fail";
    incomparable: "incomparable";
    inconclusive: "inconclusive";
    not-applicable: "not-applicable";
    pass: "pass";
    reported: "reported";
    skipped: "skipped";
  }>;
}, $strip>

constloadErrorDataSchemameasure-data.ts:63

const loadErrorDataSchema: ZodMiniObject<{
  file: ZodMiniString<string>;
  kind: ZodMiniLiteral<"load-error">;
  message: ZodMiniString<string>;
}, $strip>

constlocatedGateDeclarationSchemagate.ts:116

const locatedGateDeclarationSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  conditionPath: ZodMiniArray<ZodMiniInt>;
  declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
    denominators: ZodMiniArray<ZodMiniString<string>>;
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"ratio">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    numerator: ZodMiniString<string>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
  }, $strip>, ZodMiniObject<{
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"difference">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    reference: ZodMiniString<string>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
    subject: ZodMiniString<string>;
  }, $strip>, ZodMiniObject<{
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"bound">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
    subject: ZodMiniString<string>;
  }, $strip>], "kind">;
  file: ZodMiniString<string>;
  origin: ZodMiniLiteral<"suite">;
}, $strip>, ZodMiniObject<{
  declaration: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
    denominators: ZodMiniArray<ZodMiniUnion<readonly [..., ..., ...]>>;
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"ratio">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    numerator: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniObject<..., ...>, ZodMiniObject<..., ...>]>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
  }, $strip>, ZodMiniObject<{
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"difference">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    reference: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniObject<..., ...>, ZodMiniObject<..., ...>]>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
    subject: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniObject<..., ...>, ZodMiniObject<..., ...>]>;
  }, $strip>, ZodMiniObject<{
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"bound">;
    max: ZodMiniOptional<ZodMiniNumber<number>>;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    min: ZodMiniOptional<ZodMiniNumber<number>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
    subject: ZodMiniUnion<readonly [ZodMiniString<...>, ZodMiniObject<..., ...>, ZodMiniObject<..., ...>]>;
  }, $strip>, ZodMiniObject<{
    id: ZodMiniOptional<ZodMiniString<string>>;
    kind: ZodMiniLiteral<"baseline">;
    maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
    maxRegression: ZodMiniOptional<ZodMiniNumber<number>>;
    metric: ZodMiniOptional<ZodMiniString<string>>;
    normalizeBy: ZodMiniOptional<ZodMiniUnion<readonly [..., ..., ...]>>;
    rationale: ZodMiniOptional<ZodMiniString<string>>;
    runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<...>>>;
    subjects: ZodMiniOptional<ZodMiniArray<ZodMiniUnion<...>>>;
  }, $strip>], "kind">;
  origin: ZodMiniEnum<{
    cli: "cli";
    config: "config";
  }>;
}, $strip>], "origin">

A declaration and where it came from.

constmachineFingerprintSchemarun-description.ts:67

const machineFingerprintSchema: ZodMiniObject<{
  architecture: ZodMiniString<string>;
  availableParallelism: ZodMiniInt;
  cpuGovernor: ZodMiniNullable<ZodMiniString<string>>;
  cpuModel: ZodMiniString<string>;
  kernelRelease: ZodMiniString<string>;
  logicalCores: ZodMiniInt;
  memoryGiB: ZodMiniInt;
  os: ZodMiniString<string>;
  physicalCores: ZodMiniNullable<ZodMiniInt>;
}, $strip>

The host a run happened on. No host name and no user name, on purpose.

constMEASURE_PLUGIN_TAGplugin.ts:23

const MEASURE_PLUGIN_TAG: unique symbol

Brands a MeasurePlugin so isMeasurePlugin can check for it nominally instead of validating every member’s shape — only defineMeasurePlugin and fallbackAdapter ever attach it.

constmeasureCaseExecutionSchemameasure-data.ts:36

const measureCaseExecutionSchema: ZodMiniObject<{
  arm: ZodMiniEnum<{
    isolated: "isolated";
    shared: "shared";
  }>;
  caseTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"case-execution">;
  measure: ZodMiniString<string>;
  replicate: ZodMiniNumber<number>;
  result: ZodMiniUnknown;
}, $strip>

One case, as measured by one process. The evidence.

Emitted by the child as each case finishes, so a live view can fill in while the run is still going. A case measured in several processes produces several of these and exactly one MeasureCaseResult, which is the answer.

constmeasureCaseResultSchemameasure-data.ts:54

const measureCaseResultSchema: ZodMiniObject<{
  caseTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"case-result">;
  measure: ZodMiniString<string>;
  result: ZodMiniUnknown;
}, $strip>

One case’s answer, pooled across every process that measured it.

Emitted by the parent, which is the only party that sees every execution. With a single execution it carries that execution’s result unchanged.

constmeasureConditionInputSchemaplugin.ts:33

const measureConditionInputSchema: ZodMiniObject<{
  results: ZodMiniArray<ZodMiniUnknown>;
  title: ZodMiniString<string>;
}, $strip>

The generic “whole condition” value the CLI builds by grouping case-result events by measure id, before handing it to an plugin’s parseConditionResult. This is what a real child-process boundary will eventually carry as a condition-result event (§4.6, not yet emitted by any measure); until then, the parent assembles it itself from the case results it already collected.

constmeasureConditionResultSchemameasure-data.ts:14

const measureConditionResultSchema: ZodMiniObject<{
  conditionTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"condition-result">;
  measure: ZodMiniString<string>;
  result: ZodMiniUnknown;
}, $strip>

constmeasureDataSchemameasure-data.ts:140

const measureDataSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  conditionTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"condition-result">;
  measure: ZodMiniString<string>;
  result: ZodMiniUnknown;
}, $strip>, ZodMiniObject<{
  arm: ZodMiniEnum<{
    isolated: "isolated";
    shared: "shared";
  }>;
  caseTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"case-execution">;
  measure: ZodMiniString<string>;
  replicate: ZodMiniNumber<number>;
  result: ZodMiniUnknown;
}, $strip>, ZodMiniObject<{
  caseTitle: ZodMiniString<string>;
  kind: ZodMiniLiteral<"case-result">;
  measure: ZodMiniString<string>;
  result: ZodMiniUnknown;
}, $strip>], "kind">

constmeasurementPlanSchemarun-description.ts:13

const measurementPlanSchema: ZodMiniObject<{
  cooldown: ZodMiniBoolean<boolean>;
  isolatedRuns: ZodMiniInt;
  maxReplicates: ZodMiniInt;
  replicates: ZodMiniInt;
  retryOnInstability: ZodMiniInt;
  rounds: ZodMiniInt;
}, $strip>

How many contexts a condition is measured in, and under what conditions.

Sampling (how many samples one case needs in one process) is the layer below and is decided per case by the sampler. This is the layer above: how many processes there are and what runs in each.

Parameters, not an intent: naming an intent (quick, rigorous) and turning it into these numbers is configuration, and lives in @ac-bench/cli.

constNODE_RUNTIME_IDrun-description.ts:102

const NODE_RUNTIME_ID: "node"

The id of the runtime every run measures in unless another is selected. Its conditions keep keys without a runtime prefix, so a Node-only run keys its scopes as it always has.

constREPORTER_PLUGIN_TAGreporter-plugin.ts:50

const REPORTER_PLUGIN_TAG: unique symbol

Brands a ReporterPlugin so isReporterPlugin can check for it nominally instead of validating every member’s shape — only defineReporterPlugin ever attaches it.

construnDescriptionDataSchemameasure-data.ts:72

const runDescriptionDataSchema: ZodMiniObject<{
  kind: ZodMiniLiteral<"run-description">;
  machine: ZodMiniObject<{
    architecture: ZodMiniString<string>;
    availableParallelism: ZodMiniInt;
    cpuGovernor: ZodMiniNullable<ZodMiniString<string>>;
    cpuModel: ZodMiniString<string>;
    kernelRelease: ZodMiniString<string>;
    logicalCores: ZodMiniInt;
    memoryGiB: ZodMiniInt;
    os: ZodMiniString<string>;
    physicalCores: ZodMiniNullable<ZodMiniInt>;
  }, $strip>;
  run: ZodMiniObject<{
    argv: ZodMiniArray<ZodMiniString<string>>;
    id: ZodMiniString<string>;
    mode: ZodMiniNullable<ZodMiniString<string>>;
    orderSeed: ZodMiniInt;
    plan: ZodMiniObject<{
      cooldown: ZodMiniBoolean<boolean>;
      isolatedRuns: ZodMiniInt;
      maxReplicates: ZodMiniInt;
      replicates: ZodMiniInt;
      retryOnInstability: ZodMiniInt;
      rounds: ZodMiniInt;
    }, $strip>;
    startedAt: ZodMiniISODateTime;
    tool: ZodMiniObject<{
      name: ZodMiniLiteral<"@ac-bench/lib">;
      version: ZodMiniString<string>;
    }, $strip>;
  }, $strip>;
}, $strip>

Emitted once by the parent, first: what the run is and where it runs.

construnDescriptionSchemarun-description.ts:171

const runDescriptionSchema: ZodMiniObject<{
  argv: ZodMiniArray<ZodMiniString<string>>;
  id: ZodMiniString<string>;
  mode: ZodMiniNullable<ZodMiniString<string>>;
  orderSeed: ZodMiniInt;
  plan: ZodMiniObject<{
    cooldown: ZodMiniBoolean<boolean>;
    isolatedRuns: ZodMiniInt;
    maxReplicates: ZodMiniInt;
    replicates: ZodMiniInt;
    retryOnInstability: ZodMiniInt;
    rounds: ZodMiniInt;
  }, $strip>;
  startedAt: ZodMiniISODateTime;
  tool: ZodMiniObject<{
    name: ZodMiniLiteral<"@ac-bench/lib">;
    version: ZodMiniString<string>;
  }, $strip>;
}, $strip>

What a run was asked to do and who ran it.

construnProgressDataSchemameasure-data.ts:113

const runProgressDataSchema: ZodMiniObject<{
  completedUnits: ZodMiniInt;
  kind: ZodMiniLiteral<"run-progress">;
  totalUnits: ZodMiniInt;
}, $strip>

Emitted by the parent once every file is discovered, then after each fork unit: how much of the whole run is done. A unit counts once, whatever the executions and replicates it took.

constRUNTIME_PLUGIN_TAGruntime-plugin.ts:8

const RUNTIME_PLUGIN_TAG: unique symbol

Brands a runtime plugin so partitionPlugins can sort it from a mixed list nominally. Only @ac-bench/lib’s defineRuntimePlugin attaches it: this package knows the brand and the id, and @ac-bench/lib the rest.

construntimeCapabilitiesSchemarun-description.ts:113

const runtimeCapabilitiesSchema: ZodMiniObject<{
  allocationCounter: ZodMiniNullable<ZodMiniEnum<{
    browser-heap-growth: "browser-heap-growth";
    gc-profiler: "gc-profiler";
    heap-growth: "heap-growth";
    v8-total-allocated: "v8-total-allocated";
  }>>;
  cpuTime: ZodMiniBoolean<boolean>;
  forcedCollection: ZodMiniBoolean<boolean>;
}, $strip>

What a runtime can do for a measure, as the child itself observed it.

construntimeDescriptionDataSchemameasure-data.ts:80

const runtimeDescriptionDataSchema: ZodMiniObject<{
  kind: ZodMiniLiteral<"runtime-description">;
  runtime: ZodMiniObject<{
    capabilities: ZodMiniObject<{
      allocationCounter: ZodMiniNullable<ZodMiniEnum<{
        browser-heap-growth: "browser-heap-growth";
        gc-profiler: "gc-profiler";
        heap-growth: "heap-growth";
        v8-total-allocated: "v8-total-allocated";
      }>>;
      cpuTime: ZodMiniBoolean<boolean>;
      forcedCollection: ZodMiniBoolean<boolean>;
    }, $strip>;
    clock: ZodMiniObject<{
      readCostMs: ZodMiniNumber<number>;
      resolutionMs: ZodMiniNumber<number>;
      source: ZodMiniLiteral<"performance.now">;
    }, $strip>;
    crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    device: ZodMiniNullable<ZodMiniObject<{
      model: ZodMiniString<string>;
      os: ZodMiniString<string>;
      osVersion: ZodMiniString<string>;
    }, $strip>>;
    engine: ZodMiniEnum<{
      javascriptcore: "javascriptcore";
      spidermonkey: "spidermonkey";
      v8: "v8";
    }>;
    flags: ZodMiniArray<ZodMiniString<string>>;
    headless: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    id: ZodMiniString<string>;
    isolation: ZodMiniEnum<{
      browser: "browser";
      context: "context";
      process: "process";
      reload: "reload";
    }>;
    kind: ZodMiniEnum<{
      browser: "browser";
      node: "node";
    }>;
    product: ZodMiniString<string>;
    userAgent: ZodMiniNullable<ZodMiniString<string>>;
    version: ZodMiniString<string>;
  }, $strip>;
}, $strip>

Emitted by the parent once per runtime a run measures in.

construntimeDescriptionSchemarun-description.ts:147

const runtimeDescriptionSchema: ZodMiniObject<{
  capabilities: ZodMiniObject<{
    allocationCounter: ZodMiniNullable<ZodMiniEnum<{
      browser-heap-growth: "browser-heap-growth";
      gc-profiler: "gc-profiler";
      heap-growth: "heap-growth";
      v8-total-allocated: "v8-total-allocated";
    }>>;
    cpuTime: ZodMiniBoolean<boolean>;
    forcedCollection: ZodMiniBoolean<boolean>;
  }, $strip>;
  clock: ZodMiniObject<{
    readCostMs: ZodMiniNumber<number>;
    resolutionMs: ZodMiniNumber<number>;
    source: ZodMiniLiteral<"performance.now">;
  }, $strip>;
  crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
  device: ZodMiniNullable<ZodMiniObject<{
    model: ZodMiniString<string>;
    os: ZodMiniString<string>;
    osVersion: ZodMiniString<string>;
  }, $strip>>;
  engine: ZodMiniEnum<{
    javascriptcore: "javascriptcore";
    spidermonkey: "spidermonkey";
    v8: "v8";
  }>;
  flags: ZodMiniArray<ZodMiniString<string>>;
  headless: ZodMiniNullable<ZodMiniBoolean<boolean>>;
  id: ZodMiniString<string>;
  isolation: ZodMiniEnum<{
    browser: "browser";
    context: "context";
    process: "process";
    reload: "reload";
  }>;
  kind: ZodMiniEnum<{
    browser: "browser";
    node: "node";
  }>;
  product: ZodMiniString<string>;
  userAgent: ZodMiniNullable<ZodMiniString<string>>;
  version: ZodMiniString<string>;
}, $strip>

The engine a case ran in, as far as a reader needs to compare two runs.

construntimeReferenceSchemarun-description.ts:105

const runtimeReferenceSchema: ZodMiniObject<{
  id: ZodMiniString<string>;
  kind: ZodMiniEnum<{
    browser: "browser";
    node: "node";
  }>;
}, $strip>

Which runtime a child measures in: what a case can branch on.

constsuiteGateDeclarationSchemagate.ts:37

const suiteGateDeclarationSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  denominators: ZodMiniArray<ZodMiniString<string>>;
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"ratio">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  numerator: ZodMiniString<string>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
}, $strip>, ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"difference">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  reference: ZodMiniString<string>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  subject: ZodMiniString<string>;
}, $strip>, ZodMiniObject<{
  id: ZodMiniOptional<ZodMiniString<string>>;
  kind: ZodMiniLiteral<"bound">;
  max: ZodMiniOptional<ZodMiniNumber<number>>;
  maxDispersion: ZodMiniOptional<ZodMiniNumber<number>>;
  metric: ZodMiniOptional<ZodMiniString<string>>;
  min: ZodMiniOptional<ZodMiniNumber<number>>;
  rationale: ZodMiniOptional<ZodMiniString<string>>;
  runtimes: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  subject: ZodMiniString<string>;
}, $strip>], "kind">

constunitDeclarationDataSchemameasure-data.ts:127

const unitDeclarationDataSchema: ZodMiniObject<{
  cases: ZodMiniArray<ZodMiniObject<{
    selected: ZodMiniBoolean<boolean>;
    title: ZodMiniString<string>;
  }, $strip>>;
  conditionPath: ZodMiniArray<ZodMiniInt>;
  file: ZodMiniString<string>;
  kind: ZodMiniLiteral<"unit-declaration">;
  measure: ZodMiniString<string>;
  runtime: ZodMiniString<string>;
  titles: ZodMiniArray<ZodMiniString<string>>;
}, $strip>

Emitted by the parent once per executable leaf it discovered, before measuring anything: every case the leaf runs, and whether the run’s filter selected it. What lets an archive list a case the run never measured.

typeBenchArchivearchive.ts:162

type BenchArchive = unknown

One document per run: what ran, where, and every condition’s answers.

Raw per-execution results are not kept, so the archive’s size follows the number of cases and processes, never the number of samples.

typeBrandedRuntimePluginruntime-plugin.ts:15

type BrandedRuntimePlugin = unknown

What this package knows of a runtime plugin: its brand and the id a config or --runtime selects it by. @ac-bench/lib’s RuntimePlugin extends it with how to create the runtime.

typeGateMetricplugin.ts:62

type GateMetric = GateMetricDescriptor & {
  readonly title: string;
  observe(result: unknown): _ReadonlyObjectDeep<{
    dispersion: number | null;
    samples: number;
    value: number;
    variance: number;
  }, never> | null;
}

The erased GateMetricSpec: observe validates its argument.

typeGateMetricSpecplugin.ts:49

type GateMetricSpec<TCase> = GateMetricDescriptor & {
  readonly title: string;
  observe(result: TCase): _ReadonlyObjectDeep<{
    dispersion: number | null;
    samples: number;
    value: number;
    variance: number;
  }, never> | null;
}

One quantity of a measure a gate can read, declared by the measure so the gate never reads a result shape.

typeMeasureComparisonplugin.ts:111

type MeasureComparison = unknown

Which field orders the cases against each other, and which fields bound that estimate’s uncertainty.

Read by the escalation policy, which asks whether two cases can be told apart, and by any renderer marking a row better or worse than its peers. Absent when the measure makes no ordered claim.

typeMeasureExecutionplugin.ts:11

type MeasureExecution<TResult> = unknown

One execution’s result, tagged with the context that produced it.

typeReporterContextreporter-plugin.ts:16

type ReporterContext = unknown

Everything a reporter needs that belongs to the run rather than to the reporter: the host’s streams, the run’s environment, and the registry that turns an opaque result into something renderable.

Handing these in is what keeps a reporter package free of node: imports — the host-bound half is assembled once, by whoever starts the run.

@ac-bench/core/runner

Functions

Classes

Constants

Types

functionallOfPoliciespolicy-combinators.ts:71

allOfPolicies<TSample, const TPolicies extends readonly StoppingPolicy<TSample, object>[]>(policies: TPolicies): StoppingPolicy<TSample, Simplify<UnionToIntersection<{ [K in string | number | symbol]: TPolicies[K] extends StoppingPolicy<TSample, TMetadata> ? TMetadata : never }[number]>>>

Satisfied once every policy is.

What a measure reporting both deterministic and noisy quantities needs: neither a confidence interval on a counter that never moves nor a settling test on a timing is correct alone, so the run continues until each quantity is judged by the rule that fits it.

functionanyOfPoliciespolicy-combinators.ts:127

anyOfPolicies<TSample, const TPolicies extends readonly StoppingPolicy<TSample, object>[]>(policies: TPolicies): StoppingPolicy<TSample, Simplify<UnionToIntersection<{ [K in string | number | symbol]: TPolicies[K] extends StoppingPolicy<TSample, TMetadata> ? TMetadata : never }[number]>>>

Satisfied as soon as any policy is.

For a measure whose quantities are alternative readings of the same thing, where the first one to settle answers for the case.

functionassembleForkUnitCasesfork-units.ts:214

assembleForkUnitCases(chain: readonly BenchCondition[], path: readonly number[]): BenchCase[]

Assembles a fork unit’s case list in reading order.

chain runs outermost-first; every path entry after the first indexes the nested condition that level descended into, so an enclosing level’s cases split around it.

functionboundGategates.ts:47

boundGate(subject: string, settings: GateSettings): void

metric(subject) against an absolute bound.

Throws When the settings contradict each other.

functioncaseScopeKeyprotocol.ts:324

caseScopeKey(file: string, conditionPath: readonly number[], conditionTitles: readonly string[], caseTitle: string, runtime?: string): string

The cross-run identity of a case within its fork unit, and the key of its report scope: forkUnitKey’s tuple with the case title appended, so it never equals a unit’s key either. file and runtime are as for forkUnitKey.

functioncheckForkUnitGatesfork-units.ts:73

checkForkUnitGates(unit: ForkUnit, context: GateReferenceContext): GateReferenceError[]

Checks every gate of unit against the cases the unit runs.

Done when the unit is assembled rather than when the gate is registered, so a gate may precede the cases it names. A title must name exactly one case: none is unknown, and two (an inherited case and an own one sharing a title) is ambiguous. Two gates with one id in a unit are an error too, since the id is what baselines and reports match on.

Returns One error per problem, in declaration order; empty when sound.

functioncollectForkUnitsfork-units.ts:148

collectForkUnits(roots: readonly BenchCondition[], context?: GateReferenceContext): ForkUnit[]

Walks roots depth-first and returns every executable leaf.

A leaf’s case list is assembled in reading order: at each enclosing level, the cases declared above the nested condition being descended into come first, then that condition’s own list, then the cases declared below it. So sibling leaves of one parent see the parent’s cases split around their own declaration point, exactly as the file reads.

Throws The first gate whose reference does not name exactly one case of its unit; checkForkUnitGates lists them all.

Parameters

context

The file the roots came from, for the error a bad gate reference raises. Default: no file name.

functioncreateProjectedPolicypolicy-combinators.ts:52

createProjectedPolicy<TSample, TProjected, TMetadata>(select: (sample: TSample) => TProjected, policy: StoppingPolicy<TProjected, TMetadata>): StoppingPolicy<TSample, TMetadata>

Adapts a policy to a different sample type by projecting each sample onto the quantity that policy judges.

A measure whose sample is a record of several quantities needs a different rule per quantity. This is what lets each of those rules stay written against a plain number and still compose under allOfPolicies.

functioncreateStabilityPolicystability-policy.ts:48

createStabilityPolicy<TSample>(select: (sample: TSample) => readonly number[], options?: StabilityOptions): StoppingPolicy<TSample, StabilityMetadata>

Stops once the watched quantities have stopped changing.

The counterpart to createRelativeErrorPolicy, for quantities that do not vary: an allocation count is the same every run, so a confidence interval around it says nothing, and “enough samples” means “it has settled” instead.

Each evaluation costs O(window × selected), independent of how many samples have accumulated.

Returns A policy for Sampler.

Parameters

select

The quantities to watch, in a fixed order. Every one of them must settle; a single unsettled entry keeps sampling.

functiondifferenceGategates.ts:34

differenceGate(subject: string, reference: string, settings?: _ReadonlyObjectDeep<{
  id?: string;
  max?: number;
  maxDispersion?: number;
  metric?: string;
  min?: number;
  rationale?: string;
  runtimes?: string[];
}, never>): void

metric(subject) − metric(reference), on the metric’s own (linear) scale.

Throws When the settings contradict each other.

functionforkUnitKeyprotocol.ts:307

forkUnitKey(file: string, conditionPath: readonly number[], conditionTitles: readonly string[], runtime?: string): string

The cross-run identity of a fork unit: stable under re-ordering (the titles) and unique across files and sibling groups (the path). A JSON tuple, so no file name or title can imitate another part.

Parameters

file

The bench file’s label: relative to the run’s working directory and /-separated, as the archive records it, so the key is the same from any checkout location. Never an absolute path.

runtime

The runtime the unit is measured in. Any but NODE_RUNTIME_ID leads the tuple, so one condition measured in two runtimes has two keys, while a Node run keys its units as it always has.

functionparseChildMessageprotocol.ts:261

parseChildMessage(value: unknown): {
  environment: {
    capabilities: {
      allocationCounter: "v8-total-allocated" | "gc-profiler" | "heap-growth" | "browser-heap-growth" | null;
      cpuTime: boolean;
      forcedCollection: boolean;
    };
    clock: {
      readCostMs: number;
      resolutionMs: number;
      source: "performance.now";
    };
    crossOriginIsolated: boolean | null;
    engineVersion: string;
    userAgent: string | null;
  };
  processId: string | number;
  t: "hello";
  version: number;
} | {
  conditions: DiscoveredCondition[];
  t: "conditions";
} | {
  event: unknown;
  seq: number;
  t: "event";
} | {
  count: number;
  kinds: string[];
  seq: number;
  t: "dropped";
} | {
  seq: number;
  status: "skipped" | "failed" | "ok" | "cancelled";
  t: "done";
} | {
  error: unknown;
  seq: number;
  t: "fatal";
}

Throws When value is a child hello of another protocol version, whatever else it carries.

Throws When value is not a valid child message.

functionparseParentMessageprotocol.ts:240

parseParentMessage(value: unknown): {
  artifactCacheRoot: string;
  runId: string;
  setupFiles?: string[];
  t: "hello";
  version: number;
} | {
  file: string;
  t: "list";
} | {
  arm: "shared" | "isolated";
  caseFilter?: string[];
  conditionPath: number[];
  conditionTitles: string[];
  emitSamples: boolean;
  file: string;
  fileLabel: string;
  hashSeed?: number;
  measureOptions?: Record<string, unknown>;
  orderSeed: number;
  parentScopeId: string | null;
  profile?: boolean;
  replicate: number;
  rounds: number;
  runtime: {
    id: string;
    kind: "node" | "browser";
  };
  t: "start";
} | {
  seq: number;
  t: "ack";
} | {
  reason: string;
  t: "abort";
}

Throws When value is a parent hello of another protocol version, whatever else it carries.

Throws When value is not a valid parent message.

functionprobeClockclock.ts:30

probeClock(durationMs?: number, now?: () => number): {
  readCostMs: number;
  resolutionMs: number;
  source: "performance.now";
}

Busy-loops the clock for durationMs and returns the median of its positive steps (its resolution) and the mean cost of one read.

A child calls it once, before measuring anything, so a measure can size its spans from the clock it actually runs under (a cross-origin-isolated page steps by 5 µs, a page that is not by 100 µs) without probing again.

Parameters

durationMs

How long to read the clock for. Default DEFAULT_CLOCK_PROBE_MS.

now

The clock, performance.now() by default; injectable to test the arithmetic on a scripted clock.

functionratioGategates.ts:15

ratioGate(numerator: string, denominator: string | readonly string[], settings?: _ReadonlyObjectDeep<{
  id?: string;
  max?: number;
  maxDispersion?: number;
  metric?: string;
  min?: number;
  rationale?: string;
  runtimes?: string[];
}, never>): void

metric(numerator) / metric(denominator). Several denominators mean “against each of them”: the gate passes only if every ratio passes, which is the same claim as “against the fastest of them” without choosing the fastest from noisy data.

Throws When the settings contradict each other.

Parameters

numerator

A case title of this condition, inherited cases included.

denominator

One or several case titles, same scope.

settings

Bounds and options; neither bound makes the gate report only.

functionregisterGateregistry.ts:260

registerGate(declaration: SuiteGateDeclaration): void

Registers a gate in the condition whose body is open, like a case. A gate may precede the cases it names: references are checked when a fork unit is assembled.

Throws When the declaration is contradictory.

Throws Outside a condition body.

functionreportCaseFailurecase-failure.ts:24

reportCaseFailure(context: BenchCaseRunContext, error: unknown, report: CaseFailureReport): Promise<void>

Ends a case that threw: runs its teardown, reports the measure’s failure result, then rethrows so the runner closes the case’s scope as "failed".

The scope’s status is what says a case failed — the archive and the exit code read it, never a measure’s result. A teardown that fails too is rethrown with the case’s error as a SuppressedError. Once the run is aborted the error is not rethrown, so the scope closes as "cancelled".

Throws The case’s error, unless context.signal is aborted.

functionresolveForkUnitprotocol.ts:375

resolveForkUnit(roots: readonly BenchCondition[], conditionPath: readonly number[], conditionTitles: readonly string[]): ForkUnit

Walks conditionPath through a freshly drained tree and checks the title at every level, which is what catches a bench file that changed between discovery and execution.

Throws At the first level that disagrees.

functionrunCaseOncerunner.ts:406

runCaseOnce(input: RunCaseOnceInput): Promise<void>

Invokes one case body once, reporting nothing.

For measures whose iteration is a whole process: the spawned process has no sink and no IPC channel, and its result reaches the sampler as wall time and an exit code. None of the condition chain’s hooks run — a fresh process holds none of the state they would set up, and paying beforeAll per iteration is exactly the cost this execution mode exists to measure honestly.

Throws If the unit has no case by that title.

functionrunForkUnitrunner.ts:143

runForkUnit(input: ForkUnitRunInput): Promise<ForkUnitOutcome>

Runs one fork unit: every case it inherited from its enclosing conditions plus its own, wrapped in the beforeAll hooks of the whole chain, outermost first.

Sibling fork units are run separately and, once isolation is on, in their own processes — which is why an enclosing condition’s beforeAll runs here again rather than once for the whole tree.

Never rethrows a case failure: a failed case closes its own scope as "failed", is counted in ForkUnitOutcome.casesFailed, and the condition continues. A failed beforeAll/afterAll closes the condition scope as "failed" and reports every remaining case as "skipped".

functionrunSamplingDefaultsoptions.ts:14

runSamplingDefaults<TSampling extends object>(context: Pick<BenchCaseRunContext, "measureOptions">): Partial<TSampling>

The run’s default sampling options for the case’s measure — a config file’s sampling[measureId], which the parent forwards as measureOptions.sampling — or {}. A measure spreads its condition’s own options over these, and its defaults under both.

Typed by the caller: the config validated the value as a record only, so a key the measure does not know is ignored like any other.

functionserveChildserve-child.ts:99

serveChild(transport: ChildTransport, host: ChildHost, options?: ServeChildOptions): void

Serves the bench child protocol until host.finish: the hello handshake, a list (discovery) or a start (one fork unit), acknowledgements and aborts.

The one implementation every runtime’s child shares — a Node process and a browser page differ only in their ChildTransport and ChildHost. Never throws: whatever goes wrong is reported as fatal.

classSamplersampler.ts:99

class Sampler<TSample = number, TMetadata = unknown>

Drives sampling without owning a clock, a loop, or an opinion about when enough is enough.

Time is an input rather than something read from a clock inside, which is what makes the whole apparatus testable from a scripted sequence with no fake timers — and what lets a scheduler hand this case a slice, walk away to another case, and come back.

new <TSample = number, TMetadata = unknown>(policy: StoppingPolicy<TSample, TMetadata>, bounds: SamplingBounds, options?: SamplerOptions<TSample>): Sampler<TSample, TMetadata>
nextBatch(): number | null

null once this case is done; otherwise the size of the next batch.

observe(samples: readonly TSample[], activeMs: number): void

Feeds one batch back. activeMs is the wall time the scheduler spent on this slice, including hooks and this recomputation.

result(): SamplerResult<TSample, TMetadata>

Defined only once Sampler.nextBatch has returned null.

stop(reason: "cancelled" | "failure"): void

Ends sampling early, keeping whatever was collected.

classUnsupportedInRuntimeErrorunsupported-in-runtime.ts:11

class UnsupportedInRuntimeError extends Error

Thrown by a measure’s case when the runtime it runs in lacks what the case needs: a process to spawn, an event-loop monitor, a nanosecond clock. The case fails with this message instead of the whole file failing to load, so a suite mixing measures still bundles and runs what it can.

A measure that knows ahead of time declares it through supportsRuntime, and the parent skips the condition without starting a child; this error is for what only the running case can tell.

new (what: string): UnsupportedInRuntimeError
readonly code: "unsupported-in-runtime"
readonly what: string

What the runtime lacks, as a phrase: "per-iteration processes".

constBENCH_PROTOCOL_VERSIONprotocol.ts:29

const BENCH_PROTOCOL_VERSION: 3

Bumped whenever a message’s shape changes in a way an older peer cannot read. A mismatch aborts that condition rather than the run.

3: the child’s hello names its processId (a pid or a page label) and carries the environment it measured; start names the runtime.

constchildHelloMessageSchemaprotocol.ts:147

const childHelloMessageSchema: ZodMiniObject<{
  environment: ZodMiniObject<{
    capabilities: ZodMiniObject<{
      allocationCounter: ZodMiniNullable<ZodMiniEnum<{
        browser-heap-growth: "browser-heap-growth";
        gc-profiler: "gc-profiler";
        heap-growth: "heap-growth";
        v8-total-allocated: "v8-total-allocated";
      }>>;
      cpuTime: ZodMiniBoolean<boolean>;
      forcedCollection: ZodMiniBoolean<boolean>;
    }, $strip>;
    clock: ZodMiniObject<{
      readCostMs: ZodMiniNumber<number>;
      resolutionMs: ZodMiniNumber<number>;
      source: ZodMiniLiteral<"performance.now">;
    }, $strip>;
    crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    engineVersion: ZodMiniString<string>;
    userAgent: ZodMiniNullable<ZodMiniString<string>>;
  }, $strip>;
  processId: ZodMiniUnion<readonly [ZodMiniNumber<number>, ZodMiniString<string>]>;
  t: ZodMiniLiteral<"hello">;
  version: ZodMiniNumber<number>;
}, $strip>

constchildMessageSchemaprotocol.ts:188

const childMessageSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  environment: ZodMiniObject<{
    capabilities: ZodMiniObject<{
      allocationCounter: ZodMiniNullable<ZodMiniEnum<{
        browser-heap-growth: ...;
        gc-profiler: ...;
        heap-growth: ...;
        v8-total-allocated: ...;
      }>>;
      cpuTime: ZodMiniBoolean<boolean>;
      forcedCollection: ZodMiniBoolean<boolean>;
    }, $strip>;
    clock: ZodMiniObject<{
      readCostMs: ZodMiniNumber<number>;
      resolutionMs: ZodMiniNumber<number>;
      source: ZodMiniLiteral<"performance.now">;
    }, $strip>;
    crossOriginIsolated: ZodMiniNullable<ZodMiniBoolean<boolean>>;
    engineVersion: ZodMiniString<string>;
    userAgent: ZodMiniNullable<ZodMiniString<string>>;
  }, $strip>;
  processId: ZodMiniUnion<readonly [ZodMiniNumber<number>, ZodMiniString<string>]>;
  t: ZodMiniLiteral<"hello">;
  version: ZodMiniNumber<number>;
}, $strip>, ZodMiniObject<{
  conditions: ZodMiniArray<ZodMiniType<DiscoveredCondition, unknown, $ZodTypeInternals<DiscoveredCondition, unknown>>>;
  t: ZodMiniLiteral<"conditions">;
}, $strip>, ZodMiniObject<{
  event: ZodMiniUnknown;
  seq: ZodMiniNumber<number>;
  t: ZodMiniLiteral<"event">;
}, $strip>], "t">

constdoneMessageSchemaprotocol.ts:176

const doneMessageSchema: ZodMiniObject<{
  seq: ZodMiniNumber<number>;
  status: ZodMiniEnum<{
    cancelled: "cancelled";
    failed: "failed";
    ok: "ok";
    skipped: "skipped";
  }>;
  t: ZodMiniLiteral<"done">;
}, $strip>

constdroppedMessageSchemaprotocol.ts:169

const droppedMessageSchema: ZodMiniObject<{
  count: ZodMiniNumber<number>;
  kinds: ZodMiniArray<ZodMiniString<string>>;
  seq: ZodMiniNumber<number>;
  t: ZodMiniLiteral<"dropped">;
}, $strip>

consteventMessageSchemaprotocol.ts:162

const eventMessageSchema: ZodMiniObject<{
  event: ZodMiniUnknown;
  seq: ZodMiniNumber<number>;
  t: ZodMiniLiteral<"event">;
}, $strip>

constfatalMessageSchemaprotocol.ts:182

const fatalMessageSchema: ZodMiniObject<{
  error: ZodMiniUnknown;
  seq: ZodMiniNumber<number>;
  t: ZodMiniLiteral<"fatal">;
}, $strip>

constparentHelloMessageSchemaprotocol.ts:65

const parentHelloMessageSchema: ZodMiniObject<{
  artifactCacheRoot: ZodMiniString<string>;
  runId: ZodMiniString<string>;
  setupFiles: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  t: ZodMiniLiteral<"hello">;
  version: ZodMiniNumber<number>;
}, $strip>

constparentMessageSchemaprotocol.ts:136

const parentMessageSchema: ZodMiniDiscriminatedUnion<[ZodMiniObject<{
  artifactCacheRoot: ZodMiniString<string>;
  runId: ZodMiniString<string>;
  setupFiles: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  t: ZodMiniLiteral<"hello">;
  version: ZodMiniNumber<number>;
}, $strip>, ZodMiniObject<{
  file: ZodMiniString<string>;
  t: ZodMiniLiteral<"list">;
}, $strip>, ZodMiniObject<{
  arm: ZodMiniEnum<{
    isolated: "isolated";
    shared: "shared";
  }>;
  caseFilter: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  conditionPath: ZodMiniArray<ZodMiniNumber<number>>;
  conditionTitles: ZodMiniArray<ZodMiniString<string>>;
  emitSamples: ZodMiniBoolean<boolean>;
  file: ZodMiniString<string>;
  fileLabel: ZodMiniString<string>;
  hashSeed: ZodMiniOptional<ZodMiniNumber<number>>;
  measureOptions: ZodMiniOptional<ZodMiniRecord<ZodMiniString<string>, ZodMiniUnknown>>;
  orderSeed: ZodMiniNumber<number>;
  parentScopeId: ZodMiniNullable<ZodMiniString<string>>;
  profile: ZodMiniOptional<ZodMiniBoolean<boolean>>;
  replicate: ZodMiniNumber<number>;
  rounds: ZodMiniNumber<number>;
  runtime: ZodMiniObject<{
    id: ZodMiniString<string>;
    kind: ZodMiniEnum<{
      browser: "browser";
      node: "node";
    }>;
  }, $strip>;
  t: ZodMiniLiteral<"start">;
}, $strip>, ZodMiniObject<{
  seq: ZodMiniNumber<number>;
  t: ZodMiniLiteral<"ack">;
}, $strip>, ZodMiniObject<{
  reason: ZodMiniString<string>;
  t: ZodMiniLiteral<"abort">;
}, $strip>], "t">

conststartMessageSchemaprotocol.ts:88

const startMessageSchema: ZodMiniObject<{
  arm: ZodMiniEnum<{
    isolated: "isolated";
    shared: "shared";
  }>;
  caseFilter: ZodMiniOptional<ZodMiniArray<ZodMiniString<string>>>;
  conditionPath: ZodMiniArray<ZodMiniNumber<number>>;
  conditionTitles: ZodMiniArray<ZodMiniString<string>>;
  emitSamples: ZodMiniBoolean<boolean>;
  file: ZodMiniString<string>;
  fileLabel: ZodMiniString<string>;
  hashSeed: ZodMiniOptional<ZodMiniNumber<number>>;
  measureOptions: ZodMiniOptional<ZodMiniRecord<ZodMiniString<string>, ZodMiniUnknown>>;
  orderSeed: ZodMiniNumber<number>;
  parentScopeId: ZodMiniNullable<ZodMiniString<string>>;
  profile: ZodMiniOptional<ZodMiniBoolean<boolean>>;
  replicate: ZodMiniNumber<number>;
  rounds: ZodMiniNumber<number>;
  runtime: ZodMiniObject<{
    id: ZodMiniString<string>;
    kind: ZodMiniEnum<{
      browser: "browser";
      node: "node";
    }>;
  }, $strip>;
  t: ZodMiniLiteral<"start">;
}, $strip>

typeBenchCaseIdregistry.ts:24

type BenchCaseId = unknown

Everything needed to reach one case again from a process that has only the bench file.

A measure whose iteration is a whole process (cold-start measurement, an external command) has to tell the process it spawns which case to run, and the spawned process has no IPC channel to ask over. Re-importing the file and replaying this identity is the only way back to the same case.

typeBenchCaseRunContextregistry.ts:44

type BenchCaseRunContext = unknown

What a measure’s case runner reports through.

Every method returns void, never a promise: a case runner has nothing to await, so no sink can be awaited from inside a timed region even by mistake.

typeBenchConditionregistry.ts:146

type BenchCondition = unknown

A registered condition: its hooks, and the cases and nested conditions its body declared, in declaration order.

Nesting is context specialization, not grouping. Only a condition with no nested condition of its own is executed (a “fork unit”); it runs its enclosing conditions’ cases as well as its own, under their hooks. So an outer condition declaring the cases and two inner conditions declaring nothing but a different beforeAll measures those same cases twice, once per setup — which is the point of writing a hierarchy at all.

A condition that declares both cases and a nested condition therefore never runs its cases on their own: they run inside each of its descendants.

typeDiscoveredConditionprotocol.ts:41

type DiscoveredCondition = unknown

A node of the condition tree a discovery child reports back. entries mirrors the registered body exactly, so an index into it is a valid conditionPath step.

typeForkUnitfork-units.ts:14

type ForkUnit = unknown

One executable unit: a condition with no nested condition of its own, together with the enclosing conditions whose hooks wrap it and the full case list it runs.

Only such a leaf is executed. A condition that declares nested conditions contributes its hooks and_its cases to each of them instead of running on its own.

typeMergedMetadatapolicy-combinators.ts:10

type MergedMetadata<TSample, TPolicies extends readonly StoppingPolicy<TSample, object>[]> = Simplify<UnionToIntersection<{ [K in keyof TPolicies]: TPolicies[K] extends StoppingPolicy<TSample, infer TMetadata> ? TMetadata : never }[number]>>

Every combined policy’s metadata in one record, since each contributes its own fields to the sampler result.

typeRelativeErrorSamplingrelative-error-policy.ts:24

type RelativeErrorSampling = unknown

What createRelativeErrorPolicy reads from a measure’s own resolved sampling record.

Structural rather than a base to extend, so a measure keeps naming its sampling after what it measures and passes it straight in. Every field is required: each measure resolves its own defaults first.

typeStoppingPolicysampler.ts:22

type StoppingPolicy<TSample = number, TMetadata = unknown> = unknown

The judgement half of sampling: when is this enough.

A policy never sees the bounds. It answers only “is the evidence good enough yet”, and the driver reconciles that answer with the floors and ceilings — which is what lets one driver serve a confidence-interval policy and a deterministic-counter policy without knowing the difference.

typeStopReasonsampler.ts:2

type StopReason = "policy-satisfied" | "min-time" | "max-time" | "max-runs" | "cancelled" | "failure"

Why a case stopped taking samples.