@ac-bench/lib 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -0
- package/README.md +41 -0
- package/dist/child/channel.d.ts +28 -0
- package/dist/child/channel.d.ts.map +1 -0
- package/dist/child/channel.js +68 -0
- package/dist/child/channel.js.map +1 -0
- package/dist/child/event-sink.d.ts +13 -0
- package/dist/child/event-sink.d.ts.map +1 -0
- package/dist/child/event-sink.js +34 -0
- package/dist/child/event-sink.js.map +1 -0
- package/dist/child/main.d.ts +2 -0
- package/dist/child/main.d.ts.map +1 -0
- package/dist/child/main.js +157 -0
- package/dist/child/main.js.map +1 -0
- package/dist/cooldown.d.ts +51 -0
- package/dist/cooldown.d.ts.map +1 -0
- package/dist/cooldown.js +118 -0
- package/dist/cooldown.js.map +1 -0
- package/dist/current-environment.d.ts +8 -0
- package/dist/current-environment.d.ts.map +1 -0
- package/dist/current-environment.js +10 -0
- package/dist/current-environment.js.map +1 -0
- package/dist/environment-monitor.d.ts +59 -0
- package/dist/environment-monitor.d.ts.map +1 -0
- package/dist/environment-monitor.js +163 -0
- package/dist/environment-monitor.js.map +1 -0
- package/dist/escalation.d.ts +24 -0
- package/dist/escalation.d.ts.map +1 -0
- package/dist/escalation.js +73 -0
- package/dist/escalation.js.map +1 -0
- package/dist/fork-runner.d.ts +52 -0
- package/dist/fork-runner.d.ts.map +1 -0
- package/dist/fork-runner.js +348 -0
- package/dist/fork-runner.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc-report-receiver.d.ts +47 -0
- package/dist/ipc-report-receiver.d.ts.map +1 -0
- package/dist/ipc-report-receiver.js +149 -0
- package/dist/ipc-report-receiver.js.map +1 -0
- package/dist/isolated-runner.d.ts +67 -0
- package/dist/isolated-runner.d.ts.map +1 -0
- package/dist/isolated-runner.js +537 -0
- package/dist/isolated-runner.js.map +1 -0
- package/dist/measure-diagnostic-proxy.d.ts +15 -0
- package/dist/measure-diagnostic-proxy.d.ts.map +1 -0
- package/dist/measure-diagnostic-proxy.js +50 -0
- package/dist/measure-diagnostic-proxy.js.map +1 -0
- package/dist/measurement-plan.d.ts +50 -0
- package/dist/measurement-plan.d.ts.map +1 -0
- package/dist/measurement-plan.js +2 -0
- package/dist/measurement-plan.js.map +1 -0
- package/dist/reporter-context.d.ts +19 -0
- package/dist/reporter-context.d.ts.map +1 -0
- package/dist/reporter-context.js +21 -0
- package/dist/reporter-context.js.map +1 -0
- package/dist/run-bench.d.ts +61 -0
- package/dist/run-bench.d.ts.map +1 -0
- package/dist/run-bench.js +151 -0
- package/dist/run-bench.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { MeasureRegistry, MeasureScheduling } from "@ac-bench/core/plugin";
|
|
2
|
+
import { DiscoveredCondition, MeasureData } from "@ac-bench/core/runner";
|
|
3
|
+
import { ISink } from "@ac-kit/app-report";
|
|
4
|
+
import { CooldownGate } from "./cooldown.js";
|
|
5
|
+
import { EnvironmentMonitor } from "./environment-monitor.js";
|
|
6
|
+
import { ForkOptions } from "./fork-runner.js";
|
|
7
|
+
import { MeasurementPlan } from "./measurement-plan.js";
|
|
8
|
+
export type IsolatedRunOptions = {
|
|
9
|
+
readonly sink: ISink<MeasureData>;
|
|
10
|
+
/** Resolves each leaf's measure, whose `scheduling` constrains the fork. */
|
|
11
|
+
readonly registry: MeasureRegistry;
|
|
12
|
+
readonly signal: AbortSignal;
|
|
13
|
+
readonly runId: string;
|
|
14
|
+
readonly artifactCacheRoot: string;
|
|
15
|
+
/** Case-insensitive substring patterns, matched on a case or condition title. */
|
|
16
|
+
readonly filter?: readonly string[];
|
|
17
|
+
/** How many contexts each condition is measured in. Defaults to one. */
|
|
18
|
+
readonly plan?: MeasurementPlan;
|
|
19
|
+
/**
|
|
20
|
+
* Seeds the replicate and case orderings.
|
|
21
|
+
*
|
|
22
|
+
* Randomising is not book-keeping: without it, thermal drift is confounded
|
|
23
|
+
* with replicate index and the process-level offset stops behaving like a
|
|
24
|
+
* random draw, which is the assumption every estimator above rests on. A
|
|
25
|
+
* fixed seed reproduces one run exactly.
|
|
26
|
+
*/
|
|
27
|
+
readonly orderSeed?: number;
|
|
28
|
+
/** Round-robin rounds a measure may refuse. Default 1. */
|
|
29
|
+
readonly rounds?: number;
|
|
30
|
+
/** Watches the machine while each attempt measures. Omitted disables it. */
|
|
31
|
+
readonly monitor?: EnvironmentMonitor;
|
|
32
|
+
/** Waits between fork units. Omitted disables cooling. */
|
|
33
|
+
readonly cooldown?: CooldownGate;
|
|
34
|
+
/** Re-runs a condition whose verdict is `"unstable"`. Default 0. */
|
|
35
|
+
readonly retryOnInstability?: number;
|
|
36
|
+
/** Attach each case's raw samples, which are copied across the boundary. */
|
|
37
|
+
readonly emitSamples?: boolean;
|
|
38
|
+
/** Observes each child's pid, so a monitor can read its resident set. */
|
|
39
|
+
readonly onChildPid?: (pid: number | undefined) => void;
|
|
40
|
+
/** Imported by every child before the bench file, in order. */
|
|
41
|
+
readonly setupFiles?: readonly string[];
|
|
42
|
+
/** Wall-clock cap on one fork unit. `0` disables it. */
|
|
43
|
+
readonly conditionTimeoutMs?: number;
|
|
44
|
+
readonly heartbeatTimeoutMs?: number;
|
|
45
|
+
};
|
|
46
|
+
/** `node_modules/.cache/ac-bench`, relative to where the CLI was invoked. */
|
|
47
|
+
export declare function defaultArtifactCacheRoot(): string;
|
|
48
|
+
export declare function toForkOptions(options: IsolatedRunOptions): ForkOptions;
|
|
49
|
+
/** The cases `condition` declared directly, within an optional entry range. */
|
|
50
|
+
export declare function discoveredCaseTitles(condition: DiscoveredCondition, start?: number, end?: number): string[];
|
|
51
|
+
/** The conditions `condition` declared directly, each with its entry index. */
|
|
52
|
+
export declare function discoveredChildren(condition: DiscoveredCondition): [number, DiscoveredCondition][];
|
|
53
|
+
/**
|
|
54
|
+
* Discovers `file`'s condition tree in its own child, then runs every
|
|
55
|
+
* executable leaf in a child of its own.
|
|
56
|
+
*
|
|
57
|
+
* Enclosing scopes are opened here rather than in a child: one such scope spans
|
|
58
|
+
* several children, so only the parent can own it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function runFileIsolated(file: string, options: IsolatedRunOptions): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* A measure declaring `rounds: "one"` refuses round-robin interleaving whatever
|
|
63
|
+
* the run asks for; the scheduler reads the declaration and never the measure
|
|
64
|
+
* id.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveConditionRounds(scheduling: MeasureScheduling, requested: number | undefined): number;
|
|
67
|
+
//# sourceMappingURL=isolated-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolated-runner.d.ts","sourceRoot":"","sources":["../src/isolated-runner.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,eAAe,EACf,iBAAiB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,mBAAmB,EAEnB,WAAW,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACN,KAAK,EAIL,MAAM,oBAAoB,CAAC;AAK5B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EACN,kBAAkB,EAElB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEN,WAAW,EAEX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC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;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CA0Cf;AA6iBD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,UAAU,EAAE,iBAAiB,EAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,CAER"}
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import path from "node:path";
|
|
54
|
+
import { conditionFrame, } from "@ac-bench/core/plugin";
|
|
55
|
+
import { shuffle } from "@ac-kit/algo";
|
|
56
|
+
import { openScope, } from "@ac-kit/app-report";
|
|
57
|
+
import { formatError, snakeCase } from "@ac-kit/core";
|
|
58
|
+
import { mulberry32 } from "@ac-kit/math-random";
|
|
59
|
+
import { comparisonUnresolved } from "./escalation.js";
|
|
60
|
+
import { discoverConditionsInFile, runForkUnitInChild, } from "./fork-runner.js";
|
|
61
|
+
/** `node_modules/.cache/ac-bench`, relative to where the CLI was invoked. */
|
|
62
|
+
export function defaultArtifactCacheRoot() {
|
|
63
|
+
return path.resolve(process.cwd(), "node_modules/.cache/ac-bench");
|
|
64
|
+
}
|
|
65
|
+
export function toForkOptions(options) {
|
|
66
|
+
return {
|
|
67
|
+
runId: options.runId,
|
|
68
|
+
artifactCacheRoot: options.artifactCacheRoot,
|
|
69
|
+
signal: options.signal,
|
|
70
|
+
...(options.onChildPid ? { onChildPid: options.onChildPid } : {}),
|
|
71
|
+
...(options.setupFiles ? { setupFiles: options.setupFiles } : {}),
|
|
72
|
+
...(options.conditionTimeoutMs !== undefined
|
|
73
|
+
? { conditionTimeoutMs: options.conditionTimeoutMs }
|
|
74
|
+
: {}),
|
|
75
|
+
...(options.heartbeatTimeoutMs !== undefined
|
|
76
|
+
? { heartbeatTimeoutMs: options.heartbeatTimeoutMs }
|
|
77
|
+
: {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** The cases `condition` declared directly, within an optional entry range. */
|
|
81
|
+
export function discoveredCaseTitles(condition, start = 0, end = condition.entries.length) {
|
|
82
|
+
return condition.entries
|
|
83
|
+
.slice(start, end)
|
|
84
|
+
.filter((entry) => entry.kind === "case")
|
|
85
|
+
.map((entry) => entry.title);
|
|
86
|
+
}
|
|
87
|
+
/** The conditions `condition` declared directly, each with its entry index. */
|
|
88
|
+
export function discoveredChildren(condition) {
|
|
89
|
+
return condition.entries.flatMap((entry, index) => entry.kind === "condition"
|
|
90
|
+
? [[index, entry.condition]]
|
|
91
|
+
: []);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Discovers `file`'s condition tree in its own child, then runs every
|
|
95
|
+
* executable leaf in a child of its own.
|
|
96
|
+
*
|
|
97
|
+
* Enclosing scopes are opened here rather than in a child: one such scope spans
|
|
98
|
+
* several children, so only the parent can own it.
|
|
99
|
+
*/
|
|
100
|
+
export async function runFileIsolated(file, options) {
|
|
101
|
+
const forkOptions = toForkOptions(options);
|
|
102
|
+
let conditions;
|
|
103
|
+
try {
|
|
104
|
+
conditions = await discoverConditionsInFile(file, forkOptions);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const message = formatError(error);
|
|
108
|
+
process.stderr.write(`measure: failed to load ${file}: ${message}\n`);
|
|
109
|
+
await options.sink.write({
|
|
110
|
+
kind: "data",
|
|
111
|
+
timestamp: Date.now(),
|
|
112
|
+
scopeId: null,
|
|
113
|
+
data: { kind: "load-error", file, message },
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const context = {
|
|
118
|
+
file,
|
|
119
|
+
options,
|
|
120
|
+
forkOptions,
|
|
121
|
+
cooldown: options.cooldown,
|
|
122
|
+
};
|
|
123
|
+
for (const [index, condition] of conditions.entries()) {
|
|
124
|
+
if (options.signal.aborted) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
await visitCondition_(condition, context, [condition.title], [index], null, [], []);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function visitCondition_(condition, context, titles, conditionPath, parentScopeId, before, after) {
|
|
131
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
132
|
+
try {
|
|
133
|
+
const children = discoveredChildren(condition);
|
|
134
|
+
if (children.length === 0) {
|
|
135
|
+
await forkLeaf_(condition, context, titles, conditionPath, parentScopeId, [
|
|
136
|
+
...before,
|
|
137
|
+
...discoveredCaseTitles(condition),
|
|
138
|
+
...after,
|
|
139
|
+
]);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
// No `conditionMeasure`: an enclosing scope is not itself a measure condition, and
|
|
143
|
+
// claiming one would fold its descendants' results into a single table.
|
|
144
|
+
const scope = __addDisposableResource(env_1, openScope(context.options.sink, parentScopeId, titles.join(" > "), { key: snakeCase(titles.join(" ")), signal: context.options.signal }), true);
|
|
145
|
+
for (const [index, child] of children) {
|
|
146
|
+
if (context.options.signal.aborted) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
// Same split as the child's own assembly: this condition's cases declared
|
|
150
|
+
// above the descent point come first, the ones below it come last.
|
|
151
|
+
await visitCondition_(child, context, [...titles, child.title], [...conditionPath, index], scope.id, [...before, ...discoveredCaseTitles(condition, 0, index)], [...discoveredCaseTitles(condition, index + 1), ...after]);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (e_1) {
|
|
155
|
+
env_1.error = e_1;
|
|
156
|
+
env_1.hasError = true;
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
const result_1 = __disposeResources(env_1);
|
|
160
|
+
if (result_1)
|
|
161
|
+
await result_1;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async function forkLeaf_(condition, context, titles, conditionPath, parentScopeId, available) {
|
|
165
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
166
|
+
try {
|
|
167
|
+
const caseFilter = selectCaseTitles_(available, titles, context.options.filter);
|
|
168
|
+
if (caseFilter.length === 0) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const { scheduling } = context.options.registry.resolve(condition.measure);
|
|
172
|
+
const rounds = resolveConditionRounds(scheduling, context.options.plan?.rounds ?? context.options.rounds);
|
|
173
|
+
const forkOptions = withScheduling_(context.forkOptions, scheduling);
|
|
174
|
+
// `grouping: "case"` buys per-case isolation at the cost of pairing.
|
|
175
|
+
const batches = scheduling.grouping === "case"
|
|
176
|
+
? caseFilter.map((title) => [title])
|
|
177
|
+
: [caseFilter];
|
|
178
|
+
const plan = context.options.plan;
|
|
179
|
+
const random = mulberry32(context.options.orderSeed ?? 1);
|
|
180
|
+
// Every execution the plan calls for, shuffled together: replicate order and
|
|
181
|
+
// case order both have to be random, and drawing them from one shuffled list
|
|
182
|
+
// is the same thing as drawing them separately.
|
|
183
|
+
const executions = shuffle(plannedExecutions_(batches, plan?.replicates ?? 1, plan?.isolatedRuns ?? 0), { rand: random });
|
|
184
|
+
// The parent owns this scope because pooling spans every child under it: no
|
|
185
|
+
// single child sees enough to state the case's answer.
|
|
186
|
+
const unitScope = __addDisposableResource(env_2, openScope(context.options.sink, parentScopeId, titles.join(" > "), {
|
|
187
|
+
key: snakeCase(titles.join(" ")),
|
|
188
|
+
signal: context.options.signal,
|
|
189
|
+
attributes: { conditionMeasure: condition.measure },
|
|
190
|
+
}), true);
|
|
191
|
+
const collected = new ExecutionCollector();
|
|
192
|
+
/** The first fork unit failure, which the condition's scope answers for. */
|
|
193
|
+
let failure = null;
|
|
194
|
+
for (const execution of executions) {
|
|
195
|
+
if (context.options.signal.aborted) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const error = await runBatch_(context, titles, conditionPath, unitScope.id, execution, rounds, forkOptions, collected);
|
|
199
|
+
failure ??= error;
|
|
200
|
+
}
|
|
201
|
+
const plugin = context.options.registry.resolve(condition.measure);
|
|
202
|
+
let pooled = poolAll_(collected, plugin, context, unitScope.id);
|
|
203
|
+
// One process cannot tell a real difference from its own luck, so the plan
|
|
204
|
+
// buys more processes — but only for a comparison that is still open, and
|
|
205
|
+
// only up to what the mode is willing to spend.
|
|
206
|
+
for (let replicate = plan?.replicates ?? 1; replicate < (plan?.maxReplicates ?? 1) &&
|
|
207
|
+
comparisonUnresolved(conditionFrame_(plugin, titles, pooled), plugin.comparison); replicate++) {
|
|
208
|
+
if (context.options.signal.aborted) {
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
for (const batch of batches) {
|
|
212
|
+
const error = await runBatch_(context, titles, conditionPath, unitScope.id, {
|
|
213
|
+
caseFilter: batch,
|
|
214
|
+
arm: "shared",
|
|
215
|
+
replicate,
|
|
216
|
+
suffix: ` [#${replicate + 1}]`,
|
|
217
|
+
}, rounds, forkOptions, collected);
|
|
218
|
+
failure ??= error;
|
|
219
|
+
}
|
|
220
|
+
pooled = poolAll_(collected, plugin, context, unitScope.id);
|
|
221
|
+
}
|
|
222
|
+
// Awaited, not fired and forgotten: the warnings a reporter derives from a
|
|
223
|
+
// case result have to reach it before this scope ends, or they arrive with
|
|
224
|
+
// nothing left to attach them to.
|
|
225
|
+
for (const [caseTitle, result] of pooled) {
|
|
226
|
+
await context.options.sink.write({
|
|
227
|
+
kind: "data",
|
|
228
|
+
timestamp: Date.now(),
|
|
229
|
+
scopeId: unitScope.id,
|
|
230
|
+
data: {
|
|
231
|
+
kind: "case-result",
|
|
232
|
+
measure: condition.measure,
|
|
233
|
+
caseTitle,
|
|
234
|
+
result,
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
// A condition whose child died did not measure what it was asked to, whatever
|
|
239
|
+
// the surviving executions produced.
|
|
240
|
+
if (failure !== null) {
|
|
241
|
+
unitScope.fail(failure);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch (e_2) {
|
|
245
|
+
env_2.error = e_2;
|
|
246
|
+
env_2.hasError = true;
|
|
247
|
+
}
|
|
248
|
+
finally {
|
|
249
|
+
const result_2 = __disposeResources(env_2);
|
|
250
|
+
if (result_2)
|
|
251
|
+
await result_2;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** The pooled results as a frame, for the escalation decision. */
|
|
255
|
+
function conditionFrame_(plugin, titles, pooled) {
|
|
256
|
+
try {
|
|
257
|
+
return conditionFrame(plugin, {
|
|
258
|
+
title: titles.join(" > "),
|
|
259
|
+
results: [...pooled.values()],
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
// A measure that cannot describe a partial condition has nothing to say
|
|
264
|
+
// about whether more of it would help.
|
|
265
|
+
return { fields: [], columns: [], rowCount: 0 };
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Gathers each case's executions as their children report them.
|
|
270
|
+
*
|
|
271
|
+
* Insertion order is the order the cases first reported, which is randomised
|
|
272
|
+
* per execution; the caller re-imposes declaration order so the table does not
|
|
273
|
+
* shuffle between runs.
|
|
274
|
+
*/
|
|
275
|
+
class ExecutionCollector {
|
|
276
|
+
byCase = new Map();
|
|
277
|
+
add(data) {
|
|
278
|
+
const existing = this.byCase.get(data.caseTitle);
|
|
279
|
+
const execution = {
|
|
280
|
+
result: data.result,
|
|
281
|
+
arm: data.arm,
|
|
282
|
+
replicate: data.replicate,
|
|
283
|
+
};
|
|
284
|
+
if (existing === undefined) {
|
|
285
|
+
this.byCase.set(data.caseTitle, [execution]);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
existing.push(execution);
|
|
289
|
+
}
|
|
290
|
+
/** Folds a kept attempt in; a discarded one is simply never merged. */
|
|
291
|
+
merge(other) {
|
|
292
|
+
for (const [caseTitle, executions] of other.byCase) {
|
|
293
|
+
const existing = this.byCase.get(caseTitle);
|
|
294
|
+
if (existing === undefined) {
|
|
295
|
+
this.byCase.set(caseTitle, [...executions]);
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
existing.push(...executions);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
entries() {
|
|
302
|
+
return [...this.byCase];
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/** Forwards everything, keeping a copy of the evidence the parent must pool. */
|
|
306
|
+
function collectingSink_(sink, collected) {
|
|
307
|
+
return {
|
|
308
|
+
write: (event, signal) => {
|
|
309
|
+
if (event.kind === "data" && event.data.kind === "case-execution") {
|
|
310
|
+
collected.add(event.data);
|
|
311
|
+
}
|
|
312
|
+
return sink.write(event, signal);
|
|
313
|
+
},
|
|
314
|
+
flush: (signal) => sink.flush(signal),
|
|
315
|
+
// Owned by the run, not by one child.
|
|
316
|
+
close: () => { },
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
/** Combines each case's executions into the one result that answers for it. */
|
|
320
|
+
function poolAll_(collected, plugin, context, scopeId) {
|
|
321
|
+
const pooled = new Map();
|
|
322
|
+
for (const [caseTitle, executions] of collected.entries()) {
|
|
323
|
+
try {
|
|
324
|
+
pooled.set(caseTitle, plugin.pool(executions));
|
|
325
|
+
}
|
|
326
|
+
catch (error) {
|
|
327
|
+
void context.options.sink.write({
|
|
328
|
+
kind: "diagnostic",
|
|
329
|
+
timestamp: Date.now(),
|
|
330
|
+
scopeId,
|
|
331
|
+
severity: "error",
|
|
332
|
+
code: "pool-failed",
|
|
333
|
+
message: `could not combine ${executions.length} executions: ${formatError(error)}`,
|
|
334
|
+
attributes: { "bench.case": caseTitle },
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return pooled;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Expands a plan into the executions it calls for.
|
|
342
|
+
*
|
|
343
|
+
* The isolated arm runs each case alone but under the full ancestor hook chain,
|
|
344
|
+
* exactly as the shared arm does. Skipping those hooks would be cheaper and
|
|
345
|
+
* actively misleading: such a case would fail only in the isolated arm, and the
|
|
346
|
+
* contamination estimate would be measuring a missing fixture rather than order
|
|
347
|
+
* sensitivity.
|
|
348
|
+
*/
|
|
349
|
+
function plannedExecutions_(batches, replicates, isolatedRuns) {
|
|
350
|
+
const executions = [];
|
|
351
|
+
for (const batch of batches) {
|
|
352
|
+
for (let replicate = 0; replicate < replicates; replicate++) {
|
|
353
|
+
executions.push({
|
|
354
|
+
caseFilter: batch,
|
|
355
|
+
arm: "shared",
|
|
356
|
+
replicate,
|
|
357
|
+
suffix: replicates > 1 ? ` [#${replicate + 1}]` : "",
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
if (batch.length < 2) {
|
|
361
|
+
// Running a lone case alone is the shared arm again; there is no order
|
|
362
|
+
// for it to be sensitive to.
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
for (const title of batch) {
|
|
366
|
+
for (let replicate = 0; replicate < isolatedRuns; replicate++) {
|
|
367
|
+
const repeat = isolatedRuns > 1 ? ` #${replicate + 1}` : "";
|
|
368
|
+
executions.push({
|
|
369
|
+
caseFilter: [title],
|
|
370
|
+
arm: "isolated",
|
|
371
|
+
replicate,
|
|
372
|
+
suffix: ` [isolated ${title}${repeat}]`,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return executions;
|
|
378
|
+
}
|
|
379
|
+
async function runBatch_(context, titles, conditionPath, parentScopeId, execution, rounds, forkOptions, collected) {
|
|
380
|
+
const attempts = 1 + (context.options.retryOnInstability ?? 0);
|
|
381
|
+
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
382
|
+
const lastAttempt = attempt === attempts - 1;
|
|
383
|
+
const attemptExecutions = new ExecutionCollector();
|
|
384
|
+
const outcome = await runAttempt_(context, titles, conditionPath, parentScopeId, execution, rounds, forkOptions, attempt, lastAttempt, attemptExecutions);
|
|
385
|
+
// Only contention justifies re-running; a warming machine only gets warmer.
|
|
386
|
+
if (outcome.stability !== "unstable" || lastAttempt) {
|
|
387
|
+
collected.merge(attemptExecutions);
|
|
388
|
+
return outcome.error;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return null;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Runs one attempt, wrapped in a parent-owned scope whenever a retry is
|
|
395
|
+
* possible.
|
|
396
|
+
*
|
|
397
|
+
* The child owns its own condition scope and reports its own status, so a
|
|
398
|
+
* discarded attempt is marked `"skipped"` on the scope the parent owns rather
|
|
399
|
+
* than by overwriting what the child said. With retries off there is one
|
|
400
|
+
* attempt and no wrapper, so the common shape is unchanged.
|
|
401
|
+
*/ async function runAttempt_(context, titles, conditionPath, parentScopeId, execution, rounds, forkOptions, attempt, lastAttempt, collected) {
|
|
402
|
+
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
403
|
+
try {
|
|
404
|
+
const retrying = (context.options.retryOnInstability ?? 0) > 0;
|
|
405
|
+
const label = executionLabel_(titles, execution);
|
|
406
|
+
const attemptScope = __addDisposableResource(env_3, retrying
|
|
407
|
+
? openScope(context.options.sink, parentScopeId, `${label} (attempt ${attempt + 1})`, {
|
|
408
|
+
key: snakeCase(`${label} attempt ${attempt + 1}`),
|
|
409
|
+
signal: context.options.signal,
|
|
410
|
+
attributes: { "bench.attempt": attempt + 1 },
|
|
411
|
+
})
|
|
412
|
+
: null, true);
|
|
413
|
+
const scopeId = attemptScope?.id ?? parentScopeId;
|
|
414
|
+
const writeDiagnostic = (diagnostic) => {
|
|
415
|
+
void context.options.sink.write({
|
|
416
|
+
kind: "diagnostic",
|
|
417
|
+
timestamp: Date.now(),
|
|
418
|
+
scopeId,
|
|
419
|
+
...diagnostic,
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
// `settle()` itself reports nothing while it waits — this is the only signal
|
|
423
|
+
// a reporter gets that the run is paused for the machine rather than stuck.
|
|
424
|
+
if (context.cooldown) {
|
|
425
|
+
writeDiagnostic({
|
|
426
|
+
severity: "info",
|
|
427
|
+
code: "cooling-down",
|
|
428
|
+
message: "waiting for the machine to settle before measuring",
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
const cooldown = await context.cooldown?.settle(context.options.signal);
|
|
432
|
+
for (const diagnostic of cooldown?.diagnostics ?? []) {
|
|
433
|
+
writeDiagnostic(diagnostic);
|
|
434
|
+
}
|
|
435
|
+
const monitor = context.options.monitor;
|
|
436
|
+
monitor?.start();
|
|
437
|
+
const outcome = await runForkUnitInChild({
|
|
438
|
+
file: context.file,
|
|
439
|
+
conditionPath: [...conditionPath],
|
|
440
|
+
conditionTitles: [...titles],
|
|
441
|
+
parentScopeId: scopeId,
|
|
442
|
+
arm: execution.arm,
|
|
443
|
+
replicate: execution.replicate,
|
|
444
|
+
rounds,
|
|
445
|
+
// Distinct per execution, so two replicates do not run their cases in
|
|
446
|
+
// the same order and re-introduce the bias interleaving removes.
|
|
447
|
+
orderSeed: executionSeed_(context.options.orderSeed ?? 1, execution),
|
|
448
|
+
caseFilter: [...execution.caseFilter],
|
|
449
|
+
emitSamples: context.options.emitSamples === true,
|
|
450
|
+
}, collectingSink_(context.options.sink, collected), writeDiagnostic, forkOptions);
|
|
451
|
+
const verdict = await monitor?.stop();
|
|
452
|
+
context.options.onChildPid?.(undefined);
|
|
453
|
+
for (const diagnostic of verdict?.diagnostics ?? []) {
|
|
454
|
+
writeDiagnostic(diagnostic);
|
|
455
|
+
}
|
|
456
|
+
if (outcome.error !== null) {
|
|
457
|
+
writeDiagnostic({
|
|
458
|
+
severity: "error",
|
|
459
|
+
code: "fork-unit-failed",
|
|
460
|
+
message: formatError(outcome.error),
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
const stability = verdict?.stability ?? "stable";
|
|
464
|
+
if (stability === "unstable") {
|
|
465
|
+
writeDiagnostic({
|
|
466
|
+
// A retry that is also unstable is the one that gets kept, so it escalates.
|
|
467
|
+
severity: lastAttempt && attempt > 0 ? "error" : "warning",
|
|
468
|
+
code: "unstable-environment",
|
|
469
|
+
message: `measured on a contended machine${execution.suffix}`,
|
|
470
|
+
attributes: { "bench.stability": stability },
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
attemptScope?.attributes({
|
|
474
|
+
"bench.stability": stability,
|
|
475
|
+
...(cooldown ? { "bench.cooldownMs": cooldown.cooldownMs } : {}),
|
|
476
|
+
});
|
|
477
|
+
if (stability === "unstable" && !lastAttempt) {
|
|
478
|
+
attemptScope?.skip();
|
|
479
|
+
}
|
|
480
|
+
return { stability, error: outcome.error };
|
|
481
|
+
}
|
|
482
|
+
catch (e_3) {
|
|
483
|
+
env_3.error = e_3;
|
|
484
|
+
env_3.hasError = true;
|
|
485
|
+
}
|
|
486
|
+
finally {
|
|
487
|
+
const result_3 = __disposeResources(env_3);
|
|
488
|
+
if (result_3)
|
|
489
|
+
await result_3;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
/** Distinguishes one execution from its siblings in a diagnostic or a scope. */
|
|
493
|
+
function executionLabel_(titles, execution) {
|
|
494
|
+
return `${titles.join(" > ")}${execution.suffix}`;
|
|
495
|
+
}
|
|
496
|
+
/** Derives a per-execution seed, so each one shuffles its cases differently. */
|
|
497
|
+
function executionSeed_(runSeed, execution) {
|
|
498
|
+
const arm = execution.arm === "isolated" ? 1542469173 : 0;
|
|
499
|
+
return (Math.imul(runSeed, 2654435769) + execution.replicate + arm) | 0;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* A measure declaring `rounds: "one"` refuses round-robin interleaving whatever
|
|
503
|
+
* the run asks for; the scheduler reads the declaration and never the measure
|
|
504
|
+
* id.
|
|
505
|
+
*/
|
|
506
|
+
export function resolveConditionRounds(scheduling, requested) {
|
|
507
|
+
return scheduling.rounds === "one" ? 1 : (requested ?? 1);
|
|
508
|
+
}
|
|
509
|
+
/** Merges a measure's declared child requirements into the run's own. */
|
|
510
|
+
function withScheduling_(base, scheduling) {
|
|
511
|
+
if (scheduling.execArgv === undefined && scheduling.env === undefined) {
|
|
512
|
+
return base;
|
|
513
|
+
}
|
|
514
|
+
return {
|
|
515
|
+
...base,
|
|
516
|
+
...(scheduling.execArgv
|
|
517
|
+
? { execArgv: [...(base.execArgv ?? []), ...scheduling.execArgv] }
|
|
518
|
+
: {}),
|
|
519
|
+
...(scheduling.env ? { env: { ...base.env, ...scheduling.env } } : {}),
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* A pattern matching any title along the path selects every case the leaf runs;
|
|
524
|
+
* otherwise only the cases whose own title matches survive.
|
|
525
|
+
*/
|
|
526
|
+
function selectCaseTitles_(available, titles, patterns) {
|
|
527
|
+
if (patterns === undefined || patterns.length === 0) {
|
|
528
|
+
return [...available];
|
|
529
|
+
}
|
|
530
|
+
const needles = patterns.map((pattern) => pattern.toLowerCase());
|
|
531
|
+
const pathMatches = titles.some((title) => needles.some((needle) => title.toLowerCase().includes(needle)));
|
|
532
|
+
if (pathMatches) {
|
|
533
|
+
return [...available];
|
|
534
|
+
}
|
|
535
|
+
return available.filter((title) => needles.some((needle) => title.toLowerCase().includes(needle)));
|
|
536
|
+
}
|
|
537
|
+
//# sourceMappingURL=isolated-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isolated-runner.js","sourceRoot":"","sources":["../src/isolated-runner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EACN,cAAc,GAGd,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,OAAO,EAAE,MAAM,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AAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CACzB,SAA4B,EAC5B,MAAyB,EACzB,QAAuC;IAEvC,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACzC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAC9D,CAAC;IAEF,IAAI,WAAW,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CACjC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MeasureRegistry } from "@ac-bench/core/plugin";
|
|
2
|
+
import { MeasureData } from "@ac-bench/core/runner";
|
|
3
|
+
import { ISink } from "@ac-kit/app-report";
|
|
4
|
+
/**
|
|
5
|
+
* Derives the generic `diagnostic` events from a measure's typed warnings, in
|
|
6
|
+
* the parent.
|
|
7
|
+
*
|
|
8
|
+
* Warnings live in the typed result, where the plugin renders them inline per
|
|
9
|
+
* row; generic sinks need them as severity-carrying events. Emitting both from
|
|
10
|
+
* the child would give one fact two sources of truth, so the translation
|
|
11
|
+
* happens here instead — right after the `data` event that carries the result
|
|
12
|
+
* and before the case's `scope-end`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMeasureDiagnosticProxy(inner: ISink<MeasureData>, registry: MeasureRegistry): ISink<MeasureData>;
|
|
15
|
+
//# sourceMappingURL=measure-diagnostic-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"measure-diagnostic-proxy.d.ts","sourceRoot":"","sources":["../src/measure-diagnostic-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAoB,MAAM,oBAAoB,CAAC;AAG7D;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EACzB,QAAQ,EAAE,eAAe,GACvB,KAAK,CAAC,WAAW,CAAC,CA+BpB"}
|