import Link from "next/link";
import { notFound } from "next/navigation";
import { ScopeTrace } from "@/components/ScopeTrace";
import { fmtParams, getRun, getRuns, limitOf, type QualityResult } from "@/lib/results";
export const dynamic = "force-static";
export function generateStaticParams() {
return getRuns().map((r) => ({ id: r.run_id.slice(0, 8) }));
}
const TIER_TONE = {
signal: { text: "text-signal", border: "border-signal-dim", chip: "bg-signal-dim/30" },
reference: { text: "text-reference", border: "border-reference-dim", chip: "bg-reference-dim/30" },
example: { text: "text-dim", border: "border-rule", chip: "bg-rule" },
} as const;
/**
* Per-sample outcome grid.
*
* This is the reason the result schema stores samples and not just aggregates:
* an aggregate says a checkpoint got worse, this says which samples broke.
*/
function SampleGrid({ q }: { q: QualityResult }) {
if (!q.samples.length) return null;
return (
per-sample outcomes · {q.samples.filter((s) => s.passed).length}/{q.samples.length} passed
{q.samples.map((s) => (
))}
);
}
export default async function RunPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const run = getRun(id);
if (!run) notFound();
const limit = limitOf(run);
const perf = run.perf?.points ?? [];
const flags = Object.entries(run.target.serving.flags ?? {});
return (
← board
{run.target.display_name}
{run.target_id}
{run.host.hardware}
{fmtParams(run.target)}
{run.target.quant?.toUpperCase()}
ctx {run.target.serving.max_model_len?.toLocaleString()}
measured {run.timestamp.slice(0, 16).replace("T", " ")}Z
{limit && (
Capped run. Reference tasks were
limited to {limit} samples. Not comparable to a full-dataset score.
)}
Quality
{run.quality.length === 0 && (
Perf-only run — no quality tasks were executed.
)}
{run.quality.map((q) => {
const tone = TIER_TONE[q.tier] ?? TIER_TONE.example;
const acc = q.metrics?.accuracy;
return (
{q.task}
{q.tier}
{q.error ? "ERR" : acc != null ? acc.toFixed(3) : "—"}
{q.error ? (
{q.error.slice(0, 240)}
) : (
<>
{q.n_samples} samples
{q.duration_s && {Math.round(q.duration_s)}s}
{Object.entries(q.metrics)
.filter(([k]) => !k.startsWith("_") && k !== "accuracy")
.slice(0, 4)
.map(([k, val]) => (
{k} {val.toFixed(3)}
))}
>
)}
);
})}
Serving performance
{perf.length > 1 && (
)}
| conc |
tok/s all |
/stream |
ttft p50 |
ttft p95 |
tpot |
{perf.map((p) => (
| {p.concurrency} |
{p.output_tps_total.toFixed(1)}
|
{p.output_tps_per_stream.toFixed(1)}
|
{p.ttft_p50_ms ? `${Math.round(p.ttft_p50_ms)}ms` : "—"}
|
{p.ttft_p95_ms ? `${Math.round(p.ttft_p95_ms)}ms` : "—"}
|
{p.tpot_p50_ms ? `${p.tpot_p50_ms.toFixed(1)}ms` : "—"}
|
))}
{flags.length > 0 && (
serving configuration
Results are only comparable between targets with identical flags.
These are recorded from the live server, not from memory.
{flags.map(([k, v]) => (
- {k}
- {String(v)}
))}
)}
{run.target.notes && (
)}
);
}