@ac-bench/gate 0.0.0-stage → 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/CHANGELOG.md +66 -0
- package/LICENSE +28 -0
- package/README.md +81 -2
- package/dist/baseline/compare-environments.d.ts +27 -0
- package/dist/baseline/compare-environments.d.ts.map +1 -0
- package/dist/baseline/compare-environments.js +60 -0
- package/dist/baseline/compare-environments.js.map +1 -0
- package/dist/decision/decide.d.ts +16 -0
- package/dist/decision/decide.d.ts.map +1 -0
- package/dist/decision/decide.js +234 -0
- package/dist/decision/decide.js.map +1 -0
- package/dist/decision/needs-more-evidence.d.ts +18 -0
- package/dist/decision/needs-more-evidence.d.ts.map +1 -0
- package/dist/decision/needs-more-evidence.js +34 -0
- package/dist/decision/needs-more-evidence.js.map +1 -0
- package/dist/declaration/instantiate.d.ts +68 -0
- package/dist/declaration/instantiate.d.ts.map +1 -0
- package/dist/declaration/instantiate.js +254 -0
- package/dist/declaration/instantiate.js.map +1 -0
- package/dist/declaration/options.d.ts +36 -0
- package/dist/declaration/options.d.ts.map +1 -0
- package/dist/declaration/options.js +39 -0
- package/dist/declaration/options.js.map +1 -0
- package/dist/evaluate-archives.d.ts +45 -0
- package/dist/evaluate-archives.d.ts.map +1 -0
- package/dist/evaluate-archives.js +195 -0
- package/dist/evaluate-archives.js.map +1 -0
- package/dist/evidence/_run-order.d.ts +7 -0
- package/dist/evidence/_run-order.d.ts.map +1 -0
- package/dist/evidence/_run-order.js +9 -0
- package/dist/evidence/_run-order.js.map +1 -0
- package/dist/evidence/evidence.d.ts +56 -0
- package/dist/evidence/evidence.d.ts.map +1 -0
- package/dist/evidence/evidence.js +108 -0
- package/dist/evidence/evidence.js.map +1 -0
- package/dist/exit-code.d.ts +48 -0
- package/dist/exit-code.d.ts.map +1 -0
- package/dist/exit-code.js +55 -0
- package/dist/exit-code.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/test/_stats.d.ts +55 -0
- package/dist/test/_stats.d.ts.map +1 -0
- package/dist/test/_stats.js +62 -0
- package/dist/test/_stats.js.map +1 -0
- package/dist/test/test-gate.d.ts +65 -0
- package/dist/test/test-gate.d.ts.map +1 -0
- package/dist/test/test-gate.js +414 -0
- package/dist/test/test-gate.js.map +1 -0
- package/package.json +67 -3
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { CaseKey, GateSettings, GateThreshold, GateVerdict, LocatedGateDeclaration, MeasureId } from "@ac-bench/core/plugin";
|
|
2
|
+
import { GateReferenceError } from "@ac-bench/core/plugin";
|
|
3
|
+
/** One discovered case, with the fork unit it runs in. */
|
|
4
|
+
export type CatalogCase = {
|
|
5
|
+
readonly key: CaseKey;
|
|
6
|
+
/** The fork unit's entry indices from the root condition, in its file. */
|
|
7
|
+
readonly conditionPath: readonly number[];
|
|
8
|
+
readonly measure: MeasureId;
|
|
9
|
+
/** `false` when `--filter` excluded it: its gates are `skipped`. */
|
|
10
|
+
readonly selected: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type CaseCatalog = {
|
|
13
|
+
/** Every discovered case, per runtime, with its measure and fork unit. */
|
|
14
|
+
readonly cases: readonly CatalogCase[];
|
|
15
|
+
/**
|
|
16
|
+
* The cases a baseline holds. When present, a baseline gate that names no
|
|
17
|
+
* subject covers the cases present in both; absent, every discovered case.
|
|
18
|
+
*/
|
|
19
|
+
readonly baseline?: readonly CaseKey[];
|
|
20
|
+
};
|
|
21
|
+
/** A gate resolved against one runtime's discovered cases. */
|
|
22
|
+
export type GateInstance = {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly runtime: string;
|
|
25
|
+
readonly origin: LocatedGateDeclaration["origin"];
|
|
26
|
+
readonly kind: GateVerdict["kind"];
|
|
27
|
+
/** `null`: the measure's default, resolved by evidence. */
|
|
28
|
+
readonly metric: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Ratio: numerator then denominators. Difference: subject then reference.
|
|
31
|
+
* Bound and baseline: the one subject.
|
|
32
|
+
*/
|
|
33
|
+
readonly subjects: readonly CaseKey[];
|
|
34
|
+
/**
|
|
35
|
+
* What the value must stay within. For a baseline, `max` is the allowed
|
|
36
|
+
* regression as a fraction (`0.03`), not a ratio; the test turns it into
|
|
37
|
+
* one.
|
|
38
|
+
*/
|
|
39
|
+
readonly threshold: GateThreshold;
|
|
40
|
+
readonly settings: GateSettings;
|
|
41
|
+
/** Set for baseline gates with `normalizeBy`. */
|
|
42
|
+
readonly normalizer: CaseKey | null;
|
|
43
|
+
/**
|
|
44
|
+
* Subjects (and normalizer) `--filter` excluded; any makes the gate
|
|
45
|
+
* `skipped`.
|
|
46
|
+
*/
|
|
47
|
+
readonly unselected: readonly CaseKey[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Resolves declarations against the discovered cases, one instance per leaf
|
|
51
|
+
* fork unit for a suite declaration and one per match of the first subject for
|
|
52
|
+
* a config declaration, in each runtime the gate applies to.
|
|
53
|
+
*
|
|
54
|
+
* A suite gate declared in an outer condition applies to every leaf below it,
|
|
55
|
+
* resolving its titles inside each leaf. A config reference is matched against
|
|
56
|
+
* the whole fork-unit path (file, condition titles from the root, case), each
|
|
57
|
+
* segment a glob; `{ case }` alone names a sibling of the gate's first subject.
|
|
58
|
+
* Only the first subject expands: any other reference must name exactly one
|
|
59
|
+
* case. A config reference matching nothing is an error.
|
|
60
|
+
*
|
|
61
|
+
* @returns The instances, and one error per reference that does not resolve.
|
|
62
|
+
* @throws {GateDeclarationError} On a contradictory declaration.
|
|
63
|
+
*/
|
|
64
|
+
export declare function instantiateGates(declarations: readonly LocatedGateDeclaration[], catalog: CaseCatalog, runtimes: readonly string[]): {
|
|
65
|
+
readonly instances: readonly GateInstance[];
|
|
66
|
+
readonly errors: readonly GateReferenceError[];
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=instantiate.d.ts.map
|
|
@@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AY,CAAC;IAChC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,OAAO,EAAE,CAAC;CACxC,CAAC;AAyIF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC/B,YAAY,EAAE,SAAS,sBAAsB,EAAE,EAC/C,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,GACzB;IACF,QAAQ,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC/C,CAmDA"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { defaultGateId, describeCaseReference, GateReferenceError, validateGateDeclaration, } from "@ac-bench/core/plugin";
|
|
2
|
+
import { matchGlobPath } from "@ac-kit/format-glob";
|
|
3
|
+
import { caseKeyId } from "../evidence/evidence.js";
|
|
4
|
+
const TITLE_SEPARATOR_ = " > ";
|
|
5
|
+
function unitId_(entry) {
|
|
6
|
+
return JSON.stringify([
|
|
7
|
+
entry.key.runtime,
|
|
8
|
+
entry.key.file,
|
|
9
|
+
entry.conditionPath,
|
|
10
|
+
]);
|
|
11
|
+
}
|
|
12
|
+
function pattern_(reference) {
|
|
13
|
+
if (typeof reference === "string") {
|
|
14
|
+
const segments = reference.split(TITLE_SEPARATOR_);
|
|
15
|
+
return {
|
|
16
|
+
file: null,
|
|
17
|
+
condition: segments.length > 1 ? segments.slice(0, -1) : null,
|
|
18
|
+
case: segments.at(-1),
|
|
19
|
+
sibling: false,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if ("condition" in reference) {
|
|
23
|
+
return {
|
|
24
|
+
file: reference.file === undefined ? null : reference.file.split("/"),
|
|
25
|
+
condition: typeof reference.condition === "string"
|
|
26
|
+
? reference.condition.split(TITLE_SEPARATOR_)
|
|
27
|
+
: reference.condition,
|
|
28
|
+
case: reference.case,
|
|
29
|
+
sibling: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return { file: null, condition: null, case: reference.case, sibling: true };
|
|
33
|
+
}
|
|
34
|
+
/** A segment equal to its title matches whatever glob characters the title has. */
|
|
35
|
+
function segmentsMatch_(path, pattern) {
|
|
36
|
+
return ((path.length === pattern.length &&
|
|
37
|
+
path.every((segment, index) => segment === pattern[index])) ||
|
|
38
|
+
matchGlobPath(path, pattern) !== null);
|
|
39
|
+
}
|
|
40
|
+
function matches_(pattern, entry) {
|
|
41
|
+
return ((pattern.file === null ||
|
|
42
|
+
segmentsMatch_(entry.key.file.split("/"), pattern.file)) &&
|
|
43
|
+
(pattern.condition === null ||
|
|
44
|
+
segmentsMatch_(entry.key.conditionTitles, pattern.condition)) &&
|
|
45
|
+
segmentsMatch_([entry.key.caseTitle], [pattern.case]));
|
|
46
|
+
}
|
|
47
|
+
function pickSettings_(declaration) {
|
|
48
|
+
const settings = {};
|
|
49
|
+
const source = declaration;
|
|
50
|
+
for (const field of [
|
|
51
|
+
"id",
|
|
52
|
+
"runtimes",
|
|
53
|
+
"maxDispersion",
|
|
54
|
+
"rationale",
|
|
55
|
+
"metric",
|
|
56
|
+
"min",
|
|
57
|
+
"max",
|
|
58
|
+
]) {
|
|
59
|
+
if (source[field] !== undefined) {
|
|
60
|
+
settings[field] = source[field];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return settings;
|
|
64
|
+
}
|
|
65
|
+
function thresholdOf_(declaration) {
|
|
66
|
+
if (declaration.kind === "baseline") {
|
|
67
|
+
return declaration.maxRegression === undefined
|
|
68
|
+
? {}
|
|
69
|
+
: { max: declaration.maxRegression };
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
...(declaration.min === undefined ? {} : { min: declaration.min }),
|
|
73
|
+
...(declaration.max === undefined ? {} : { max: declaration.max }),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function instance_(located, runtime, subjects, normalizer) {
|
|
77
|
+
const { declaration } = located;
|
|
78
|
+
return {
|
|
79
|
+
id: declaration.id ?? defaultGateId(declaration),
|
|
80
|
+
runtime,
|
|
81
|
+
origin: located.origin,
|
|
82
|
+
kind: declaration.kind,
|
|
83
|
+
metric: declaration.metric ?? null,
|
|
84
|
+
subjects: subjects.map((entry) => entry.key),
|
|
85
|
+
threshold: thresholdOf_(declaration),
|
|
86
|
+
settings: pickSettings_(declaration),
|
|
87
|
+
normalizer: normalizer?.key ?? null,
|
|
88
|
+
unselected: [...subjects, ...(normalizer === null ? [] : [normalizer])]
|
|
89
|
+
.filter((entry) => !entry.selected)
|
|
90
|
+
.map((entry) => entry.key),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Resolves declarations against the discovered cases, one instance per leaf
|
|
95
|
+
* fork unit for a suite declaration and one per match of the first subject for
|
|
96
|
+
* a config declaration, in each runtime the gate applies to.
|
|
97
|
+
*
|
|
98
|
+
* A suite gate declared in an outer condition applies to every leaf below it,
|
|
99
|
+
* resolving its titles inside each leaf. A config reference is matched against
|
|
100
|
+
* the whole fork-unit path (file, condition titles from the root, case), each
|
|
101
|
+
* segment a glob; `{ case }` alone names a sibling of the gate's first subject.
|
|
102
|
+
* Only the first subject expands: any other reference must name exactly one
|
|
103
|
+
* case. A config reference matching nothing is an error.
|
|
104
|
+
*
|
|
105
|
+
* @returns The instances, and one error per reference that does not resolve.
|
|
106
|
+
* @throws {GateDeclarationError} On a contradictory declaration.
|
|
107
|
+
*/
|
|
108
|
+
export function instantiateGates(declarations, catalog, runtimes) {
|
|
109
|
+
const units = new Map();
|
|
110
|
+
for (const entry of catalog.cases) {
|
|
111
|
+
const id = unitId_(entry);
|
|
112
|
+
const unit = units.get(id) ?? {
|
|
113
|
+
runtime: entry.key.runtime,
|
|
114
|
+
file: entry.key.file,
|
|
115
|
+
conditionPath: entry.conditionPath,
|
|
116
|
+
cases: [],
|
|
117
|
+
};
|
|
118
|
+
unit.cases.push(entry);
|
|
119
|
+
units.set(id, unit);
|
|
120
|
+
}
|
|
121
|
+
const instances = [];
|
|
122
|
+
const errors = [];
|
|
123
|
+
for (const located of declarations) {
|
|
124
|
+
validateGateDeclaration(located.declaration);
|
|
125
|
+
const applicable = runtimes.filter((runtime) => located.declaration.runtimes === undefined ||
|
|
126
|
+
located.declaration.runtimes.includes(runtime));
|
|
127
|
+
if (located.origin === "suite") {
|
|
128
|
+
instantiateSuite_(located, [...units.values()], applicable, instances, errors);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
for (const runtime of applicable) {
|
|
132
|
+
instantiateConfig_(located, runtime, catalog, catalog.cases.filter((entry) => entry.key.runtime === runtime), instances, errors);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return { instances, errors };
|
|
137
|
+
}
|
|
138
|
+
function instantiateSuite_(located, units, applicable, instances, errors) {
|
|
139
|
+
const { declaration } = located;
|
|
140
|
+
const titles = declaration.kind === "ratio"
|
|
141
|
+
? [declaration.numerator, ...declaration.denominators]
|
|
142
|
+
: declaration.kind === "difference"
|
|
143
|
+
? [declaration.subject, declaration.reference]
|
|
144
|
+
: [declaration.subject];
|
|
145
|
+
for (const unit of units) {
|
|
146
|
+
if (unit.file !== located.file ||
|
|
147
|
+
!applicable.includes(unit.runtime) ||
|
|
148
|
+
!located.conditionPath.every((index, level) => unit.conditionPath[level] === index)) {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const resolved = [];
|
|
152
|
+
for (const title of titles) {
|
|
153
|
+
const found = unit.cases.filter((entry) => entry.key.caseTitle === title);
|
|
154
|
+
if (found.length === 1) {
|
|
155
|
+
resolved.push(found[0]);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
errors.push(new GateReferenceError(located, title, found.map((entry) => entry.key), `gate "${declaration.id ?? defaultGateId(declaration)}" names case "${title}", which ${unit.cases[0]?.key.conditionTitles.join(TITLE_SEPARATOR_) ?? unit.file} runs ${found.length} times`));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (resolved.length === titles.length) {
|
|
162
|
+
instances.push(instance_(located, unit.runtime, resolved, null));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function instantiateConfig_(located, runtime, catalog, entries, instances, errors) {
|
|
167
|
+
const { declaration } = located;
|
|
168
|
+
const gateId = declaration.id ?? defaultGateId(declaration);
|
|
169
|
+
const sameUnit = (entry) => entries.filter((candidate) => unitId_(candidate) === unitId_(entry));
|
|
170
|
+
const fail = (reference, found, problem) => {
|
|
171
|
+
errors.push(new GateReferenceError(located, reference, found.map((entry) => entry.key), `gate "${gateId}" (${runtime}): ${problem} "${describeCaseReference(reference)}"`));
|
|
172
|
+
};
|
|
173
|
+
/** Every case a reference names; a sibling reference needs `anchor`. */
|
|
174
|
+
const find = (reference, anchor) => {
|
|
175
|
+
const pattern = pattern_(reference);
|
|
176
|
+
if (pattern.sibling && anchor === null) {
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
return (anchor !== null && pattern.sibling ? sameUnit(anchor) : entries).filter((entry) => matches_(pattern, entry));
|
|
180
|
+
};
|
|
181
|
+
/** The one case a reference names, or `null` with the error recorded. */
|
|
182
|
+
const findOne = (reference, anchor) => {
|
|
183
|
+
const found = find(reference, anchor);
|
|
184
|
+
if (found.length === 1) {
|
|
185
|
+
return found[0];
|
|
186
|
+
}
|
|
187
|
+
fail(reference, found, found.length === 0
|
|
188
|
+
? "matches no case:"
|
|
189
|
+
: `matches ${found.length} cases:`);
|
|
190
|
+
return null;
|
|
191
|
+
};
|
|
192
|
+
const expand = (reference) => {
|
|
193
|
+
const found = find(reference, null);
|
|
194
|
+
if (found.length === 0) {
|
|
195
|
+
fail(reference, found, "matches no case:");
|
|
196
|
+
}
|
|
197
|
+
return found;
|
|
198
|
+
};
|
|
199
|
+
switch (declaration.kind) {
|
|
200
|
+
case "ratio":
|
|
201
|
+
case "difference":
|
|
202
|
+
case "bound": {
|
|
203
|
+
const first = declaration.kind === "ratio"
|
|
204
|
+
? declaration.numerator
|
|
205
|
+
: declaration.subject;
|
|
206
|
+
const others = declaration.kind === "ratio"
|
|
207
|
+
? declaration.denominators
|
|
208
|
+
: declaration.kind === "difference"
|
|
209
|
+
? [declaration.reference]
|
|
210
|
+
: [];
|
|
211
|
+
for (const subject of expand(first)) {
|
|
212
|
+
const resolved = others.map((reference) => findOne(reference, subject));
|
|
213
|
+
if (!resolved.includes(null)) {
|
|
214
|
+
instances.push(instance_(located, runtime, [subject, ...resolved], null));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
case "baseline": {
|
|
220
|
+
const baselineKeys = catalog.baseline === undefined
|
|
221
|
+
? null
|
|
222
|
+
: new Set(catalog.baseline.map(caseKeyId));
|
|
223
|
+
const subjects = declaration.subjects === undefined
|
|
224
|
+
? entries.filter((entry) => baselineKeys === null || baselineKeys.has(caseKeyId(entry.key)))
|
|
225
|
+
: dedupe_(declaration.subjects.flatMap((reference) => expand(reference)));
|
|
226
|
+
for (const subject of subjects) {
|
|
227
|
+
const normalizer = declaration.normalizeBy === undefined
|
|
228
|
+
? null
|
|
229
|
+
: findOne(declaration.normalizeBy, subject);
|
|
230
|
+
if (declaration.normalizeBy !== undefined && normalizer === null) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (normalizer !== null &&
|
|
234
|
+
caseKeyId(normalizer.key) === caseKeyId(subject.key)) {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
instances.push(instance_(located, runtime, [subject], normalizer));
|
|
238
|
+
}
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
function dedupe_(entries) {
|
|
244
|
+
const seen = new Set();
|
|
245
|
+
return entries.filter((entry) => {
|
|
246
|
+
const id = caseKeyId(entry.key);
|
|
247
|
+
if (seen.has(id)) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
seen.add(id);
|
|
251
|
+
return true;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=instantiate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instantiate.js","sourceRoot":"","sources":["../../src/declaration/instantiate.ts"],"names":[],"mappings":"AAWA,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAiEpD,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,SAAS,OAAO,CAAC,KAAkB;IAClC,OAAO,IAAI,CAAC,SAAS,CAAC;QACrB,KAAK,CAAC,GAAG,CAAC,OAAO;QACjB,KAAK,CAAC,GAAG,CAAC,IAAI;QACd,KAAK,CAAC,aAAa;KACnB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,SAAwB;IACzC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAEnD,OAAO;YACN,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;YAC7D,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE;YACtB,OAAO,EAAE,KAAK;SACd,CAAC;IACH,CAAC;IAED,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;QAC9B,OAAO;YACN,IAAI,EAAE,SAAS,CAAC,IAAI,KAAK,SAAS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,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAC9D,CAAC;YAEL,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;gBAChC,MAAM,UAAU,GACf,WAAW,CAAC,WAAW,KAAK,SAAS;oBACpC,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;gBAE9C,IAAI,WAAW,CAAC,WAAW,KAAK,SAAS,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;oBAClE,SAAS;gBACV,CAAC;gBAED,IACC,UAAU,KAAK,IAAI;oBACnB,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,EACnD,CAAC;oBACF,SAAS;gBACV,CAAC;gBAED,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC;YACpE,CAAC;YACD,MAAM;QACP,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAS,OAAO,CAAC,OAA+B;IAC/C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/B,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEb,OAAO,IAAI,CAAC;IACb,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Run-level knobs of the gate; every statistical one lives in a config file. */
|
|
2
|
+
export type GateOptions = {
|
|
3
|
+
/** Two-sided confidence of each interval before multiplicity. Default 0.95. */
|
|
4
|
+
readonly confidence?: number;
|
|
5
|
+
/** Family-wise adjustment over every hypothesis of the run. Default `"holm"`. */
|
|
6
|
+
readonly multiplicity?: "holm" | "bonferroni" | "none";
|
|
7
|
+
/** Interval across executions. Default `"hartung-knapp"`. */
|
|
8
|
+
readonly pooling?: "hartung-knapp" | "dersimonian-laird";
|
|
9
|
+
/**
|
|
10
|
+
* Upper limit on the combined within-execution dispersion (relative MAD);
|
|
11
|
+
* above it a gate is inconclusive whatever its interval says. Default: none.
|
|
12
|
+
*/
|
|
13
|
+
readonly maxDispersion?: number;
|
|
14
|
+
/** Fewest executions per subject before a gate may be decided. Default 3. */
|
|
15
|
+
readonly minExecutions?: number;
|
|
16
|
+
/** Buy replicates while a fork unit's gate is undecided. Default true. */
|
|
17
|
+
readonly escalate?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** {@link GateOptions} with every default applied. */
|
|
20
|
+
export type ResolvedGateOptions = {
|
|
21
|
+
readonly confidence: number;
|
|
22
|
+
readonly multiplicity: "holm" | "bonferroni" | "none";
|
|
23
|
+
readonly pooling: "hartung-knapp" | "dersimonian-laird";
|
|
24
|
+
readonly maxDispersion: number | null;
|
|
25
|
+
readonly minExecutions: number;
|
|
26
|
+
readonly escalate: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The one place a default is applied.
|
|
30
|
+
*
|
|
31
|
+
* @throws {RangeError} On a `confidence` outside `(0, 1)`, a non-positive
|
|
32
|
+
* `maxDispersion`, a `minExecutions` that is not a positive integer, or an
|
|
33
|
+
* unknown `multiplicity` or `pooling`.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveGateOptions(options?: GateOptions): ResolvedGateOptions;
|
|
36
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/declaration/options.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IACvD,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,mBAAmB,CAAC;IACzD;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IACtD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CAAC;IACxD,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,GAAE,WAAgB,GACvB,mBAAmB,CA6CrB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { describeValue } from "@ac-kit/core";
|
|
2
|
+
/**
|
|
3
|
+
* The one place a default is applied.
|
|
4
|
+
*
|
|
5
|
+
* @throws {RangeError} On a `confidence` outside `(0, 1)`, a non-positive
|
|
6
|
+
* `maxDispersion`, a `minExecutions` that is not a positive integer, or an
|
|
7
|
+
* unknown `multiplicity` or `pooling`.
|
|
8
|
+
*/
|
|
9
|
+
export function resolveGateOptions(options = {}) {
|
|
10
|
+
const confidence = options.confidence ?? 0.95;
|
|
11
|
+
const multiplicity = options.multiplicity ?? "holm";
|
|
12
|
+
const pooling = options.pooling ?? "hartung-knapp";
|
|
13
|
+
const maxDispersion = options.maxDispersion ?? null;
|
|
14
|
+
const minExecutions = options.minExecutions ?? 3;
|
|
15
|
+
if (!(confidence > 0 && confidence < 1)) {
|
|
16
|
+
throw new RangeError(`gate confidence must be in (0, 1), got ${describeValue(confidence)}`);
|
|
17
|
+
}
|
|
18
|
+
if (!["holm", "bonferroni", "none"].includes(multiplicity)) {
|
|
19
|
+
throw new RangeError(`gate multiplicity must be holm, bonferroni or none, got ${describeValue(multiplicity)}`);
|
|
20
|
+
}
|
|
21
|
+
if (!["hartung-knapp", "dersimonian-laird"].includes(pooling)) {
|
|
22
|
+
throw new RangeError(`gate pooling must be hartung-knapp or dersimonian-laird, got ${describeValue(pooling)}`);
|
|
23
|
+
}
|
|
24
|
+
if (maxDispersion !== null && !(maxDispersion > 0)) {
|
|
25
|
+
throw new RangeError(`gate maxDispersion must be positive, got ${describeValue(maxDispersion)}`);
|
|
26
|
+
}
|
|
27
|
+
if (!Number.isInteger(minExecutions) || minExecutions < 1) {
|
|
28
|
+
throw new RangeError(`gate minExecutions must be a positive integer, got ${describeValue(minExecutions)}`);
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
confidence,
|
|
32
|
+
multiplicity,
|
|
33
|
+
pooling,
|
|
34
|
+
maxDispersion,
|
|
35
|
+
minExecutions,
|
|
36
|
+
escalate: options.escalate ?? true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/declaration/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA+B7C;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CACjC,OAAO,GAAgB,EAAE;IAEzB,M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ACV,YAAY;QACZ,OAAO;QACP,aAAa;QACb,aAAa;QACb,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI;KAClC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BenchArchive, CaseReference, ConfigGateDeclaration, GateReferenceError, GateVerdict } from "@ac-bench/core/plugin";
|
|
2
|
+
import type { GateOptions } from "./declaration/options.js";
|
|
3
|
+
import type { BenchExitCode } from "./exit-code.js";
|
|
4
|
+
export type ArchiveEvaluationOptions = GateOptions & {
|
|
5
|
+
/** Recorded runs to compare with; several pool as more executions. */
|
|
6
|
+
readonly baselines?: readonly BenchArchive[];
|
|
7
|
+
/**
|
|
8
|
+
* `now / baseline ≤ 1 + maxRegression` for every case of the baselines,
|
|
9
|
+
* unless a baseline gate already names the cases.
|
|
10
|
+
*/
|
|
11
|
+
readonly maxRegression?: number;
|
|
12
|
+
/** Default `normalizeBy` of every baseline gate. */
|
|
13
|
+
readonly normalizeBy?: CaseReference;
|
|
14
|
+
/** Compare with another machine's baseline, through `normalizeBy` only. */
|
|
15
|
+
readonly allowForeignBaseline?: boolean;
|
|
16
|
+
/** Exit 0 instead of 2 on an undecided gate. Default on for `quick` archives. */
|
|
17
|
+
readonly allowInconclusive?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Offline: `measure gate run-1.json run-2.json run-3.json`. Pools the archives
|
|
21
|
+
* as more executions and re-evaluates every gate they recorded plus `extra`,
|
|
22
|
+
* against `options.baselines` when there are any.
|
|
23
|
+
*
|
|
24
|
+
* A run and its archive evaluated later give the same verdicts: the online path
|
|
25
|
+
* calls the same instantiation, test and decision.
|
|
26
|
+
*
|
|
27
|
+
* The result does not depend on the order of `archives` or of the baselines:
|
|
28
|
+
* both pool in run id order. A case is selected when any run selected it; a run
|
|
29
|
+
* that filtered a case out contributes nothing to it, so the case is judged on
|
|
30
|
+
* the runs that selected it (failed in all of them is an error, not a skip),
|
|
31
|
+
* and a case no run selected makes its gates `skipped`. A baseline gate
|
|
32
|
+
* compares the environments of the archives that contribute executions to it
|
|
33
|
+
* only, on either side.
|
|
34
|
+
*
|
|
35
|
+
* @returns The verdicts, the exit code, and the references that did not resolve
|
|
36
|
+
* (each makes the exit code 4).
|
|
37
|
+
* @throws {RangeError} When `archives` is empty.
|
|
38
|
+
* @throws {GateDeclarationError} On a contradictory declaration.
|
|
39
|
+
*/
|
|
40
|
+
export declare function evaluateArchives(archives: readonly BenchArchive[], extra: readonly ConfigGateDeclaration[], options?: ArchiveEvaluationOptions): {
|
|
41
|
+
readonly verdicts: readonly GateVerdict[];
|
|
42
|
+
readonly exitCode: BenchExitCode;
|
|
43
|
+
readonly errors: readonly GateReferenceError[];
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=evaluate-archives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluate-archives.d.ts","sourceRoot":"","sources":["../src/evaluate-archives.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,EAEZ,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,WAAW,EAEX,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKpD,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG;IACpD,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IACrC,2EAA2E;IAC3E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC,iFAAiF;IACjF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAgIF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,SAAS,YAAY,EAAE,EACjC,KAAK,EAAE,SAAS,qBAAqB,EAAE,EACvC,OAAO,GAAE,wBAA6B,GACpC;IACF,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,SAAS,kBAAkB,EAAE,CAAC;CAC/C,CA2HA"}
|