@mark1russell7/rigor-bench
The paired-time records of a bench, and the time verdict against an A/A arm. This package is the first part of the shared bench harness of rigor.
npm install @mark1russell7/rigor-bench
The method
- Each round runs the two arms of a pair on one case, one after the other. Arm
a is the baseline, and arm b is the candidate.
- The order turns each round (
firstArm). Thus a warm cache or a slow start does not always help the same arm.
- A run with three or more arms in one child order uses
armOrder. A plain turn of the arms does not turn each pair evenly.
- An A/A pair runs the same code in its two arms. Its ratios show how far apart two equal arms come on the machine.
- The ratio of a case is
b / a over its rounds (caseRatios).
- The default rule
difference gives the bootstrap interval of the candidate median over the A/A median. The verdict compares it with 1.
Give a verdict
import { firstArm, timeVerdict, type PairedTime } from "@mark1russell7/rigor-bench";
const first = firstArm(round, caseIndex); // "a" or "b": run this arm first
const records: PairedTime[] = [{ case: "board-1", round: 0, first: "a", a: 12.1, b: 10.4 }];
const v = timeVerdict(records, aaRecords);
v.outcome; // "faster", "slower", "same" or "cannot decide"
v.reason; // one sentence with the interval and the band
v.comparison; // the cases that gain and drop beyond the band
The functions