38. The statistics of evals

Chapter 30 printed bare 9/9 and structured 9/9 and left the intervals to this chapter. The figure draws them to scale: four 95 percent intervals for the same nine passes of nine, on the axis of the true pass rate. One of them is a point.

Why this layer exists

A pass count is a number. What the reader needs is what the count supports: how far the true rate could be from c/nc/n, whether two columns differ by more than their noise, and what “more than the noise” means when the ten trials of one task are not ten independent draws. Chapter 37 built the harness and captured trials by the hundred; this chapter is the procedure that reads them.

The question is concrete. Chapter 1 promised that “which model carries the capstone’s main loop is decided by the Part VI eval matrix”, and that “if glm-5.3-flash wins on the tasks you care about by more than the noise, the capstone uses it”. The matrix is captured, nine columns by twelve tasks. The rule that turns it into a decision is written down before the table is looked at, the table is read once, and the verdict is whatever the rule prints.

Evan Miller’s Adding Error Bars to Evals (2024) is the paper that says an evaluation is an experiment and should be reported like one, with standard errors, and its five recommendations are this chapter’s spine. His list (§1), the third and fifth items quoted: computing standard errors of the mean using the Central Limit Theorem; computing clustered standard errors when questions are drawn in related groups; “reducing variance by resampling answers and by analyzing next-token probabilities”; conducting statistical inference on the question-level paired differences when two models are compared; and “using power analysis to determine whether an eval (or a random subsample) is capable of testing a hypothesis of interest”. The chapter follows four of the five in full and the third in part: it resamples answers (ten trials per task on the fleet, five on z.ai) and does not analyse next-token probabilities. Its power analysis is the resolution paragraph of the decision rule, computed from the rule and not from the data. It departs from Miller in one place. He regards bootstrapping “as unnecessary unless a complicated sampling scheme or estimator is being used”. For a mean of Bernoullis this chapter agrees. It uses the bootstrap for a paired difference of per-task rates over twelve tasks, which is not a mean of Bernoullis and has n=12n = 12.

Mechanism

Each item cites what chapters 4, 19, 20, 29 and 30 already proved and derives the rest. Nothing earlier in the book has the Wilson interval, the pass@k estimator, the clustered variance or the large-sample variance of κ\kappa, so those are derived here once, and chapter 39 cites this chapter for them.

A trial is a Bernoulli draw

A trial is scored 0 or 1: Xi∈{0,1}X_i \in \{0, 1\} with EXi=p\mathbb{E}X_i = p. Its square is itself, so EXi2=p\mathbb{E}X_i^2 = p, and chapter 4’s identity VarX=EX2−(EX)2\mathrm{Var}X = \mathbb{E}X^2 - (\mathbb{E}X)^2 gives

VarXi=p−p2=p(1−p). \mathrm{Var}X_i = p - p^2 = p(1-p).

The pass rate is p^=1n∑i=1nXi\hat p = \frac{1}{n}\sum_{i=1}^n X_i. By linearity Ep^=p\mathbb{E}\hat p = p. When the XiX_i are independent, chapter 4’s sum formula (variances of independent terms add; scaling by 1/n1/n scales the variance by 1/n21/n^2) gives

Varp^=1n2∑i=1nVarXi=p(1−p)n. \mathrm{Var}\,\hat p = \frac{1}{n^2}\sum_{i=1}^n \mathrm{Var}X_i = \frac{p(1-p)}{n}.

The standard error is p(1−p)/n\sqrt{p(1-p)/n}. Since p(1−p)≤1/4p(1-p) \le 1/4 it is at most 1/(2n)1/(2\sqrt n): 0.1670.167 at n=9n = 9, 0.1580.158 at n=10n = 10, and 0.0460.046 at n=120n = 120, if 120 trials were independent, which the section on dependence says they are not. The plug-in estimate p^(1−p^)/n\sqrt{\hat p(1-\hat p)/n} is Miller’s equation 2. It is 0 at p^∈{0,1}\hat p \in \{0, 1\} although the uncertainty is not: chapter 30’s 9/9 has a plug-in standard error of 0, and a true rate that could be two in three.

Two conventions, stated once. An error trial (the run or the grader failed) is a trial that ran and did not pass: it is in nn and not in cc. A skipped trial sent nothing and is in neither. These are chapter 37’s statuses, and every count in this chapter follows them.

Three intervals for one proportion

Wald. By the central limit theorem (chapter 20 used the normal approximation for a bin’s accuracy), (p^−p)/p(1−p)/n(\hat p - p)/\sqrt{p(1-p)/n} is approximately standard normal. Replacing pp by p^\hat p in the denominator gives p^±zp^(1−p^)/n\hat p \pm z\sqrt{\hat p(1-\hat p)/n}, with z=1.96z = 1.96 at 95 percent. (Z inverts Φ(z)=(1+erf(z/2))/2\Phi(z) = (1 + \mathrm{erf}(z/\sqrt 2))/2 by bisection and returns 1.9599641.959964.) The interval collapses to a point at c=0c = 0 and c=nc = n.

Wilson keeps pp in the denominator. The interval is the set of pp with ∣p^−p∣≤zp(1−p)/n|\hat p - p| \le z\sqrt{p(1-p)/n}. Squaring both sides gives (p^−p)2≤z2np(1−p)(\hat p - p)^2 \le \frac{z^2}{n}p(1-p). Expanding, p^2−2p^p+p2≤z2np−z2np2\hat p^2 - 2\hat p p + p^2 \le \frac{z^2}{n}p - \frac{z^2}{n}p^2, and collecting in pp,

(1+z2n)p2−(2p^+z2n)p+p^2≤0. \Big(1 + \frac{z^2}{n}\Big)p^2 - \Big(2\hat p + \frac{z^2}{n}\Big)p + \hat p^2 \le 0.

The leading coefficient is positive, so the set lies between the roots

p=(2p^+z2/n)±D2(1+z2/n), p = \frac{(2\hat p + z^2/n) \pm \sqrt{D}}{2(1 + z^2/n)},

with discriminant

D=(2p^+z2n)2−4(1+z2n)p^2 D = \Big(2\hat p + \frac{z^2}{n}\Big)^2 - 4\Big(1 + \frac{z^2}{n}\Big)\hat p^2

=4p^2+4p^z2n+z4n2−4p^2−4p^2z2n = 4\hat p^2 + \frac{4\hat p z^2}{n} + \frac{z^4}{n^2} - 4\hat p^2 - \frac{4\hat p^2 z^2}{n}

=4z2n(p^(1−p^)+z24n). = \frac{4z^2}{n}\Big(\hat p(1-\hat p) + \frac{z^2}{4n}\Big).

So D=2zp^(1−p^)/n+z2/4n2\sqrt D = 2z\sqrt{\hat p(1-\hat p)/n + z^2/4n^2}, and dividing numerator and denominator by 2 the centre is

p^+z2/2n1+z2/n \frac{\hat p + z^2/2n}{1 + z^2/n}

and the half-width

zp^(1−p^)/n+z2/4n21+z2/n. \frac{z\sqrt{\hat p(1-\hat p)/n + z^2/4n^2}}{1 + z^2/n}.

At c=nc = n the centre is

1+z2/2n1+z2/n \frac{1 + z^2/2n}{1 + z^2/n}

and the half-width

z2/2n1+z2/n, \frac{z^2/2n}{1 + z^2/n},

so the upper bound is exactly 1 and the lower bound is

11+z2/n. \frac{1}{1 + z^2/n}.

At n=9n = 9, z2=3.8415z^2 = 3.8415 and 1/1.4268=0.70091/1.4268 = 0.7009.

Clopper–Pearson is exact: the interval is every pp that neither one-sided binomial test rejects at α/2\alpha/2. So plop_{\mathrm{lo}} solves P(X≥c∣p)=α/2P(X \ge c \mid p) = \alpha/2, phip_{\mathrm{hi}} solves P(X≤c∣p)=α/2P(X \le c \mid p) = \alpha/2, and the bounds are 0 and 1 at the ends. The tail P(X≥c∣p)P(X \ge c \mid p) is non-decreasing in pp: draw UiU_i uniform and set X(p)=#{i:Ui≤p}X(p) = \#\{i : U_i \le p\}, so that raising pp never lowers any indicator. Bisection therefore finds each root. BinomTail sums (nk)pk(1−p)n−k\binom{n}{k}p^k(1-p)^{n-k} with log(nk)=lgamma(n+1)−lgamma(k+1)−lgamma(n−k+1)\log\binom{n}{k} = \mathrm{lgamma}(n+1) - \mathrm{lgamma}(k+1) - \mathrm{lgamma}(n-k+1). At c=nc = n the tail is P(X=n)=pnP(X = n) = p^n, so plo=(α/2)1/np_{\mathrm{lo}} = (\alpha/2)^{1/n}, and 0.0251/9=0.66370.025^{1/9} = 0.6637. At c=0c = 0, P(X=0)=(1−p)nP(X = 0) = (1-p)^n gives phi=1−(α/2)1/np_{\mathrm{hi}} = 1 - (\alpha/2)^{1/n}.

Worked on chapter 30’s 9/9, the figure: Wald [1,1][1, 1], Wilson [0.7009,1][0.7009, 1], Clopper–Pearson [0.6637,1][0.6637, 1]. “The structured prompt passed 9 of 9” is consistent at 95 percent with a true rate as low as 0.66 by the exact interval and 0.70 by the score interval. Two in three lies inside the first and just outside the second, and that is the precise statement. Two variants at 9/9 and 9/9 have intervals that coincide: no evidence of a difference, and none of equivalence. The other counts this chapter prints: 8/9 gives Wilson [0.5650,0.9801][0.5650, 0.9801] and Clopper–Pearson [0.5175,0.9972][0.5175, 0.9972]; 6/9 gives [0.3542,0.8794][0.3542, 0.8794] and [0.2993,0.9251][0.2993, 0.9251]; 27/27 gives Clopper–Pearson lower 0.87230.8723 and Wilson [0.8754,1][0.8754, 1]; 18/20 gives [0.6990,0.9721][0.6990, 0.9721] and [0.6830,0.9877][0.6830, 0.9877] (all from TestIntervals, talos).

Four 95 percent intervals for nine passes of nine, to scale A horizontal axis for the true pass rate runs from 0 on the left to 1 on the right. Four rows above it show what each method says about nine passes of nine. The Wald interval is a single point at 1. The Wilson score interval is a bar from 0.7009 to 1. The Clopper–Pearson exact interval is a bar from 0.6637 to 1. The percentile bootstrap over two thousand replicates is a single point at 1, because every replicate of an all-pass sample is all passes. A dashed vertical line at two thirds marks a true rate the exact interval admits and the score interval does not. Nine passes of nine 0 0.25 0.5 0.75 1 true pass rate two in three Wald [1, 1], a point Wilson [0.7009, 1] Clopper–Pearson [0.6637, 1] bootstrap, 2,000 replicates [1, 1], a point again

Which to print. Wilson by default: it is never a point, and at every cc for n=20n = 20 it lies inside the exact interval (TestIntervals). Clopper–Pearson goes beside it at the boundaries, where the exact guarantee is worth having. Brown, Cai and DasGupta (2001) compare the three intervals’ coverage; this chapter makes no recommendation in their name, since their text was not read while it was written. The Wald collapse at 9/9 is shown rather than argued from authority.

pass@k

Define pass@k\mathrm{pass@}k as the probability that at least one of kk independent attempts passes: 1−(1−p)k1 - (1-p)^k. The plug-in 1−(1−p^)k1 - (1-\hat p)^k is biased. The function f(x)=(1−x)kf(x) = (1-x)^k has f′′(x)=k(k−1)(1−x)k−2≥0f''(x) = k(k-1)(1-x)^{k-2} \ge 0 on [0,1][0, 1], so it is convex, and Jensen’s inequality (chapter 4) gives E(1−p^)k≥(1−Ep^)k=(1−p)k\mathbb{E}(1-\hat p)^k \ge (1 - \mathbb{E}\hat p)^k = (1-p)^k. Hence

E[1−(1−p^)k]≤1−(1−p)k: \mathbb{E}\big[1 - (1-\hat p)^k\big] \le 1 - (1-p)^k:

the plug-in understates. Chen et al. (2021, Appendix A and Figure 13) say it “underestimates the true value by a considerable margin”. At n=10n = 10, c=3c = 3, k=5k = 5 the plug-in is 1−0.75=0.83191 - 0.7^5 = 0.8319 and the unbiased estimator below is 0.91670.9167 (stats, talos).

The unbiased estimator, by counting. Among nn trials with cc passes there are (nk)\binom{n}{k} subsets of size kk, and (n−ck)\binom{n-c}{k} of them hold no pass. A uniformly random kk-subset therefore misses every pass with probability (n−ck)/(nk)\binom{n-c}{k}/\binom{n}{k}, so the estimator, written π^k\hat\pi_k, is

π^k=1−(n−ck)(nk) \hat\pi_k = 1 - \frac{\binom{n-c}{k}}{\binom{n}{k}}

(Chen et al., equation 1).

The product form. Write both coefficients as factorials:

(n−c)!k!(n−c−k)!⋅k!(n−k)!n!=(n−c)!n!⋅(n−k)!(n−c−k)!. \frac{(n-c)!}{k!\,(n-c-k)!}\cdot\frac{k!\,(n-k)!}{n!} = \frac{(n-c)!}{n!}\cdot\frac{(n-k)!}{(n-c-k)!}.

The first factor is 1/∏i=n−c+1ni1/\prod_{i=n-c+1}^{n} i. The second is ∏j=n−c−k+1n−kj\prod_{j=n-c-k+1}^{n-k} j, which becomes ∏i=n−c+1n(i−k)\prod_{i=n-c+1}^{n}(i-k) on substituting j=i−kj = i - k. The ratio is

∏i=n−c+1ni−ki=∏i=n−c+1n(1−ki), \prod_{i=n-c+1}^{n}\frac{i-k}{i} = \prod_{i=n-c+1}^{n}\Big(1 - \frac{k}{i}\Big),

