"use client"; import type { ReactElement } from "react"; import { CartesianGrid, ResponsiveContainer, Scatter, ScatterChart, Tooltip, XAxis, YAxis, ZAxis, } from "recharts"; import ProvenanceChip from "@/components/ui/ProvenanceChip"; import { categoryLabels, fmt } from "@/lib/data"; import type { ModelRow } from "@/lib/types"; import { CHART_AXIS_LABEL, CHART_AXIS_TICK, CHART_LABEL_FILL, CHART_LABEL_KNOCKOUT, categoryColor, isApiCategory, shortName, } from "./compare-utils"; interface EffDatum { rtfx: number; wer: number; paramsB: number; model: ModelRow; } function renderBubble(props: unknown): ReactElement { const { cx, cy, size, payload } = props as { cx?: number; cy?: number; size?: number; payload?: EffDatum; }; if (typeof cx !== "number" || typeof cy !== "number" || !payload) { return ; } const color = categoryColor[payload.model.category]; const r = Math.max(Math.sqrt((size ?? 64) / Math.PI), 4); const side = r * Math.SQRT2; // diamond with the same half-diagonal return ( {isApiCategory(payload.model.category) ? ( ) : ( )} {shortName(payload.model)} ); } function EffTooltip(props: unknown) { const { active, payload } = props as { active?: boolean; payload?: ReadonlyArray<{ payload?: EffDatum }>; }; const d = payload?.[0]?.payload; if (!active || !d) return null; return (

{d.model.name}

{d.model.org} · {categoryLabels[d.model.category]}

RTFx
{fmt(d.rtfx)}×
WER
{fmt(d.wer)}
Params
{fmt(d.paramsB, 3)}B
); } export interface EfficiencySectionProps { models: ModelRow[]; /** Name of the dataset the comparison is scoped to (e.g. "ViMedCSS"). */ datasetName?: string; } export default function EfficiencySection({ models, datasetName = "ViMedCSS", }: EfficiencySectionProps) { const data: EffDatum[] = models.flatMap((m) => { const s = m.metrics?.test; if (typeof s?.rtfx !== "number" || typeof s?.wer !== "number") return []; return [{ rtfx: s.rtfx, wer: s.wer, paramsB: m.paramsB ?? 0.1, model: m }]; }); const running = models.filter((m) => m.provenance === "running"); /* a sparse plot reads as broken unless the gap is named: when most systems are unmeasured, say so inside the plot itself */ const unmeasured = models.length - data.length; const sparse = data.length > 0 && unmeasured > models.length / 2; return (
{data.length > 0 ? (
{sparse && (

{data.length} of {models.length} systems measured — RTFx only ships with platform-verified runs; the rest of this plane is the evidence gap, not the field.

)}
RTFx = audio seconds ÷ wall seconds, measured on platform hardware. Bubble area scales with parameter count. {datasetName}{" "} test split · normalizer v0.1.
) : ( /* slim status banner — the tall canvas is reserved for real data */

AWAITING PILOT DATA — RTFX REQUIRES A PLATFORM-VERIFIED RUN

{running.length > 0 && (
    {running.map((m) => (
  • {m.name}
  • ))}
)}
)}
); }