@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @ac-bench/gate
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 34e8cfa: First release: gate evaluation for `@ac-bench`. `instantiateGates` resolves
|
|
8
|
+
suite and config declarations against the discovered cases (globs per segment of
|
|
9
|
+
`"condition > … > case"`, `{ case }` for a sibling, unknown or ambiguous
|
|
10
|
+
references as `GateReferenceError`). `testGate` pools each case's executions
|
|
11
|
+
under a random-effects model with the Hartung–Knapp interval, pairs two cases
|
|
12
|
+
that shared processes and otherwise compares them unpaired
|
|
13
|
+
(Welch–Satterthwaite), takes ratios of log metrics on the log scale and
|
|
14
|
+
differences, bounds and byte counts on the linear one, and gives one p-value per
|
|
15
|
+
threshold side. `decideGates` adjusts every hypothesis of the run together
|
|
16
|
+
(Holm by default, Bonferroni or none on request) and returns one `GateVerdict`
|
|
17
|
+
per instance: `pass`, `fail`, `inconclusive` (the interval contains the
|
|
18
|
+
threshold, the dispersion exceeds the limit, too few executions, or the
|
|
19
|
+
multiplicity adjustment stopped before it), `reported`, `skipped`,
|
|
20
|
+
`not-applicable`, `error` or `incomparable`, each with its estimate, interval
|
|
21
|
+
at the level that decided it, and a sentence to act on. `needsMoreEvidence`
|
|
22
|
+
advises escalation. `compareEnvironments` says whether a baseline can be
|
|
23
|
+
compared with a run; a foreign baseline is compared only as a double ratio
|
|
24
|
+
against a `normalizeBy` case. `evaluateArchives` re-evaluates the gates archives
|
|
25
|
+
recorded, plus extra ones, offline, pooling several archives as more
|
|
26
|
+
executions, independently of the order the archives are given in. A case is
|
|
27
|
+
selected when any run selected it and is judged on the runs that selected it; a
|
|
28
|
+
case no run selected skips its gates. A pool is refused when two archives share a run id or when a case
|
|
29
|
+
sits at two positions (conditions sharing their titles); a baseline is
|
|
30
|
+
incomparable if any archive contributing executions to the gate, on either
|
|
31
|
+
side, comes from an incomparable environment. A linear baseline allowance tests
|
|
32
|
+
`now − (1 + r) × baseline` with the baseline's variance scaled by `(1 + r)²`.
|
|
33
|
+
Each comparison names its own estimator. `benchExitCode` and `BENCH_EXIT_CODES` define the exit codes:
|
|
34
|
+
0 success, 1 a gate failed, 2 undecided, 3 measurement error, 4 usage error,
|
|
35
|
+
5 nothing ran, 130 interrupted.
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [34e8cfa]
|
|
40
|
+
- Updated dependencies [34e8cfa]
|
|
41
|
+
- Updated dependencies [34e8cfa]
|
|
42
|
+
- Updated dependencies [34e8cfa]
|
|
43
|
+
- Updated dependencies [34e8cfa]
|
|
44
|
+
- Updated dependencies [34e8cfa]
|
|
45
|
+
- Updated dependencies [34e8cfa]
|
|
46
|
+
- Updated dependencies [34e8cfa]
|
|
47
|
+
- Updated dependencies [34e8cfa]
|
|
48
|
+
- Updated dependencies [34e8cfa]
|
|
49
|
+
- Updated dependencies [34e8cfa]
|
|
50
|
+
- Updated dependencies [34e8cfa]
|
|
51
|
+
- Updated dependencies [34e8cfa]
|
|
52
|
+
- Updated dependencies [34e8cfa]
|
|
53
|
+
- Updated dependencies [34e8cfa]
|
|
54
|
+
- Updated dependencies [34e8cfa]
|
|
55
|
+
- Updated dependencies [34e8cfa]
|
|
56
|
+
- Updated dependencies [34e8cfa]
|
|
57
|
+
- Updated dependencies [34e8cfa]
|
|
58
|
+
- Updated dependencies [34e8cfa]
|
|
59
|
+
- Updated dependencies [34e8cfa]
|
|
60
|
+
- Updated dependencies [34e8cfa]
|
|
61
|
+
- Updated dependencies [34e8cfa]
|
|
62
|
+
- Updated dependencies [34e8cfa]
|
|
63
|
+
- @ac-kit/math-stats@0.5.0
|
|
64
|
+
- @ac-bench/core@0.3.0
|
|
65
|
+
- @ac-kit/core@0.12.0
|
|
66
|
+
- @ac-kit/format-glob@0.3.2
|
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 Anthony Champagne and contributors
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ac-bench/gate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Decides whether a measured ratio, difference or value is within a threshold,
|
|
4
|
+
from the executions a benchmark run recorded: **fail** when the threshold is
|
|
5
|
+
exceeded by more than the measured spread, **inconclusive** when the spread is
|
|
6
|
+
too wide to decide, **pass** otherwise. Portable: it reads archives and holds no
|
|
7
|
+
runtime of its own.
|
|
8
|
+
|
|
9
|
+
## Declare
|
|
10
|
+
|
|
11
|
+
A gate sits next to the cases it reads, in a suite (`ratioGate`,
|
|
12
|
+
`differenceGate`, `boundGate` from a measure package such as
|
|
13
|
+
`@ac-bench/measure-duration`):
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
durationCondition("vec3 add", () => {
|
|
17
|
+
durationCase("new", () => addAll(outs, as, bs));
|
|
18
|
+
durationCase("three", () => addThree(vs, ws));
|
|
19
|
+
|
|
20
|
+
ratioGate("new", "three", { max: 1.2, rationale: "M1 2.2/2.6 ns" });
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or in a config file, for gates that span suites or many suites at once (cases
|
|
25
|
+
named by `"condition > … > case"` globs, `{ case }` for a sibling), or that
|
|
26
|
+
compare with a recorded baseline (`kind: "baseline"`). A gate without `min` or
|
|
27
|
+
`max` only reports its estimate.
|
|
28
|
+
|
|
29
|
+
## Evaluate
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { evaluateArchives } from "@ac-bench/gate";
|
|
33
|
+
|
|
34
|
+
const { verdicts, exitCode } = evaluateArchives(
|
|
35
|
+
[run1, run2, run3], // BenchArchive documents; pooled as more executions
|
|
36
|
+
[], // gates to add to the ones the archives recorded
|
|
37
|
+
{ baselines: [before], maxRegression: 0.03 },
|
|
38
|
+
);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Each execution of a case is one observation. The gate pools the executions of a
|
|
42
|
+
case under a random-effects model (Hartung–Knapp), so the uncertainty comes from
|
|
43
|
+
the spread _between_ processes, takes the ratio on the log scale (a difference
|
|
44
|
+
or a byte count on the linear one), and tests it against the threshold. Every
|
|
45
|
+
hypothesis of the run is adjusted together (Holm by default), so "all forty rows
|
|
46
|
+
hold" is claimed at 95 %, not each row. A verdict carries the estimate, its
|
|
47
|
+
interval at the level that decided it, and a sentence saying what to do.
|
|
48
|
+
|
|
49
|
+
| verdict | meaning |
|
|
50
|
+
| ---------------- | --------------------------------------------------------------- |
|
|
51
|
+
| `pass` | the interval lies entirely on the allowed side |
|
|
52
|
+
| `fail` | it lies entirely on the forbidden side |
|
|
53
|
+
| `inconclusive` | it contains the threshold, or the dispersion exceeds the limit |
|
|
54
|
+
| `reported` | no threshold: estimate and interval only |
|
|
55
|
+
| `skipped` | a subject was filtered out |
|
|
56
|
+
| `not-applicable` | the measure does not run in this runtime |
|
|
57
|
+
| `error` | a subject failed or is missing, or the metric is unusable |
|
|
58
|
+
| `incomparable` | the baseline comes from an environment it cannot be compared to |
|
|
59
|
+
|
|
60
|
+
`needsMoreEvidence` tells a run whether more executions would move a gate
|
|
61
|
+
towards a decision.
|
|
62
|
+
|
|
63
|
+
Pooled archives give the same verdicts in any order. A case is selected when any
|
|
64
|
+
run selected it, and a run whose filter excluded it adds nothing to it: the case
|
|
65
|
+
is judged on the runs that selected it, and `skipped` only when none did.
|
|
66
|
+
|
|
67
|
+
## Baselines
|
|
68
|
+
|
|
69
|
+
A baseline is an archive. It is compared directly when it comes from the same
|
|
70
|
+
machine, runtime major version and mode (`compareEnvironments` lists what
|
|
71
|
+
differs); otherwise it is `incomparable`, unless `allowForeignBaseline` and a
|
|
72
|
+
`normalizeBy` case let `(case / normalizer)` now be compared with the same ratio
|
|
73
|
+
in the baseline, which cancels machine speed to first order. Only the archives,
|
|
74
|
+
current or baseline, that hold executions of a gate's cases are compared for
|
|
75
|
+
that gate.
|
|
76
|
+
|
|
77
|
+
## Exit codes
|
|
78
|
+
|
|
79
|
+
`BENCH_EXIT_CODES` and `benchExitCode`: `0` success, `1` a gate failed, `2`
|
|
80
|
+
undecided (`0` with `allowInconclusive`), `3` a measurement failed or a subject
|
|
81
|
+
is missing, `4` a usage error or incomparable baseline, `5` nothing ran, `130`
|
|
82
|
+
interrupted. Precedence: 130 > 4 > 3 > 1 > 2 > 5 > 0.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BenchArchive } from "@ac-bench/core/plugin";
|
|
2
|
+
export type EnvironmentDifference = {
|
|
3
|
+
readonly field: string;
|
|
4
|
+
readonly current: string;
|
|
5
|
+
readonly baseline: string;
|
|
6
|
+
};
|
|
7
|
+
export type EnvironmentComparison = {
|
|
8
|
+
readonly comparable: boolean;
|
|
9
|
+
/** Required fields that differ; any makes the baseline incomparable. */
|
|
10
|
+
readonly mismatches: readonly EnvironmentDifference[];
|
|
11
|
+
/** Fields that differ and are compared anyway. */
|
|
12
|
+
readonly warnings: readonly EnvironmentDifference[];
|
|
13
|
+
};
|
|
14
|
+
type Environment_ = Pick<BenchArchive, "machine" | "runtimes" | "run">;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a baseline's measurements can be compared directly with this run's.
|
|
17
|
+
*
|
|
18
|
+
* Required equal: CPU model, logical cores, architecture, OS, the runtime and
|
|
19
|
+
* its major version, and the mode (or, when the plan was pinned, the plan).
|
|
20
|
+
* Warned but compared: kernel release, the runtime's minor version, CPU
|
|
21
|
+
* governor, memory and available parallelism.
|
|
22
|
+
*
|
|
23
|
+
* @param runtime The runtime id the comparison concerns.
|
|
24
|
+
*/
|
|
25
|
+
export declare function compareEnvironments(current: Environment_, baseline: Environment_, runtime: string): EnvironmentComparison;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=compare-environments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-environments.d.ts","sourceRoot":"","sources":["../../src/baseline/compare-environments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,MAAM,MAAM,qBAAqB,GAAG;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACtD,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACpD,CAAC;AAEF,KAAK,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,UAAU,GAAG,KAAK,CAAC,CAAC;AAMvE;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,GACb,qBAAqB,CAqGvB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isDeepEqual } from "@ac-kit/core";
|
|
2
|
+
function versionPart_(version, index) {
|
|
3
|
+
return version.split(".")[index] ?? "";
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Whether a baseline's measurements can be compared directly with this run's.
|
|
7
|
+
*
|
|
8
|
+
* Required equal: CPU model, logical cores, architecture, OS, the runtime and
|
|
9
|
+
* its major version, and the mode (or, when the plan was pinned, the plan).
|
|
10
|
+
* Warned but compared: kernel release, the runtime's minor version, CPU
|
|
11
|
+
* governor, memory and available parallelism.
|
|
12
|
+
*
|
|
13
|
+
* @param runtime The runtime id the comparison concerns.
|
|
14
|
+
*/
|
|
15
|
+
export function compareEnvironments(current, baseline, runtime) {
|
|
16
|
+
const mismatches = [];
|
|
17
|
+
const warnings = [];
|
|
18
|
+
const compare = (target, field, now, then) => {
|
|
19
|
+
if (now !== then) {
|
|
20
|
+
target.push({ field, current: String(now), baseline: String(then) });
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
compare(mismatches, "cpuModel", current.machine.cpuModel, baseline.machine.cpuModel);
|
|
24
|
+
compare(mismatches, "logicalCores", current.machine.logicalCores, baseline.machine.logicalCores);
|
|
25
|
+
compare(mismatches, "architecture", current.machine.architecture, baseline.machine.architecture);
|
|
26
|
+
compare(mismatches, "os", current.machine.os, baseline.machine.os);
|
|
27
|
+
const now = current.runtimes.find((candidate) => candidate.id === runtime);
|
|
28
|
+
const then = baseline.runtimes.find((candidate) => candidate.id === runtime);
|
|
29
|
+
if (now === undefined || then === undefined) {
|
|
30
|
+
mismatches.push({
|
|
31
|
+
field: "runtime",
|
|
32
|
+
current: now === undefined ? "absent" : now.id,
|
|
33
|
+
baseline: then === undefined ? "absent" : then.id,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
compare(mismatches, "runtime.product", now.product, then.product);
|
|
38
|
+
compare(mismatches, "runtime.version (major)", versionPart_(now.version, 0), versionPart_(then.version, 0));
|
|
39
|
+
compare(warnings, "runtime.version (minor)", versionPart_(now.version, 1), versionPart_(then.version, 1));
|
|
40
|
+
}
|
|
41
|
+
if (current.run.mode === null || baseline.run.mode === null) {
|
|
42
|
+
if (current.run.mode !== baseline.run.mode ||
|
|
43
|
+
!isDeepEqual(current.run.plan, baseline.run.plan)) {
|
|
44
|
+
mismatches.push({
|
|
45
|
+
field: "plan",
|
|
46
|
+
current: JSON.stringify(current.run.plan),
|
|
47
|
+
baseline: JSON.stringify(baseline.run.plan),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
compare(mismatches, "mode", current.run.mode, baseline.run.mode);
|
|
53
|
+
}
|
|
54
|
+
compare(warnings, "kernelRelease", current.machine.kernelRelease, baseline.machine.kernelRelease);
|
|
55
|
+
compare(warnings, "cpuGovernor", current.machine.cpuGovernor, baseline.machine.cpuGovernor);
|
|
56
|
+
compare(warnings, "memoryGiB", current.machine.memoryGiB, baseline.machine.memoryGiB);
|
|
57
|
+
compare(warnings, "availableParallelism", current.machine.availableParallelism, baseline.machine.availableParallelism);
|
|
58
|
+
return { comparable: mismatches.length === 0, mismatches, warnings };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=compare-environments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-environments.js","sourceRoot":"","sources":["../../src/baseline/compare-environments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAkB3C,SAAS,YAAY,CAAC,OAAe,EAAE,KAAa;IACnD,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAClC,OAAqB,EACrB,QAAsB,EACtB,OAAe;IAEf,MAAM,UAAU,GAA4B,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAE7C,MAAM,OAAO,GAAG,CACf,MAA+B,EAC/B,KAAa,EACb,GAA2B,EAC3B,IAA4B,EACrB,EAAE;QACT,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,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EACb,OAAO,CAAC,OAAO,CAAC,WAAW,EAC3B,QAAQ,CAAC,OAAO,CAAC,WAAW,CAC5B,CAAC;IACF,OAAO,CACN,QAAQ,EACR,WAAW,EACX,OAAO,CAAC,OAAO,CAAC,SAAS,EACzB,QAAQ,CAAC,OAAO,CAAC,SAAS,CAC1B,CAAC;IACF,OAAO,CACN,QAAQ,EACR,sBAAsB,EACtB,OAAO,CAAC,OAAO,CAAC,oBAAoB,EACpC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CACrC,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GateVerdict } from "@ac-bench/core/plugin";
|
|
2
|
+
import type { ResolvedGateOptions } from "../declaration/options.js";
|
|
3
|
+
import type { GateTest } from "../test/test-gate.js";
|
|
4
|
+
/**
|
|
5
|
+
* Decides every test: Holm's step-down procedure (or the chosen adjustment)
|
|
6
|
+
* over every hypothesis of the run, then one verdict per test, in order.
|
|
7
|
+
*
|
|
8
|
+
* A hypothesis is decided when its adjusted p-value is at most `1 −
|
|
9
|
+
* confidence`; the verdict reports the interval at that step's level, so a pass
|
|
10
|
+
* always sits next to an interval entirely inside the threshold. A gate fails
|
|
11
|
+
* when any hypothesis is decided on the forbidden side, passes when every one
|
|
12
|
+
* is decided on the allowed side, and is inconclusive otherwise, or when its
|
|
13
|
+
* dispersion exceeds the limit whatever its interval says.
|
|
14
|
+
*/
|
|
15
|
+
export declare function decideGates(tests: readonly GateTest[], options: ResolvedGateOptions): readonly GateVerdict[];
|
|
16
|
+
//# sourceMappingURL=decide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/decision/decide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEX,WAAW,EAEX,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAkB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAyDrE;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,OAAO,EAAE,mBAAmB,GAC1B,SAAS,WAAW,EAAE,CAIxB"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { adjustPValues } from "@ac-kit/math-stats";
|
|
2
|
+
import { criticalValue } from "../test/_stats.js";
|
|
3
|
+
import { formatNumber, runsOnLogScale } from "../test/test-gate.js";
|
|
4
|
+
const NO_METRIC_ = {
|
|
5
|
+
name: "",
|
|
6
|
+
unit: { symbol: "1", scale: 0 },
|
|
7
|
+
scale: "linear",
|
|
8
|
+
direction: "lower-is-better",
|
|
9
|
+
};
|
|
10
|
+
/** Decides every hypothesis of the run at once: the family is the whole run. */
|
|
11
|
+
function decideHypotheses_(tests, options) {
|
|
12
|
+
const tested = tests
|
|
13
|
+
.filter((test) => test.settled === null)
|
|
14
|
+
.flatMap((test) => test.hypotheses)
|
|
15
|
+
.filter((hypothesis) => hypothesis.pValue !== null);
|
|
16
|
+
const pValues = tested.map((hypothesis) => hypothesis.pValue);
|
|
17
|
+
const adjusted = options.multiplicity === "none"
|
|
18
|
+
? pValues
|
|
19
|
+
: adjustPValues(pValues, options.multiplicity);
|
|
20
|
+
const alpha = 1 - options.confidence;
|
|
21
|
+
const decisions = new Map();
|
|
22
|
+
for (const [index, hypothesis] of tested.entries()) {
|
|
23
|
+
const pValue = pValues[index];
|
|
24
|
+
const multiplier = options.multiplicity === "none"
|
|
25
|
+
? 1
|
|
26
|
+
: options.multiplicity === "bonferroni"
|
|
27
|
+
? tested.length
|
|
28
|
+
: pValues.filter((other) => other >= pValue).length;
|
|
29
|
+
const above = hypothesis.estimate > hypothesis.threshold;
|
|
30
|
+
decisions.set(hypothesis, {
|
|
31
|
+
adjusted: adjusted[index],
|
|
32
|
+
multiplier,
|
|
33
|
+
decided: adjusted[index] <= alpha,
|
|
34
|
+
violating: hypothesis.bound === "max" ? above : !above,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return decisions;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Decides every test: Holm's step-down procedure (or the chosen adjustment)
|
|
41
|
+
* over every hypothesis of the run, then one verdict per test, in order.
|
|
42
|
+
*
|
|
43
|
+
* A hypothesis is decided when its adjusted p-value is at most `1 −
|
|
44
|
+
* confidence`; the verdict reports the interval at that step's level, so a pass
|
|
45
|
+
* always sits next to an interval entirely inside the threshold. A gate fails
|
|
46
|
+
* when any hypothesis is decided on the forbidden side, passes when every one
|
|
47
|
+
* is decided on the allowed side, and is inconclusive otherwise, or when its
|
|
48
|
+
* dispersion exceeds the limit whatever its interval says.
|
|
49
|
+
*/
|
|
50
|
+
export function decideGates(tests, options) {
|
|
51
|
+
const decisions = decideHypotheses_(tests, options);
|
|
52
|
+
return tests.map((test) => verdictOf_(test, decisions, options));
|
|
53
|
+
}
|
|
54
|
+
/** Normal inference has no degrees of freedom: `null`, which JSON can carry. */
|
|
55
|
+
function finiteOrNull_(value) {
|
|
56
|
+
return Number.isFinite(value) ? value : null;
|
|
57
|
+
}
|
|
58
|
+
function titleOf_(test, index) {
|
|
59
|
+
return test.instance.subjects[index]?.caseTitle ?? "?";
|
|
60
|
+
}
|
|
61
|
+
function labelOf_(test, hypothesis) {
|
|
62
|
+
const { instance } = test;
|
|
63
|
+
switch (instance.kind) {
|
|
64
|
+
case "ratio":
|
|
65
|
+
return `${titleOf_(test, 0)}/${hypothesis.denominator?.caseTitle ?? "?"}`;
|
|
66
|
+
case "difference":
|
|
67
|
+
return `${titleOf_(test, 0)} − ${hypothesis.denominator?.caseTitle ?? "?"}`;
|
|
68
|
+
case "bound":
|
|
69
|
+
return titleOf_(test, 0);
|
|
70
|
+
case "baseline":
|
|
71
|
+
return `${titleOf_(test, 0)} against the baseline${instance.normalizer === null ? "" : ` (normalised by ${instance.normalizer.caseTitle})`}`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function verdictThreshold_(test, hypothesis, onLog) {
|
|
75
|
+
if (test.instance.kind !== "baseline") {
|
|
76
|
+
return test.instance.threshold;
|
|
77
|
+
}
|
|
78
|
+
if (hypothesis?.threshold !== null && hypothesis !== undefined) {
|
|
79
|
+
return {
|
|
80
|
+
max: onLog ? Math.exp(hypothesis.threshold) : hypothesis.threshold,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const regression = test.instance.threshold.max;
|
|
84
|
+
return regression === undefined || test.metric?.scale === "linear"
|
|
85
|
+
? {}
|
|
86
|
+
: { max: 1 + regression };
|
|
87
|
+
}
|
|
88
|
+
function verdictOf_(test, decisions, options) {
|
|
89
|
+
const { instance } = test;
|
|
90
|
+
const metric = test.metric ?? { ...NO_METRIC_, name: instance.metric ?? "" };
|
|
91
|
+
const onLog = test.metric !== null && runsOnLogScale(instance.kind, test.metric);
|
|
92
|
+
const origin = instance.origin;
|
|
93
|
+
const rationale = instance.settings.rationale;
|
|
94
|
+
const shared = {
|
|
95
|
+
id: instance.id,
|
|
96
|
+
kind: instance.kind,
|
|
97
|
+
runtime: instance.runtime,
|
|
98
|
+
subjects: [...instance.subjects],
|
|
99
|
+
metric: {
|
|
100
|
+
name: metric.name,
|
|
101
|
+
unit: { ...metric.unit },
|
|
102
|
+
scale: metric.scale,
|
|
103
|
+
direction: metric.direction,
|
|
104
|
+
},
|
|
105
|
+
dispersion: test.dispersion,
|
|
106
|
+
estimator: test.estimator,
|
|
107
|
+
executions: [...test.executions],
|
|
108
|
+
escalatedReplicates: 0,
|
|
109
|
+
origin,
|
|
110
|
+
...(rationale === undefined ? {} : { rationale }),
|
|
111
|
+
};
|
|
112
|
+
const empty = {
|
|
113
|
+
estimate: null,
|
|
114
|
+
interval: null,
|
|
115
|
+
degreesOfFreedom: null,
|
|
116
|
+
pValue: null,
|
|
117
|
+
adjustedPValue: null,
|
|
118
|
+
};
|
|
119
|
+
const decorate = (message) => [
|
|
120
|
+
message + (test.notes.length === 0 ? "" : ` (${test.notes.join("; ")})`),
|
|
121
|
+
...(rationale === undefined ? [] : [rationale]),
|
|
122
|
+
].join(" — ");
|
|
123
|
+
if (test.settled !== null) {
|
|
124
|
+
return {
|
|
125
|
+
...shared,
|
|
126
|
+
...empty,
|
|
127
|
+
verdict: test.settled.verdict,
|
|
128
|
+
reason: test.settled.reason,
|
|
129
|
+
message: decorate(test.settled.message),
|
|
130
|
+
threshold: verdictThreshold_(test, undefined, onLog),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const thresholded = test.hypotheses.filter((hypothesis) => hypothesis.bound !== null);
|
|
134
|
+
const convert = (value) => (onLog ? Math.exp(value) : value);
|
|
135
|
+
const render = (hypothesis, level) => {
|
|
136
|
+
const half = criticalValue(hypothesis.degreesOfFreedom, (1 - level) / 2) *
|
|
137
|
+
hypothesis.standardError;
|
|
138
|
+
return {
|
|
139
|
+
estimate: convert(hypothesis.estimate),
|
|
140
|
+
interval: {
|
|
141
|
+
lower: convert(hypothesis.estimate - half),
|
|
142
|
+
upper: convert(hypothesis.estimate + half),
|
|
143
|
+
level,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
if (thresholded.length === 0) {
|
|
148
|
+
const worst = test.hypotheses.reduce((chosen, hypothesis) => (metric.direction === "lower-is-better"
|
|
149
|
+
? hypothesis.estimate > chosen.estimate
|
|
150
|
+
: hypothesis.estimate < chosen.estimate)
|
|
151
|
+
? hypothesis
|
|
152
|
+
: chosen);
|
|
153
|
+
const { estimate, interval } = render(worst, options.confidence);
|
|
154
|
+
return {
|
|
155
|
+
...shared,
|
|
156
|
+
verdict: "reported",
|
|
157
|
+
reason: "no-threshold",
|
|
158
|
+
message: decorate(`${labelOf_(test, worst)} = ${formatNumber(estimate)} [${formatNumber(interval.lower)}, ${formatNumber(interval.upper)}] (${formatNumber(interval.level * 100)} % interval), no threshold`),
|
|
159
|
+
estimate,
|
|
160
|
+
interval,
|
|
161
|
+
threshold: verdictThreshold_(test, undefined, onLog),
|
|
162
|
+
degreesOfFreedom: finiteOrNull_(worst.degreesOfFreedom),
|
|
163
|
+
estimator: worst.estimator,
|
|
164
|
+
pValue: null,
|
|
165
|
+
adjustedPValue: null,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const alpha = 1 - options.confidence;
|
|
169
|
+
const score = (hypothesis) => ((hypothesis.bound === "max" ? 1 : -1) *
|
|
170
|
+
(hypothesis.estimate - hypothesis.threshold)) /
|
|
171
|
+
hypothesis.standardError;
|
|
172
|
+
const decisionOf = (hypothesis) => decisions.get(hypothesis);
|
|
173
|
+
const violated = thresholded
|
|
174
|
+
.filter((hypothesis) => {
|
|
175
|
+
const decision = decisionOf(hypothesis);
|
|
176
|
+
return decision.decided && decision.violating;
|
|
177
|
+
})
|
|
178
|
+
.reduce((chosen, hypothesis) => chosen === null || score(hypothesis) > score(chosen)
|
|
179
|
+
? hypothesis
|
|
180
|
+
: chosen, null);
|
|
181
|
+
const allAllowed = thresholded.every((hypothesis) => {
|
|
182
|
+
const decision = decisionOf(hypothesis);
|
|
183
|
+
return decision.decided && !decision.violating;
|
|
184
|
+
});
|
|
185
|
+
const chosen = violated ??
|
|
186
|
+
thresholded.reduce((best, hypothesis) => score(hypothesis) > score(best) ? hypothesis : best);
|
|
187
|
+
const decision = decisionOf(chosen);
|
|
188
|
+
const level = 1 - alpha / decision.multiplier;
|
|
189
|
+
const { estimate, interval } = render(chosen, level);
|
|
190
|
+
const limit = instance.settings.maxDispersion ?? options.maxDispersion;
|
|
191
|
+
const thresholdValue = convert(chosen.threshold);
|
|
192
|
+
const text = `${labelOf_(test, chosen)} = ${formatNumber(estimate)} [${formatNumber(interval.lower)}, ${formatNumber(interval.upper)}] (${formatNumber(level * 100)} % interval)`;
|
|
193
|
+
const executionsEach = Math.min(...test.executions);
|
|
194
|
+
let verdict;
|
|
195
|
+
let reason;
|
|
196
|
+
let message;
|
|
197
|
+
if (limit !== null && test.dispersion !== null && test.dispersion > limit) {
|
|
198
|
+
verdict = "inconclusive";
|
|
199
|
+
reason = "dispersion-exceeds-limit";
|
|
200
|
+
message = `${text}: dispersion ${formatNumber(test.dispersion * 100)} % exceeds the ${formatNumber(limit * 100)} % limit, whatever the interval says`;
|
|
201
|
+
}
|
|
202
|
+
else if (violated !== null) {
|
|
203
|
+
verdict = "fail";
|
|
204
|
+
reason = "decided";
|
|
205
|
+
message = `${text}, ${violated.bound === "max" ? "above" : "below"} ${formatNumber(convert(violated.threshold))}`;
|
|
206
|
+
}
|
|
207
|
+
else if (allAllowed) {
|
|
208
|
+
verdict = "pass";
|
|
209
|
+
reason = "decided";
|
|
210
|
+
message = `${text}, ${chosen.bound === "max" ? "below" : "above"} ${formatNumber(thresholdValue)}`;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
const alone = thresholded.some((hypothesis) => !decisionOf(hypothesis).decided && hypothesis.pValue <= alpha);
|
|
214
|
+
verdict = "inconclusive";
|
|
215
|
+
reason = alone ? "multiplicity" : "interval-contains-threshold";
|
|
216
|
+
message = alone
|
|
217
|
+
? `${text}: decided alone, not across the ${decisions.size} hypotheses of the run: more executions would settle it`
|
|
218
|
+
: `${text}: the interval contains ${formatNumber(thresholdValue)} after ${executionsEach} executions per case: run on a quieter machine or accept`;
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
...shared,
|
|
222
|
+
verdict,
|
|
223
|
+
reason,
|
|
224
|
+
message: decorate(message),
|
|
225
|
+
estimate,
|
|
226
|
+
interval,
|
|
227
|
+
threshold: verdictThreshold_(test, chosen, onLog),
|
|
228
|
+
degreesOfFreedom: finiteOrNull_(chosen.degreesOfFreedom),
|
|
229
|
+
estimator: chosen.estimator,
|
|
230
|
+
pValue: chosen.pValue,
|
|
231
|
+
adjustedPValue: decision.adjusted,
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AAC,cAAc,CAAC,CAAC,CAAC,6BAA6B,CAAC;QAChE,OAAO,GAAG,KAAK;YACd,CAAC,CAAC,GAAG,IAAI,mCAAmC,SAAS,CAAC,IAAI,yDAAyD;YACnH,CAAC,CAAC,GAAG,IAAI,2BAA2B,YAAY,CAAC,cAAc,CAAC,UAAU,cAAc,0DAA0D,CAAC;IACrJ,CAAC;IAED,OAAO;QACN,GAAG,MAAM;QACT,OAAO;QACP,MAAM;QACN,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC1B,QAAQ;QACR,QAAQ;QACR,SAAS,EAAE,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC;QACjD,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACxD,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,cAAc,EAAE,QAAQ,CAAC,QAAQ;KACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ResolvedGateOptions } from "../declaration/options.js";
|
|
2
|
+
import type { GateTest } from "../test/test-gate.js";
|
|
3
|
+
/**
|
|
4
|
+
* Escalation advice for one fork unit's gate: whether more executions would
|
|
5
|
+
* move it towards a decision.
|
|
6
|
+
*
|
|
7
|
+
* True when the gate has too few executions to be decided at all; when its
|
|
8
|
+
* dispersion exceeds the limit (the "re-run" of a noisy ratio); or when some
|
|
9
|
+
* hypothesis would still be undecided at the Bonferroni level `α / m`, the
|
|
10
|
+
* strictest step Holm can reach, so that meeting it guarantees the final pass
|
|
11
|
+
* decides the gate. False for a gate that is settled for another reason (an
|
|
12
|
+
* error, a skip, an unsupported runtime, no threshold) or when escalation is
|
|
13
|
+
* off. The caller bounds the replicates it buys by the plan's ceiling.
|
|
14
|
+
*
|
|
15
|
+
* @param hypothesesInRun How many hypotheses the whole run holds (`m`).
|
|
16
|
+
*/
|
|
17
|
+
export declare function needsMoreEvidence(test: GateTest, hypothesesInRun: number, options: ResolvedGateOptions): boolean;
|
|
18
|
+
//# sourceMappingURL=needs-more-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needs-more-evidence.d.ts","sourceRoot":"","sources":["../../src/decision/needs-more-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,QAAQ,EACd,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,mBAAmB,GAC1B,OAAO,CA4BT"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escalation advice for one fork unit's gate: whether more executions would
|
|
3
|
+
* move it towards a decision.
|
|
4
|
+
*
|
|
5
|
+
* True when the gate has too few executions to be decided at all; when its
|
|
6
|
+
* dispersion exceeds the limit (the "re-run" of a noisy ratio); or when some
|
|
7
|
+
* hypothesis would still be undecided at the Bonferroni level `α / m`, the
|
|
8
|
+
* strictest step Holm can reach, so that meeting it guarantees the final pass
|
|
9
|
+
* decides the gate. False for a gate that is settled for another reason (an
|
|
10
|
+
* error, a skip, an unsupported runtime, no threshold) or when escalation is
|
|
11
|
+
* off. The caller bounds the replicates it buys by the plan's ceiling.
|
|
12
|
+
*
|
|
13
|
+
* @param hypothesesInRun How many hypotheses the whole run holds (`m`).
|
|
14
|
+
*/
|
|
15
|
+
export function needsMoreEvidence(test, hypothesesInRun, options) {
|
|
16
|
+
if (!options.escalate) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (test.settled !== null) {
|
|
20
|
+
return test.settled.reason === "too-few-executions";
|
|
21
|
+
}
|
|
22
|
+
const thresholded = test.hypotheses.filter((hypothesis) => hypothesis.bound !== null);
|
|
23
|
+
if (thresholded.length === 0) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const limit = test.instance.settings.maxDispersion ?? options.maxDispersion;
|
|
27
|
+
if (limit !== null && test.dispersion !== null && test.dispersion > limit) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
const family = options.multiplicity === "none" ? 1 : Math.max(1, hypothesesInRun);
|
|
31
|
+
const alpha = 1 - options.confidence;
|
|
32
|
+
return thresholded.some((hypothesis) => hypothesis.pValue * family > alpha);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=needs-more-evidence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"needs-more-evidence.js","sourceRoot":"","sources":["../../src/decision/needs-more-evidence.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAChC,IAAc,EACd,eAAuB,EACvB,OAA4B;IAE5B,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACd,CAAC;IAED,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,oBAAoB,CAAC;IACrD,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CACzC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,CACzC,CAAC;IAEF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAE5E,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC;QAC3E,OAAO,IAAI,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