@mark1russell7/rigor-bench 0.2.24 → 0.2.25
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/README.md +27 -0
- package/build/index.d.ts +47 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +65 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,7 @@ v.comparison; // the cases that gain and dro
|
|
|
33
33
|
|
|
34
34
|
| Function | What it gives |
|
|
35
35
|
| --- | --- |
|
|
36
|
+
| `growthVerdict(rounds, options)` | The growth of a cost for each step of size, from a ratio inside each job, against a limit, for example 15 times for each 10 times. |
|
|
36
37
|
| `firstArm(round, offset)` | The arm that runs first. The order turns each round, and an odd offset starts with arm `b`. |
|
|
37
38
|
| `armOrder(arms, round)` | The order of any count of arms in a round. Each pair of arms has each order within 1 after each count of rounds. A report that keeps no `first` for each pair states the order that it used, so that a reader can make `first` again. |
|
|
38
39
|
| `checkPairedTime(record)` | The record, or a `RangeError` for a time that is not a finite number above 0. |
|
|
@@ -257,6 +258,32 @@ There are four kinds of budget:
|
|
|
257
258
|
- A record states what was real and what was synthetic. A record with no entry in `real` gives `cannot decide`.
|
|
258
259
|
- `checkLadder` gives each problem of a ladder as data. `ladderVerdict` throws a `RangeError` for a ladder with problems.
|
|
259
260
|
|
|
261
|
+
## A claim on the growth of a cost
|
|
262
|
+
|
|
263
|
+
A ladder holds each size to a limit. A growth claim holds the step between sizes, for example "the time of one publish grows less than 15 times for each 10 times more subscribers". A cost that grows as n x n grows 100 times for each 10 times. A linear cost grows 10 times.
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
const v = growthVerdict(
|
|
267
|
+
[
|
|
268
|
+
{ job: "job-1", size: 1_000, value: 9.0 },
|
|
269
|
+
{ job: "job-1", size: 10_000, value: 51.8 },
|
|
270
|
+
{ job: "job-1", size: 100_000, value: 590 },
|
|
271
|
+
// ... the same sizes for each other job
|
|
272
|
+
],
|
|
273
|
+
{ maxGrowth: 15 },
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
v.outcome; // "within", "beyond" or "cannot decide"
|
|
277
|
+
v.steps[0].median; // the median growth of the jobs from 1,000 to 10,000, for a step of 10 times
|
|
278
|
+
v.steps[0].exponent; // the cost grows as the size to this power
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
- The verdict reads a ratio inside each job: the cost at the larger size over the cost at the smaller size. Each job runs on one runner, so a slow runner changes both values and the ratio keeps its value. The verdict needs no A/A arm.
|
|
282
|
+
- A step that is not `per` times in size is scaled to `per` times, with the exponent of the step. The default of `per` is 10.
|
|
283
|
+
- The interval of each step is the distribution-free interval of the median of the jobs. With 5 jobs it is the full range, with the coverage 0.94. A step is `within` when the high end is less than `maxGrowth`.
|
|
284
|
+
- A job that gives more than one value at a size gives their median.
|
|
285
|
+
- The flip test of a growth gate is the old code: it must give `beyond`.
|
|
286
|
+
|
|
260
287
|
## Time the rounds
|
|
261
288
|
|
|
262
289
|
`timeRounds` times one case in one process. Start a fresh process for each case and each pair, and give the index of the case as `offset`:
|
package/build/index.d.ts
CHANGED
|
@@ -124,6 +124,52 @@ export declare function budgetLookSpend(looks: readonly BudgetLook[]): number;
|
|
|
124
124
|
* - The field `fails` is true only for the outcome `beyond`. Tell a final `cannot decide` to the reader of the run.
|
|
125
125
|
*/
|
|
126
126
|
export declare function budgetLooksVerdict(rounds: readonly BudgetRound[], aa: readonly BudgetRound[], options: BudgetLooksOptions): BudgetLooksVerdict;
|
|
127
|
+
/** One value of one job at one size. A job that gives more than one value at a size gives the median of its values. */
|
|
128
|
+
interface GrowthRound {
|
|
129
|
+
/** The name of the job: one runner, which gives each size. */
|
|
130
|
+
readonly job: string;
|
|
131
|
+
/** The size, for example the count of subscribers. It is finite and more than 0. */
|
|
132
|
+
readonly size: number;
|
|
133
|
+
/** The cost at the size, for example a time in ms. It is finite and more than 0. */
|
|
134
|
+
readonly value: number;
|
|
135
|
+
}
|
|
136
|
+
/** The three outcomes of a growth verdict. */
|
|
137
|
+
type GrowthOutcome = "within" | "beyond" | "cannot decide";
|
|
138
|
+
/** The options of a growth verdict. */
|
|
139
|
+
interface GrowthOptions {
|
|
140
|
+
/** The largest growth of the cost that the claim permits for each step of `per` times in size. It is more than 1. */
|
|
141
|
+
readonly maxGrowth: number;
|
|
142
|
+
/** The factor of size that `maxGrowth` refers to. The default is 10. */
|
|
143
|
+
readonly per?: number;
|
|
144
|
+
/** The level of the interval of the median growth of each step. The default is 0.95. */
|
|
145
|
+
readonly level?: number;
|
|
146
|
+
}
|
|
147
|
+
/** The verdict of one step, from one size to the next larger size. */
|
|
148
|
+
interface GrowthStep {
|
|
149
|
+
readonly from: number;
|
|
150
|
+
readonly to: number;
|
|
151
|
+
/** The growth of each job that gives both sizes, for a step of `per` times in size, in the order of the job names. */
|
|
152
|
+
readonly growths: readonly number[];
|
|
153
|
+
/** The median of `growths`. */
|
|
154
|
+
readonly median: number;
|
|
155
|
+
readonly low: number;
|
|
156
|
+
readonly high: number;
|
|
157
|
+
/** The coverage of the interval from `low` to `high`. It is less than the level with 5 jobs or fewer. */
|
|
158
|
+
readonly coverage: number;
|
|
159
|
+
/** The exponent of the median growth: the cost grows as the size to this power. */
|
|
160
|
+
readonly exponent: number;
|
|
161
|
+
readonly outcome: GrowthOutcome;
|
|
162
|
+
}
|
|
163
|
+
/** The verdict of a cost over all its sizes. */
|
|
164
|
+
interface GrowthVerdict {
|
|
165
|
+
/** It is `beyond` when a step is beyond, `within` when each step is within, and `cannot decide` in the other cases. */
|
|
166
|
+
readonly outcome: GrowthOutcome;
|
|
167
|
+
readonly maxGrowth: number;
|
|
168
|
+
readonly per: number;
|
|
169
|
+
readonly steps: readonly GrowthStep[];
|
|
170
|
+
}
|
|
171
|
+
/** This function gives the growth verdict of a cost over its sizes, from the values of one or more jobs. */
|
|
172
|
+
export declare function growthVerdict(rounds: readonly GrowthRound[], options: GrowthOptions): GrowthVerdict;
|
|
127
173
|
/**
|
|
128
174
|
* The two kinds of an A/A band.
|
|
129
175
|
* - The band `case` holds the ratio of one A/A case. It is wide, so it finds only a large change.
|
|
@@ -1442,5 +1488,5 @@ interface Rounds {
|
|
|
1442
1488
|
* keeps the work.
|
|
1443
1489
|
*/
|
|
1444
1490
|
export declare function timeRounds(arms: Readonly<Record<Arm, () => number>>, options: RoundsOptions): Rounds;
|
|
1445
|
-
export { type Arm, type ArmModels, type ArmPair, type Balanced, type Band, type BandKind, type BandOptions, type BudgetLook, type BudgetLooksOptions, type BudgetLooksVerdict, type BudgetMore, type BudgetOptions, type BudgetOutcome, type BudgetResult, type BudgetRound, type BudgetVerdict, type CaseBudget, type CaseGate, type CaseInterval, type CaseLimit, type CaseRatio, type CaseResults, type CaseTail, type CaseTailLimit, type Comparison, type ControlFactors, type ControlOptions, type ControlRead, type ControlRow, type EntryCount, type Gate, type GateCaseOutcome, type GateJobRead, type GateOutcome, type GroupCounts, type GroupFactor, type GuardRead, type JobLimitVerdict, type JobRecords, type JobVerdict, type JointClaim, type JointControl, type JointMeasure, type JointVerdict, type Ladder, type LadderDimension, type LadderOptions, type LadderVerdict, type LimitOnModel, type LimitOptions, type LimitOutcome, type LimitVerdict, type MeasureCheck, type MeasureCheckOptions, type MeasureChecks, type MeasureFinding, type MeasureFindingKind, type MeasureRow, type MeasureRule, type MeasuredFactor, type MedianBudget, type ModelLimits, type ModelRead, type ModelRow, type ModelStatus, type ModelTest, type ModelTestOptions, type NoControl, type NoFactor, type NoiseCheck, type NotSlowerOptions, type NotSlowerRead, type NotSlowerVerdict, type OrderSize, type PairedTime, type PartnerRead, type PoolFacts, type PoolOptions, type PooledJob, type PooledLimitVerdict, type PooledRecords, type PooledVerdict, type Power, type PowerOptions, type QuantileBudget, type RateBudget, type ResultRead, type ResultRow, type ResultRows, type ResultVerdict, type Rounds, type RoundsOptions, type RowRead, type RunPairs, type Rung, type RungBudget, type RungEvidence, type RungRecord, type RungVerdict, type SpreadRead, type TailFalseFails, type TailGainCase, type TailLimit, type TailLimitOptions, type TailLimitVerdict, type TailRuleOptions, type TimeOutcome, type TimeVerdict, type VerdictOptions, type VerdictRule, type VisibleShift, type WinClaim, type WorstBudget, armOrder, caseRatios, checkPairedTime, firstArm, orderSize };
|
|
1491
|
+
export { type Arm, type ArmModels, type ArmPair, type Balanced, type Band, type BandKind, type BandOptions, type BudgetLook, type BudgetLooksOptions, type BudgetLooksVerdict, type BudgetMore, type BudgetOptions, type BudgetOutcome, type BudgetResult, type BudgetRound, type BudgetVerdict, type CaseBudget, type CaseGate, type CaseInterval, type CaseLimit, type CaseRatio, type CaseResults, type CaseTail, type CaseTailLimit, type Comparison, type ControlFactors, type ControlOptions, type ControlRead, type ControlRow, type EntryCount, type Gate, type GateCaseOutcome, type GateJobRead, type GateOutcome, type GroupCounts, type GroupFactor, type GrowthOptions, type GrowthOutcome, type GrowthRound, type GrowthStep, type GrowthVerdict, type GuardRead, type JobLimitVerdict, type JobRecords, type JobVerdict, type JointClaim, type JointControl, type JointMeasure, type JointVerdict, type Ladder, type LadderDimension, type LadderOptions, type LadderVerdict, type LimitOnModel, type LimitOptions, type LimitOutcome, type LimitVerdict, type MeasureCheck, type MeasureCheckOptions, type MeasureChecks, type MeasureFinding, type MeasureFindingKind, type MeasureRow, type MeasureRule, type MeasuredFactor, type MedianBudget, type ModelLimits, type ModelRead, type ModelRow, type ModelStatus, type ModelTest, type ModelTestOptions, type NoControl, type NoFactor, type NoiseCheck, type NotSlowerOptions, type NotSlowerRead, type NotSlowerVerdict, type OrderSize, type PairedTime, type PartnerRead, type PoolFacts, type PoolOptions, type PooledJob, type PooledLimitVerdict, type PooledRecords, type PooledVerdict, type Power, type PowerOptions, type QuantileBudget, type RateBudget, type ResultRead, type ResultRow, type ResultRows, type ResultVerdict, type Rounds, type RoundsOptions, type RowRead, type RunPairs, type Rung, type RungBudget, type RungEvidence, type RungRecord, type RungVerdict, type SpreadRead, type TailFalseFails, type TailGainCase, type TailLimit, type TailLimitOptions, type TailLimitVerdict, type TailRuleOptions, type TimeOutcome, type TimeVerdict, type VerdictOptions, type VerdictRule, type VisibleShift, type WinClaim, type WorstBudget, armOrder, caseRatios, checkPairedTime, firstArm, orderSize };
|
|
1446
1492
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Comparison"],"sources":["../src/budget.ts","../src/verdict.ts","../src/limit.ts","../src/merge.ts","../src/gate.ts","../src/control.ts","../src/ladder.ts","../src/model.ts","../src/tail.ts","../src/measures.ts","../src/power.ts","../src/results.ts","../src/rounds.ts"],"mappings":";;;UAQiB;;WAEN;;WAEA;WACA;;;KAIC;;UAGK;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;;WAEA;;WAEA;WACA;;WAEA;;WAEA;;WAEA;WACA;;WAEA;WACA,SAAS;;WAET;;;UAIM;WACN,SAAS;;WAET;WACA;WACA;WACA;WACA,gBAAgB;;;;;;;;;;;;wBAyDX,cAAc,iBAAiB,eAAe,aAAa,eAAe,SAAS,gBAAgB;;UAyBlG;WACN;WACA;;;;;;qBAOE,uBAAuB;;UAOnB;;WAEN;;WAEA;;WAEA,iBAAiB;;WAEjB;;;UAIM;WACN;WACA;;;UAIM,2BAA2B;;WAEjC;;WAEA,eAAe;;WAEf;;;;;;wBAOK,gBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;wBAoDhC,mBAAmB,iBAAiB,eAAe,aAAa,eAAe,SAAS,qBAAqB;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Comparison"],"sources":["../src/budget.ts","../src/growth.ts","../src/verdict.ts","../src/limit.ts","../src/merge.ts","../src/gate.ts","../src/control.ts","../src/ladder.ts","../src/model.ts","../src/tail.ts","../src/measures.ts","../src/power.ts","../src/results.ts","../src/rounds.ts"],"mappings":";;;UAQiB;;WAEN;;WAEA;WACA;;;KAIC;;UAGK;;WAEN;;WAEA;;WAEA;;;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AAc,eAAe,cAAc,SAAS,sBAAsB;;;;;;;wBAgC1E,SAAS,OAAO,eAAe,iBAAiB,eAAe,mBAAmB;;;;;;;;;;wBAiClF,WAAW,OAAO,eAAe,6BAA6B,eAAe,mBAAmB;;UCrrB/F;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA,UAAU;;;UAIJ;WACN;WACA,UAAU,SAAS,OAAO;;;;;;WAM1B;;;;;;wBAOK,aAAa,SAAS,eAAe;;;;;;;;;;;;;UC7BpC;WACN;;WAEA;;WAEA;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN,eAAe;WACf,eAAe;;;UAIT,mBAAmB;WACzB;;WAEA;;;UAIM;WACN,KAAK;WACL;;;UAIM;;WAEN;;WAEA,gBAAgB;;WAEhB,iBAAiB;;WAEjB,iBAAiB;;WAEjB,gBAAgB;;WAEhB;;;wBAMK,WAAW,mBAAmB;;;;;wBAuC9B,cAAc,kBAAkB,eAAe,MAAM,aAAa;;UCnGjE;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;WACN,SAAS;;WAET;;WAEA;;;;;;;wBAQK,WAAW,MAAM,SAAS,OAAO,qBAAqB,SAAS,gBAAgB"}
|
package/build/index.js
CHANGED
|
@@ -212,6 +212,70 @@ function budgetLooksVerdict(rounds, aa, options) {
|
|
|
212
212
|
function round$3(x) {
|
|
213
213
|
return Math.round(x * 1e4) / 1e4;
|
|
214
214
|
}
|
|
215
|
+
// src/growth.ts
|
|
216
|
+
/**
|
|
217
|
+
* The growth verdict of a cost over sizes: does the cost grow slower than a limit, for each step of size? An example is
|
|
218
|
+
* the claim "the time of one publish grows less than 15 times for each 10 times more subscribers". A cost that grows as
|
|
219
|
+
* n x n grows 100 times for each 10 times, and a linear cost grows 10 times.
|
|
220
|
+
*
|
|
221
|
+
* The verdict reads a ratio inside each job: the cost at the larger size over the cost at the smaller size, on the same
|
|
222
|
+
* runner. So a slow runner changes both sizes, and the ratio keeps its value. The verdict needs no A/A arm.
|
|
223
|
+
*/
|
|
224
|
+
/** This function gives the growth verdict of a cost over its sizes, from the values of one or more jobs. */
|
|
225
|
+
function growthVerdict(rounds, options) {
|
|
226
|
+
const per = options.per ?? 10;
|
|
227
|
+
const level = options.level ?? .95;
|
|
228
|
+
if (!(Number.isFinite(options.maxGrowth) && options.maxGrowth > 1)) throw new RangeError("growthVerdict: maxGrowth is not a finite number more than 1.");
|
|
229
|
+
if (!(Number.isFinite(per) && per > 1)) throw new RangeError("growthVerdict: per is not a finite number more than 1.");
|
|
230
|
+
const byJob = /* @__PURE__ */ new Map();
|
|
231
|
+
for (const round of rounds) {
|
|
232
|
+
if (!(Number.isFinite(round.size) && round.size > 0)) throw new RangeError(`growthVerdict: job ${round.job} has the size ${round.size}, which is not finite and more than 0.`);
|
|
233
|
+
if (!(Number.isFinite(round.value) && round.value > 0)) throw new RangeError(`growthVerdict: job ${round.job} has the value ${round.value} at the size ${round.size}, which is not finite and more than 0.`);
|
|
234
|
+
const sizes = byJob.get(round.job) ?? /* @__PURE__ */ new Map();
|
|
235
|
+
byJob.set(round.job, sizes);
|
|
236
|
+
const values = sizes.get(round.size) ?? [];
|
|
237
|
+
sizes.set(round.size, values);
|
|
238
|
+
values.push(round.value);
|
|
239
|
+
}
|
|
240
|
+
const sizes = [...new Set(rounds.map((round) => round.size))].sort((a, b) => a - b);
|
|
241
|
+
if (sizes.length < 2) throw new RangeError("growthVerdict: the rounds give fewer than 2 sizes.");
|
|
242
|
+
const jobs = [...byJob.keys()].sort();
|
|
243
|
+
const steps = [];
|
|
244
|
+
for (let i = 0; i + 1 < sizes.length; i++) {
|
|
245
|
+
const from = sizes[i];
|
|
246
|
+
const to = sizes[i + 1];
|
|
247
|
+
const growths = [];
|
|
248
|
+
for (const job of jobs) {
|
|
249
|
+
const values = byJob.get(job);
|
|
250
|
+
const small = values.get(from);
|
|
251
|
+
const large = values.get(to);
|
|
252
|
+
if (small === void 0 || large === void 0) continue;
|
|
253
|
+
const exponent = Math.log(median(large) / median(small)) / Math.log(to / from);
|
|
254
|
+
growths.push(Math.pow(per, exponent));
|
|
255
|
+
}
|
|
256
|
+
if (growths.length === 0) throw new RangeError(`growthVerdict: no job gives both the size ${from} and the size ${to}.`);
|
|
257
|
+
const interval = medianInterval(growths, level);
|
|
258
|
+
const middle = median(growths);
|
|
259
|
+
const outcome = interval.high < options.maxGrowth ? "within" : interval.low > options.maxGrowth ? "beyond" : "cannot decide";
|
|
260
|
+
steps.push({
|
|
261
|
+
from,
|
|
262
|
+
to,
|
|
263
|
+
growths,
|
|
264
|
+
median: middle,
|
|
265
|
+
low: interval.low,
|
|
266
|
+
high: interval.high,
|
|
267
|
+
coverage: interval.coverage,
|
|
268
|
+
exponent: Math.log(middle) / Math.log(per),
|
|
269
|
+
outcome
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
outcome: steps.some((step) => step.outcome === "beyond") ? "beyond" : steps.every((step) => step.outcome === "within") ? "within" : "cannot decide",
|
|
274
|
+
maxGrowth: options.maxGrowth,
|
|
275
|
+
per,
|
|
276
|
+
steps
|
|
277
|
+
};
|
|
278
|
+
}
|
|
215
279
|
// src/gate.ts
|
|
216
280
|
/**
|
|
217
281
|
* The gate of a bench: the result that a check of a merge reads. A verdict gives one of the words of `LimitOutcome` for each
|
|
@@ -2478,6 +2542,6 @@ function timeRounds(arms, options) {
|
|
|
2478
2542
|
sink
|
|
2479
2543
|
};
|
|
2480
2544
|
}
|
|
2481
|
-
export { BUDGET_LOOKS, CEILING_ONLY, GATE_LOOKS, LADDER_FORMAT, NARROW_SPREAD_SHARE, UNKNOWN_MODEL, aaBand, aaSpread, armModels, armOrder, armVerdicts, balanceOrders, budgetLookSpend, budgetLooksVerdict, budgetVerdict, caseIntervals, caseRatios, caseTails, checkLadder, checkMeasures, checkPairedTime, controlFactor, firstArm, gateOf, jointClaim, ladderVerdict, limitOnModel, limitVerdict, modelRowText, modelTest, notSlowerVerdict, orderSize, poolRecords, pooledBand, pooledLimitVerdict, pooledVerdict, resultRows, resultVerdict, rungVerdict, tailFalseFails, tailLimitVerdict, timeRounds, timeVerdict, verdictMargin, verdictPower, visibleShift, winClaim };
|
|
2545
|
+
export { BUDGET_LOOKS, CEILING_ONLY, GATE_LOOKS, LADDER_FORMAT, NARROW_SPREAD_SHARE, UNKNOWN_MODEL, aaBand, aaSpread, armModels, armOrder, armVerdicts, balanceOrders, budgetLookSpend, budgetLooksVerdict, budgetVerdict, caseIntervals, caseRatios, caseTails, checkLadder, checkMeasures, checkPairedTime, controlFactor, firstArm, gateOf, growthVerdict, jointClaim, ladderVerdict, limitOnModel, limitVerdict, modelRowText, modelTest, notSlowerVerdict, orderSize, poolRecords, pooledBand, pooledLimitVerdict, pooledVerdict, resultRows, resultVerdict, rungVerdict, tailFalseFails, tailLimitVerdict, timeRounds, timeVerdict, verdictMargin, verdictPower, visibleShift, winClaim };
|
|
2482
2546
|
|
|
2483
2547
|
//# sourceMappingURL=index.js.map
|