Chen et al.’s Figure 3, “numerically stable” because no large factorial appears. There are cc factors, each positive when n−c≥kn - c \ge k (then i≥n−c+1>ki \ge n - c + 1 > k). When n−c<kn - c < k every kk-subset holds a pass and the estimate is 1; when c=0c = 0 the product is empty and the estimate is 0; k>nk > n is refused.

Unbiasedness. Condition on the nn outcomes. The estimator is the conditional probability that a uniformly random kk-subset of them holds a pass. The subset is chosen independently of the outcomes, so its kk members are themselves independent Bernoulli(pp) draws, and its unconditional probability of holding a pass is 1−(1−p)k1 - (1-p)^k. The step from conditional to unconditional is the tower rule, which chapter 4 does not state: for any X,YX, Y,

E[E[Y∣X]]=∑xp(x)∑yyp(y∣x)=∑x,yyp(x,y)=EY, \mathbb{E}\big[\mathbb{E}[Y \mid X]\big] = \sum_x p(x)\sum_y y\,p(y \mid x) = \sum_{x,y} y\,p(x, y) = \mathbb{E}Y,

from chapter 4’s definition of the conditional distribution. So E[π^k]=1−(1−p)k\mathbb{E}[\hat\pi_k] = 1 - (1-p)^k. At k=1k = 1 the estimator is c/nc/n.

What it measures: the chance that a verifier able to pick the passing attempt (Chen et al.’s unit tests; chapter 37’s oracles) gets one in kk tries. For a loop with no verifier, the user sees pass@1. TestPassAtK checks the product against the math/big ratio for every (n,c,k)(n, c, k) with n≤12n \le 12.

The bootstrap

The plug-in principle: the empirical distribution F^\hat F (mass 1/n1/n on each observation) stands in for the unknown FF. A replicate is nn draws with replacement from the sample; a statistic of a replicate is the statistic under F^\hat F; BB replicates approximate its sampling distribution (Efron 1979; DiCiccio and Efron 1996 catalogue the intervals). The percentile interval is [qα/2,q1−α/2][q_{\alpha/2}, q_{1-\alpha/2}] of the replicates. This book’s quantile is nearest-rank, index ⌈qB⌉−1\lceil qB \rceil - 1 of the sorted replicates: with B=2000B = 2000, indices 49 and 1949 (Quantile). That is a convention, stated and not derived.

The basic interval approximates the law of the pivot θ^−θ\hat\theta - \theta by that of θ^∗−θ^\hat\theta^* - \hat\theta. Then P(qα/2−θ^≤θ^−θ≤q1−α/2−θ^)≈1−αP(q_{\alpha/2} - \hat\theta \le \hat\theta - \theta \le q_{1-\alpha/2} - \hat\theta) \approx 1 - \alpha, and solving for θ\theta gives [2θ^−q1−α/2, 2θ^−qα/2][2\hat\theta - q_{1-\alpha/2},\ 2\hat\theta - q_{\alpha/2}].

When it fails. At 9/9 every replicate is 9/9 and the percentile interval is [1,1][1, 1] (2,000 replicates, seed 1, talos): F^\hat F puts no mass on a failure, so no resample can contain one. The bootstrap samples the sample, and a sample of nine that saw no failure cannot say how rare failures are. That is why the exact and score intervals come first. At 8/9 the replicates live on the lattice {k/9}\{k/9\} (seed 1: 3 replicates at 4/9, 19 at 5/9, 118 at 6/9, 404 at 7/9, 774 at 8/9, 682 at 9/9) and the percentile interval is [0.6667,1][0.6667, 1], narrower than Clopper–Pearson’s [0.5175,0.9972][0.5175, 0.9972]: at small nn the percentile bootstrap undercovers. The basic interval on 8/9 is [0.7778,1.1111][0.7778, 1.1111]. It leaves [0,1][0, 1] because the pivot’s symmetry fails for a bounded statistic near its boundary.

Chapter 20’s bootstrap band on a reliability bin (200 resamples, 2.5th to 97.5th percentiles) is the percentile interval, and that chapter promised this one would say what it guarantees: the sampling distribution under F^\hat F, and nothing about an event the sample did not see. BCa is named and not derived; its acceleration needs a jackknife this chapter does not use, and exercise (h) points at DiCiccio and Efron.

Every resampler is seeded (math/rand/v2’s PCG, by Seed), so one machine reproduces its own intervals. The chapter claims nothing across machines beyond what the walkthrough reports.

Dependence: clusters and pairs

Ten trials of one task share the task, so they are not independent draws from “the tasks the reader cares about” (Miller’s recommendation 2). Write the pass indicators as XicX_{ic}, trial ii of cluster (task) cc, with nn in all. Chapter 4’s sum formula, with the cross terms kept, gives

VarX¯=1n2[∑c∑i∈cVarXic+∑c∑i≠j∈cCov(Xic,Xjc)], \mathrm{Var}\bar X = \frac{1}{n^2}\Big[\sum_c\sum_{i \in c}\mathrm{Var}X_{ic} + \sum_c\sum_{i \ne j \in c}\mathrm{Cov}(X_{ic}, X_{jc})\Big],

the covariances across clusters being zero when clusters are drawn independently. That is an assumption; the twelve tasks are the author’s, and the chapter treats them as a sample of “tasks like these” only for the sake of the interval. Estimate the first bracket by s2/ns^2/n (the n−1n-1 sample variance; chapter 20 proves the Bernoulli case, E[a¯(1−a¯)/(n−1)]=Vara¯\mathbb{E}[\bar a(1-\bar a)/(n-1)] = \mathrm{Var}\,\bar a, and for 0/1 indicators s2/n=p^(1−p^)/(n−1)s^2/n = \hat p(1-\hat p)/(n-1)) and each covariance by the product of residuals ric=xic−x¯r_{ic} = x_{ic} - \bar x:

SE^clustered2=s2n+1n2∑c∑i≠j∈cricrjc. \hat{\mathrm{SE}}^2_{\mathrm{clustered}} = \frac{s^2}{n} + \frac{1}{n^2}\sum_c\sum_{i \ne j \in c} r_{ic}r_{jc}.

