Files
zooqueenandHanzo Dev e6601dc5ed Kai's headings wait for the model list, the landing draws its figures at once, and a link to a /benchmarks anchor lands on it
The Kai heading on /benchmarks and on /kai read useClaim, so neither states the
harness count before the Decision Suite's, and the /benchmarks hero's built
lede no longer states one. The landing's band says it is reading until every
read has answered or failed, draws its tiles together, and is not drawn when
none holds. useAnchor scrolls to the address's anchor instantly once the runs,
the model list and the price list have answered, unless the reader has moved
the page, and an anchored Block stops clear of the chapter nav.


Co-authored-by: Hanzo Dev <[email protected]>
2026-10-15 21:21:00 -07:00

121 lines
6.2 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* /benchmarks' own build-time figures: the hero, then the sections of Zen 6,
* the agent harness and the agent platform — each its one headline and one
* number and its figures — each read from the file that holds it. Every
* comparison it hands on is a win.
*
* The index page (components/benchmarks/Showcase.tsx) types no number, so every
* figure it shows is built here from the run files, and reaches it through
* `BOARD` in lib/bench-data. Enso's section, its frontier and its hero tile are
* the research API's `enso.*` runs, read when the page opens (lib/enso), and no
* rate is built here: what Kai and Enso cost is the price list's, read when the
* page opens (lib/tally `kaiPrice`, components/api/rate). A headline is a
* condition on the data, the rule lib/kai keeps: it counts what the rows hold, so
* a rerun that loses a suite changes the count rather than leaving a stale win.
*/
import type { Kai } from './kai'
import { day, type Tile } from './tally'
import runtime from './data/benchmarks-runtime.json' with { type: 'json' }
import cloud from './data/bench.json' with { type: 'json' }
import { DESKS, MEASURED } from '../components/zen/desks'
/* ---- the page ---- */
/** A product's section: one plain headline, one number set large, and what that number is. */
export type Story = { headline: string; figure: string; label: string; note: string; href: string }
/** A measured rate drawn as a bar: its label, the value the bar is drawn from, and the reading as recorded. */
export type Rate = { label: string; value: number; shown: string }
export type Board = {
/** The day the Kai runs the page reads ended. */
measured: string
/** The hero: intelligence, cost and speed, each in measured terms. */
title: string
lede: string
/** The hero's figure that is not read when the page opens: Zen 6's speed. */
also: Tile[]
zen: Story & { prefill: Rate[]; decode: Rate[] }
harness: Story
platform: Story & { tiles: Tile[] }
}
/** The index figures this file reads (lib/bench-data computes them). */
type Metric = number | { mean: number } | null
type Index = {
locomo: { k: number; split: string; all: { base: Metric; ours: Metric } }
}
const val = (m: Metric) => (m == null ? null : typeof m === 'number' ? m : m.mean)
const pct = (v: number | null) => (v == null ? '–' : `${(v * 100).toFixed(1)}%`)
/** The leading figure of a reading: `~2,400` → 2400, `1,150–1,400` → 1150, the conservative end. */
const lead = (shown: string) => Number((/[\d,.]+/.exec(shown)?.[0] ?? '0').replace(/,/g, ''))
type Shot = { part: string; what: string; ours: string | null; theirs: string | null }
const SHOTS = (runtime as { shots: Shot[] }).shots
const shot = (part: string, what: string) => SHOTS.find((x) => x.part === part && x.what === what) ?? null
type Row = { id: string; claim: string; ours: string; published: string; multiple: string; detail: string }
const CLOUD = cloud as { machine: string; rows: Row[] }
const row = (id: string) => CLOUD.rows.find((r) => r.id === id) ?? null
export function board(kai: Kai | null, index: Index): Board {
const grace = DESKS[0]
/* Zen 6: speed on Hanzo's own hardware */
const zen: Board['zen'] = {
headline: grace ? `Zen 6 prefills ${grace.prefill} tokens a second on ${grace.machine}.` : 'Zen 6 on Hanzo hardware.',
figure: grace ? `${grace.prefill} tok/s` : '–',
label: grace ? `Prefill · Zen 6 on ${grace.machine}` : 'Prefill',
note: grace ? `Decode ${grace.decode} tok/s${grace.more ? ` · ${grace.more}` : ''} · measured by Hanzo on ${day(MEASURED)}.` : '',
href: '/benchmarks/zen-6',
prefill: DESKS.map((d) => ({ label: `${d.machine} · ${d.build}`, value: lead(d.prefill), shown: `${d.prefill} tok/s` })),
decode: DESKS.map((d) => ({ label: `${d.machine} · ${d.build}`, value: lead(d.decode), shown: `${d.decode} tok/s` })),
}
/* Agent harness: what the agent remembers and finds */
const lb = val(index.locomo.all.base)
const lo = val(index.locomo.all.ours)
const harness: Board['harness'] = {
headline: lb && lo ? `On LoCoMo, Hanzo's context engine finds ${(lo / lb).toFixed(1)}× the multi-hop evidence cosine does.` : "The agent's memory, beside cosine.",
figure: lb && lo ? `${(lo / lb).toFixed(1)}×` : '–',
label: `Multi-hop ALL@${index.locomo.k} · LoCoMo`,
note: `${pct(lo)} against cosine's ${pct(lb)} on the ${index.locomo.split} split: every annotated evidence turn in the top ${index.locomo.k}.`,
href: '/benchmarks/locomo',
}
/* Agent platform: what an agent costs to keep, start and call */
const dormant = row('residency')
const coldRow = row('cold')
const call = row('call')
const resume = shot('fleet', 'resume one, in process')
const platform: Board['platform'] = {
headline: dormant ? `A dormant agent costs ${dormant.ours}.` : 'What an agent costs.',
figure: dormant?.ours ?? '–',
label: 'State per dormant agent',
note: dormant ? `Against a published ${dormant.published} (${dormant.multiple}). ${dormant.detail.split(' · ')[0]}.` : '',
href: '/benchmarks/platform-bench',
tiles: [
...(resume?.ours ? [{ figure: resume.ours, label: 'Resume one dormant agent', note: 'In process, from its stored state.', href: '/benchmarks/fleet' }] : []),
...(coldRow ? [{ figure: coldRow.ours, label: 'A sandbox that runs a shell, cold', note: `${coldRow.multiple}; published ${coldRow.published}.`, href: '/benchmarks/platform-bench' }] : []),
...(call ? [{ figure: call.ours, label: 'One call, marginal cost', note: `Against a published ${call.published} (${call.multiple}).`, href: '/benchmarks/platform-bench' }] : []),
],
}
/* the hero: the three-way story, in measured terms */
const also: Tile[] = grace ? [{ figure: zen.figure, label: zen.label, note: zen.note, href: '#zen' }] : []
// Kai's figure is the hero tile's, read when the page opens (hooks/useSuite `useLead`), so the built lede states none.
const lede = [
grace ? `Zen 6 prefills ${grace.prefill} tokens a second and decodes ${grace.decode} on ${grace.machine}, measured ${day(MEASURED)}.` : '',
]
.filter(Boolean)
.join(' ')
return {
measured: day(kai?.index.ended ?? null),
title: 'Intelligence, cost and speed, each measured.',
lede,
also,
zen,
harness,
platform,
}
}