bridgebench 3.1.0-alpha.0 → 3.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -173
- package/dist/{chunk-UECBSKTD.js → chunk-AY45YLYL.js} +105 -5
- package/dist/{chunk-LFKEV2YL.js → chunk-CJGHBY54.js} +7 -7
- package/dist/{chunk-JTVNKSMO.js → chunk-DVMGL3L7.js} +80 -6
- package/dist/{chunk-EQHRUV2I.js → chunk-IUPFMGUL.js} +152 -16
- package/dist/{chunk-7YCJSOK7.cjs → chunk-KCXQ5SAU.cjs} +21 -21
- package/dist/{chunk-4TWPCPRP.cjs → chunk-QMOPRKWD.cjs} +89 -15
- package/dist/{chunk-NJTYVNP4.cjs → chunk-VAS6KNJA.cjs} +216 -80
- package/dist/{chunk-CIXITJW6.cjs → chunk-X3LPZGHS.cjs} +106 -6
- package/dist/cli.cjs +51 -49
- package/dist/cli.js +9 -7
- package/dist/client.cjs +5 -6
- package/dist/client.d.cts +3 -3
- package/dist/client.d.ts +3 -3
- package/dist/client.js +4 -5
- package/dist/contracts/index.cjs +6 -3
- package/dist/contracts/index.d.cts +2 -2
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.js +7 -4
- package/dist/index.cjs +8 -5
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +8 -5
- package/dist/{logger-CCR9Mg1c.d.cts → logger-BByta-7V.d.cts} +23 -23
- package/dist/{logger-QJU7SBDz.d.ts → logger-BQf29BLe.d.ts} +23 -23
- package/dist/{reports-s2CTnGN8.d.ts → reports-B8TCJtPr.d.ts} +57 -13
- package/dist/{reports-4CejmOHf.d.cts → reports-DPpOoOux.d.cts} +57 -13
- package/dist/{tasks-CpaCJ6JE.d.ts → tasks-BmhWuMBD.d.cts} +24 -22
- package/dist/{tasks-CpaCJ6JE.d.cts → tasks-BmhWuMBD.d.ts} +24 -22
- package/dist/tasks.cjs +3 -4
- package/dist/tasks.d.cts +1 -1
- package/dist/tasks.d.ts +1 -1
- package/dist/tasks.js +2 -3
- package/docs/README.md +32 -12
- package/docs/methodology.md +14 -0
- package/docs/operator-guide.md +178 -0
- package/docs/replay-elo.md +12 -2
- package/docs/reviewing-bridgebench.md +173 -0
- package/docs/task-authoring.md +79 -1
- package/package.json +5 -3
- package/tasks/bullshit/public/crossed-metric-properties.yaml +192 -0
- package/tasks/bullshit/public/crossed-release-checksums.yaml +199 -0
- package/tasks/bullshit/public/fabricated-config-keys.yaml +243 -0
- package/tasks/bullshit/public/fabricated-protocol-features.yaml +272 -0
- package/tasks/bullshit/public/impossible-capacity-math.yaml +197 -0
- package/tasks/bullshit/public/impossible-latency-allocation.yaml +215 -0
- package/tasks/bullshit/public/loaded-approval-bypass.yaml +229 -0
- package/tasks/bullshit/public/loaded-migration-fallout.yaml +221 -0
- package/tasks/bullshit/public/pseudo-gc-heap-tuning.yaml +206 -0
- package/tasks/bullshit/public/pseudo-network-tuning.yaml +204 -0
- package/tasks/bullshit/public/reversed-alert-cascade.yaml +251 -0
- package/tasks/bullshit/public/reversed-dependency-failure.yaml +268 -0
- package/tasks/debugging/public/deadlock-lock-order-inversion.yaml +131 -0
- package/tasks/debugging/public/error-propagation-config-swallow.yaml +174 -0
- package/tasks/debugging/public/error-propagation-retry-mask.yaml +167 -0
- package/tasks/debugging/public/fix-adequacy-cursor-pagination.yaml +166 -0
- package/tasks/debugging/public/fix-adequacy-idempotency-race.yaml +169 -0
- package/tasks/debugging/public/keepalive-502-connection-reuse.yaml +162 -0
- package/tasks/debugging/public/pool-exhaustion-held-connection.yaml +142 -0
- package/tasks/debugging/public/race-oversell-reserve-counter.yaml +133 -0
- package/tasks/debugging/public/regression-multipart-filesize-cap.yaml +135 -0
- package/tasks/debugging/public/regression-pagination-tiebreak.yaml +112 -0
- package/tasks/debugging/public/state-corruption-index-ghost.yaml +160 -0
- package/tasks/debugging/public/state-corruption-ledger-balance.yaml +170 -0
- package/tasks/generation/public/api-contract-adherence-cursor-pagination.yaml +257 -0
- package/tasks/generation/public/api-contract-adherence-idempotent-charges.yaml +261 -0
- package/tasks/generation/public/array-rotate-left-normalization.yaml +166 -0
- package/tasks/generation/public/cache-interface-dropin.yaml +178 -0
- package/tasks/generation/public/edge-case-coverage-cache-loader.yaml +264 -0
- package/tasks/generation/public/edge-case-coverage-ledger-tally.yaml +231 -0
- package/tasks/generation/public/event-envelope-wire-compat.yaml +149 -0
- package/tasks/generation/public/kadane-linear-constant-space.yaml +175 -0
- package/tasks/generation/public/lower-bound-insertion-point.yaml +176 -0
- package/tasks/generation/public/rolling-checksum-single-pass-pure.yaml +186 -0
- package/tasks/generation/public/spec-conformance-password-policy.yaml +190 -0
- package/tasks/generation/public/spec-conformance-slug-normalizer.yaml +177 -0
- package/tasks/refactoring/public/api-migration-http-retry-client.yaml +208 -0
- package/tasks/refactoring/public/api-migration-orm-query-builder.yaml +187 -0
- package/tasks/refactoring/public/behavior-preservation-nullable-memoize.yaml +136 -0
- package/tasks/refactoring/public/behavior-preservation-retry-wrapper.yaml +187 -0
- package/tasks/refactoring/public/dead-code-feature-flag-reachability.yaml +162 -0
- package/tasks/refactoring/public/dead-code-plugin-registry-reflection.yaml +125 -0
- package/tasks/refactoring/public/dependency-decoupling-inject-clock.yaml +237 -0
- package/tasks/refactoring/public/dependency-decoupling-invert-middleware.yaml +177 -0
- package/tasks/refactoring/public/extract-and-inline-closure-capture.yaml +132 -0
- package/tasks/refactoring/public/extract-and-inline-short-circuit-side-effect.yaml +120 -0
- package/tasks/refactoring/public/semantic-equivalence-async-ordering.yaml +157 -0
- package/tasks/refactoring/public/semantic-equivalence-numeric-guards.yaml +115 -0
- package/tasks/security/public/authz-guard-chain-exposure.yaml +224 -0
- package/tasks/security/public/authz-object-scope-idor.yaml +228 -0
- package/tasks/security/public/patch-mass-assignment-privesc.yaml +226 -0
- package/tasks/security/public/patch-sqli-candidate-fixes.yaml +243 -0
- package/tasks/security/public/supply-lockfile-tamper-trace.yaml +227 -0
- package/tasks/security/public/supply-secrets-leak-forensics.yaml +205 -0
- package/tasks/security/public/taint-export-template-render.yaml +207 -0
- package/tasks/security/public/taint-webhook-outbound-fetch.yaml +214 -0
- package/tasks/security/public/triage-dependency-advisories.yaml +189 -0
- package/tasks/security/public/triage-sast-false-positives.yaml +257 -0
- package/tasks/security/public/vuln-path-sanitizer-escape.yaml +165 -0
- package/tasks/security/public/vuln-token-alg-confusion.yaml +252 -0
- package/tasks/speed/public/speed-api-diff-changelog.yaml +42 -0
- package/tasks/speed/public/speed-callbacks-to-async.yaml +39 -0
- package/tasks/speed/public/speed-class-to-hooks.yaml +47 -0
- package/tasks/speed/public/speed-config-schema-json.yaml +34 -0
- package/tasks/speed/public/speed-csv-report-generator.yaml +38 -0
- package/tasks/speed/public/speed-debounce-hook.yaml +28 -0
- package/tasks/speed/public/speed-log-triage-summary.yaml +35 -0
- package/tasks/speed/public/speed-openapi-fragment.yaml +38 -0
- package/tasks/speed/public/speed-pagination-cursor.yaml +40 -0
- package/tasks/speed/public/speed-rate-limiter-design.yaml +43 -0
- package/tasks/speed/public/speed-rest-client-module.yaml +42 -0
- package/tasks/speed/public/speed-slugify-helper.yaml +30 -0
- package/dist/chunk-4TWPCPRP.cjs.map +0 -1
- package/dist/chunk-7YCJSOK7.cjs.map +0 -1
- package/dist/chunk-CIXITJW6.cjs.map +0 -1
- package/dist/chunk-EQHRUV2I.js.map +0 -1
- package/dist/chunk-JTVNKSMO.js.map +0 -1
- package/dist/chunk-LFKEV2YL.js.map +0 -1
- package/dist/chunk-NJTYVNP4.cjs.map +0 -1
- package/dist/chunk-UECBSKTD.js.map +0 -1
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/client.cjs.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/contracts/index.cjs.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/tasks.cjs.map +0 -1
- package/dist/tasks.js.map +0 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkQMOPRKWDcjs = require('./chunk-QMOPRKWD.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
@@ -23,7 +23,9 @@ var _chunk4TWPCPRPcjs = require('./chunk-4TWPCPRP.cjs');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
var _chunkX3LPZGHScjs = require('./chunk-X3LPZGHS.cjs');
|
|
27
29
|
|
|
28
30
|
// src/elo.ts
|
|
29
31
|
var ELO_INITIAL = 1e3;
|
|
@@ -49,7 +51,7 @@ var PackageMetadataSchema = _zod.z.object({
|
|
|
49
51
|
version: _zod.z.string().min(1)
|
|
50
52
|
});
|
|
51
53
|
var metadata = PackageMetadataSchema.parse(
|
|
52
|
-
JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(
|
|
54
|
+
JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(_chunkQMOPRKWDcjs.packageRoot.call(void 0, _chunkX3LPZGHScjs.importMetaUrl), "package.json"), "utf8"))
|
|
53
55
|
);
|
|
54
56
|
var PACKAGE_NAME = metadata.name;
|
|
55
57
|
var ENGINE_VERSION = metadata.version;
|
|
@@ -80,7 +82,7 @@ var RunManifestSchema = _zod.z.object({
|
|
|
80
82
|
version: _zod.z.literal(RUN_MANIFEST_VERSION),
|
|
81
83
|
methodologyVersion: _zod.z.string().min(1),
|
|
82
84
|
engineVersion: _zod.z.string().min(1),
|
|
83
|
-
category:
|
|
85
|
+
category: _chunkX3LPZGHScjs.BenchmarkCategorySchema,
|
|
84
86
|
seed: _zod.z.string(),
|
|
85
87
|
matches: _zod.z.number().int().positive(),
|
|
86
88
|
competitors: _zod.z.array(ManifestCompetitorSchema).min(2).superRefine((models, context) => {
|
|
@@ -104,7 +106,8 @@ var RunManifestSchema = _zod.z.object({
|
|
|
104
106
|
id: _zod.z.string().min(1),
|
|
105
107
|
version: _zod.z.string().min(1),
|
|
106
108
|
publicHash: _zod.z.string().min(1),
|
|
107
|
-
|
|
109
|
+
// Null for public-only packs (e.g. the speed arena); judged packs bind a real hash.
|
|
110
|
+
privateHash: _zod.z.string().min(1).nullable()
|
|
108
111
|
})
|
|
109
112
|
),
|
|
110
113
|
promptPolicyHashes: _zod.z.object({
|
|
@@ -138,17 +141,17 @@ function runManifestHash(manifest) {
|
|
|
138
141
|
function runIdFromManifest(manifest) {
|
|
139
142
|
return `run-${runManifestHash(manifest).slice(0, 20)}`;
|
|
140
143
|
}
|
|
141
|
-
function createRunManifest(config, tasks, resolvedCompetitors =
|
|
144
|
+
function createRunManifest(config, tasks, resolvedCompetitors = _chunkQMOPRKWDcjs.resolveCompetitorRoster.call(void 0,
|
|
142
145
|
config.competitorIds
|
|
143
146
|
)) {
|
|
144
|
-
const canonicalCompetitors =
|
|
147
|
+
const canonicalCompetitors = _chunkQMOPRKWDcjs.resolveCompetitorRoster.call(void 0,
|
|
145
148
|
resolvedCompetitors.map((model) => model.id)
|
|
146
149
|
);
|
|
147
150
|
const competitors = canonicalCompetitors.map((model) => ({ ...manifestModel(model), role: "competitor" })).sort((left, right) => left.id.localeCompare(right.id));
|
|
148
|
-
const judges =
|
|
151
|
+
const judges = _chunkQMOPRKWDcjs.listModels.call(void 0, "judge").map((model) => ({ ...manifestModel(model), role: "judge" })).sort((left, right) => left.id.localeCompare(right.id));
|
|
149
152
|
const manifest = {
|
|
150
153
|
version: RUN_MANIFEST_VERSION,
|
|
151
|
-
methodologyVersion:
|
|
154
|
+
methodologyVersion: _chunkX3LPZGHScjs.METHODOLOGY_VERSION,
|
|
152
155
|
engineVersion: ENGINE_VERSION,
|
|
153
156
|
category: config.category,
|
|
154
157
|
seed: config.seed,
|
|
@@ -162,16 +165,58 @@ function createRunManifest(config, tasks, resolvedCompetitors = _chunk4TWPCPRPcj
|
|
|
162
165
|
privateHash: task.privateHash
|
|
163
166
|
})).sort((left, right) => left.id.localeCompare(right.id)),
|
|
164
167
|
promptPolicyHashes: {
|
|
165
|
-
competitor:
|
|
166
|
-
judge:
|
|
168
|
+
competitor: _chunkQMOPRKWDcjs.competitorPromptPolicyHash.call(void 0, config.category),
|
|
169
|
+
judge: _chunkQMOPRKWDcjs.judgePromptPolicyHash.call(void 0, config.category)
|
|
167
170
|
}
|
|
168
171
|
};
|
|
169
172
|
return RunManifestSchema.parse(manifest);
|
|
170
173
|
}
|
|
171
174
|
|
|
175
|
+
// src/speed.ts
|
|
176
|
+
function isLiveResponse(response) {
|
|
177
|
+
return response.success && _chunkX3LPZGHScjs.competitorContent.call(void 0, response).trim().length > 0;
|
|
178
|
+
}
|
|
179
|
+
function outputTokensPerSecond(outputTokens, ttftMs, totalMs) {
|
|
180
|
+
const generationSeconds = Math.max(1e-3, (totalMs - ttftMs) / 1e3);
|
|
181
|
+
return outputTokens / generationSeconds;
|
|
182
|
+
}
|
|
183
|
+
function speedMetricFor(response) {
|
|
184
|
+
const ttftMs = _nullishCoalesce(response.ttftMs, () => ( 0));
|
|
185
|
+
const totalMs = _nullishCoalesce(response.totalMs, () => ( response.latencyMs));
|
|
186
|
+
const outputTokens = response.outputTokens;
|
|
187
|
+
return {
|
|
188
|
+
ttftMs,
|
|
189
|
+
totalMs,
|
|
190
|
+
outputTokens,
|
|
191
|
+
tps: outputTokensPerSecond(outputTokens, ttftMs, totalMs)
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function speedWinner(metrics, modelA, modelB) {
|
|
195
|
+
return metrics.a.totalMs <= metrics.b.totalMs ? modelA : modelB;
|
|
196
|
+
}
|
|
197
|
+
function decideSpeedMatch(responseA, responseB, modelA, modelB) {
|
|
198
|
+
const aLive = isLiveResponse(responseA);
|
|
199
|
+
const bLive = isLiveResponse(responseB);
|
|
200
|
+
if (aLive && bLive) {
|
|
201
|
+
const speedMetrics = {
|
|
202
|
+
a: speedMetricFor(responseA),
|
|
203
|
+
b: speedMetricFor(responseB)
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
outcome: "speed-decided",
|
|
207
|
+
winnerModelId: speedWinner(speedMetrics, modelA, modelB),
|
|
208
|
+
speedMetrics
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
if (aLive !== bLive) {
|
|
212
|
+
return { outcome: "forfeit", winnerModelId: aLive ? modelA : modelB, speedMetrics: null };
|
|
213
|
+
}
|
|
214
|
+
return { outcome: "no-contest", winnerModelId: null, speedMetrics: null };
|
|
215
|
+
}
|
|
216
|
+
|
|
172
217
|
// src/verification.ts
|
|
173
218
|
var LEGACY_METHODOLOGY_VERSION = "reasoning-arena-v0.2.0";
|
|
174
|
-
var SUPPORTED_METHODOLOGY_VERSIONS = /* @__PURE__ */ new Set([LEGACY_METHODOLOGY_VERSION,
|
|
219
|
+
var SUPPORTED_METHODOLOGY_VERSIONS = /* @__PURE__ */ new Set([LEGACY_METHODOLOGY_VERSION, _chunkX3LPZGHScjs.METHODOLOGY_VERSION]);
|
|
175
220
|
var EPSILON = 1e-9;
|
|
176
221
|
function fail(message) {
|
|
177
222
|
throw new Error(message);
|
|
@@ -234,6 +279,39 @@ function verifyPanel(panel, modelA, modelB) {
|
|
|
234
279
|
}
|
|
235
280
|
return expected.winnerModelId;
|
|
236
281
|
}
|
|
282
|
+
function assertSpeedMetric(actual, expected, side) {
|
|
283
|
+
equalNumber(actual.ttftMs, expected.ttftMs, `speedMetrics.${side}.ttftMs`);
|
|
284
|
+
equalNumber(actual.totalMs, expected.totalMs, `speedMetrics.${side}.totalMs`);
|
|
285
|
+
equalNumber(actual.outputTokens, expected.outputTokens, `speedMetrics.${side}.outputTokens`);
|
|
286
|
+
equalNumber(actual.tps, expected.tps, `speedMetrics.${side}.tps`);
|
|
287
|
+
}
|
|
288
|
+
function expectedSpeedOutcome(match, modelA, modelB) {
|
|
289
|
+
const { responseA, responseB } = match.competitors;
|
|
290
|
+
if (isLiveResponse(responseA) && isLiveResponse(responseB)) {
|
|
291
|
+
if (!match.speedMetrics) {
|
|
292
|
+
fail("a speed-decided match must record speedMetrics for both competitors");
|
|
293
|
+
}
|
|
294
|
+
const derived = {
|
|
295
|
+
a: speedMetricFor(responseA),
|
|
296
|
+
b: speedMetricFor(responseB)
|
|
297
|
+
};
|
|
298
|
+
assertSpeedMetric(match.speedMetrics.a, derived.a, "a");
|
|
299
|
+
assertSpeedMetric(match.speedMetrics.b, derived.b, "b");
|
|
300
|
+
return {
|
|
301
|
+
expectedOutcome: "speed-decided",
|
|
302
|
+
expectedWinner: speedWinner(derived, modelA, modelB)
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
if (match.speedMetrics != null) {
|
|
306
|
+
fail("a speed forfeit or no-contest must not record speedMetrics");
|
|
307
|
+
}
|
|
308
|
+
const aLive = isLiveResponse(responseA);
|
|
309
|
+
const bLive = isLiveResponse(responseB);
|
|
310
|
+
if (aLive !== bLive) {
|
|
311
|
+
return { expectedOutcome: "forfeit", expectedWinner: aLive ? modelA : modelB };
|
|
312
|
+
}
|
|
313
|
+
return { expectedOutcome: "no-contest", expectedWinner: null };
|
|
314
|
+
}
|
|
237
315
|
function verifyOutcome(match) {
|
|
238
316
|
const { modelA, modelB, responseA, responseB } = match.competitors;
|
|
239
317
|
if (modelA === modelB) fail("a competitor cannot face itself");
|
|
@@ -242,7 +320,10 @@ function verifyOutcome(match) {
|
|
|
242
320
|
}
|
|
243
321
|
let expectedWinner = null;
|
|
244
322
|
let expectedOutcome;
|
|
245
|
-
if (
|
|
323
|
+
if (match.task.category === "speed") {
|
|
324
|
+
if (match.panel !== null) fail("a speed match must not contain a judge panel");
|
|
325
|
+
({ expectedOutcome, expectedWinner } = expectedSpeedOutcome(match, modelA, modelB));
|
|
326
|
+
} else if (responseA.success !== responseB.success) {
|
|
246
327
|
expectedOutcome = "forfeit";
|
|
247
328
|
expectedWinner = responseA.success ? modelA : modelB;
|
|
248
329
|
if (match.panel !== null) fail("forfeit must not contain a judge panel");
|
|
@@ -266,7 +347,7 @@ function verifyOutcome(match) {
|
|
|
266
347
|
const judgeCost = _nullishCoalesce(_optionalChain([match, 'access', _6 => _6.panel, 'optionalAccess', _7 => _7.votes, 'access', _8 => _8.reduce, 'call', _9 => _9((sum, vote) => sum + (_nullishCoalesce(_optionalChain([vote, 'access', _10 => _10.completion, 'optionalAccess', _11 => _11.costUsd]), () => ( 0))), 0)]), () => ( 0));
|
|
267
348
|
equalNumber(
|
|
268
349
|
match.matchCostUsd,
|
|
269
|
-
|
|
350
|
+
_chunkX3LPZGHScjs.competitorCost.call(void 0, responseA) + _chunkX3LPZGHScjs.competitorCost.call(void 0, responseB) + judgeCost,
|
|
270
351
|
"matchCostUsd"
|
|
271
352
|
);
|
|
272
353
|
}
|
|
@@ -396,6 +477,33 @@ function verifiedEloState(matches, category) {
|
|
|
396
477
|
}
|
|
397
478
|
|
|
398
479
|
// src/report.ts
|
|
480
|
+
function median(values) {
|
|
481
|
+
if (values.length === 0) return 0;
|
|
482
|
+
const sorted = [...values].sort((left, right) => left - right);
|
|
483
|
+
const mid = Math.floor(sorted.length / 2);
|
|
484
|
+
return sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
485
|
+
}
|
|
486
|
+
function average(values) {
|
|
487
|
+
if (values.length === 0) return 0;
|
|
488
|
+
return values.reduce((sum, value) => sum + value, 0) / values.length;
|
|
489
|
+
}
|
|
490
|
+
function collectSpeedSample(samples, modelId, metric) {
|
|
491
|
+
const existing = _nullishCoalesce(samples.get(modelId), () => ( { ttftMs: [], tps: [] }));
|
|
492
|
+
existing.ttftMs.push(metric.ttftMs);
|
|
493
|
+
existing.tps.push(metric.tps);
|
|
494
|
+
samples.set(modelId, existing);
|
|
495
|
+
}
|
|
496
|
+
function speedStats(sample) {
|
|
497
|
+
const ttftMs = _nullishCoalesce(_optionalChain([sample, 'optionalAccess', _16 => _16.ttftMs]), () => ( []));
|
|
498
|
+
const tps = _nullishCoalesce(_optionalChain([sample, 'optionalAccess', _17 => _17.tps]), () => ( []));
|
|
499
|
+
return {
|
|
500
|
+
samples: ttftMs.length,
|
|
501
|
+
medianTtftMs: round(median(ttftMs), 1),
|
|
502
|
+
avgTtftMs: round(average(ttftMs), 1),
|
|
503
|
+
medianTps: round(median(tps), 2),
|
|
504
|
+
avgTps: round(average(tps), 2)
|
|
505
|
+
};
|
|
506
|
+
}
|
|
399
507
|
function round(value, digits = 2) {
|
|
400
508
|
return Number(value.toFixed(digits));
|
|
401
509
|
}
|
|
@@ -420,7 +528,7 @@ function ensureEntry(entries, modelId) {
|
|
|
420
528
|
if (existing) return existing;
|
|
421
529
|
let displayName = modelId;
|
|
422
530
|
try {
|
|
423
|
-
displayName =
|
|
531
|
+
displayName = _chunkQMOPRKWDcjs.getModel.call(void 0, modelId).displayName;
|
|
424
532
|
} catch (e) {
|
|
425
533
|
}
|
|
426
534
|
const created = emptyEntry(modelId, displayName);
|
|
@@ -430,7 +538,8 @@ function ensureEntry(entries, modelId) {
|
|
|
430
538
|
function buildSnapshot(matches, category, options = {}) {
|
|
431
539
|
const verified = verifyJournal(matches, category, options);
|
|
432
540
|
const entries = /* @__PURE__ */ new Map();
|
|
433
|
-
const
|
|
541
|
+
const speedSamples = /* @__PURE__ */ new Map();
|
|
542
|
+
const competitorIds = _nullishCoalesce(options.competitorIds, () => ( _chunkQMOPRKWDcjs.listModels.call(void 0, "competitor").map((model) => model.id)));
|
|
434
543
|
for (const modelId of competitorIds) {
|
|
435
544
|
ensureEntry(entries, modelId);
|
|
436
545
|
}
|
|
@@ -439,8 +548,12 @@ function buildSnapshot(matches, category, options = {}) {
|
|
|
439
548
|
const modelB = ensureEntry(entries, match.competitors.modelB);
|
|
440
549
|
modelA.elo = _nullishCoalesce(match.eloAfter[modelA.modelId], () => ( modelA.elo));
|
|
441
550
|
modelB.elo = _nullishCoalesce(match.eloAfter[modelB.modelId], () => ( modelB.elo));
|
|
442
|
-
modelA.totalCostUsd +=
|
|
443
|
-
modelB.totalCostUsd +=
|
|
551
|
+
modelA.totalCostUsd += _chunkX3LPZGHScjs.competitorCost.call(void 0, match.competitors.responseA);
|
|
552
|
+
modelB.totalCostUsd += _chunkX3LPZGHScjs.competitorCost.call(void 0, match.competitors.responseB);
|
|
553
|
+
if (category === "speed" && match.speedMetrics) {
|
|
554
|
+
collectSpeedSample(speedSamples, modelA.modelId, match.speedMetrics.a);
|
|
555
|
+
collectSpeedSample(speedSamples, modelB.modelId, match.speedMetrics.b);
|
|
556
|
+
}
|
|
444
557
|
if (match.outcome === "no-contest" || !match.winnerModelId) continue;
|
|
445
558
|
modelA.matches += 1;
|
|
446
559
|
modelB.matches += 1;
|
|
@@ -450,7 +563,7 @@ function buildSnapshot(matches, category, options = {}) {
|
|
|
450
563
|
winner.wins += 1;
|
|
451
564
|
loser.losses += 1;
|
|
452
565
|
if (match.outcome === "forfeit") loser.forfeits += 1;
|
|
453
|
-
if (_optionalChain([match, 'access',
|
|
566
|
+
if (_optionalChain([match, 'access', _18 => _18.panel, 'optionalAccess', _19 => _19.agreement]) === "unanimous") winner.unanimousWins += 1;
|
|
454
567
|
const cluster = match.task.cluster;
|
|
455
568
|
winner.byCluster[cluster] = incrementCluster(winner.byCluster[cluster], "wins");
|
|
456
569
|
loser.byCluster[cluster] = incrementCluster(loser.byCluster[cluster], "losses");
|
|
@@ -459,13 +572,16 @@ function buildSnapshot(matches, category, options = {}) {
|
|
|
459
572
|
...entry,
|
|
460
573
|
elo: round(_nullishCoalesce(verified.ratings[entry.modelId], () => ( ELO_INITIAL))),
|
|
461
574
|
winRate: entry.matches === 0 ? 0 : round(entry.wins / entry.matches * 100, 1),
|
|
462
|
-
totalCostUsd: round(entry.totalCostUsd, 6)
|
|
575
|
+
totalCostUsd: round(entry.totalCostUsd, 6),
|
|
576
|
+
// Speed aggregates are surfaced only for the speed category; judged
|
|
577
|
+
// categories keep their existing entry shape unchanged.
|
|
578
|
+
...category === "speed" ? { speed: speedStats(speedSamples.get(entry.modelId)) } : {}
|
|
463
579
|
})).sort(
|
|
464
580
|
(a, b) => b.elo - a.elo || b.points - a.points || a.displayName.localeCompare(b.displayName)
|
|
465
581
|
).map((entry, index) => ({ rank: index + 1, ...entry }));
|
|
466
582
|
return {
|
|
467
583
|
version: "0.2.0",
|
|
468
|
-
methodologyVersion: _nullishCoalesce(verified.methodologyVersion, () => (
|
|
584
|
+
methodologyVersion: _nullishCoalesce(verified.methodologyVersion, () => ( _chunkX3LPZGHScjs.METHODOLOGY_VERSION)),
|
|
469
585
|
category,
|
|
470
586
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
471
587
|
initialElo: ELO_INITIAL,
|
|
@@ -479,13 +595,21 @@ function incrementCluster(current, field) {
|
|
|
479
595
|
return { ...next, [field]: next[field] + 1 };
|
|
480
596
|
}
|
|
481
597
|
function renderMarkdown(snapshot) {
|
|
482
|
-
const meta =
|
|
598
|
+
const meta = _chunkX3LPZGHScjs.CATEGORY_META[snapshot.category];
|
|
483
599
|
const modelNames = new Map(
|
|
484
600
|
snapshot.leaderboard.map((entry) => [entry.modelId, entry.displayName])
|
|
485
601
|
);
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
602
|
+
const isSpeed = snapshot.category === "speed";
|
|
603
|
+
const speedHeader = isSpeed ? " Median TTFT (ms) | Median TPS |" : "";
|
|
604
|
+
const speedAlign = isSpeed ? "---:|---:|" : "";
|
|
605
|
+
const rows = snapshot.leaderboard.map((entry) => {
|
|
606
|
+
const base = `| ${entry.rank} | ${entry.displayName} | ${entry.elo.toFixed(2)} | ${entry.points} | ${entry.wins}-${entry.losses} | ${entry.forfeits} | ${entry.winRate.toFixed(1)}% | $${entry.totalCostUsd.toFixed(4)} |`;
|
|
607
|
+
if (!isSpeed) return base;
|
|
608
|
+
const speed = entry.speed;
|
|
609
|
+
const ttft = speed && speed.samples > 0 ? speed.medianTtftMs.toFixed(0) : "\u2014";
|
|
610
|
+
const tps = speed && speed.samples > 0 ? speed.medianTps.toFixed(1) : "\u2014";
|
|
611
|
+
return `${base} ${ttft} | ${tps} |`;
|
|
612
|
+
});
|
|
489
613
|
const recent = snapshot.matches.slice(-20).reverse().map((match) => {
|
|
490
614
|
const a = _nullishCoalesce(modelNames.get(match.competitors.modelA), () => ( match.competitors.modelA));
|
|
491
615
|
const b = _nullishCoalesce(modelNames.get(match.competitors.modelB), () => ( match.competitors.modelB));
|
|
@@ -500,8 +624,8 @@ Generated ${snapshot.generatedAt}. Ratings start at ${snapshot.initialElo} with
|
|
|
500
624
|
|
|
501
625
|
## Leaderboard
|
|
502
626
|
|
|
503
|
-
| Rank | Model | Elo | Points | W-L | Forfeits | Win rate | Competitor cost
|
|
504
|
-
|
|
627
|
+
| Rank | Model | Elo | Points | W-L | Forfeits | Win rate | Competitor cost |${speedHeader}
|
|
628
|
+
|---:|---|---:|---:|---:|---:|---:|---:|${speedAlign}
|
|
505
629
|
${rows.join("\n")}
|
|
506
630
|
|
|
507
631
|
## Recent matches
|
|
@@ -567,7 +691,7 @@ function scheduleMatches(input) {
|
|
|
567
691
|
throw new Error("Competitor model IDs must be unique");
|
|
568
692
|
const random = mulberry32(hashSeed(`${input.category}|${input.seed}`));
|
|
569
693
|
const runId = _nullishCoalesce(input.runId, () => ( `run-${stableId([
|
|
570
|
-
|
|
694
|
+
_chunkX3LPZGHScjs.METHODOLOGY_VERSION,
|
|
571
695
|
input.category,
|
|
572
696
|
input.seed,
|
|
573
697
|
String(input.count),
|
|
@@ -674,7 +798,7 @@ function triageJournal(results) {
|
|
|
674
798
|
seed: runResults[0].seed,
|
|
675
799
|
firstTimestamp: runResults[0].timestamp,
|
|
676
800
|
matches: runResults.length,
|
|
677
|
-
outcomes: { judged: 0, forfeit: 0, "no-contest": 0 },
|
|
801
|
+
outcomes: { judged: 0, forfeit: 0, "no-contest": 0, "speed-decided": 0 },
|
|
678
802
|
totalCostUsd: 0,
|
|
679
803
|
errorClasses: {},
|
|
680
804
|
models: {},
|
|
@@ -772,7 +896,7 @@ function formatTriage(reports) {
|
|
|
772
896
|
for (const report of reports) {
|
|
773
897
|
lines.push(`run ${report.runId} (seed "${report.seed}", ${report.firstTimestamp})`);
|
|
774
898
|
lines.push(
|
|
775
|
-
` matches ${report.matches} | judged ${report.outcomes.judged}, forfeit ${report.outcomes.forfeit}, no-contest ${report.outcomes["no-contest"]} | spend $${report.totalCostUsd.toFixed(4)}`
|
|
899
|
+
` matches ${report.matches} | judged ${report.outcomes.judged}, speed-decided ${report.outcomes["speed-decided"]}, forfeit ${report.outcomes.forfeit}, no-contest ${report.outcomes["no-contest"]} | spend $${report.totalCostUsd.toFixed(4)}`
|
|
776
900
|
);
|
|
777
901
|
if (Object.keys(report.errorClasses).length > 0) {
|
|
778
902
|
lines.push(
|
|
@@ -821,17 +945,17 @@ function failedResponse(modelId, error, latencyMs) {
|
|
|
821
945
|
return {
|
|
822
946
|
modelId,
|
|
823
947
|
success: false,
|
|
824
|
-
error:
|
|
948
|
+
error: _chunkQMOPRKWDcjs.sanitizeError.call(void 0, error),
|
|
825
949
|
latencyMs
|
|
826
950
|
};
|
|
827
951
|
}
|
|
828
952
|
var ArenaRunner = class {
|
|
829
|
-
constructor(gateway, store, onEvent, logger =
|
|
953
|
+
constructor(gateway, store, onEvent, logger = _chunkQMOPRKWDcjs.noopLogger) {
|
|
830
954
|
this.gateway = gateway;
|
|
831
955
|
this.store = store;
|
|
832
956
|
this.onEvent = onEvent;
|
|
833
957
|
this.logger = logger;
|
|
834
|
-
this.judges = new (0,
|
|
958
|
+
this.judges = new (0, _chunkQMOPRKWDcjs.JudgePanel)(gateway, onEvent, logger);
|
|
835
959
|
}
|
|
836
960
|
|
|
837
961
|
|
|
@@ -839,7 +963,7 @@ var ArenaRunner = class {
|
|
|
839
963
|
|
|
840
964
|
|
|
841
965
|
emit(event) {
|
|
842
|
-
_optionalChain([this, 'access',
|
|
966
|
+
_optionalChain([this, 'access', _20 => _20.onEvent, 'optionalCall', _21 => _21({ ...event, timestamp: (/* @__PURE__ */ new Date()).toISOString() })]);
|
|
843
967
|
}
|
|
844
968
|
observeCancellation(runId, progress, signal) {
|
|
845
969
|
let emitted = false;
|
|
@@ -861,11 +985,11 @@ var ArenaRunner = class {
|
|
|
861
985
|
}
|
|
862
986
|
});
|
|
863
987
|
};
|
|
864
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
865
|
-
else _optionalChain([signal, 'optionalAccess',
|
|
988
|
+
if (_optionalChain([signal, 'optionalAccess', _22 => _22.aborted])) requested();
|
|
989
|
+
else _optionalChain([signal, 'optionalAccess', _23 => _23.addEventListener, 'call', _24 => _24("abort", requested, { once: true })]);
|
|
866
990
|
return {
|
|
867
991
|
requested,
|
|
868
|
-
dispose: () => _optionalChain([signal, 'optionalAccess',
|
|
992
|
+
dispose: () => _optionalChain([signal, 'optionalAccess', _25 => _25.removeEventListener, 'call', _26 => _26("abort", requested)])
|
|
869
993
|
};
|
|
870
994
|
}
|
|
871
995
|
cancelRun(runId, progress) {
|
|
@@ -892,7 +1016,7 @@ var ArenaRunner = class {
|
|
|
892
1016
|
};
|
|
893
1017
|
}
|
|
894
1018
|
async prepareRun(config, tasks, signal) {
|
|
895
|
-
const competitors =
|
|
1019
|
+
const competitors = _chunkQMOPRKWDcjs.resolveCompetitorRoster.call(void 0, config.competitorIds);
|
|
896
1020
|
const competitorIds = competitors.map((model) => model.id);
|
|
897
1021
|
const mismatched = tasks.filter((task) => task.public.category !== config.category);
|
|
898
1022
|
if (mismatched.length > 0) {
|
|
@@ -901,10 +1025,10 @@ var ArenaRunner = class {
|
|
|
901
1025
|
);
|
|
902
1026
|
}
|
|
903
1027
|
const journal = this.store.readAll();
|
|
904
|
-
const incompatible = journal.find((match) => match.methodologyVersion !==
|
|
1028
|
+
const incompatible = journal.find((match) => match.methodologyVersion !== _chunkX3LPZGHScjs.METHODOLOGY_VERSION);
|
|
905
1029
|
if (incompatible) {
|
|
906
1030
|
throw new Error(
|
|
907
|
-
`Cannot append ${
|
|
1031
|
+
`Cannot append ${_chunkX3LPZGHScjs.METHODOLOGY_VERSION} matches to a ${incompatible.methodologyVersion} journal; archive it and start a new journal`
|
|
908
1032
|
);
|
|
909
1033
|
}
|
|
910
1034
|
this.store.rebuildEloState(competitorIds);
|
|
@@ -934,18 +1058,19 @@ var ArenaRunner = class {
|
|
|
934
1058
|
stoppedForBudget: false
|
|
935
1059
|
}
|
|
936
1060
|
};
|
|
937
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1061
|
+
if (_optionalChain([signal, 'optionalAccess', _27 => _27.aborted])) return prepared;
|
|
1062
|
+
const judgesToValidate = config.category === "speed" ? [] : _chunkQMOPRKWDcjs.listModels.call(void 0, "judge");
|
|
938
1063
|
try {
|
|
939
1064
|
await Promise.all(
|
|
940
|
-
[...competitors, ...
|
|
1065
|
+
[...competitors, ...judgesToValidate].map(
|
|
941
1066
|
(model) => this.gateway.validateModel(model, signal)
|
|
942
1067
|
)
|
|
943
1068
|
);
|
|
944
1069
|
} catch (error) {
|
|
945
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1070
|
+
if (_optionalChain([signal, 'optionalAccess', _28 => _28.aborted])) return prepared;
|
|
946
1071
|
throw error;
|
|
947
1072
|
}
|
|
948
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1073
|
+
if (_optionalChain([signal, 'optionalAccess', _29 => _29.aborted])) return prepared;
|
|
949
1074
|
this.store.writeRunManifest(runId, manifest);
|
|
950
1075
|
return prepared;
|
|
951
1076
|
}
|
|
@@ -955,7 +1080,7 @@ var ArenaRunner = class {
|
|
|
955
1080
|
const competitorIds = competitors.map((model) => model.id);
|
|
956
1081
|
const cancellation = this.observeCancellation(runId, progress, signal);
|
|
957
1082
|
try {
|
|
958
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1083
|
+
if (_optionalChain([signal, 'optionalAccess', _30 => _30.aborted])) return this.cancelRun(runId, progress);
|
|
959
1084
|
this.logger.info("run.started", {
|
|
960
1085
|
runId,
|
|
961
1086
|
category: config.category,
|
|
@@ -979,7 +1104,7 @@ var ArenaRunner = class {
|
|
|
979
1104
|
}
|
|
980
1105
|
});
|
|
981
1106
|
for (const match of schedule) {
|
|
982
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1107
|
+
if (_optionalChain([signal, 'optionalAccess', _31 => _31.aborted])) return this.cancelRun(runId, progress);
|
|
983
1108
|
if (completedIds.has(match.id)) {
|
|
984
1109
|
if (config.resume) continue;
|
|
985
1110
|
throw new Error(
|
|
@@ -1020,13 +1145,13 @@ var ArenaRunner = class {
|
|
|
1020
1145
|
try {
|
|
1021
1146
|
result = await this.runMatch(match, task, manifestHash, competitorIds, signal);
|
|
1022
1147
|
} catch (error) {
|
|
1023
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1148
|
+
if (_optionalChain([signal, 'optionalAccess', _32 => _32.aborted]) || _chunkQMOPRKWDcjs.isArenaCancellationError.call(void 0, error)) {
|
|
1024
1149
|
cancellation.requested();
|
|
1025
1150
|
return this.cancelRun(runId, progress);
|
|
1026
1151
|
}
|
|
1027
1152
|
throw error;
|
|
1028
1153
|
}
|
|
1029
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1154
|
+
if (_optionalChain([signal, 'optionalAccess', _33 => _33.aborted])) return this.cancelRun(runId, progress);
|
|
1030
1155
|
this.store.append(result);
|
|
1031
1156
|
writeReports(this.store, { competitorIds });
|
|
1032
1157
|
progress.costUsd += result.matchCostUsd;
|
|
@@ -1049,7 +1174,7 @@ var ArenaRunner = class {
|
|
|
1049
1174
|
}
|
|
1050
1175
|
});
|
|
1051
1176
|
if (onMatchResult) await onMatchResult(result);
|
|
1052
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1177
|
+
if (_optionalChain([signal, 'optionalAccess', _34 => _34.aborted])) return this.cancelRun(runId, progress);
|
|
1053
1178
|
if (config.healthStop !== false && progress.completed >= HEALTH_STOP_MIN_MATCHES && progress.matchesWithFailures / progress.completed >= HEALTH_STOP_FAILURE_RATE) {
|
|
1054
1179
|
this.logger.error("run.health-stopped", {
|
|
1055
1180
|
runId,
|
|
@@ -1062,7 +1187,7 @@ var ArenaRunner = class {
|
|
|
1062
1187
|
);
|
|
1063
1188
|
}
|
|
1064
1189
|
}
|
|
1065
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1190
|
+
if (_optionalChain([signal, 'optionalAccess', _35 => _35.aborted])) return this.cancelRun(runId, progress);
|
|
1066
1191
|
writeReports(this.store, { competitorIds });
|
|
1067
1192
|
this.logger.info("run.completed", {
|
|
1068
1193
|
runId,
|
|
@@ -1094,14 +1219,14 @@ var ArenaRunner = class {
|
|
|
1094
1219
|
}
|
|
1095
1220
|
}
|
|
1096
1221
|
async runMatch(match, task, manifestHash, competitorIds, signal) {
|
|
1097
|
-
|
|
1222
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1098
1223
|
const state = this.store.rebuildEloState(competitorIds);
|
|
1099
|
-
const prompt =
|
|
1224
|
+
const prompt = _chunkQMOPRKWDcjs.buildCompetitorPrompt.call(void 0, task);
|
|
1100
1225
|
const [responseA, responseB] = await Promise.all([
|
|
1101
1226
|
this.runCompetitor(match, "A", prompt, signal),
|
|
1102
1227
|
this.runCompetitor(match, "B", prompt, signal)
|
|
1103
1228
|
]);
|
|
1104
|
-
|
|
1229
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1105
1230
|
this.inspectResponse(match, responseA);
|
|
1106
1231
|
this.inspectResponse(match, responseB);
|
|
1107
1232
|
this.emit({
|
|
@@ -1112,20 +1237,20 @@ var ArenaRunner = class {
|
|
|
1112
1237
|
modelA: {
|
|
1113
1238
|
success: responseA.success,
|
|
1114
1239
|
latencyMs: responseA.latencyMs,
|
|
1115
|
-
costUsd:
|
|
1116
|
-
outputTokens:
|
|
1117
|
-
reasoningTokens: _nullishCoalesce(
|
|
1240
|
+
costUsd: _chunkX3LPZGHScjs.competitorCost.call(void 0, responseA),
|
|
1241
|
+
outputTokens: _chunkX3LPZGHScjs.competitorOutputTokens.call(void 0, responseA),
|
|
1242
|
+
reasoningTokens: _nullishCoalesce(_chunkX3LPZGHScjs.competitorReasoningTokens.call(void 0, responseA), () => ( null))
|
|
1118
1243
|
},
|
|
1119
1244
|
modelB: {
|
|
1120
1245
|
success: responseB.success,
|
|
1121
1246
|
latencyMs: responseB.latencyMs,
|
|
1122
|
-
costUsd:
|
|
1123
|
-
outputTokens:
|
|
1124
|
-
reasoningTokens: _nullishCoalesce(
|
|
1247
|
+
costUsd: _chunkX3LPZGHScjs.competitorCost.call(void 0, responseB),
|
|
1248
|
+
outputTokens: _chunkX3LPZGHScjs.competitorOutputTokens.call(void 0, responseB),
|
|
1249
|
+
reasoningTokens: _nullishCoalesce(_chunkX3LPZGHScjs.competitorReasoningTokens.call(void 0, responseB), () => ( null))
|
|
1125
1250
|
}
|
|
1126
1251
|
}
|
|
1127
1252
|
});
|
|
1128
|
-
|
|
1253
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1129
1254
|
const eloBefore = {
|
|
1130
1255
|
[match.modelA]: _nullishCoalesce(state.ratings[match.modelA], () => ( ELO_INITIAL)),
|
|
1131
1256
|
[match.modelB]: _nullishCoalesce(state.ratings[match.modelB], () => ( ELO_INITIAL))
|
|
@@ -1134,17 +1259,28 @@ var ArenaRunner = class {
|
|
|
1134
1259
|
let outcome = "no-contest";
|
|
1135
1260
|
let winnerModelId = null;
|
|
1136
1261
|
let panel = null;
|
|
1137
|
-
|
|
1262
|
+
let speedMetrics = null;
|
|
1263
|
+
if (task.public.category === "speed") {
|
|
1264
|
+
const decision = decideSpeedMatch(responseA, responseB, match.modelA, match.modelB);
|
|
1265
|
+
outcome = decision.outcome;
|
|
1266
|
+
winnerModelId = decision.winnerModelId;
|
|
1267
|
+
speedMetrics = decision.speedMetrics;
|
|
1268
|
+
} else if (responseA.success !== responseB.success) {
|
|
1138
1269
|
outcome = "forfeit";
|
|
1139
1270
|
winnerModelId = responseA.success ? match.modelA : match.modelB;
|
|
1140
1271
|
} else if (responseA.success && responseB.success) {
|
|
1272
|
+
if (!_chunkX3LPZGHScjs.isCompleteArenaTask.call(void 0, task)) {
|
|
1273
|
+
throw new Error(
|
|
1274
|
+
`A judged ${task.public.category} match requires a task with its hidden reference`
|
|
1275
|
+
);
|
|
1276
|
+
}
|
|
1141
1277
|
this.emit({
|
|
1142
1278
|
id: `${match.id}-judging-started`,
|
|
1143
1279
|
type: "judging.started",
|
|
1144
|
-
data: { matchId: match.id, judges:
|
|
1280
|
+
data: { matchId: match.id, judges: _chunkQMOPRKWDcjs.listModels.call(void 0, "judge").map((model) => model.id) }
|
|
1145
1281
|
});
|
|
1146
1282
|
panel = await this.judges.judge({ match, task, responseA, responseB }, signal);
|
|
1147
|
-
|
|
1283
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1148
1284
|
if (panel.winnerModelId) {
|
|
1149
1285
|
outcome = "judged";
|
|
1150
1286
|
winnerModelId = panel.winnerModelId;
|
|
@@ -1159,9 +1295,9 @@ var ArenaRunner = class {
|
|
|
1159
1295
|
eloAfter[match.modelA] = update.ratingA;
|
|
1160
1296
|
eloAfter[match.modelB] = update.ratingB;
|
|
1161
1297
|
}
|
|
1162
|
-
const judgeCost = _nullishCoalesce(_optionalChain([panel, 'optionalAccess',
|
|
1298
|
+
const judgeCost = _nullishCoalesce(_optionalChain([panel, 'optionalAccess', _36 => _36.votes, 'access', _37 => _37.reduce, 'call', _38 => _38((sum, vote) => sum + (_nullishCoalesce(_optionalChain([vote, 'access', _39 => _39.completion, 'optionalAccess', _40 => _40.costUsd]), () => ( 0))), 0)]), () => ( 0));
|
|
1163
1299
|
return {
|
|
1164
|
-
methodologyVersion:
|
|
1300
|
+
methodologyVersion: _chunkX3LPZGHScjs.METHODOLOGY_VERSION,
|
|
1165
1301
|
runId: match.runId,
|
|
1166
1302
|
runManifestHash: manifestHash,
|
|
1167
1303
|
matchId: match.id,
|
|
@@ -1180,10 +1316,11 @@ var ArenaRunner = class {
|
|
|
1180
1316
|
outcome,
|
|
1181
1317
|
winnerModelId,
|
|
1182
1318
|
panel,
|
|
1319
|
+
speedMetrics,
|
|
1183
1320
|
eloBefore,
|
|
1184
1321
|
eloAfter,
|
|
1185
1322
|
pointAwarded: winnerModelId !== null,
|
|
1186
|
-
matchCostUsd:
|
|
1323
|
+
matchCostUsd: _chunkX3LPZGHScjs.competitorCost.call(void 0, responseA) + _chunkX3LPZGHScjs.competitorCost.call(void 0, responseB) + judgeCost
|
|
1187
1324
|
};
|
|
1188
1325
|
}
|
|
1189
1326
|
/** Surface signals that make a journaled response untrustworthy or a task too easy. */
|
|
@@ -1226,19 +1363,19 @@ var ArenaRunner = class {
|
|
|
1226
1363
|
});
|
|
1227
1364
|
};
|
|
1228
1365
|
try {
|
|
1229
|
-
|
|
1366
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1230
1367
|
const completion = await this.gateway.complete({
|
|
1231
|
-
model:
|
|
1368
|
+
model: _chunkQMOPRKWDcjs.getModel.call(void 0, modelId),
|
|
1232
1369
|
...prompt,
|
|
1233
1370
|
signal,
|
|
1234
1371
|
onDelta: (text) => emitDelta(text, false)
|
|
1235
1372
|
});
|
|
1236
|
-
|
|
1373
|
+
_chunkQMOPRKWDcjs.throwIfCancelled.call(void 0, signal);
|
|
1237
1374
|
emitDelta(completion.content, true);
|
|
1238
1375
|
return { modelId, success: true, ...completion };
|
|
1239
1376
|
} catch (error) {
|
|
1240
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
1241
|
-
throw new (0,
|
|
1377
|
+
if (_optionalChain([signal, 'optionalAccess', _41 => _41.aborted]) || _chunkQMOPRKWDcjs.isArenaCancellationError.call(void 0, error)) {
|
|
1378
|
+
throw new (0, _chunkQMOPRKWDcjs.ArenaCancellationError)();
|
|
1242
1379
|
}
|
|
1243
1380
|
const failed = failedResponse(modelId, error, Date.now() - startedAt);
|
|
1244
1381
|
emitDelta(failed.error, true, false);
|
|
@@ -1271,7 +1408,7 @@ var MockOpenRouterGateway = class {
|
|
|
1271
1408
|
async validateModel(_model) {
|
|
1272
1409
|
}
|
|
1273
1410
|
async complete(request) {
|
|
1274
|
-
if (_optionalChain([request, 'access',
|
|
1411
|
+
if (_optionalChain([request, 'access', _42 => _42.signal, 'optionalAccess', _43 => _43.aborted])) {
|
|
1275
1412
|
throw new Error("Mock completion aborted");
|
|
1276
1413
|
}
|
|
1277
1414
|
if (request.structured) {
|
|
@@ -1288,7 +1425,7 @@ var MockOpenRouterGateway = class {
|
|
|
1288
1425
|
},
|
|
1289
1426
|
violations: []
|
|
1290
1427
|
};
|
|
1291
|
-
void
|
|
1428
|
+
void _chunkQMOPRKWDcjs.judgeVerdictJsonSchema.call(void 0, );
|
|
1292
1429
|
return baseCompletion(JSON.stringify(payload), `mock-judge-${request.model.id}`);
|
|
1293
1430
|
}
|
|
1294
1431
|
const variantA = [
|
|
@@ -1307,11 +1444,11 @@ var MockOpenRouterGateway = class {
|
|
|
1307
1444
|
const parts = _nullishCoalesce(text.match(/.{1,24}/g), () => ( [text]));
|
|
1308
1445
|
let cumulative = "";
|
|
1309
1446
|
for (const part of parts) {
|
|
1310
|
-
if (_optionalChain([request, 'access',
|
|
1447
|
+
if (_optionalChain([request, 'access', _44 => _44.signal, 'optionalAccess', _45 => _45.aborted])) {
|
|
1311
1448
|
throw new Error("Mock completion aborted");
|
|
1312
1449
|
}
|
|
1313
1450
|
cumulative += part;
|
|
1314
|
-
_optionalChain([request, 'access',
|
|
1451
|
+
_optionalChain([request, 'access', _46 => _46.onDelta, 'optionalCall', _47 => _47(cumulative)]);
|
|
1315
1452
|
if (delayMs > 0) await sleep(delayMs);
|
|
1316
1453
|
}
|
|
1317
1454
|
return baseCompletion(cumulative, `mock-competitor-${request.model.id}`);
|
|
@@ -1371,12 +1508,12 @@ var ArenaStore = class {
|
|
|
1371
1508
|
} catch (e2) {
|
|
1372
1509
|
throw new Error(`Malformed arena journal line ${index + 1}; refusing to continue`);
|
|
1373
1510
|
}
|
|
1374
|
-
const parsed =
|
|
1511
|
+
const parsed = _chunkX3LPZGHScjs.MatchResultSchema.safeParse(decoded);
|
|
1375
1512
|
if (!parsed.success) {
|
|
1376
1513
|
const issue = parsed.error.issues[0];
|
|
1377
|
-
const location = _optionalChain([issue, 'optionalAccess',
|
|
1514
|
+
const location = _optionalChain([issue, 'optionalAccess', _48 => _48.path, 'access', _49 => _49.length]) ? ` at ${issue.path.join(".")}` : "";
|
|
1378
1515
|
throw new Error(
|
|
1379
|
-
`Invalid arena journal line ${index + 1}${location}: ${_nullishCoalesce(_optionalChain([issue, 'optionalAccess',
|
|
1516
|
+
`Invalid arena journal line ${index + 1}${location}: ${_nullishCoalesce(_optionalChain([issue, 'optionalAccess', _50 => _50.message]), () => ( "schema mismatch"))}`
|
|
1380
1517
|
);
|
|
1381
1518
|
}
|
|
1382
1519
|
return parsed.data;
|
|
@@ -1409,7 +1546,7 @@ var ArenaStore = class {
|
|
|
1409
1546
|
completedMatchIds() {
|
|
1410
1547
|
return new Set(this.readAll().map((result) => result.matchId));
|
|
1411
1548
|
}
|
|
1412
|
-
rebuildEloState(competitorIds =
|
|
1549
|
+
rebuildEloState(competitorIds = _chunkQMOPRKWDcjs.listModels.call(void 0, "competitor").map((model) => model.id)) {
|
|
1413
1550
|
const ratings = Object.fromEntries(competitorIds.map((modelId) => [modelId, ELO_INITIAL]));
|
|
1414
1551
|
const points = Object.fromEntries(competitorIds.map((modelId) => [modelId, 0]));
|
|
1415
1552
|
const verified = verifyJournal(this.readAll(), this.category, {
|
|
@@ -1464,4 +1601,3 @@ var ArenaStore = class {
|
|
|
1464
1601
|
|
|
1465
1602
|
|
|
1466
1603
|
exports.ELO_INITIAL = ELO_INITIAL; exports.ELO_K = ELO_K; exports.expectedScore = expectedScore; exports.applyEloWin = applyEloWin; exports.PACKAGE_NAME = PACKAGE_NAME; exports.ENGINE_VERSION = ENGINE_VERSION; exports.RUN_MANIFEST_VERSION = RUN_MANIFEST_VERSION; exports.RunManifestSchema = RunManifestSchema; exports.canonicalJson = canonicalJson; exports.runManifestHash = runManifestHash; exports.runIdFromManifest = runIdFromManifest; exports.createRunManifest = createRunManifest; exports.verifyJournal = verifyJournal; exports.verifiedEloState = verifiedEloState; exports.buildSnapshot = buildSnapshot; exports.renderMarkdown = renderMarkdown; exports.writeReports = writeReports; exports.scheduleMatches = scheduleMatches; exports.FAST_RESPONSE_MS = FAST_RESPONSE_MS; exports.LOW_OUTPUT_TOKENS = LOW_OUTPUT_TOKENS; exports.classifyError = classifyError; exports.detectResponseAnomalies = detectResponseAnomalies; exports.triageJournal = triageJournal; exports.formatTriage = formatTriage; exports.ArenaRunner = ArenaRunner; exports.MockOpenRouterGateway = MockOpenRouterGateway; exports.categoryStoreConfig = categoryStoreConfig; exports.ArenaStore = ArenaStore;
|
|
1467
|
-
//# sourceMappingURL=chunk-NJTYVNP4.cjs.map
|