This is Miller’s equation 4, which he derives in his Appendix A as the sandwich (X′X)−1∑cXc′ΩcXc(X′X)−1(X'X)^{-1}\sum_c X_c'\Omega_c X_c(X'X)^{-1} with X=1nX = \mathbf 1_n. Within a cluster, ∑i≠jrirj=(∑iri)2−∑iri2\sum_{i \ne j} r_ir_j = (\sum_i r_i)^2 - \sum_i r_i^2, which is how ClusteredSE computes it. With one trial per cluster the cross terms vanish and the estimate is the ordinary standard error (TestClusteredSE).

With perfectly correlated trials inside each cluster it approaches the standard error of the cluster means. Twelve tasks of ten, six all-pass and six all-fail, give a naive 0.04580.0458 and a clustered 0.14440.1444, a ratio of 3.153.15 (Miller’s Table 4 says “over 3X”). The standard error of the twelve cluster means is 0.15080.1508 with C−1C - 1 in the divisor, so “approaches” is right and “equals” would not be. The cluster bootstrap resamples tasks, not trials, and takes the mean over every trial of the drawn tasks (Clustered): the same twelve tasks give [0.2500,0.7500][0.2500, 0.7500] at 95 percent, seed 1.

The clustered error is not a floor at the naive one. The cross terms are negative when the cluster means vary less than independent trials would make them. Twelve tasks each at exactly 8/10 give a clustered 0.00330.0033 against a naive 0.03670.0367: every task has the same rate, the estimate is of the variance of the mean as a function of the tasks drawn, and a column whose tasks all share a rate has less of that variance than its trial count suggests. ClusteredSE clamps a negative total at 0 rather than returning NaN. The matrix has such a column, in the walkthrough.

Pairing. Two candidates on the same tasks are compared on per-task differences dt=p^A,t−p^B,td_t = \hat p_{A,t} - \hat p_{B,t}. Chapter 4’s sum formula with Y→−YY \to -Y gives Var(X−Y)=VarX+VarY−2Cov(X,Y)\mathrm{Var}(X - Y) = \mathrm{Var}X + \mathrm{Var}Y - 2\mathrm{Cov}(X, Y), so

Vardt=Varp^A,t+Varp^B,t−2Cov(p^A,t,p^B,t), \mathrm{Var}\,d_t = \mathrm{Var}\hat p_{A,t} + \mathrm{Var}\hat p_{B,t} - 2\mathrm{Cov}(\hat p_{A,t}, \hat p_{B,t}),

so pairing helps exactly when the covariance is positive: hard tasks are hard for both (Miller §4.2, “a ‘free’ reduction in estimator variance”). It is invalid when the index does not mean the same thing on both sides: a different task set, or a task one side skipped. compare drops any task with no non-skipped trial on either side, names it, and prints how many. With no shared task it prints a warning and the two unpaired counts with no interval (TestCompareDrops).

McNemar’s exact test on discordant pairs. Let bb be the pairs that passed under A and failed under B, and cc the reverse. Under H0H_0 each discordant pair is a fair coin, so b∣b+c∼Binomial(b+c,1/2)b \mid b + c \sim \mathrm{Binomial}(b + c, 1/2), and the two-sided pp is 2P(X≤min(b,c))2\,P(X \le \min(b, c)), capped at 1, and 1 when b=cb = c (McNemar 1947). For (b,c)=(8,2)(b, c) = (8, 2) it is 0.10940.1094; for (5,0)(5, 0), 0.06250.0625.

Its scope here needs care. A pair must be the same unit. At trial level the unit is a (task, rep) index, and compare pools those pairs over every task the two candidates share. With a shared seed on a Local provider (chapter 37 sends seed + rep), two candidates’ rep rr share a seed but not a sample: they send different requests (another model, or another effort field), so one seed drives different distributions. Nor does a seed make even one candidate repeat itself. Chapter 19’s batch caveat: “The functions are the same; the arithmetic is not.” BLAS sums in an order that depends on the batch, so a seed fixes the sampler’s draws and not the probabilities they are applied to. The pooled count is a description, and the pairs in it are clustered by task, so its pp overstates the evidence. The headline comparison is the paired bootstrap over tasks (Miller’s recommendation 4): resample the twelve task indices with replacement, take the mean of dtd_t over the resample, 2,000 replicates, percentile interval (Paired).

Effort as a column

Chapter 29 showed the llama-server knobs, reasoning_budget_tokens per request and reasoning_effort: none, which the 9b’s template honours, and that z.ai’s GLM-5.3-FLASH thinking cannot be disabled. The z.ai levels are from z.ai’s Deep Thinking page (docs.z.ai/guides/capabilities/thinking): for GLM-5.3 and GLM-5.3-FLASH reasoning_effort accepts max (the default), high and low. The matrix’s columns are <provider>@<effort label>, and the labels are names, not a shared scale: budget:64 is a sampler-enforced token cap, none is a template switch, low is a vendor level. So efforts are compared within a provider, paired over tasks, and “low on z.ai equals a 64-token budget” is never written.

The cost side is Usage.Completion; Usage.Reasoning where the provider reports it; and Seconds per trial, with a mean and standard error per column (matrix’s cost lines). llama-server at the commit chapter 29 pinned does not report reasoning tokens, so the fleet columns read reasoning=0.0. That is a missing field, not a measurement of zero.

The decision rule, pre-registered

Chapter 1’s sentence is the question. The rule below is the answer’s form, and aec-stats decide prints exactly this text before it prints any number (the walkthrough shows the whole output; the text is pasted from the program’s output and the ch38-decide listing carries the same string):

Rule (pre-registered before the capture): the columns are zai@max
(cloud) and straylight-35b@default (local). For each task t of the suite,
d_t = p_cloud,t - p_local,t, the difference of pass rates over the task's
trials in each column (an error trial counts as a failure). The statistic
is the mean of d_t over the suite's tasks; its 95% interval is the
percentile interval of the paired bootstrap over tasks, B = 2000, seed 1,
nearest-rank quantiles. Verdict: cloud when the interval's lower bound is
above zero; otherwise local. No verdict when every cloud trial is skipped
(there is no cloud side). No verdict when the trials do not cover the suite
exactly: a suite task with no trial in either column, a task in the file
that the suite does not name, a cell of either column that holds a skipped
trial, or cells of one column with different numbers of trials. The rule
was registered on every trial of every task and is not run on fewer. No
verdict for any other columns, B or seed.

The rule text reached its final form in commit 555d302, made at 2026-10-04T23:21:41-07:00 (06:21:41Z), seven minutes before the fleet run began at 06:28:45Z. Two columns, named before the capture. zai@max is z.ai’s documented default effort; straylight-35b@default is spec §3’s default main-loop model at its server’s own setting. Every other paired difference in the matrix (efforts within a provider, the 9b, trinity-mini if it is ever loaded) is printed and decides nothing. Nothing is dropped: decide either runs on every task or refuses, and compare, which describes any pair, is where a task missing on one side is dropped and counted.

Three refusals, not verdicts. If every cloud trial is skipped, the rule has no cloud side. If the trials do not cover the suite exactly (a task with no trial, a task the suite does not name, a skipped trial in either column, or a short cell), decide lists the cells and gives no verdict, because the rule was registered on every trial of every task and a rule run on fewer is a different rule. If anything other than the two registered columns, B=2000B = 2000 and seed 1 is asked for, it prints the rule and refuses: exploration is compare’s job. An error trial ran and is a failure in nn, as the rule’s first sentence says. Each refusal prints what it can and exits 4. A verdict, cloud or local, exits 0; a usage error exits 2 and any other failure 1 (exitCode, cmd/aec-stats/main.go).

What the rule can resolve. The lower bound exceeds zero only if fewer than 50 of the 2,000 replicates have a mean d≤0d \le 0. Suppose the cloud leads on kk tasks and ties the rest. A replicate’s mean is 0 exactly when none of the kk tasks is drawn, with probability ((12−k)/12)12((12 - k)/12)^{12}: 0.3520.352, 0.1120.112, 0.03170.0317, 0.00770.0077 for k=1,2,3,4k = 1, 2, 3, 4. The lower bound is above zero only once that probability falls below 0.0250.025, so the rule almost always needs the cloud ahead on at least four tasks of twelve with no reversal (at k=3k = 3 the expected number of zero-mean replicates is 6363 of 2,000, above the 49 the lower bound tolerates, and a seeded run gets under it only by sampling luck). A cloud lead on one or two tasks cannot be told from a tie by this rule, whatever its size on those tasks, and “the interval does not exclude zero” must not be read as “no difference”. It reads: this suite cannot see a difference this concentrated.

A control and an unselected set

One paper on a neighbouring question shows both failure modes in a single study, and the chapter uses it as a worked example, with its scope stated. Zhang et al., Guardrails Beat Guidance (2026, arXiv 2604.11088v2), measure how rule files (CLAUDE.md and its relatives) change a coding agent’s pass rate. It is one agent (Claude Code), one model (Claude Opus 4.6 through Bedrock) and one benchmark (SWE-bench Verified) (§5, “Scope”), and the authors say to read the findings as scoped to that. Nothing below transfers to this book’s suite; it shows what a measured gain needs.

A placebo arm. Their Experiment 1 (§6.1) compares a no-rule baseline with seven rule conditions on 58 tasks, one of them random rules drawn from community files. In their words: “Every rule condition outperforms the 50.0% no-rule baseline by 6.9–13.8pp (Figure 1a, Table 2), yet no condition is significantly different from any other (Cochran’s Q = 4.70, p = 0.697)”, and “random rules tie with curated rules at 63.8%”. The gain is real in direction and almost content-independent. Had the study compared curated rules against the baseline alone, the 13.8 points would have read as the curation’s effect. The control arm is what shows that most of it is the presence of rules. They are candid about the statistics: “The closest pairwise contrast is random vs. baseline (McNemar p = 0.077; 12 tasks helped, 4 hurt)”, and “No individual McNemar comparison reaches p < 0.05 at n = 58; the headline rests on direction, not magnitude.” (Check the first: b=12b = 12, c=4c = 4 gives 2P(X≤4∣16,12)=2⋅2517/65536=0.07682\,P(X \le 4 \mid 16, \tfrac12) = 2 \cdot 2517/65536 = 0.0768.)

Selection on discrimination. The 58 tasks are not a sample of SWE-bench Verified. §5 (“Discriminative task selection”): “Pilot runs confirmed that 47% of tasks are always solved and 27% never solved regardless of rules, contributing no statistical signal. We screen all 500 tasks with three baseline repetitions each (1,500 screening runs) and retain 58 discriminative tasks (those solved 1 or 2 out of 3 times, i.e., 30–70% baseline pass rate), where rules have room to help or hurt.” §7 (“Selection bias”) states the consequence: “By selecting discriminative tasks (30–70% baseline pass rate), we enrich for tasks where rules can produce a measurable effect.” A gain of 13.8 points on that subset is not a gain on the benchmark, where in the authors’ pilot 74 percent of tasks (47 percent always solved, 27 percent never solved) did not move. Their screen selects on baseline runs, not on the outcome of the compared arms, so it does not manufacture a difference between arms; it does set the baseline. A task kept because it passed once or twice in three noisy runs is expected to regress toward its true rate on the next run, and the paper’s Experiment 2 baseline is 60.3%60.3\% against Experiment 1’s 50.0%50.0\% (§7, “Statistical power and baseline variance”), which the authors attribute in part to “the run-to-run stochasticity of single-trajectory agent evaluation”. The published numbers cannot separate that from regression; this paragraph’s reading is the chapter’s, not the paper’s.

Selecting after the fact, on the outcome itself, is worse, and the matrix can show it. In the comparison of dixie-9b@default with dixie-9b@none below, four tasks differ (dt=+0.9,+0.1,+0.1,+0.9d_t = +0.9, +0.1, +0.1, +0.9) and eight tie. The mean over all twelve is +0.1667+0.1667. Keep only the four where the columns differ and the mean is (0.9+0.1+0.1+0.9)/4=0.5(0.9 + 0.1 + 0.1 + 0.9)/4 = 0.5, three times larger, from the same trials. The rule above is fixed on all twelve tasks for this reason, and the five tasks that every filled candidate passes in every trial stay in it.

Agreement between two raters

This is the last function this chapter adds to the leaf package (chapter 49 adds a quantile interval); chapter 39 uses it on its judge, its labels and the programmatic truth, and cites this derivation. Two raters label nn items with kk labels. Let pijp_{ij} be the share labelled ii by A and jj by B, with marginals pi⋅p_{i\cdot} and p⋅jp_{\cdot j}. Observed agreement is po=∑ipiip_o = \sum_i p_{ii}. Chance agreement is pe=∑ipi⋅p⋅ip_e = \sum_i p_{i\cdot}p_{\cdot i}, the agreement two independent raters with those marginals would have (chapter 4’s product rule for independent events). Cohen’s

κ=po−pe1−pe \kappa = \frac{p_o - p_e}{1 - p_e}

(Cohen 1960) is the agreement beyond chance as a share of the agreement available beyond chance: 1 is perfect, 0 is chance level, negative is below chance, and it is undefined at pe=1p_e = 1 (both raters always say one thing). It depends on the marginals. Two raters who both pass 95 percent of items have pe=0.952+0.052=0.905p_e = 0.95^2 + 0.05^2 = 0.905, so po=0.96p_o = 0.96 is only κ=0.579\kappa = 0.579, which is why pop_o is printed beside it.

The large-sample standard error. Fleiss, Cohen and Everitt (1969) are the source of the result; it is derived here because the paper was not read. Write κ^=g(p^)\hat\kappa = g(\hat{\mathbf p}) with p^\hat{\mathbf p} the multinomial cell proportions: p^ij=1n∑m1[item m is in cell ij]\hat p_{ij} = \frac{1}{n}\sum_m \mathbb{1}[\text{item } m \text{ is in cell } ij]. Then Ep^ij=pij\mathbb{E}\hat p_{ij} = p_{ij}. For two cells, E[1ij1kl]\mathbb{E}[\mathbb{1}_{ij}\mathbb{1}_{kl}] is pijp_{ij} if they are the same cell and 0 if they are disjoint (an item is in one cell), so chapter 4’s covariance identity gives, for one item, Cov(1ij,1kl)=pij1[ij=kl]−pijpkl\mathrm{Cov}(\mathbb{1}_{ij}, \mathbb{1}_{kl}) = p_{ij}\,\mathbb{1}[ij = kl] - p_{ij}p_{kl}. Items are independent, so the covariances of the means divide by nn:

Cov(p^ij,p^kl)=pij1[ij=kl]−pijpkln. \mathrm{Cov}(\hat p_{ij}, \hat p_{kl}) = \frac{p_{ij}\,\mathbb{1}[ij = kl] - p_{ij}p_{kl}}{n}.

The delta method is the first-order Taylor expansion κ^−κ≈∑ijgij(p^ij−pij)\hat\kappa - \kappa \approx \sum_{ij} g_{ij}(\hat p_{ij} - p_{ij}), with gij=∂κ/∂pijg_{ij} = \partial\kappa/\partial p_{ij}. Its variance, on substituting the covariance and collecting, is

1n[∑ijpijgij2−(∑ijpijgij)2]. \frac{1}{n}\Big[\sum_{ij}p_{ij}g_{ij}^2 - \Big(\sum_{ij}p_{ij}g_{ij}\Big)^2\Big].

Differentiate κ=(po−pe)/(1−pe)\kappa = (p_o - p_e)/(1 - p_e) by the quotient rule. In pop_o it is linear, ∂κ/∂po=1/(1−pe)\partial\kappa/\partial p_o = 1/(1 - p_e). In pep_e the numerator and the denominator both have derivative −1-1, so ∂κ∂pe=−(1−pe)+(po−pe)(1−pe)2=−(1−po)(1−pe)2\frac{\partial\kappa}{\partial p_e} = \frac{-(1 - p_e) + (p_o - p_e)}{(1 - p_e)^2} = \frac{-(1 - p_o)}{(1 - p_e)^2}, and

dκ=dpo(1−pe)−dpe(1−po)(1−pe)2. d\kappa = \frac{dp_o\,(1 - p_e) - dp_e\,(1 - p_o)}{(1 - p_e)^2}.

Now ∂po/∂pij=1[i=j]\partial p_o/\partial p_{ij} = \mathbb{1}[i = j], and ∂pe/∂pij=p⋅i+pj⋅\partial p_e/\partial p_{ij} = p_{\cdot i} + p_{j\cdot} (the cell enters pi⋅p⋅ip_{i\cdot}p_{\cdot i} through pi⋅p_{i\cdot} and pj⋅p⋅jp_{j\cdot}p_{\cdot j} through p⋅jp_{\cdot j}). So

gij=1[i=j](1−pe)−(1−po)(p⋅i+pj⋅)(1−pe)2. g_{ij} = \frac{\mathbb{1}[i = j](1 - p_e) - (1 - p_o)(p_{\cdot i} + p_{j\cdot})}{(1 - p_e)^2}.

The mean term: using ∑ijpijp⋅i=∑ipi⋅p⋅i=pe\sum_{ij}p_{ij}p_{\cdot i} = \sum_i p_{i\cdot}p_{\cdot i} = p_e and likewise for pj⋅p_{j\cdot},

∑ijpijgij=po(1−pe)−2pe(1−po)(1−pe)2=po+pope−2pe(1−pe)2. \sum_{ij}p_{ij}g_{ij} = \frac{p_o(1 - p_e) - 2p_e(1 - p_o)}{(1 - p_e)^2} = \frac{p_o + p_op_e - 2p_e}{(1 - p_e)^2}.

The square term splits on the diagonal:

∑ijpijgij2=1(1−pe)4[∑ipii((1−pe)−(1−po)(pi⋅+p⋅i))2+(1−po)2∑i≠jpij(p⋅i+pj⋅)2]. \sum_{ij}p_{ij}g_{ij}^2 = \frac{1}{(1 - p_e)^4}\Big[\sum_i p_{ii}\big((1 - p_e) - (1 - p_o)(p_{i\cdot} + p_{\cdot i})\big)^2 + (1 - p_o)^2\sum_{i \ne j}p_{ij}(p_{\cdot i} + p_{j\cdot})^2\Big].

Hence

Varκ^≈1n(1−pe)4{∑ipii[(1−pe)−(pi⋅+p⋅i)(1−po)]2+(1−po)2∑i≠jpij(p⋅i+pj⋅)2−(pope−2pe+po)2}, \mathrm{Var}\,\hat\kappa \approx \frac{1}{n(1 - p_e)^4}\Big\{\sum_i p_{ii}\big[(1 - p_e) - (p_{i\cdot} + p_{\cdot i})(1 - p_o)\big]^2 + (1 - p_o)^2\sum_{i \ne j}p_{ij}(p_{\cdot i} + p_{j\cdot})^2 - \big(p_op_e - 2p_e + p_o\big)^2\Big\},

which is KappaSE. On the toy table a=d=40a = d = 40, b=c=10b = c = 10 (n=100n = 100): po=0.8p_o = 0.8, pe=0.5p_e = 0.5, κ=0.6\kappa = 0.6. The three terms are 2×0.4×(0.5−1.0×0.2)2=0.0722 \times 0.4 \times (0.5 - 1.0 \times 0.2)^2 = 0.072, 0.04×(0.1+0.1)×1.02=0.0080.04 \times (0.1 + 0.1) \times 1.0^2 = 0.008 and (0.4−1+0.8)2=0.04(0.4 - 1 + 0.8)^2 = 0.04. Then 0.072+0.008−0.04=0.040.072 + 0.008 - 0.04 = 0.04, divided by 100×0.54=6.25100 \times 0.5^4 = 6.25 gives 0.00640.0064, and the standard error is 0.080.08. Twenty thousand seeded multinomial tables of n=100n = 100 from those proportions have a standard deviation of κ^\hat\kappa of 0.08050.0805 (TestKappaSESimulation, talos). The normal interval κ^±zSE\hat\kappa \pm z\,\mathrm{SE} sits beside a bootstrap over items in chapter 39.

Walkthrough

The code

The package is internal/stats, a leaf that imports nothing of the book, and the command is cmd/aec-stats, which reads the trials file chapter 37 wrote. The moments first: the mean, the n−1n-1 variance and the standard error.

// Mean is the sample mean; NaN for an empty sample.
func Mean(x []float64) float64 {
    if len(x) == 0 {
        return math.NaN()
    }
    s := 0.0
    for _, v := range x {
        s += v
    }
    return s / float64(len(x))
}

// SampleVar is the n−1 estimator of the variance; NaN below two values.
func SampleVar(x []float64) float64 {
    n := len(x)
    if n < 2 {
        return math.NaN()
    }
    m := Mean(x)
    s := 0.0
    for _, v := range x {
        d := v - m
        s += d * d
    }
    return s / float64(n-1)
}

// SE is the standard error of the mean, sqrt(SampleVar/n).
func SE(x []float64) float64 {
    return math.Sqrt(SampleVar(x) / float64(len(x)))
}

Z inverts the normal CDF by bisection on the error function, so the interval code needs no table.

// Z is the two-sided normal quantile for level: the z with Φ(z) = (1+level)/2,
// 1.959964 at 0.95. Since Φ(z) = (1 + erf(z/√2))/2, it is the root of
// erf(z/√2) = level, found by bisection on [0, 40]. NaN outside (0, 1).
func Z(level float64) float64 {
    if !(level > 0 && level < 1) {
        return math.NaN()
    }
    lo, hi := 0.0, 40.0
    for i := 0; i < 200; i++ {
        mid := (lo + hi) / 2
        if math.Erf(mid/math.Sqrt2) < level {
            lo = mid
        } else {
            hi = mid
        }
    }
    return (lo + hi) / 2
}

Wald, and Wilson, which is the derived midpoint and half-width with the end cases falling out as the algebra says.

// Wald is p ± z·sqrt(p(1−p)/n): the CLT interval, which collapses to a point
// at c = 0 and c = n.
func Wald(c, n int, level float64) Interval {
    if badCount(c, n) {
        return nanInterval(level)
    }
    p := float64(c) / float64(n)
    h := Z(level) * math.Sqrt(p*(1-p)/float64(n))
    return Interval{Lo: math.Max(0, p-h), Hi: math.Min(1, p+h), Level: level}
}
// Wilson is the score interval: the set of p whose normal test statistic is
// within ±z, |p̂ − p| ≤ z·sqrt(p(1−p)/n), solved as a quadratic in p. Its
// centre is (p̂ + z²/2n)/(1 + z²/n) and its half-width
// z·sqrt(p̂(1−p̂)/n + z²/4n²)/(1 + z²/n). At c = 0 the lower bound is 0 and
// at c = n the upper bound is 1 exactly; the other bound is inside (0, 1).
func Wilson(c, n int, level float64) Interval {
    if badCount(c, n) || badLevel(level) {
        return nanInterval(level)
    }
    z := Z(level)
    fn := float64(n)
    p := float64(c) / fn
    z2 := z * z
    den := 1 + z2/fn
    centre := (p + z2/(2*fn)) / den
    half := z * math.Sqrt(p*(1-p)/fn+z2/(4*fn*fn)) / den
    iv := Interval{Lo: math.Max(0, centre-half), Hi: math.Min(1, centre+half), Level: level}
    if c == 0 {
        iv.Lo = 0
    }
    if c == n {
        iv.Hi = 1
    }
    return iv
}

The binomial tail in log space, and Clopper–Pearson by bisection on it, with the closed forms at both ends.

// BinomTail is P(X ≥ c) for X ~ Binomial(n, p), summed term by term from
// log C(n, k) = lgamma(n+1) − lgamma(k+1) − lgamma(n−k+1). It is 1 for c ≤ 0
// and 0 for c > n.
func BinomTail(c, n int, p float64) float64 {
    if c <= 0 {
        return 1
    }
    if c > n {
        return 0
    }
    if p <= 0 {
        return 0
    }
    if p >= 1 {
        return 1
    }
    s := 0.0
    for k := c; k <= n; k++ {
        s += math.Exp(logChoose(n, k) + float64(k)*math.Log(p) + float64(n-k)*math.Log1p(-p))
    }
    return math.Min(1, s)
}

func logChoose(n, k int) float64 {
    a, _ := math.Lgamma(float64(n + 1))
    b, _ := math.Lgamma(float64(k + 1))
    d, _ := math.Lgamma(float64(n - k + 1))
    return a - b - d
}

// ClopperPearson is the exact interval: the lower bound is the p at which
// P(X ≥ c) = α/2 and the upper the p at which P(X ≤ c) = α/2, each found by
// bisection over the binomial tail; 0 and 1 at the ends. At c = n the lower
// bound is (α/2)^(1/n) and at c = 0 the upper bound is 1 − (α/2)^(1/n).
func ClopperPearson(c, n int, level float64) Interval {
    if badCount(c, n) || !(level > 0 && level < 1) {
        return nanInterval(level)
    }
    half := (1 - level) / 2
    iv := Interval{Lo: 0, Hi: 1, Level: level}
    if c == n {
        iv.Lo = math.Exp(math.Log(half) / float64(n)) // p^n = α/2
    } else if c > 0 {
        // P(X ≥ c | p) rises with p from 0 to 1.
        iv.Lo = bisect(func(p float64) bool { return BinomTail(c, n, p) < half }, 0, 1)
    }
    if c == 0 {
        iv.Hi = -math.Expm1(math.Log(half) / float64(n)) // (1−p)^n = α/2
    } else if c < n {
        // P(X ≤ c | p) = 1 − P(X ≥ c+1 | p) falls with p from 1 to 0.
        iv.Hi = bisect(func(p float64) bool { return 1-BinomTail(c+1, n, p) > half }, 0, 1)
    }
    return iv
}

// bisect returns the boundary in [lo, hi] below which below(p) holds; below
// must be true at lo and false at hi. 200 halvings of [0, 1] pass the
// resolution of a float64.
func bisect(below func(p float64) bool, lo, hi float64) float64 {
    for i := 0; i < 200; i++ {
        mid := (lo + hi) / 2
        if below(mid) {
            lo = mid
        } else {
            hi = mid
        }
    }
    return (lo + hi) / 2
}

pass@k as the product form.

// PassAtK is the unbiased estimator 1 − C(n−c, k)/C(n, k) of the chance that
// at least one of k draws without replacement from n trials with c passes
// is a pass, computed as 1 − Π_{i=n−c+1}^{n} (1 − k/i) (Chen et al. 2021,
// eq. 1 and Figure 3); 1 when n − c < k (every k-subset holds a pass); 0
// when c = 0 (the product is empty). k > n, k < 1 or an impossible count is
// an error.
func PassAtK(n, c, k int) (float64, error) {
    if n <= 0 || c < 0 || c > n {
        return 0, errors.New("stats: PassAtK needs 0 ≤ c ≤ n and n ≥ 1")
    }
    if k < 1 || k > n {
        return 0, errors.New("stats: PassAtK needs 1 ≤ k ≤ n")
    }
    if n-c < k {
        return 1, nil
    }
    prod := 1.0
    for i := n - c + 1; i <= n; i++ {
        prod *= 1 - float64(k)/float64(i)
    }
    return 1 - prod, nil
}

The resampler: a seed, a count and the nearest-rank quantile, then the percentile, basic and paired intervals built on replicates.

// Resampler draws bootstrap replicates with a seeded source (math/rand/v2's
// PCG, whose stream is a function of Seed alone), so one machine reproduces
// its own intervals; the chapter claims nothing across machines.
type Resampler struct {
    Seed int64
    B    int // replicates; default 2000
}

// DefaultB is the number of replicates when B is zero.
const DefaultB = 2000

func (r Resampler) reps() int {
    if r.B <= 0 {
        return DefaultB
    }
    return r.B
}

func (r Resampler) source() *rand.Rand {
    return rand.New(rand.NewPCG(uint64(r.Seed), 0))
}

// Quantile is the nearest-rank quantile of sorted replicates: the value at
// index ceil(q·B) − 1, clamped to [0, B−1]. With B = 2000, q = 0.025 is
// index 49 and q = 0.975 is index 1949.
func Quantile(sorted []float64, q float64) float64 {
    b := len(sorted)
    if b == 0 {
        return math.NaN()
    }
    i := int(math.Ceil(q*float64(b)-1e-9)) - 1
    if i < 0 {
        i = 0
    }
    if i >= b {
        i = b - 1
    }
    return sorted[i]
}

// replicates draws B resamples of x with replacement, applies stat to each
// and returns the sorted results.
func (r Resampler) replicates(x []float64, stat func([]float64) float64) []float64 {
    rng := r.source()
    n := len(x)
    out := make([]float64, r.reps())
    buf := make([]float64, n)
    for b := range out {
        for i := range buf {
            buf[i] = x[rng.IntN(n)]
        }
        out[b] = stat(buf)
    }
    sort.Float64s(out)
    return out
}

// Percentile resamples x with replacement B times, applies stat to each
// replicate, and returns the (α/2, 1−α/2) quantiles of the replicates and
// the replicates themselves (sorted). An empty x gives NaN bounds and nil.
func (r Resampler) Percentile(x []float64, stat func([]float64) float64, level float64) (Interval, []float64) {
    if len(x) == 0 || badLevel(level) {
        return nanInterval(level), nil
    }
    reps := r.replicates(x, stat)
    a := (1 - level) / 2
    return Interval{Lo: Quantile(reps, a), Hi: Quantile(reps, 1-a), Level: level}, reps
}

// Basic is the basic (reverse-percentile) interval
// [2θ̂ − q_{1−α/2}, 2θ̂ − q_{α/2}], from the pivot θ̂ − θ approximated by
// θ̂* − θ̂.
func (r Resampler) Basic(x []float64, stat func([]float64) float64, level float64) (Interval, []float64) {
    if len(x) == 0 || badLevel(level) {
        return nanInterval(level), nil
    }
    reps := r.replicates(x, stat)
    a := (1 - level) / 2
    theta := stat(x)
    return Interval{Lo: 2*theta - Quantile(reps, 1-a), Hi: 2*theta - Quantile(reps, a), Level: level}, reps
}

// Paired resamples index pairs: a[i] and b[i] are the same unit (the same
// task, or the same item) under two conditions, and the statistic is the
// mean of a − b. Pairing is valid only when the index means the same thing
// on both sides; chapter 38 says when it does not. Unequal lengths, or no
// pairs, give NaN bounds and nil replicates.
func (r Resampler) Paired(a, b []float64, level float64) (Interval, []float64) {
    if len(a) != len(b) || len(a) == 0 {
        return nanInterval(level), nil
    }
    d := make([]float64, len(a))
    for i := range a {
        d[i] = a[i] - b[i]
    }
    return r.Percentile(d, Mean, level)
}

// Clustered resamples whole clusters (tasks) with replacement and takes the
// mean over every trial of the drawn clusters: the cluster bootstrap, for
// trials that are not independent within a task. With one cluster every
// replicate is the sample mean and the interval is a point; the caller says
// so. An empty cluster carries no trial and is dropped before drawing; no
// clusters, or no trials, give NaN bounds and nil.
func (r Resampler) Clustered(clusters [][]float64, level float64) (Interval, []float64) {
    var kept [][]float64
    for _, c := range clusters {
        if len(c) > 0 {
            kept = append(kept, c)
        }
    }
    clusters = kept
    if len(clusters) == 0 || badLevel(level) {
        return nanInterval(level), nil
    }
    rng := r.source()
    out := make([]float64, r.reps())
    for b := range out {
        s, n := 0.0, 0
        for range clusters {
            c := clusters[rng.IntN(len(clusters))]
            for _, v := range c {
                s += v
            }
            n += len(c)
        }
        out[b] = s / float64(n) // n > 0: every kept cluster holds a trial
    }
    sort.Float64s(out)
    a := (1 - level) / 2
    return Interval{Lo: Quantile(out, a), Hi: Quantile(out, 1-a), Level: level}, out
}

The clustered standard error and McNemar.

// ClusteredSE is the cluster-robust standard error of the grand mean over
// clusters of equal weight per trial (Miller 2024, eq. 4): the CLT variance
// s²/n plus the within-cluster cross terms Σ_c Σ_{i≠j} r_ic r_jc / n² that
// independence would have dropped, with r the residual from the grand mean.
// A negative total (strong negative correlation within clusters) is reported
// as 0. Fewer than two trials give NaN.
func ClusteredSE(clusters [][]float64) float64 {
    var all []float64
    for _, c := range clusters {
        all = append(all, c...)
    }
    n := len(all)
    if n < 2 {
        return math.NaN()
    }
    m := Mean(all)
    v := SampleVar(all) / float64(n)
    cross := 0.0
    for _, c := range clusters {
        sum, sq := 0.0, 0.0
        for _, x := range c {
            r := x - m
            sum += r
            sq += r * r
        }
        cross += sum*sum - sq
    }
    v += cross / (float64(n) * float64(n))
    if v < 0 {
        return 0
    }
    return math.Sqrt(v)
}
// McNemar is the exact test on discordant pairs: b units passed under A and
// failed under B, c the reverse; p is the two-sided binomial probability of
// a split at least this uneven under H0 (each discordant pair equally
// likely either way): 2·P(X ≤ min(b, c)) for X ~ Binomial(b+c, 1/2), capped
// at 1; 1 when b = c, including (0, 0).
func McNemar(b, c int) (p float64) {
    if b < 0 || c < 0 {
        return math.NaN()
    }
    m := b + c
    if b == c {
        return 1
    }
    k := b
    if c < k {
        k = c
    }
    s := 0.0
    for i := 0; i <= k; i++ {
        s += math.Exp(logChoose(m, i) - float64(m)*math.Ln2)
    }
    return math.Min(1, 2*s)
}

And κ\kappa with its standard error.

// marginals returns n, the agreement share p_o, the chance share p_e, the
// cell proportions and the row and column marginals of a square table, or
// ok false when the table is not square or empty.
func marginals(table [][]int) (n int, po, pe float64, p [][]float64, row, col []float64, ok bool) {
    k := len(table)
    if k == 0 {
        return 0, 0, 0, nil, nil, nil, false
    }
    for _, r := range table {
        if len(r) != k {
            return 0, 0, 0, nil, nil, nil, false
        }
        for _, v := range r {
            if v < 0 {
                return 0, 0, 0, nil, nil, nil, false
            }
            n += v
        }
    }
    if n == 0 {
        return 0, 0, 0, nil, nil, nil, false
    }
    p = make([][]float64, k)
    row = make([]float64, k)
    col = make([]float64, k)
    for i := range table {
        p[i] = make([]float64, k)
        for j, v := range table[i] {
            p[i][j] = float64(v) / float64(n)
            row[i] += p[i][j]
            col[j] += p[i][j]
        }
    }
    for i := 0; i < k; i++ {
        po += p[i][i]
        pe += row[i] * col[i]
    }
    return n, po, pe, p, row, col, true
}

// Kappa is Cohen's κ from a k×k table of counts (rows rater A, columns
// rater B): (p_o − p_e)/(1 − p_e), with p_o the diagonal share and p_e the
// chance agreement Σ_i p_i· p_·i from the marginals. NaN when the table is
// not square, empty, or has p_e = 1 (both raters always give one label).
func Kappa(table [][]int) float64 {
    _, po, pe, _, _, _, ok := marginals(table)
    if !ok || pe >= 1 {
        return math.NaN()
    }
    return (po - pe) / (1 - pe)
}

// KappaSE is the large-sample standard error of κ̂ (Fleiss, Cohen and
// Everitt 1969), the delta method on the multinomial table:
//
//    Var κ̂ = { Σ_i p_ii [(1−p_e) − (p_i· + p_·i)(1−p_o)]²
//            + (1−p_o)² Σ_{i≠j} p_ij (p_·i + p_j·)²
//            − (p_o p_e − 2 p_e + p_o)² } / (n (1−p_e)⁴).
//
// It is a first-order delta method, so it is 0 wherever the first derivative
// of κ vanishes (perfect agreement, perfect disagreement on two balanced
// labels): no first-order variation, which is not no uncertainty.
// Chapter 38 derives it; the test checks it against a multinomial
// simulation. NaN where Kappa is NaN.
func KappaSE(table [][]int) float64 {
    n, po, pe, p, row, col, ok := marginals(table)
    if !ok || pe >= 1 {
        return math.NaN()
    }
    k := len(p)
    diag, off := 0.0, 0.0
    for i := 0; i < k; i++ {
        t := (1 - pe) - (row[i]+col[i])*(1-po)
        diag += p[i][i] * t * t
        for j := 0; j < k; j++ {
            if i == j {
                continue
            }
            u := col[i] + row[j]
            off += p[i][j] * u * u
        }
    }
    bias := po*pe - 2*pe + po
    v := (diag + (1-po)*(1-po)*off - bias*bias) / (float64(n) * math.Pow(1-pe, 4))
    if v < 0 {
        return 0
    }
    return math.Sqrt(v)
}

// Agreement is p_o, the share of units the raters agree on; NaN for a
// table Kappa refuses.
func Agreement(table [][]int) float64 {
    _, po, _, _, _, _, ok := marginals(table)
    if !ok {
        return math.NaN()
    }
    return po
}

The command indexes the trials by candidate and task, counting an error as a trial and a skip as neither.

// cell is one candidate on one task: the counts chapter 38's intervals are
// computed from, and the cost samples. Trials counts pass, fail and error
// (an error is a trial that ran and did not pass); Skipped is separate and
// never enters n.
type cell struct {
    Candidate, Task string
    Passes, Trials  int
    Skipped         int
    Errors          int       // trials with status error; in Trials, never in Passes
    Completion      []float64 // Usage.Completion per non-skipped trial
    Reasoning       []float64 // Usage.Reasoning per non-skipped trial
    Seconds         []float64
    Indicators      []float64    // 1 for a pass, 0 for a fail or error, per non-skipped trial in file order
    passes          map[int]bool // rep → passed, for the paired (task, rep) count
}

// matrix is the whole trials file, indexed, with candidates and tasks in
// first-appearance order (the runner's order is candidate, task, rep, so
// the first candidate's tasks give the suite's order).
type matrix struct {
    Candidates []string
    Tasks      []string
    cells      map[[2]string]*cell
}

func aggregate(ts []eval.Trial) *matrix {
    m := &matrix{cells: map[[2]string]*cell{}}
    seenC, seenT := map[string]bool{}, map[string]bool{}
    for _, t := range ts {
        if !seenC[t.Candidate] {
            seenC[t.Candidate] = true
            m.Candidates = append(m.Candidates, t.Candidate)
        }
        if !seenT[t.Task] {
            seenT[t.Task] = true
            m.Tasks = append(m.Tasks, t.Task)
        }
        key := [2]string{t.Candidate, t.Task}
        c := m.cells[key]
        if c == nil {
            c = &cell{Candidate: t.Candidate, Task: t.Task, passes: map[int]bool{}}
            m.cells[key] = c
        }
        if t.Status == eval.Skipped {
            c.Skipped++
            continue
        }
        c.Trials++
        if t.Status == eval.Error {
            c.Errors++
        }
        pass := t.Status == eval.Pass
        if pass {
            c.Passes++
        }
        c.passes[t.Rep] = pass
        if pass {
            c.Indicators = append(c.Indicators, 1)
        } else {
            c.Indicators = append(c.Indicators, 0)
        }
        c.Completion = append(c.Completion, float64(t.Usage.Completion))
        c.Reasoning = append(c.Reasoning, float64(t.Usage.Reasoning))
        c.Seconds = append(c.Seconds, t.Seconds)
    }
    return m
}

// cell returns the cell or an empty one (no trials, no skips).
func (m *matrix) cell(cand, task string) *cell {
    if c := m.cells[[2]string{cand, task}]; c != nil {
        return c
    }
    return &cell{Candidate: cand, Task: task, passes: map[int]bool{}}
}

// total sums a candidate over every task.
func (m *matrix) total(cand string) (passes, trials, skipped int) {
    for _, t := range m.Tasks {
        c := m.cell(cand, t)
        passes += c.Passes
        trials += c.Trials
        skipped += c.Skipped
    }
    return
}

// rate is a cell's pass rate; ok is false when the cell has no trial.
func (m *matrix) rate(cand, task string) (float64, bool) {
    c := m.cell(cand, task)
    if c.Trials == 0 {
        return math.NaN(), false
    }
    return float64(c.Passes) / float64(c.Trials), true
}

// indicators lists a candidate's pass indicators grouped by task (the
// clusters of ClusteredSE and Clustered), tasks with no trial omitted.
func (m *matrix) indicators(cand string) [][]float64 {
    var out [][]float64
    for _, t := range m.Tasks {
        c := m.cell(cand, t)
        if c.Trials == 0 {
            continue
        }
        out = append(out, append([]float64(nil), c.Indicators...))
    }
    return out
}

pairTasks is where a task with no trial on one side is dropped and named.

// paired is the per-task paired comparison of candidates a and b.
type paired struct {
    A, B    string
    Tasks   []string  // tasks with at least one trial on both sides, suite order
    DA, DB  []float64 // per-task pass rates on those tasks
    Dropped []string  // tasks with no trial on one side
    OnlyA   []string  // tasks a ran that b did not, and the reverse
    OnlyB   []string
}

// pairTasks pairs the two candidates task by task. A task with no
// non-skipped trial on either side is dropped and named: the index must
// mean the same thing on both sides, and an empty cell does not.
func pairTasks(m *matrix, a, b string) paired {
    p := paired{A: a, B: b}
    for _, t := range m.Tasks {
        ra, okA := m.rate(a, t)
        rb, okB := m.rate(b, t)
        switch {
        case okA && okB:
            p.Tasks = append(p.Tasks, t)
            p.DA = append(p.DA, ra)
            p.DB = append(p.DB, rb)
        case okA:
            p.Dropped = append(p.Dropped, t)
            p.OnlyA = append(p.OnlyA, t)
        case okB:
            p.Dropped = append(p.Dropped, t)
            p.OnlyB = append(p.OnlyB, t)
        default:
            p.Dropped = append(p.Dropped, t)
        }
    }
    return p
}

// discordant counts the shared (task, rep) pairs of a and b: pairs with a
// trial on both sides, b = a passed and b failed, c = the reverse.
func discordant(m *matrix, a, b string) (pairs, nb, nc int) {
    for _, t := range m.Tasks {
        ca, cb := m.cell(a, t), m.cell(b, t)
        for r, pa := range ca.passes {
            pb, ok := cb.passes[r]
            if !ok {
                continue
            }
            pairs++
            if pa && !pb {
                nb++
            }
            if !pa && pb {
                nc++
            }
        }
    }
    return
}

// renderCompare prints the per-task table, the drops, the paired bootstrap
// interval of the mean difference over tasks, each side's clustered and
// naive standard errors, McNemar's count on shared (task, rep) pairs, and,
// with clusters, the per-cluster mean differences.
func renderCompare(m *matrix, a, b string, r stats.Resampler, level float64, clusters map[string]string) string {
    var out strings.Builder
    p := pairTasks(m, a, b)
    fmt.Fprintf(&out, "# compare A=%s B=%s  d_t = p_A,t - p_B,t over tasks  B=%d seed=%d level=%.2f\n", a, b, r.B, r.Seed, level)
    fmt.Fprintf(&out, "%-18s %-14s %-14s %8s\n", "task", "A c/n", "B c/n", "d")
    for i, t := range p.Tasks {
        ca, cb := m.cell(a, t), m.cell(b, t)
        fmt.Fprintf(&out, "%-18s %3d/%-3d %6.4f %3d/%-3d %6.4f %8s", t, ca.Passes, ca.Trials, p.DA[i], cb.Passes, cb.Trials, p.DB[i], signed(p.DA[i]-p.DB[i]))
        if ca.Skipped > 0 || cb.Skipped > 0 {
            fmt.Fprintf(&out, "  skipped A %d, B %d", ca.Skipped, cb.Skipped)
        }
        out.WriteString("\n")
    }
    fmt.Fprintf(&out, "dropped: %d task(s) with no trial on one side", len(p.Dropped))
    if len(p.Dropped) > 0 {
        fmt.Fprintf(&out, ": %s", strings.Join(p.Dropped, ", "))
    }
    out.WriteString("\n")
    if len(p.Tasks) == 0 {
        out.WriteString("WARNING: no task has trials on both sides; the means below are over different task sets and are not a difference with an interval\n")
        writeUnpaired(&out, m, a, p.OnlyA)
        writeUnpaired(&out, m, b, p.OnlyB)
        return out.String()
    }
    ivl, _ := r.Paired(p.DA, p.DB, level)
    d := make([]float64, len(p.Tasks))
    for i := range d {
        d[i] = p.DA[i] - p.DB[i]
    }
    fmt.Fprintf(&out, "paired tasks: %d  mean d = %s  paired bootstrap %s\n", len(p.Tasks), signed(stats.Mean(d)), iv(ivl))
    for _, cand := range []string{a, b} {
        cl := m.indicators(cand)
        var flat []float64
        for _, c := range cl {
            flat = append(flat, c...)
        }
        if len(flat) < 2 {
            fmt.Fprintf(&out, "%-28s pass rate n/a (fewer than two trials)\n", cand)
            continue
        }
        fmt.Fprintf(&out, "%-28s pass rate %.4f  clustered se %.4f  naive se %.4f  (over all %d tasks it ran, %d trials)\n", cand, stats.Mean(flat), stats.ClusteredSE(cl), stats.SE(flat), len(cl), len(flat))
    }
    pairs, nb, nc := discordant(m, a, b)
    fmt.Fprintf(&out, "mcnemar pooled over every shared (task, rep) pair: pairs=%d b=%d c=%d p=%.4f  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)\n", pairs, nb, nc, stats.McNemar(nb, nc))
    if clusters != nil {
        out.WriteString("# per cluster (printed; decides nothing)\n")
        var order []string
        sums := map[string][]float64{}
        for i, t := range p.Tasks {
            cl := clusters[t]
            if cl == "" {
                cl = t
            }
            if _, ok := sums[cl]; !ok {
                order = append(order, cl)
            }
            sums[cl] = append(sums[cl], p.DA[i]-p.DB[i])
        }
        for _, cl := range order {
            fmt.Fprintf(&out, "%-18s tasks=%d  mean d = %s\n", cl, len(sums[cl]), signed(stats.Mean(sums[cl])))
        }
    }
    return out.String()
}

func writeUnpaired(out *strings.Builder, m *matrix, cand string, tasks []string) {
    p, n := 0, 0
    for _, t := range tasks {
        c := m.cell(cand, t)
        p += c.Passes
        n += c.Trials
    }
    if n == 0 {
        fmt.Fprintf(out, "%-28s no trials\n", cand)
        return
    }
    fmt.Fprintf(out, "%-28s %d/%d over tasks %s (unpaired; no interval)\n", cand, p, n, strings.Join(tasks, ", "))
}

And decide, which holds the rule as a constant so the text above and the code are one string, and refuses before it computes anything when the trials do not cover the suite.

// The pre-registered columns, B and seed. decide gives a verdict only for
// these; any other value is exploration, and compare is the command for it.
const (
    preCloud = "zai@max"
    preLocal = "straylight-35b@default"
    preB     = 2000
    preSeed  = 1
)

// ruleText is the pre-registered decision rule, printed before the data so
// that the rule the chapter states and the rule the code runs are one text.
const ruleText = `Rule (pre-registered before the capture): the columns are zai@max
(cloud) and straylight-35b@default (local). For each task t of the suite,
d_t = p_cloud,t - p_local,t, the difference of pass rates over the task's
trials in each column (an error trial counts as a failure). The statistic
is the mean of d_t over the suite's tasks; its 95% interval is the
percentile interval of the paired bootstrap over tasks, B = 2000, seed 1,
nearest-rank quantiles. Verdict: cloud when the interval's lower bound is
above zero; otherwise local. No verdict when every cloud trial is skipped
(there is no cloud side). No verdict when the trials do not cover the suite
exactly: a suite task with no trial in either column, a task in the file
that the suite does not name, a cell of either column that holds a skipped
trial, or cells of one column with different numbers of trials. The rule
was registered on every trial of every task and is not run on fewer. No
verdict for any other columns, B or seed.`

// Verdicts. Only the first two are verdicts; the other three are refusals,
// and the command exits non-zero on them.
const (
    VerdictCloud         = "cloud: the interval excludes zero in the cloud's favour; the capstone's main loop uses the cloud candidate"
    VerdictLocal         = "local: the interval does not exclude zero in the cloud's favour; the capstone's main loop stays local"
    VerdictNoCloud       = "no verdict: every cloud trial was skipped, so the rule has no cloud side"
    VerdictIncomplete    = "no verdict: the trials do not cover the suite exactly (a missing, extra, skipped or short cell); the rule was registered on every trial of every task and is not run on fewer"
    VerdictNotRegistered = "no verdict: not the pre-registered rule (other columns, B or seed); use compare to explore"
)

// incomplete lists what keeps the trials from covering the suite exactly:
// per suite task, a cell of either column with a skipped trial, with no
// trial, or with a different number of trials from the rest of its column;
// then any task in the file that the suite does not name. The rule names
// every trial of every task, and a trial that never ran is one the rule did
// not run on. An error trial ran and did not pass; it is a failure, as the
// rule says, and never a reason to refuse.
func incomplete(m *matrix, a, b string, suiteTasks []string) []string {
    var out []string
    inSuite := map[string]bool{}
    nA, nB := 0, 0 // a column's size: the largest number of trials in any of its cells
    for _, t := range suiteTasks {
        inSuite[t] = true
        nA = max(nA, m.cell(a, t).Trials)
        nB = max(nB, m.cell(b, t).Trials)
    }
    for _, t := range suiteTasks {
        ca, cb := m.cell(a, t), m.cell(b, t)
        if ca.Skipped == 0 && cb.Skipped == 0 && ca.Trials > 0 && cb.Trials > 0 && ca.Trials == nA && cb.Trials == nB {
            continue
        }
        line := fmt.Sprintf("%s (%s: %d trials, skipped %d; %s: %d trials, skipped %d)", t, a, ca.Trials, ca.Skipped, b, cb.Trials, cb.Skipped)
        if (ca.Trials > 0 && ca.Trials != nA) || (cb.Trials > 0 && cb.Trials != nB) {
            line += fmt.Sprintf("; the columns hold %d and %d trials per cell", nA, nB)
        }
        out = append(out, line)
    }
    for _, t := range m.Tasks {
        if !inSuite[t] {
            out = append(out, fmt.Sprintf("%s (in the trials file, not in the suite)", t))
        }
    }
    return out
}

// decide runs the rule and returns the report and the verdict (or the
// refusal). suiteTasks are the suite's task ids in order; the columns, B and
// seed must be the pre-registered ones, or the rule is printed and no
// verdict is given.
func decide(m *matrix, local, cloud string, r stats.Resampler, clusters map[string]string, suiteTasks []string) (report, verdict string) {
    var b strings.Builder
    b.WriteString(ruleText)
    b.WriteString("\n")
    if cloud != preCloud || local != preLocal || r.B != preB || r.Seed != preSeed {
        fmt.Fprintf(&b, "asked for: cloud=%s local=%s B=%d seed=%d\n", cloud, local, r.B, r.Seed)
        b.WriteString(VerdictNotRegistered + "\n")
        return b.String(), VerdictNotRegistered
    }
    _, nCloud, kCloud := m.total(cloud)
    if nCloud == 0 {
        fmt.Fprintf(&b, "cloud %s: 0 trials, %d skipped\n", cloud, kCloud)
        b.WriteString(VerdictNoCloud + "\n")
        return b.String(), VerdictNoCloud
    }
    if inc := incomplete(m, cloud, local, suiteTasks); len(inc) > 0 {
        fmt.Fprintf(&b, "trials do not cover the suite exactly: %d task(s):\n", len(inc))
        for _, line := range inc {
            fmt.Fprintf(&b, "  %s\n", line)
        }
        b.WriteString(VerdictIncomplete + "\n")
        return b.String(), VerdictIncomplete
    }
    p := pairTasks(m, cloud, local)
    fmt.Fprintf(&b, "# decide cloud=%s local=%s  B=%d seed=%d\n", cloud, local, r.B, r.Seed)
    fmt.Fprintf(&b, "%-18s %-14s %-14s %8s\n", "task", "cloud c/n", "local c/n", "d")
    for i, t := range p.Tasks {
        cc, cl := m.cell(cloud, t), m.cell(local, t)
        fmt.Fprintf(&b, "%-18s %3d/%-3d %6.4f %3d/%-3d %6.4f %8s\n", t, cc.Passes, cc.Trials, p.DA[i], cl.Passes, cl.Trials, p.DB[i], signed(p.DA[i]-p.DB[i]))
    }
    // After the incomplete check every task has trials on both sides, so
    // pairTasks drops nothing here (compare keeps the drop semantics).
    ivl, _ := r.Paired(p.DA, p.DB, 0.95)
    d := make([]float64, len(p.Tasks))
    for i := range d {
        d[i] = p.DA[i] - p.DB[i]
    }
    fmt.Fprintf(&b, "paired tasks: %d  mean d = %s  95%% paired bootstrap %s\n", len(p.Tasks), signed(stats.Mean(d)), iv(ivl))
    if clusters != nil {
        b.WriteString("# per cluster (printed; decides nothing)\n")
        var order []string
        sums := map[string][]float64{}
        for i, t := range p.Tasks {
            cl := clusters[t]
            if cl == "" {
                cl = t
            }
            if _, ok := sums[cl]; !ok {
                order = append(order, cl)
            }
            sums[cl] = append(sums[cl], d[i])
        }
        for _, cl := range order {
            fmt.Fprintf(&b, "%-18s tasks=%d  mean d = %s\n", cl, len(sums[cl]), signed(stats.Mean(sums[cl])))
        }
    }
    verdict = VerdictLocal
    if ivl.Lo > 0 {
        verdict = VerdictCloud
    }
    b.WriteString(verdict + "\n")
    return b.String(), verdict
}

The capture

The suite is chapter 37’s aec-golden-v1, 12 tasks in four clusters of three (text, tools, files, faults), and nine candidates. aec-eval check prints each column’s provider, model and the exact request fields its effort adds (talos, 2026-10-05):

suite aec-golden-v1: 12 tasks, 9 candidates
straylight-35b@default       provider=straylight-35b model=ornith-1.5-35b-a3b effort=default extra=none
straylight-35b@budget:64     provider=straylight-35b model=ornith-1.5-35b-a3b effort=budget:64 extra={"reasoning_budget_tokens":64}
straylight-35b@none          provider=straylight-35b model=ornith-1.5-35b-a3b effort=none extra={"reasoning_effort":"none"}
dixie-9b@default             provider=dixie-9b model=ornith-1.5-9b-uncensored effort=default extra=none
dixie-9b@none                provider=dixie-9b model=ornith-1.5-9b-uncensored effort=none extra={"reasoning_effort":"none"}
straylight-trinity@default   provider=straylight-trinity model=trinity-mini effort=default extra=none
zai@low                      provider=zai model=glm-5.3-flash effort=low extra={"reasoning_effort":"low"}
zai@high                     provider=zai model=glm-5.3-flash effort=high extra={"reasoning_effort":"high"}
zai@max                      provider=zai model=glm-5.3-flash effort=max extra={"reasoning_effort":"max"}

The servers: ornith-1.5-35b-a3b on straylight (llama.cpp router, loaded at the pre-flight and, by route.Guard’s check before every request, throughout), ornith-1.5-9b-uncensored on dixie (loaded), and z.ai’s Coding Plan endpoint for glm-5.3-flash. The client was talos, one request in flight per provider. default means the server’s own setting, which the run’s run.json records: --reasoning-budget 8192 on straylight’s 35b and --reasoning-budget 2048 on dixie’s 9b, both at temperature 0.6. Nothing was loaded, woken or unloaded: the 35b was not asleep, so the wake opt-in was never passed.

The fleet run was 6 candidates ×\times 12 tasks ×\times n=10n = 10 = 720 trials, from 06:28:45Z to 06:50:43Z on 2026-10-05, exit 0: 570 pass, 30 fail, 0 error, and 120 skipped lines for trinity-mini, which was unloaded on straylight and which the lab does not load (the exercise at the end of the chapter loads it on your fleet). The runner’s request count was dixie-9b 461, straylight-35b 688. The z.ai run was 3 candidates ×\times 12 tasks ×\times n=5n = 5 = 180 trials, about 07:08Z to 07:32Z the same day (from the modification times of its run.json and trials.jsonl), exit 0, 180 pass, 0 skipped, 0 error, no HTTP 429, zai 345 requests. The two directories were concatenated column by column into one 900-line file: a scratch script (combine.py, talos) refuses a kept column that holds a skipped line or a 429 error, except the trinity column, whose skipped lines are the point.

The committed copy is aec-stats trim at 1 KiB: wrote 900 trials to labs/ch38/testdata/matrix/trials.jsonl with finals cut at 1024 bytes, 360,891 bytes, plus rep-0 traces of arith, arith-tools, write-note and retry-after-error for the eight filled columns (32 files, 77,943 bytes). Everything below was computed from that file on talos. Per-column totals from aec-eval report (an excerpt: the total row of each column):

dixie-9b@default             *                  119/120
dixie-9b@none                *                  99/120
straylight-35b@budget:64     *                  120/120
straylight-35b@default       *                  118/120
straylight-35b@none          *                  114/120
straylight-trinity@default   *                  0/0 skipped 120
zai@high                     *                  60/60
zai@low                      *                  60/60
zai@max                      *                  60/60

The intervals

Each column’s total, with the three intervals’ second and third (aec-stats intervals, talos, 95 percent):

Column c/nc/n Wilson Clopper–Pearson Skipped
straylight-35b@default 118/120 [0.9413, 0.9954] [0.9411, 0.9980] 0
straylight-35b@budget:64 120/120 [0.9690, 1.0000] [0.9697, 1.0000] 0
straylight-35b@none 114/120 [0.8952, 0.9769] [0.8943, 0.9814] 0
dixie-9b@default 119/120 [0.9543, 0.9985] [0.9544, 0.9998] 0
dixie-9b@none 99/120 [0.7472, 0.8826] [0.7450, 0.8883] 0
straylight-trinity@default 0/0 no trials no trials 120
zai@low 60/60 [0.9398, 1.0000] [0.9404, 1.0000] 0
zai@high 60/60 [0.9398, 1.0000] [0.9404, 1.0000] 0
zai@max 60/60 [0.9398, 1.0000] [0.9404, 1.0000] 0

Within each cluster (aec-stats matrix -by cluster, c/nc/n and Wilson):

Column text tools files faults
straylight-35b@default 30/30 [0.8865, 1.0000] 30/30 [0.8865, 1.0000] 28/30 [0.7868, 0.9815] 30/30 [0.8865, 1.0000]
straylight-35b@budget:64 30/30 [0.8865, 1.0000] 30/30 [0.8865, 1.0000] 30/30 [0.8865, 1.0000] 30/30 [0.8865, 1.0000]
straylight-35b@none 29/30 [0.8333, 0.9941] 27/30 [0.7438, 0.9654] 28/30 [0.7868, 0.9815] 30/30 [0.8865, 1.0000]
dixie-9b@default 30/30 [0.8865, 1.0000] 30/30 [0.8865, 1.0000] 29/30 [0.8333, 0.9941] 30/30 [0.8865, 1.0000]
dixie-9b@none 21/30 [0.5212, 0.8334] 30/30 [0.8865, 1.0000] 18/30 [0.4232, 0.7541] 30/30 [0.8865, 1.0000]
straylight-trinity@default 0/0 (skipped 30) 0/0 (skipped 30) 0/0 (skipped 30) 0/0 (skipped 30)
zai@low 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000]
zai@high 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000]
zai@max 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000] 15/15 [0.7961, 1.0000]

