@ac-bench/measure-constant-time 0.1.10 → 0.2.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 +98 -0
- package/dist/_run-case.d.ts.map +1 -1
- package/dist/_run-case.js +10 -15
- package/dist/_run-case.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,103 @@
|
|
|
1
1
|
# @ac-bench/measure-constant-time
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 34e8cfa: Reports tell conditions apart. **`@ac-bench/reporter-json`** writes the archive
|
|
8
|
+
(`format: "ac-bench-archive"`, version 1) instead of one section per measure:
|
|
9
|
+
every condition keyed and titled, so two suites that each declare a case `new`
|
|
10
|
+
are two conditions, with the run, machine and runtime descriptions, and what a
|
|
11
|
+
gate reads: each execution's `processKey` and `observations` per gate metric,
|
|
12
|
+
each condition's `metrics`, the run's `gates` and `verdicts`, so
|
|
13
|
+
`@ac-bench/gate` evaluates it offline. It folds
|
|
14
|
+
events as they arrive and keeps no raw result, and writes nothing for a run that
|
|
15
|
+
described nothing (a listing). **Migration:** read `conditions[].cases[].result`
|
|
16
|
+
where you read `<measure>.conditions[]`. **`@ac-bench/reporter-markdown`** opens
|
|
17
|
+
with an environment section and renders one titled table per condition, its
|
|
18
|
+
heading on one line whatever the titles or file name hold.
|
|
19
|
+
**`@ac-bench/reporter-csv`** writes one table per condition, each row ending with
|
|
20
|
+
`runtime` and `condition` columns; a condition with no result is one row with
|
|
21
|
+
only those two filled. Neither asks a measure to conclude on a condition with
|
|
22
|
+
no result. **`@ac-bench/measure-duration`** leaves the
|
|
23
|
+
raw `timings` out of its JSON form unless the run was started with
|
|
24
|
+
`--emit-samples`; a six-case archive no longer weighs tens of megabytes.
|
|
25
|
+
**Duration, jitter, resource and constant-time** close a case that threw as
|
|
26
|
+
`failed` — its failure result is still reported — so the archive, the report
|
|
27
|
+
and the run's outcome count it as failed rather than measured.
|
|
28
|
+
- 34e8cfa: Gates. Every measure package re-exports `ratioGate`, `differenceGate`,
|
|
29
|
+
`boundGate` and `registerGate` beside `beforeAll` and `afterAll`, so a suite
|
|
30
|
+
declares a gate next to the cases it reads. `@ac-bench/measure-duration` declares
|
|
31
|
+
the gate metrics `median` (the default) and `mean`, per operation on the log
|
|
32
|
+
scale: the variance of the median comes from its distribution-free interval,
|
|
33
|
+
never below what the clock's quantum forces over the timed span. A gate reads
|
|
34
|
+
`statistics`, not the overhead-adjusted ones. `@ac-bench/measure-resource`
|
|
35
|
+
declares `allocatedBytes` (linear, in bytes per operation, never more precise
|
|
36
|
+
than one byte over a batch) and `cpuTime` (log); its statistics gain
|
|
37
|
+
`allocatedBytesMad` and `cpuTimeMsMad`, the median absolute deviation of the
|
|
38
|
+
per-batch costs the medians summarise, and `allocatedBytesMedianVariance` and
|
|
39
|
+
`cpuTimeMsMedianVariance`, each median's exact bootstrap variance, which the
|
|
40
|
+
gate metrics read as the median's uncertainty. Measures without gate metrics
|
|
41
|
+
cannot be gated.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
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
|
+
- Updated dependencies [34e8cfa]
|
|
64
|
+
- Updated dependencies [34e8cfa]
|
|
65
|
+
- Updated dependencies [34e8cfa]
|
|
66
|
+
- Updated dependencies [34e8cfa]
|
|
67
|
+
- Updated dependencies [34e8cfa]
|
|
68
|
+
- Updated dependencies [34e8cfa]
|
|
69
|
+
- Updated dependencies [34e8cfa]
|
|
70
|
+
- Updated dependencies [34e8cfa]
|
|
71
|
+
- Updated dependencies [34e8cfa]
|
|
72
|
+
- Updated dependencies [34e8cfa]
|
|
73
|
+
- Updated dependencies [34e8cfa]
|
|
74
|
+
- Updated dependencies [34e8cfa]
|
|
75
|
+
- Updated dependencies [34e8cfa]
|
|
76
|
+
- Updated dependencies [34e8cfa]
|
|
77
|
+
- @ac-kit/algo@0.5.0
|
|
78
|
+
- @ac-kit/math-random@0.4.0
|
|
79
|
+
- @ac-kit/math-stats@0.5.0
|
|
80
|
+
- @ac-bench/core@0.3.0
|
|
81
|
+
- @ac-kit/core@0.12.0
|
|
82
|
+
- @ac-kit/model-dataset@0.2.0
|
|
83
|
+
- @ac-kit/app-report@0.3.0
|
|
84
|
+
|
|
85
|
+
## 0.1.11
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [065cf8d]
|
|
90
|
+
- Updated dependencies [065cf8d]
|
|
91
|
+
- Updated dependencies [065cf8d]
|
|
92
|
+
- Updated dependencies [065cf8d]
|
|
93
|
+
- Updated dependencies [065cf8d]
|
|
94
|
+
- @ac-kit/core@0.11.0
|
|
95
|
+
- @ac-kit/math-random@0.3.0
|
|
96
|
+
- @ac-kit/math-stats@0.4.0
|
|
97
|
+
- @ac-bench/core@0.2.5
|
|
98
|
+
- @ac-kit/app-report@0.2.4
|
|
99
|
+
- @ac-kit/algo@0.4.1
|
|
100
|
+
|
|
3
101
|
## 0.1.10
|
|
4
102
|
|
|
5
103
|
### Patch Changes
|
package/dist/_run-case.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_run-case.d.ts","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"_run-case.d.ts","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAU9C,OAAO,EACN,uBAAuB,EACvB,4BAA4B,EAC5B,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,GAAG;IAClE,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAiDf"}
|
package/dist/_run-case.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { hrtime } from "node:process";
|
|
2
|
-
import {
|
|
2
|
+
import { reportCaseFailure } from "@ac-bench/core/runner";
|
|
3
3
|
import { mulberry32 } from "@ac-kit/math-random";
|
|
4
4
|
import { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, runDudectCheck, } from "./_dudect.js";
|
|
5
5
|
import { detectConstantTimeWarnings_ } from "./_warnings.js";
|
|
@@ -42,20 +42,15 @@ export async function runConstantTimeCase(title, classA, classB, context, option
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
catch (error) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
title,
|
|
55
|
-
tags,
|
|
56
|
-
dudectResult: null,
|
|
57
|
-
warnings: [],
|
|
58
|
-
failureMessage,
|
|
45
|
+
await reportCaseFailure(context, error, {
|
|
46
|
+
...(options?.teardown ? { teardown: options.teardown } : {}),
|
|
47
|
+
result: (failureMessage) => ({
|
|
48
|
+
title,
|
|
49
|
+
tags,
|
|
50
|
+
dudectResult: null,
|
|
51
|
+
warnings: [],
|
|
52
|
+
failureMessage,
|
|
53
|
+
}),
|
|
59
54
|
});
|
|
60
55
|
}
|
|
61
56
|
}
|
package/dist/_run-case.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_run-case.js","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"_run-case.js","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EACN,sBAAsB,EACtB,YAAY,EACZ,cAAc,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAU7D;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,KAAa,EACb,MAAsB,EACtB,MAAsB,EACtB,OAA4B,EAC5B,OAAoC;IAEpC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;IAEhC,MAAM,IAAI,GAAG,OA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AAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,MAAM,EAAE,CAAC,cAAc,EAAE,EAAE,CAC1B,CAAC;gBACA,KAAK;gBACL,IAAI;gBACJ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,EAAE;gBACZ,cAAc;aACd,CAAkC;SACpC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { afterAll, afterEach, beforeAll, beforeEach, } from "@ac-bench/core/runner";
|
|
1
|
+
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
2
2
|
export * from "./decl.js";
|
|
3
3
|
export * from "./options.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { afterAll, afterEach, beforeAll, beforeEach, } from "@ac-bench/core/runner";
|
|
1
|
+
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
2
2
|
export * from "./decl.js";
|
|
3
3
|
export * from "./options.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-bench/measure-constant-time",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "dudect-style constant-time measure for @ac-bench: times two closures under a randomly interleaved schedule and reports Welch's t-statistic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"benchmark",
|
|
@@ -47,26 +47,26 @@
|
|
|
47
47
|
"prepack": "yarn build"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@ac-bench/core": "^0.
|
|
51
|
-
"@ac-kit/algo": "^0.
|
|
52
|
-
"@ac-kit/app-report": "^0.
|
|
53
|
-
"@ac-kit/core": "^0.
|
|
54
|
-
"@ac-kit/math-random": "^0.
|
|
55
|
-
"@ac-kit/math-stats": "^0.
|
|
56
|
-
"@ac-kit/model-dataset": "^0.
|
|
50
|
+
"@ac-bench/core": "^0.3.0",
|
|
51
|
+
"@ac-kit/algo": "^0.5.0",
|
|
52
|
+
"@ac-kit/app-report": "^0.3.0",
|
|
53
|
+
"@ac-kit/core": "^0.12.0",
|
|
54
|
+
"@ac-kit/math-random": "^0.4.0",
|
|
55
|
+
"@ac-kit/math-stats": "^0.5.0",
|
|
56
|
+
"@ac-kit/model-dataset": "^0.2.0",
|
|
57
57
|
"zod": "^4.5.4"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@ac-kit/tsconfig": "0.1.0",
|
|
61
61
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
62
|
-
"@ac-kit/vitest-config": "0.
|
|
63
|
-
"@types/node": "26.6.
|
|
62
|
+
"@ac-kit/vitest-config": "0.2.0",
|
|
63
|
+
"@types/node": "26.6.11",
|
|
64
64
|
"@typescript/native": "typescript@7.0.2",
|
|
65
65
|
"rimraf": "6.1.4",
|
|
66
66
|
"typedoc": "0.28.20",
|
|
67
67
|
"typescript": "@typescript/typescript6@6.0.2",
|
|
68
|
-
"vite": "8.
|
|
69
|
-
"vitest": "5.1.
|
|
68
|
+
"vite": "8.4.0",
|
|
69
|
+
"vitest": "5.1.2"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=24"
|