Docs: Update benchmark for anthropic/claude-opus-4.8 EFF:medium

This commit is contained in:
github-actions[bot]
2026-05-31 18:07:47 +00:00
parent 39d0a9f316
commit e5f1b816d1
12 changed files with 413 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
const CDN = "https://esm.sh/";
const hexchain = async (toml) => {
const [
{ parse },
{ default: seedrandom },
ss,
{ default: Ajv },
{ default: table },
{ default: DOMPurify }
] = await Promise.all([
import(`${CDN}smol-toml`),
import(`${CDN}seedrandom`),
import(`${CDN}simple-statistics`),
import(`${CDN}ajv`),
import(`${CDN}text-table`),
import(`${CDN}dompurify`)
]);
const config = parse(toml);
const schema = {
type: "object",
required: ["seed", "count", "label"],
properties: {
seed: { type: "string" },
count: { type: "integer", minimum: 1, maximum: 10000 },
label: { type: "string", minLength: 1 }
}
};
const ajv = new Ajv();
if (!ajv.validate(schema, config))
return { valid: false, errors: ajv.errorsText() };
const rng = new seedrandom(config.seed);
const nums = Array.from({ length: config.count }, () => rng());
const r = (n) => Math.round(n * 1e6) / 1e6;
const mean = r(ss.mean(nums));
const stddev = r(ss.standardDeviation(nums));
const median = r(ss.median(nums));
const tableString = table([
["Stat", "Value"],
["mean", String(mean)],
["stddev", String(stddev)],
["median", String(median)]
]);
const sanitized = DOMPurify.sanitize(
`<pre class="stats">${tableString}</pre>`
);
return {
valid: true,
label: config.label,
stats: { mean, stddev, median },
table: sanitized,
count: config.count
};
};
export { hexchain };
export default hexchain;
// Generation time: 8.247s
// Result: PASS