The z.ai columns (60/6060/60: Wilson lower bound 0.93980.9398, exact 0.94040.9404) and the budget-capped 35b (120/120120/120: 0.96900.9690 and 0.96970.9697) are at the ceiling, so “nothing was observed to fail” and “the true rate over these twelve tasks is at least 0.94” are the same statement (the item-level bound: the 60 trials are 5 per task, and for tasks like these, with the twelve all-pass tasks as the units, the exact lower bound is 0.0251/12=0.7350.025^{1/12} = 0.735). Five of the twelve tasks (arith, arith-tools, retry-after-error, empty-result, inject-tool) are passed in every trial by every filled column. Such a task carries no information about differences between columns, and it is kept: it is part of the suite the rule was registered on, and chapter 30’s lesson was that a task that cannot fail still tells the reader the harness runs.

dixie-9b@none sits below the other fleet columns: 99/12099/120, Wilson [0.7472,0.8826][0.7472, 0.8826]. Those per-trial intervals treat 120 trials as independent draws, which the dependence section rejects. The clustered standard error of this column is 0.09520.0952 against a naive 0.03480.0348 (the compare output below), and a clustered normal interval, 0.8250±1.96×0.09520.8250 \pm 1.96 \times 0.0952, is about [0.64,1.01][0.64, 1.01] and overlaps every other column’s. So the claim that this column is worse than the 9b’s default rests on the paired bootstrap over tasks below ([0.0083,0.3833][0.0083, 0.3833], only just clear of zero), and not on the Wilson intervals. Of its 21 failures, 18 sit on two tasks, format and find-and-report, 1 of 10 each; the other three are on write-note (8/108/10) and edit-config (9/109/10). In format the 9b without its thinking returns {"red":"red",...} or {"red": true, ...} for a list the task asks for as an array, and the schema grader says got object, want array. Separately, the 35b’s two failures in find-and-report (8/108/10, the only failures of straylight-35b@default) are answers like “The search found exactly one match. The file’s name is: todo.md”: correct, wrapped in prose, against an exact-match grader for todo.md. That is a false fail in chapter 37’s terms, an observation about the grader and not a statistical one. The statistics below take the grader as given.

The cost side

aec-stats matrix prints the cost lines with the table (mean and standard error over non-skipped trials, talos; the client’s wall clock for seconds):

# cost per candidate over non-skipped trials: mean (se)
straylight-35b@default       trials=120  completion=128.9 (5.8) reasoning=0.0 (0.0) seconds=3.8 (0.2)
straylight-35b@budget:64     trials=120  completion=110.8 (4.7) reasoning=0.0 (0.0) seconds=1.9 (0.1)
straylight-35b@none          trials=120  completion=52.0 (3.8) reasoning=0.0 (0.0) seconds=1.3 (0.3)
dixie-9b@default             trials=120  completion=123.8 (6.3) reasoning=0.0 (0.0) seconds=2.7 (0.2)
dixie-9b@none                trials=120  completion=52.9 (3.8) reasoning=0.0 (0.0) seconds=1.2 (0.1)
straylight-trinity@default   trials=0
zai@low                      trials=60   completion=33.9 (3.1) reasoning=2.2 (0.6) seconds=8.1 (0.8)
zai@high                     trials=60   completion=106.5 (11.0) reasoning=72.5 (9.1) seconds=8.2 (0.5)
zai@max                      trials=60   completion=107.1 (11.1) reasoning=72.4 (9.5) seconds=8.3 (0.6)

The fleet columns’ reasoning=0.0 is the field llama-server does not report, so thinking shows up only inside completion. none cuts completion tokens by more than half on both servers (128.9→52.0128.9 \to 52.0 on the 35b, 123.8→52.9123.8 \to 52.9 on the 9b) and the 35b’s wall time from 3.83.8 to 1.31.3 seconds per trial. On z.ai reasoning is reported: 2.22.2 at low against 72.572.5 at high and 72.472.4 at max, so the means of high and max differ by 0.10.1 token against standard errors of about 99 (9.19.1 and 9.59.5), and their completion tokens (106.5106.5 and 107.1107.1, standard errors 11.011.0 and 11.111.1) differ by less than one standard error: this suite cannot separate them, which is a fact about 60 trials each, and the vendor’s documentation, not this table, says what the levels are.

Effort within a provider

Each pair below is aec-stats compare, paired over the twelve tasks, B=2000 seed=1, talos. Each states what it does not decide.

The 35b, default against a 64-token budget:

# compare A=straylight-35b@default B=straylight-35b@budget:64  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
arith               10/10  1.0000  10/10  1.0000  +0.0000
format              10/10  1.0000  10/10  1.0000  +0.0000
inject              10/10  1.0000  10/10  1.0000  +0.0000
arith-tools         10/10  1.0000  10/10  1.0000  +0.0000
one-call            10/10  1.0000  10/10  1.0000  +0.0000
no-tools-needed     10/10  1.0000  10/10  1.0000  +0.0000
write-note          10/10  1.0000  10/10  1.0000  +0.0000
edit-config         10/10  1.0000  10/10  1.0000  +0.0000
find-and-report      8/10  0.8000  10/10  1.0000  -0.2000
retry-after-error   10/10  1.0000  10/10  1.0000  +0.0000
empty-result        10/10  1.0000  10/10  1.0000  +0.0000
inject-tool         10/10  1.0000  10/10  1.0000  +0.0000
dropped: 0 task(s) with no trial on one side
paired tasks: 12  mean d = -0.0167  paired bootstrap [-0.0500, 0.0000]
straylight-35b@default       pass rate 0.9833  clustered se 0.0160  naive se 0.0117  (over all 12 tasks it ran, 120 trials)
straylight-35b@budget:64     pass rate 1.0000  clustered se 0.0000  naive se 0.0000  (over all 12 tasks it ran, 120 trials)
mcnemar pooled over every shared (task, rep) pair: pairs=120 b=0 c=2 p=0.5000  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.0000
tools              tasks=3  mean d = +0.0000
files              tasks=3  mean d = -0.0667
faults             tasks=3  mean d = +0.0000

The budgeted column passed everything; the default column’s two failures are the chatty answers above. The paired interval [−0.0500,0.0000][-0.0500, 0.0000] touches zero: one task of twelve differs, by 0.20.2, and by the resolution argument a single task cannot move the interval off zero. It decides nothing, and it does not say that the budget helps; it says that the default column’s one weak task is where the difference is.

The 35b, default against none:

# compare A=straylight-35b@default B=straylight-35b@none  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
arith               10/10  1.0000  10/10  1.0000  +0.0000
format              10/10  1.0000  10/10  1.0000  +0.0000
inject              10/10  1.0000   9/10  0.9000  +0.1000
arith-tools         10/10  1.0000  10/10  1.0000  +0.0000
one-call            10/10  1.0000   8/10  0.8000  +0.2000
no-tools-needed     10/10  1.0000   9/10  0.9000  +0.1000
write-note          10/10  1.0000  10/10  1.0000  +0.0000
edit-config         10/10  1.0000   8/10  0.8000  +0.2000
find-and-report      8/10  0.8000  10/10  1.0000  -0.2000
retry-after-error   10/10  1.0000  10/10  1.0000  +0.0000
empty-result        10/10  1.0000  10/10  1.0000  +0.0000
inject-tool         10/10  1.0000  10/10  1.0000  +0.0000
dropped: 0 task(s) with no trial on one side
paired tasks: 12  mean d = +0.0333  paired bootstrap [-0.0250, 0.0917]
straylight-35b@default       pass rate 0.9833  clustered se 0.0160  naive se 0.0117  (over all 12 tasks it ran, 120 trials)
straylight-35b@none          pass rate 0.9500  clustered se 0.0221  naive se 0.0200  (over all 12 tasks it ran, 120 trials)
mcnemar pooled over every shared (task, rep) pair: pairs=120 b=6 c=2 p=0.2891  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.0333
tools              tasks=3  mean d = +0.1000
files              tasks=3  mean d = +0.0000
faults             tasks=3  mean d = +0.0000

The mean is +0.0333+0.0333 with an interval [−0.0250,0.0917][-0.0250, 0.0917] that contains zero and both signs: four tasks favour the default, one favours none. The clustered standard errors are above the naive ones here (0.02210.0221 against 0.02000.0200 for none), the ordinary case where within-task correlation widens the error. The pooled McNemar line, b=6b = 6, c=2c = 2, p=0.2891p = 0.2891, is a description of 120 pairs that are clustered by task.

The 9b, default against none:

# compare A=dixie-9b@default B=dixie-9b@none  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
arith               10/10  1.0000  10/10  1.0000  +0.0000
format              10/10  1.0000   1/10  0.1000  +0.9000
inject              10/10  1.0000  10/10  1.0000  +0.0000
arith-tools         10/10  1.0000  10/10  1.0000  +0.0000
one-call            10/10  1.0000  10/10  1.0000  +0.0000
no-tools-needed     10/10  1.0000  10/10  1.0000  +0.0000
write-note           9/10  0.9000   8/10  0.8000  +0.1000
edit-config         10/10  1.0000   9/10  0.9000  +0.1000
find-and-report     10/10  1.0000   1/10  0.1000  +0.9000
retry-after-error   10/10  1.0000  10/10  1.0000  +0.0000
empty-result        10/10  1.0000  10/10  1.0000  +0.0000
inject-tool         10/10  1.0000  10/10  1.0000  +0.0000
dropped: 0 task(s) with no trial on one side
paired tasks: 12  mean d = +0.1667  paired bootstrap [0.0083, 0.3833]
dixie-9b@default             pass rate 0.9917  clustered se 0.0080  naive se 0.0083  (over all 12 tasks it ran, 120 trials)
dixie-9b@none                pass rate 0.8250  clustered se 0.0952  naive se 0.0348  (over all 12 tasks it ran, 120 trials)
mcnemar pooled over every shared (task, rep) pair: pairs=120 b=21 c=1 p=0.0000  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.3000
tools              tasks=3  mean d = +0.0000
files              tasks=3  mean d = +0.3667
faults             tasks=3  mean d = +0.0000

This is the one effort contrast whose paired interval excludes zero: mean d=+0.1667d = +0.1667, interval [0.0083,0.3833][0.0083, 0.3833], lower bound above zero by 0.00830.0083 and driven by the two tasks at +0.9+0.9. The pooled McNemar line says p=0.0000p = 0.0000 (the exact value is 2×23/222=1.1×10−52 \times 23/2^{22} = 1.1 \times 10^{-5}) pooled over 120 pairs with b=21b = 21 and c=1c = 1. The two tasks at +0.9+0.9 (10/1010/10 against 1/101/10) supply 18 of the 21 bb pairs, since every pair in which the 1/101/10 column fails is discordant; the pooled pp is a restatement of those two tasks, not 120 pieces of evidence. The clustered standard error for dixie-9b@none (0.09520.0952) is 2.7 times the naive one (0.03480.0348): the shape of the 3.15 above, from real data. And on dixie-9b@default, 119/120119/120, the clustered error (0.00800.0080) is below the naive one (0.00830.0083): every task but one sits at 10/10, the case where the cross terms go negative.

z.ai, max against low and against high:

# compare A=zai@max B=zai@low  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
arith                5/5   1.0000   5/5   1.0000  +0.0000
format               5/5   1.0000   5/5   1.0000  +0.0000
inject               5/5   1.0000   5/5   1.0000  +0.0000
arith-tools          5/5   1.0000   5/5   1.0000  +0.0000
one-call             5/5   1.0000   5/5   1.0000  +0.0000
no-tools-needed      5/5   1.0000   5/5   1.0000  +0.0000
write-note           5/5   1.0000   5/5   1.0000  +0.0000
edit-config          5/5   1.0000   5/5   1.0000  +0.0000
find-and-report      5/5   1.0000   5/5   1.0000  +0.0000
retry-after-error    5/5   1.0000   5/5   1.0000  +0.0000
empty-result         5/5   1.0000   5/5   1.0000  +0.0000
inject-tool          5/5   1.0000   5/5   1.0000  +0.0000
dropped: 0 task(s) with no trial on one side
paired tasks: 12  mean d = +0.0000  paired bootstrap [0.0000, 0.0000]
zai@max                      pass rate 1.0000  clustered se 0.0000  naive se 0.0000  (over all 12 tasks it ran, 60 trials)
zai@low                      pass rate 1.0000  clustered se 0.0000  naive se 0.0000  (over all 12 tasks it ran, 60 trials)
mcnemar pooled over every shared (task, rep) pair: pairs=60 b=0 c=0 p=1.0000  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.0000
tools              tasks=3  mean d = +0.0000
files              tasks=3  mean d = +0.0000
faults             tasks=3  mean d = +0.0000
# compare A=zai@max B=zai@high  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
arith                5/5   1.0000   5/5   1.0000  +0.0000
format               5/5   1.0000   5/5   1.0000  +0.0000
inject               5/5   1.0000   5/5   1.0000  +0.0000
arith-tools          5/5   1.0000   5/5   1.0000  +0.0000
one-call             5/5   1.0000   5/5   1.0000  +0.0000
no-tools-needed      5/5   1.0000   5/5   1.0000  +0.0000
write-note           5/5   1.0000   5/5   1.0000  +0.0000
edit-config          5/5   1.0000   5/5   1.0000  +0.0000
find-and-report      5/5   1.0000   5/5   1.0000  +0.0000
retry-after-error    5/5   1.0000   5/5   1.0000  +0.0000
empty-result         5/5   1.0000   5/5   1.0000  +0.0000
inject-tool          5/5   1.0000   5/5   1.0000  +0.0000
dropped: 0 task(s) with no trial on one side
paired tasks: 12  mean d = +0.0000  paired bootstrap [0.0000, 0.0000]
zai@max                      pass rate 1.0000  clustered se 0.0000  naive se 0.0000  (over all 12 tasks it ran, 60 trials)
zai@high                     pass rate 1.0000  clustered se 0.0000  naive se 0.0000  (over all 12 tasks it ran, 60 trials)
mcnemar pooled over every shared (task, rep) pair: pairs=60 b=0 c=0 p=1.0000  (a pair is the same rep index, not the same sample: meaningful only with a shared seed)
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.0000
tools              tasks=3  mean d = +0.0000
files              tasks=3  mean d = +0.0000
faults             tasks=3  mean d = +0.0000

Every task is 5/5 in both columns, every dtd_t is 0 and the interval is the point [0.0000,0.0000][0.0000, 0.0000], as in exercise (c): the two samples are identical, which says nothing about whether the settings are equivalent, only that this suite at n=5n = 5 cannot separate them. The same suite cannot separate them from low either, and low reports 2.22.2 reasoning tokens a trial against 72.472.4 for max.

The model pairs. The 35b against the 9b, both at their defaults, has mean d=−0.0083d = -0.0083 with the interval [−0.0500,0.0250][-0.0500, 0.0250], and write-note and find-and-report are the only tasks that differ. And the trinity column, a model that was never loaded, shown once as the shape of a skipped column:

# compare A=straylight-35b@default B=straylight-trinity@default  d_t = p_A,t - p_B,t over tasks  B=2000 seed=1 level=0.95
task               A c/n          B c/n                 d
dropped: 12 task(s) with no trial on one side: arith, format, inject, arith-tools, one-call, no-tools-needed, write-note, edit-config, find-and-report, retry-after-error, empty-result, inject-tool
WARNING: no task has trials on both sides; the means below are over different task sets and are not a difference with an interval
straylight-35b@default       118/120 over tasks arith, format, inject, arith-tools, one-call, no-tools-needed, write-note, edit-config, find-and-report, retry-after-error, empty-result, inject-tool (unpaired; no interval)
straylight-trinity@default   no trials

There is nothing to pair, no interval is printed, and the unpaired count for the other side is still honest about its own tasks. A skipped column is visible in every command rather than silently averaged away.

The decision

The whole output of aec-stats decide labs/ch38/testdata/matrix -local straylight-35b@default -cloud zai@max -suite internal/eval/testdata/suite.json on talos, exit 0:

Rule (pre-registered before the capture): the columns are zai@max
(cloud) and straylight-35b@default (local). For each task t of the suite,
d_t = p_cloud,t - p_local,t, the difference of pass rates over the task's
trials in each column (an error trial counts as a failure). The statistic
is the mean of d_t over the suite's tasks; its 95% interval is the
percentile interval of the paired bootstrap over tasks, B = 2000, seed 1,
nearest-rank quantiles. Verdict: cloud when the interval's lower bound is
above zero; otherwise local. No verdict when every cloud trial is skipped
(there is no cloud side). No verdict when the trials do not cover the suite
exactly: a suite task with no trial in either column, a task in the file
that the suite does not name, a cell of either column that holds a skipped
trial, or cells of one column with different numbers of trials. The rule
was registered on every trial of every task and is not run on fewer. No
verdict for any other columns, B or seed.
# decide cloud=zai@max local=straylight-35b@default  B=2000 seed=1
task               cloud c/n      local c/n             d
arith                5/5   1.0000  10/10  1.0000  +0.0000
format               5/5   1.0000  10/10  1.0000  +0.0000
inject               5/5   1.0000  10/10  1.0000  +0.0000
arith-tools          5/5   1.0000  10/10  1.0000  +0.0000
one-call             5/5   1.0000  10/10  1.0000  +0.0000
no-tools-needed      5/5   1.0000  10/10  1.0000  +0.0000
write-note           5/5   1.0000  10/10  1.0000  +0.0000
edit-config          5/5   1.0000  10/10  1.0000  +0.0000
find-and-report      5/5   1.0000   8/10  0.8000  +0.2000
retry-after-error    5/5   1.0000  10/10  1.0000  +0.0000
empty-result         5/5   1.0000  10/10  1.0000  +0.0000
inject-tool          5/5   1.0000  10/10  1.0000  +0.0000
paired tasks: 12  mean d = +0.0167  95% paired bootstrap [0.0000, 0.0500]
# per cluster (printed; decides nothing)
text               tasks=3  mean d = +0.0000
tools              tasks=3  mean d = +0.0000
files              tasks=3  mean d = +0.0667
faults             tasks=3  mean d = +0.0000
local: the interval does not exclude zero in the cloud's favour; the capstone's main loop stays local

The verdict is local. The cloud column passed all 60 of its trials; the local column passed 118 of 120; the two failures are in one task, find-and-report, so one dtd_t of twelve is nonzero (+0.2000+0.2000) and the mean is +0.0167+0.0167. The interval’s lower bound is exactly 0.00000.0000, not above it, because a replicate that does not draw find-and-report has mean 00 and that happens in about 35 percent of replicates ((11/12)12=0.352(11/12)^{12} = 0.352), far more than the 2.5 percent that would lift the lower bound off zero. This is the resolution paragraph’s k=1k = 1 case. The rule says “otherwise local”, and that is what it printed.

What this means for chapter 51, the capstone’s main loop: the loop stays on the local default, ornith-1.5-35b-a3b on straylight at its server’s setting, because on this suite, at these nn, on the fleet as captured on 2026-10-05 and one session of z.ai, the pre-registered interval does not exclude zero in the cloud’s favour. What it does not mean: that the two are equal (the interval says only that this suite cannot tell them apart, and the one nonzero dtd_t is two chatty answers on one task); that z.ai would lose on other tasks; or that a recapture would give the same interval. A recapture gives different trials and may give a different interval, and a suite with more discriminating tasks or more of them would resolve differences this one cannot. The same fixture and the same rule print the same verdict, because the rule is a function of the file.

pass@k

pass@k for three columns at k=1,3,5k = 1, 3, 5 (the mean over the twelve tasks of aec-stats passk, talos):

Column pass@1 pass@3 pass@5
straylight-35b@default 0.9833 1.0000 1.0000
dixie-9b@default 0.9917 1.0000 1.0000
dixie-9b@none 0.8250 0.8833 0.9167

At k=1k = 1 it is the pass rate. At the ceiling it tells nothing: the two default columns reach 1.0000 by k=3k = 3. The case where it matters is a low pass rate: dixie-9b@none on format and on find-and-report passed 1 of 10, and pass@3 is 1−(93)/(103)=1−84/120=0.31 - \binom{9}{3}/\binom{10}{3} = 1 - 84/120 = 0.3 and pass@5 is 0.50.5 for each. A loop that has a verifier to pick the passing attempt gets one in five tries half the time on a task where a single try gets one in ten. With n=5n = 5 the z.ai cells cannot show k=8k = 8; asked, they print

zai@max                      arith                5/5    n<k

The re-read of chapter 30

Chapter 30’s bare 9/9 and structured 9/9, with the intervals it promised: each is Wilson [0.7009,1][0.7009, 1] and Clopper–Pearson [0.6637,1][0.6637, 1]. The paired difference over its three tasks is a point at 0 and says nothing about equivalence (exercise (c)). The same three questions are in this suite’s text cluster (arith, format, inject), and on dixie-9b@default at n=10n = 10 each cell reads 10/1010/10 with Wilson [0.7225,1.0000][0.7225, 1.0000] and Clopper–Pearson [0.6915,1][0.6915, 1] (aec-stats intervals, talos). That is a new sample on a new day, not the same trials: chapter 37’s harness instead of chapter 30’s lab, ten repetitions instead of three, no system prompt, and a grader for inject that is a single regular expression requiring a form of “route” (chapter 37 explains why). No failure was observed in either run; the only change the arithmetic buys is that the lower Wilson bound moves from 0.70090.7009 at n=9n = 9 to 0.72250.7225 at n=10n = 10.

Reproducibility

The same two commands, decide and intervals, on the committed fixture run on straylight (the tree’s snapshot, go -C go run ./cmd/aec-stats ...) printed output byte-identical to talos’s (cmp on both files). The bootstrap’s stream is a function of the seed alone and the arithmetic is IEEE double on amd64 on both; that is a statement about these two machines and this build, not a guarantee across architectures.

Exercises

(a) How many straight passes make the 95 percent lower bound at least 0.9, under Wilson and under Clopper–Pearson?

Answer

Wilson’s lower bound at c=nc = n is 1/(1+z2/n)1/(1 + z^2/n), so z2/n≤1/9z^2/n \le 1/9 and n≥9z2=34.57n \ge 9z^2 = 34.57: 35 passes of 35 give 0.90110.9011. Clopper–Pearson needs 0.0251/n≥0.90.025^{1/n} \ge 0.9, so n≥ln0.025/ln0.9=35.01n \ge \ln 0.025/\ln 0.9 = 35.01: 36 of 36 gives 0.90260.9026, while at 35 the bound is 0.899970.89997, which prints as 0.90000.9000 and is below. Numbers from stats on talos.

(b) Compute pass@3 for n=10n = 10, c=3c = 3 by the binomial ratio and by the product, and show they agree.

Answer

1−(73)/(103)=1−35/120=0.7083331 - \binom{7}{3}/\binom{10}{3} = 1 - 35/120 = 0.708333. The product over i=8,9,10i = 8, 9, 10 is (1−3/8)(1−3/9)(1−3/10)=0.625×0.6667×0.7=0.291667(1 - 3/8)(1 - 3/9)(1 - 3/10) = 0.625 \times 0.6667 \times 0.7 = 0.291667, and 1−0.291667=0.7083331 - 0.291667 = 0.708333.

(c) Chapter 30’s two variants both passed 9 of 9 on three tasks. Run the paired bootstrap over the three tasks in your head: what is the interval, and what does it say?

Answer

Every dt=0d_t = 0, every replicate’s mean is 0 and the interval is [0,0][0, 0] (Paired on equal inputs is the point 0, TestBootstrap). It says the two samples were identical, not that the variants are equivalent: each rate’s own interval is [0.6637,1][0.6637, 1], so either true rate could be 0.7, and a difference of 0.3 between them is not excluded by nine trials. A bootstrap of differences that saw no difference cannot bound the difference.

(d) A column passes all ten trials on eleven of the twelve tasks and none on the twelfth. Compute the naive and clustered standard errors of its pass rate, the normal interval each implies, and compare the second with the cluster bootstrap. What does the 120-trial interval claim that the data do not support?

Answer

x¯=110/120=0.9167\bar x = 110/120 = 0.9167 and s2=120×0.9167×0.0833/119=0.0770s^2 = 120 \times 0.9167 \times 0.0833/119 = 0.0770, so the naive error is s2/120=0.0253\sqrt{s^2/120} = 0.0253. Clustered: in each all-pass cluster the residuals are +0.0833+0.0833 and the cross term is (10×0.0833)2−10×0.08332=0.625(10 \times 0.0833)^2 - 10 \times 0.0833^2 = 0.625, eleven of them make 6.8756.875; in the failing cluster the residuals are −0.9167-0.9167 and the cross term is (9.167)2−10×0.91672=75.63(9.167)^2 - 10 \times 0.9167^2 = 75.63. The total is 82.582.5, over n2=14400n^2 = 14400 is 0.0057290.005729, plus s2/n=0.000642s^2/n = 0.000642, and the root of 0.0063710.006371 is 0.07980.0798 (ClusteredSE, talos). The normal intervals are 0.9167±1.96×0.0253=[0.867,0.966]0.9167 \pm 1.96 \times 0.0253 = [0.867, 0.966] and 0.9167±1.96×0.0798=[0.760,1.073]0.9167 \pm 1.96 \times 0.0798 = [0.760, 1.073]; the cluster bootstrap (seed 1) is [0.75,1][0.75, 1]. The first claims the true rate is below 0.97 with confidence and rests on 120 independent draws. The data are twelve observations of a task, and one of them failed in full: the failure is one task, not ten pieces of evidence, which is why the second interval is more than three times as wide.

(e) The matrix’s straylight-trinity@default column is 120 skipped lines because trinity-mini was unloaded for the whole capture and the lab never loads a model. Load it yourself (it is your fleet) and from go/, run aec-eval run -suite internal/eval/testdata/suite.json -dir ~/Work/aec-runs/part6-trinity -candidates straylight-trinity@default -n 10 -seed 1. In a scratch directory (not the fixture), copy the committed trials.jsonl, replace its 120 skipped trinity lines with the new run’s lines (appending them would duplicate every (candidate, task, rep), which aec-stats refuses), and re-run aec-stats intervals and aec-stats compare <scratch dir> straylight-35b@default straylight-trinity@default. Does the decision move?

Answer

It cannot. The rule names zai@max and straylight-35b@default and was registered before the capture, so decide prints the same verdict: its two columns are unchanged. What you get is trinity-mini’s column with its intervals and its paired difference against the 35b, printed and deciding nothing. To let trinity-mini decide anything you would have to register a new rule naming it before looking at its column, which is the point of pre-registration: a column added after the fact, however it comes out, is a description and not a decision.

(f) McNemar with b=9b = 9, c=1c = 1: compute pp by hand and say what it decides at 5 percent, and what the decision is about.

Answer

m=10m = 10 and 2P(X≤1)=2×(1+10)/1024=22/1024=0.02152\,P(X \le 1) = 2 \times (1 + 10)/1024 = 22/1024 = 0.0215. That is below 0.05: a fair coin splits ten discordant pairs 9 to 1 or worse about one time in fifty. It is a statement about those ten pairs as if they were independent units; if they come from one or two tasks, as the pooled counts above did, they are not, and the paired bootstrap over tasks is the argument that counts.

(g) The Mechanism’s worked example (two raters who each pass 95 percent of items and agree on 96 percent) gives κ=0.579\kappa = 0.579 with no error bar. For its table, 93,2/2,393, 2 / 2, 3 at n=100n = 100, give the large-sample standard error and the normal 95 percent interval for κ\kappa. What does the interval say about the two raters?

Answer

KappaSE gives 0.19020.1902, and κ±1.96×0.1902\kappa \pm 1.96 \times 0.1902 is [0.2061,0.9518][0.2061, 0.9518] (TestKappaExerciseG, talos). The interval runs from about 0.2 to nearly 1: with marginals that lopsided, agreement of 96 percent leaves κ\kappa almost undetermined at 100 items, and chapter 39’s tables print pop_o beside κ\kappa for this reason.

(h) The basic interval on 8/9 is [0.7778,1.1111][0.7778, 1.1111]. Why does it leave [0,1][0, 1], and what does DiCiccio and Efron’s catalogue offer instead?

Answer

The basic interval reflects the replicates’ quantiles through θ^\hat\theta (2×0.8889−0.6667=1.11112 \times 0.8889 - 0.6667 = 1.1111), assuming the pivot θ^−θ\hat\theta - \theta has the same law as θ^∗−θ^\hat\theta^* - \hat\theta. For a bounded statistic at 0.89 the bootstrap distribution is skewed toward 1 and capped by it, and the reflected tail is not. The percentile interval stays in [0,1][0, 1] by construction, and the BCa interval corrects the percentile interval for bias and skewness (the acceleration comes from a jackknife), which is the entry the chapter names and does not derive.

(i) You want to know whether chapter 30’s structured prompt helps. Design the comparison so that a gain cannot be mistaken for the effect of “any extra text”, and say which tasks you would measure on.

Answer

Three arms on the same tasks, paired: the bare prompt, the structured prompt, and a placebo of the same length and shape whose content is irrelevant (a random section from an unrelated document, in the structured prompt’s layout). The structured prompt’s effect is its difference from the placebo, not from the bare prompt; a bare-versus-structured gain that the placebo shares is length or format priming, as in the placebo arm of Zhang et al.’s Experiment 1, where random rules matched curated ones. Measure on all the tasks you registered, with the ceiling tasks in, and report the per-task differences, not only the mean. If you choose tasks by looking for ones where the arms differ, you have selected on the outcome, and the mean over the chosen four of a twelve-task suite is not the effect on the suite (the dixie contrast above: 0.50.5 against 0.16670.1667). If the baseline itself was used to pick the tasks, run it again on fresh trials before comparing, since a task picked for passing sometimes will pass less often next time.

Lab

make lab CH=38 IMPL=mine runs go/labs/ch38 against your code in mine/stats.go. The tests are TestIntervals, TestPassAtK, TestBootstrap and TestKappa, against mine (Wilson, Clopper–Pearson, the stable pass@k, the percentile and paired bootstraps, κ\kappa). TestMatrixShape, TestMatrixNumbers, TestTextClusterReRead, TestFixtureSizes, TestSkInsideWordsOnly, TestRedactorRan and TestNoSecretsInTestdata run on the committed matrix under both implementations, and TestFindSecretsCatchesPlants proves each detector on planted strings. Against the starter the four lab tests fail with NaN values named (wilson lo = NaN, want 0.700900) and no panic.

expected.json is the chapter’s totals and decision, recomputed from the raw records independently of aec-stats. The test aggregates its own counts, intervals and paired bootstrap from the trials file, and the file was cross-checked against the command’s output: the two computations agree on every candidate’s cc, nn, skipped count and Wilson and Clopper–Pearson bounds to four decimals, and on the decision’s task count, mean and bounds. TestMatrixShape also pins that every cell of the two pre-registered columns holds exactly its column’s registered nn (10 for the 35b, 5 for zai@max), so a uniformly short column cannot be committed. Regenerating the fixture is deliberate, AEC_UPDATE=1 for the expected numbers and a new hash in the privacy test for the files.

Further reading

results matching ""

    No results matching ""