Files
xpu-llm-ports/lfm3/results/round6/bb/fp8pc.html
T
Pascal LinxweilerandClaude Opus 5.5 38b0e9a345 lfm3: round 6 - GPTQ INT4 baked (INT4 lm_head + INT8 embedding)
- quant/gptq_baked/: llm-compressor GPTQ W4A16 body (sequential pipeline, verified
  equal to the plain forward), B65-style GPTQ INT4 lm_head bake with a small
  damp/act-order/clipping grid, INT8 per-row embedding, assembly into one
  compressed-tensors checkpoint (1.155 GB vs 3.46 GB BF16)
- plugin: pass quant_config to the token embedding so vLLM's compressed-tensors
  INT8 embedding path is used; BF16/FP8 greedy output unchanged
- tests: INT8 embedding kernel check, quant method dump, head timing, round-6 driver
- NOTES: round 6 results (PPL +8.1%, decode 217 t/s = FP8 pc +14%, head bake
  gives no measurable decode gain on this stack), llama-swap snippet (not applied)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:48:48 +01:00

511 lines
31 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>BetterBench — lfm3-1.7b</title>
<style>
:root {
color-scheme: light;
--page:#f9f9f7; --surface:#fcfcfb;
--ink:#0b0b0b; --ink-2:#52514e; --muted:#898781;
--grid:#e1e0d9; --axis:#c3c2b7; --border:rgba(11,11,11,0.10);
--s1:#2a78d6; --s2:#eb6834;
--s1-mid:#86b6ef; --s1-soft:rgba(42,120,214,0.13);
--tip-bg:#ffffff;
--sans:system-ui,-apple-system,"Segoe UI",sans-serif;
--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
color-scheme: dark;
--page:#0d0d0d; --surface:#1a1a19;
--ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781;
--grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,0.10);
--s1:#3987e5; --s2:#d95926;
--s1-mid:#256abf; --s1-soft:rgba(57,135,229,0.16);
--tip-bg:#232322;
}
}
:root[data-theme="dark"] {
color-scheme: dark;
--page:#0d0d0d; --surface:#1a1a19;
--ink:#ffffff; --ink-2:#c3c2b7; --muted:#898781;
--grid:#2c2c2a; --axis:#383835; --border:rgba(255,255,255,0.10);
--s1:#3987e5; --s2:#d95926;
--s1-mid:#256abf; --s1-soft:rgba(57,135,229,0.16);
--tip-bg:#232322;
}
* { box-sizing:border-box; }
body { background:var(--page); color:var(--ink); font-family:var(--sans);
line-height:1.55; margin:0; padding:32px 20px 72px; }
.wrap { max-width:1080px; margin:0 auto; display:flex; flex-direction:column; gap:26px; }
header { display:flex; flex-direction:column; gap:13px; }
.eyebrow { font-family:var(--mono); font-size:11px; letter-spacing:.13em;
text-transform:uppercase; color:var(--muted); }
h1 { font-size:clamp(26px,4vw,36px); line-height:1.12; margin:0;
letter-spacing:-.02em; text-wrap:balance; }
.runbar { display:flex; flex-wrap:wrap; gap:8px; }
.chip { font-family:var(--mono); font-size:12px; color:var(--ink-2);
border:1px solid var(--border); border-radius:6px; padding:4px 9px;
background:var(--surface); display:inline-flex; align-items:center; gap:7px; }
.chip code { font-family:var(--mono); font-size:12px; }
.swatch { width:9px; height:9px; border-radius:2px; flex:none; }
.thin { color:var(--muted); cursor:help; font-weight:400; padding-left:1px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:13px; }
.tile { background:var(--surface); border:1px solid var(--border); border-radius:10px;
padding:15px 16px; display:flex; flex-direction:column; gap:4px; }
.tile .label { font-family:var(--mono); font-size:10.5px; letter-spacing:.1em;
text-transform:uppercase; color:var(--muted); }
.tile .val { font-size:26px; font-weight:600; letter-spacing:-.02em; line-height:1.15; }
.tile .val small { font-size:14px; font-weight:400; color:var(--ink-2); letter-spacing:0; }
.tile .sub { font-family:var(--mono); font-size:11.5px; color:var(--muted); }
figure { margin:0; background:var(--surface); border:1px solid var(--border);
border-radius:10px; padding:18px 18px 14px;
display:flex; flex-direction:column; gap:2px; }
figcaption { display:flex; flex-direction:column; gap:3px; margin-bottom:8px; }
figcaption .t { font-size:15.5px; font-weight:600; letter-spacing:-.01em; }
figcaption .d { font-size:13px; color:var(--ink-2); max-width:76ch; }
.legend { display:flex; gap:16px; flex-wrap:wrap; margin:2px 0 10px; }
.legend span { font-family:var(--mono); font-size:12px; color:var(--ink-2);
display:inline-flex; align-items:center; gap:6px; }
.chartbox { position:relative; width:100%; }
.chartbox svg { display:block; width:100%; height:auto; overflow:visible; }
.note { font-size:12.5px; color:var(--muted); margin:9px 0 0; }
text { font-family:var(--mono); }
.tick { font-size:10.5px; fill:var(--muted); }
.axtitle { font-size:10.5px; fill:var(--muted); letter-spacing:.08em; }
.dlabel { font-size:11px; font-weight:600; }
.gridline { stroke:var(--grid); stroke-width:1; }
.baseline { stroke:var(--axis); stroke-width:1; }
.refline { stroke:var(--muted); stroke-width:1; stroke-dasharray:4 4; }
.cross { stroke:var(--axis); stroke-width:1; stroke-dasharray:3 3; }
.tip { position:absolute; pointer-events:none; opacity:0; transition:opacity .1s ease;
z-index:5; background:var(--tip-bg); border:1px solid var(--border);
border-radius:7px; padding:8px 10px; box-shadow:0 3px 14px rgba(0,0,0,.13);
font-family:var(--mono); font-size:11.5px; color:var(--ink);
white-space:nowrap; min-width:132px; }
.tip .th { color:var(--muted); font-size:10px; letter-spacing:.08em;
text-transform:uppercase; margin-bottom:5px; }
.tip .row { display:flex; align-items:center; gap:10px; justify-content:space-between; }
.tip .nm { display:inline-flex; align-items:center; gap:6px; color:var(--ink-2); }
.tip b { font-weight:600; }
details { background:var(--surface); border:1px solid var(--border);
border-radius:10px; padding:0 18px; }
summary { cursor:pointer; padding:15px 0; font-size:14.5px; font-weight:600;
list-style:none; display:flex; align-items:center; gap:9px; }
summary::-webkit-details-marker { display:none; }
summary::before { content:"\25B8"; color:var(--muted); font-family:var(--mono); }
details[open] summary::before { content:"\25BE"; }
summary:focus-visible { outline:2px solid var(--s1); outline-offset:3px; border-radius:4px; }
.tscroll { overflow-x:auto; padding-bottom:14px; }
table { border-collapse:collapse; width:100%; font-size:12.5px; font-family:var(--mono);
font-variant-numeric:tabular-nums; margin-bottom:10px; }
caption { text-align:left; font-family:var(--sans); font-size:13px; color:var(--ink-2);
padding:10px 0 8px; }
th, td { padding:6px 11px 6px 0; text-align:right; white-space:nowrap; }
th:first-child, td:first-child { text-align:left; }
thead th { color:var(--muted); font-weight:500; font-size:10.5px; letter-spacing:.07em;
text-transform:uppercase; border-bottom:1px solid var(--axis); }
tbody tr + tr td { border-top:1px solid var(--grid); }
tbody td:first-child { color:var(--ink-2); }
footer { font-size:12.5px; color:var(--muted); border-top:1px solid var(--border);
padding-top:16px; }
footer code { font-family:var(--mono); font-size:12px; color:var(--ink-2); }
noscript p { font-size:13px; color:var(--ink-2); }
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }
</style>
</head>
<body>
<div class="wrap">
<header>
<div class="eyebrow">BetterBench 0.6.1 · 30 Oct 2026 · 13:10 · llm</div>
<h1>lfm3-1.7b</h1>
<div class="runbar"><span class="chip"><span class="swatch" style="background:var(--s1)"></span>lfm3-1.7b</span><span class="chip"><code>http://127.0.0.1:8001/v1</code></span><span class="chip">corpus v1.0</span><span class="chip">5 passes/cat</span><span class="chip">temp 0.7</span><span class="chip">cold prefix cache (nonce)</span><span class="chip">32,768 tok context</span><span class="chip"><span class="swatch" style="background:var(--s2)"></span>variant: fp8pc</span></div>
</header>
<section class="tiles">
<div class="tile">
<span class="label">Combined decode</span>
<span class="val">189.9 <small>t/s</small></span>
<span class="sub">weighted across categories</span>
</div>
<div class="tile">
<span class="label">Combined ITL 1% low</span>
<span class="val">117.4 <small>t/s</small></span>
<span class="sub">the trustworthy tail metric</span>
</div>
<div class="tile">
<span class="label">Combined TTFT p50</span>
<span class="val">61 <small>ms</small></span>
<span class="sub">single-stream, batch = 1</span>
</div>
<div class="tile">
<span class="label">Aggregate @ 8 concurrent</span>
<span class="val">1,082.2 <small>t/s</small></span>
<span class="sub">48/48 ok</span>
</div>
<div class="tile">
<span class="label">Prefill @ 32,000 tok</span>
<span class="val">16,514 <small>t/s</small></span>
<span class="sub">median prompt processing</span>
</div>
</section>
<noscript><p>Charts need JavaScript — the full numbers are in the tables below.</p></noscript>
<figure>
<figcaption>
<span class="t">Decode throughput by category</span>
<span class="d">Median per-pass decode t/s at batch = 1, 5 passes per category. The dashed line is the weighted combined score.</span>
</figcaption>
<div class="chartbox" id="cb-decode"></div>
<p class="note">Hover a bar for its IQR and coefficient of variation — a high CV means the category's passes disagree, so read small differences there with care.</p>
</figure>
<figure>
<figcaption>
<span class="t">Inter-token latency range by category</span>
<span class="d">Each bar spans the 1% low to the 99% high instantaneous token rate, with a tick at the median. Wide bars stutter; narrow bars feel smooth.</span>
</figcaption>
<div class="legend"><span><span class="swatch" style="background:var(--s1-mid)"></span>1% low → 99% high</span><span><span class="swatch" style="background:var(--ink)"></span>median</span></div>
<div class="chartbox" id="cb-itl"></div>
</figure>
<figure>
<figcaption>
<span class="t">Aggregate throughput under concurrency</span>
<span class="d">Total tokens/sec across all in-flight requests as load rises — where this flattens is the throughput knee.</span>
</figcaption>
<div class="chartbox" id="cb-conc"></div>
</figure>
<figure>
<figcaption>
<span class="t">Time-to-first-token under concurrency</span>
<span class="d">Queueing shows up here first: p50 is the typical wait, p99 the tail.</span>
</figcaption>
<div class="legend"><span><span class="swatch" style="background:var(--s1)"></span>TTFT p50</span><span><span class="swatch" style="background:var(--s2)"></span>TTFT p99</span></div>
<div class="chartbox" id="cb-ttft"></div>
<p class="note">With a modest request count per level, p99 rests on very few observations — treat a spike as a prompt to re-run, not a conclusion.</p>
</figure>
<figure>
<figcaption>
<span class="t">Prompt processing throughput by depth</span>
<span class="d">Median prefill t/s (prompt tokens ÷ TTFT) at increasing input depth, cold prefix cache. The band spans the 1% low to the 99% high.</span>
</figcaption>
<div class="chartbox" id="cb-prefill"></div>
<p class="note">Skipped depth 64,000 — deeper than the model's context window.</p>
</figure>
<details open>
<summary>Full numbers</summary>
<div class="tscroll">
<table>
<caption>Single-stream, batch = 1</caption>
<thead><tr><th>category</th><th>passes</th><th>TTFT p50</th><th>TTFT p99</th><th>ITL 1% low</th><th>ITL med</th><th>ITL 99% high</th><th>decode med</th><th>±IQR</th><th>CV</th></tr></thead>
<tbody>
<tr><td>chat</td><td>5</td><td>70.1</td><td>99.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>76.6</td><td>190.4</td><td>244.1</td><td>183.6</td><td>15.1</td><td>4.3%</td></tr>
<tr><td>code</td><td>5</td><td>63.0</td><td>87.9<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>97.7</td><td>190.7</td><td>220.9</td><td>187.2</td><td>1.5</td><td>0.5%</td></tr>
<tr><td>file edit</td><td>5</td><td>66.4</td><td>87.3<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>110.5</td><td>191.2</td><td>219.8</td><td>189.9</td><td>3.8</td><td>2.0%</td></tr>
<tr><td>json</td><td>5</td><td>64.1</td><td>65.8<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>114.3</td><td>192.0</td><td>216.2</td><td>191.5</td><td>2.5</td><td>1.4%</td></tr>
<tr><td>math</td><td>5</td><td>61.2</td><td>63.2<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>153.3</td><td>190.8</td><td>221.8</td><td>190.9</td><td>0.3</td><td>0.8%</td></tr>
<tr><td>prose</td><td>5</td><td>44.0</td><td>64.0<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>147.5</td><td>190.5</td><td>214.4</td><td>191.1</td><td>1.3</td><td>0.9%</td></tr>
<tr><td>reasoning</td><td>5</td><td>61.2</td><td>62.7<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>115.0</td><td>190.8</td><td>221.8</td><td>190.5</td><td>1.9</td><td>1.3%</td></tr>
<tr><td>summarization</td><td>5</td><td>65.3</td><td>70.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>148.1</td><td>191.7</td><td>222.2</td><td>192.2</td><td>2.6</td><td>0.8%</td></tr>
</tbody>
</table>
<table>
<caption>Concurrency sweep</caption>
<thead><tr><th>level</th><th>ok/req</th><th>aggregate t/s</th><th>TTFT p50</th><th>TTFT p99</th><th>per-req decode med</th></tr></thead>
<tbody>
<tr><td>1</td><td>48/48</td><td>185.9</td><td>61.4</td><td>88.9<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>191.0</td></tr>
<tr><td>2</td><td>48/48</td><td>344.5</td><td>69.1</td><td>1,039.2<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>184.4</td></tr>
<tr><td>4</td><td>48/48</td><td>646.6</td><td>67.8</td><td>108.9<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>176.0</td></tr>
<tr><td>8</td><td>48/48</td><td>1,082.2</td><td>79.5</td><td>128.6<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>165.1</td></tr>
</tbody>
</table>
<table>
<caption>Reasoning / answer split · TTFA is time to the first answer token</caption>
<thead><tr><th>category</th><th>runs w/ split</th><th>reasoning share (est)</th><th>TTFA p50 (ms)</th><th>never reached answer</th></tr></thead>
<tbody>
<tr><td>chat</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>code</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>file edit</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>json</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>math</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>prose</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>reasoning</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
<tr><td>summarization</td><td>5/5</td><td>100%</td><td>—</td><td>5/5</td></tr>
</tbody>
</table>
<table>
<caption>Prefill sweep · cold prefix cache</caption>
<thead><tr><th>target depth</th><th>prompt tok med</th><th>TTFT p50</th><th>PP 1% low</th><th>PP median</th><th>PP 99% high</th></tr></thead>
<tbody>
<tr><td>2,000</td><td>1,500</td><td>98.4</td><td>14,529.0<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>15,305.3</td><td>15,655.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
<tr><td>8,000</td><td>5,916</td><td>321.9</td><td>18,041.8<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>18,315.6</td><td>18,563.3<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
<tr><td>16,000</td><td>11,764</td><td>659.5</td><td>17,716.4<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>17,890.4</td><td>18,003.1<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
<tr><td>32,000</td><td>23,514</td><td>1,422.9</td><td>16,456.5<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td><td>16,513.8</td><td>16,737.5<span class="thin" title="under-sampled percentile — see the note below the tables">†</span></td></tr>
<tr><td>64,000</td><td>—</td><td>—</td><td>—</td><td><em>skipped</em></td><td>—</td></tr>
</tbody>
</table>
</div>
</details>
<footer>Generated by BetterBench 0.6.1 from a corpus v1.0 run. Corpus hash <code>e332dceff176d033</code>. Combined-score weights — code 0.3, reasoning 0.2, prose 0.15, json 0.15, file_edit 0.1, summarization 0.1. Results are only comparable within a corpus version. Stopped at <code>max_tokens</code>: 40/40 runs (100%) — on a thinking model a truncated run measures the thinking phase, not a complete answer. 16 percentiles are marked † — they rest on fewer samples than <code>n · tail ≥ 5</code> requires (a p99 needs 500 observations), so read them as roughly the worst observed rather than as percentiles. The full list is under <code>sample_gate</code> in the results JSON. See METHODOLOGY.md §sample-size.</footer>
</div>
<script>
"use strict";
const D = {"cats": ["chat", "code", "file edit", "json", "math", "prose", "reasoning", "summarization"], "runs": [5, 5, 5, 5, 5, 5, 5, 5], "decode": [183.62765094983155, 187.1513040603141, 189.93116560997086, 191.52588139285035, 190.89410972774405, 191.06020362970924, 190.5267344819204, 192.2182061419854], "decodeIqr": [15.060630861671541, 1.4964528077475734, 3.813338033357752, 2.54372598274702, 0.31222588872472556, 1.344671357231448, 1.947855637778872, 2.5971776162380706], "cv": [4.334741526591588, 0.5237071754106026, 1.9946653820508635, 1.4184013707338439, 0.7863109669882481, 0.8621728758117746, 1.2528645086401082, 0.8173655489351459], "itlLow": [76.55516248077129, 97.68670478722579, 110.46601175173187, 114.26079698022886, 153.27736083853287, 147.54205171918696, 115.03991730930481, 148.12586339684444], "itlMed": [190.4130820103502, 190.6675842660272, 191.1625916261212, 192.00200273695464, 190.79603718610872, 190.49981244482572, 190.81970233427003, 191.6851210286183], "itlHigh": [244.10300887673694, 220.92913738654187, 219.8002153761105, 216.1514186679783, 221.76758288422664, 214.41805090150143, 221.76841376932344, 222.23995244658346], "batched": false, "updP50": [5.251740003586747, 5.244730004051235, 5.231148999882862, 5.208279006183147, 5.241199003648944, 5.249349000223447, 5.2405489986995235, 5.216889003349934], "updP99": [10.566882237326336, 9.260861342481798, 8.582800862350265, 7.006967802590222, 6.049261979787859, 6.070108519343177, 6.910041719675052, 6.050840602838433], "tokPerUpd": [1.0, 1.0027662517289073, 1.0, 1.0, 1.0, 1.0, 1.0007278020378456, 1.0], "ttft50": [70.13073599955533, 63.02163200598443, 66.44213600520743, 64.13286299357424, 61.1764770001173, 43.95687200303655, 61.19512700388441, 65.31191500107525], "combined": 189.85358804305787, "conc": {"levels": [1, 2, 4, 8], "agg": [185.85774226968286, 344.47170138038894, 646.6208823337246, 1082.2180775469817], "t50": [61.35995999648003, 69.10715199774131, 67.75970599846914, 79.48075800231891], "t99": [88.85125219800102, 1039.1593356401427, 108.90441784715223, 128.5879315080092], "per": [191.02498108060152, 184.40686273780165, 175.97959829954397, 165.0688426842566], "ok": [48, 48, 48, 48], "req": [48, 48, 48, 48]}, "pre": {"depths": [2000, 8000, 16000, 32000], "tok": [1499.5, 5916.5, 11763.5, 23513.5], "low": [14529.027278909176, 18041.812899034212, 17716.403507690382, 16456.511318627283], "med": [15305.271102558065, 18315.64323090558, 17890.441227731986, 16513.832416810954], "high": [15655.070961305726, 18563.288124859813, 18003.060514508594, 16737.459489563495], "t50": [98.39786550219287, 321.9181620006566, 659.4808614972862, 1422.9007075009577]}};
const NS = "http://www.w3.org/2000/svg";
const el = (n, a) => { const e = document.createElementNS(NS, n);
for (const k in a) e.setAttribute(k, a[k]); return e; };
const fmt = (v, d) => (v === null || v === undefined) ? "—"
: v.toLocaleString("en-US", { minimumFractionDigits: d, maximumFractionDigits: d });
const has = v => v !== null && v !== undefined;
const maxOf = arrs => Math.max(...arrs.flat().filter(has));
const niceTop = v => { if (!(v > 0)) return 1;
const p = Math.pow(10, Math.floor(Math.log10(v)) - 1);
return Math.ceil(v / (2 * p)) * 2 * p; };
const box = id => document.getElementById(id);
function mkTip(b) { const t = document.createElement("div"); t.className = "tip";
b.appendChild(t); return t; }
function showTip(tip, b, x, y, html) {
tip.innerHTML = html; tip.style.opacity = "1";
let left = x + 14;
if (left + tip.offsetWidth > b.clientWidth) left = x - tip.offsetWidth - 14;
tip.style.left = Math.max(0, left) + "px";
tip.style.top = Math.max(0, y - tip.offsetHeight - 10) + "px";
}
const row = (color, name, val) =>
`<div class="row"><span class="nm">${color
? `<span class="swatch" style="background:${color}"></span>` : ""}${name}</span><b>${val}</b></div>`;
function frame(svg, M, iw, ih, yMin, yMax, yTitle, ticks) {
for (let k = 0; k <= (ticks || 4); k++) {
const v = yMin + ((yMax - yMin) * k) / (ticks || 4);
const y = M.t + ih - (ih * (v - yMin)) / (yMax - yMin);
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: y, y2: y, class: "gridline" }));
const tx = el("text", { x: M.l - 10, y: y + 3.5, class: "tick", "text-anchor": "end" });
tx.textContent = fmt(v, v < 10 ? 1 : 0); svg.appendChild(tx);
}
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: M.t + ih, y2: M.t + ih, class: "baseline" }));
const ay = el("text", { x: M.l, y: M.t - 7, class: "axtitle" });
ay.textContent = yTitle; svg.appendChild(ay);
}
function xLabels(svg, labels, X, y) {
labels.forEach((lab, i) => {
const t = el("text", { x: X(i), y: y, class: "tick", "text-anchor": "middle" });
t.textContent = lab; svg.appendChild(t);
});
}
/* --- grouped / single bars, zero-based --- */
function bars(id, o) {
const b = box(id); if (!b) return;
const W = 900, H = o.height || 340, M = { t: 20, r: 16, b: 50, l: 64 };
const iw = W - M.l - M.r, ih = H - M.t - M.b;
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
const n = o.x.length, yMax = o.yMax;
const Y = v => M.t + ih - (ih * v) / yMax;
frame(svg, M, iw, ih, 0, yMax, o.yTitle);
const band = iw / n, ns = o.series.length, GAP = 2;
const bw = Math.min(40, (band - 24 - GAP * (ns - 1)) / ns);
xLabels(svg, o.x, i => M.l + band * i + band / 2, M.t + ih + 20);
if (has(o.ref)) {
const y = Y(o.ref);
svg.appendChild(el("line", { x1: M.l, x2: M.l + iw, y1: y, y2: y, class: "refline" }));
const t = el("text", { x: M.l + iw, y: y - 6, class: "tick", "text-anchor": "end" });
t.textContent = o.refLabel; svg.appendChild(t);
}
const tip = mkTip(b);
o.x.forEach((lab, i) => {
const cx = M.l + band * i + band / 2;
const start = cx - (ns * bw + (ns - 1) * GAP) / 2;
o.series.forEach((s, si) => {
const v = s.v[i]; if (!has(v)) return;
const x = start + si * (bw + GAP);
const r = el("rect", { x: x, y: Y(v), width: bw, height: Math.max(2, ih - (Y(v) - M.t)),
rx: 4, ry: 4, fill: s.color });
r.style.cursor = "crosshair";
const html = `<div class="th">${lab}</div>` +
o.series.map(q => row(ns > 1 ? q.color : null, q.name, o.tipVal(q.v[i]))).join("") +
(o.extra ? o.extra(i) : "");
r.addEventListener("pointerenter", () => {
const rc = svg.getBoundingClientRect();
showTip(tip, b, ((x + bw / 2) / W) * rc.width, (Y(v) / H) * rc.height, html);
});
r.addEventListener("pointerleave", () => { tip.style.opacity = "0"; });
svg.appendChild(r);
});
});
b.appendChild(svg);
}
/* --- floating range bars with a median tick --- */
function rangeBars(id, o) {
const b = box(id); if (!b) return;
const W = 900, H = 340, M = { t: 20, r: 16, b: 50, l: 64 };
const iw = W - M.l - M.r, ih = H - M.t - M.b;
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
const n = o.x.length, yMax = o.yMax;
const Y = v => M.t + ih - (ih * v) / yMax;
frame(svg, M, iw, ih, 0, yMax, o.yTitle);
const band = iw / n, bw = Math.min(34, band - 26);
xLabels(svg, o.x, i => M.l + band * i + band / 2, M.t + ih + 20);
const tip = mkTip(b);
o.x.forEach((lab, i) => {
const lo = o.low[i], hi = o.high[i], md = o.med[i];
if (!has(lo) || !has(hi)) return;
const cx = M.l + band * i + band / 2, x = cx - bw / 2;
const r = el("rect", { x: x, y: Y(hi), width: bw, height: Math.max(3, Y(lo) - Y(hi)),
rx: 4, ry: 4, fill: "var(--s1-mid)" });
r.style.cursor = "crosshair";
svg.appendChild(r);
if (has(md)) svg.appendChild(el("line", { x1: x, x2: x + bw, y1: Y(md), y2: Y(md),
stroke: "var(--ink)", "stroke-width": 2 }));
const html = `<div class="th">${lab}</div>` +
row(null, "99% high", o.tipVal(hi)) + row(null, "median", o.tipVal(md)) +
row(null, "1% low", o.tipVal(lo)) + (o.extra ? o.extra(i) : "");
r.addEventListener("pointerenter", () => {
const rc = svg.getBoundingClientRect();
showTip(tip, b, (cx / W) * rc.width, (Y(hi) / H) * rc.height, html);
});
r.addEventListener("pointerleave", () => { tip.style.opacity = "0"; });
});
b.appendChild(svg);
}
/* --- line chart with optional band --- */
function line(id, o) {
const b = box(id); if (!b) return;
const W = 900, H = 320, M = { t: 20, r: 24, b: 52, l: 64 };
const iw = W - M.l - M.r, ih = H - M.t - M.b;
const svg = el("svg", { viewBox: `0 0 ${W} ${H}`, role: "img", "aria-label": o.aria });
const n = o.x.length, yMin = o.yMin, yMax = o.yMax;
const X = i => M.l + (n === 1 ? iw / 2 : (iw * i) / (n - 1));
const Y = v => M.t + ih - (ih * (v - yMin)) / (yMax - yMin);
frame(svg, M, iw, ih, yMin, yMax, o.yTitle);
xLabels(svg, o.x, X, M.t + ih + 20);
if (o.xTitle) {
const t = el("text", { x: M.l, y: H - 8, class: "axtitle" });
t.textContent = o.xTitle; svg.appendChild(t);
}
if (o.band && o.band.low.every(has) && o.band.high.every(has)) {
const up = o.band.high.map((v, i) => (i ? "L" : "M") + X(i) + " " + Y(v)).join(" ");
const dn = o.band.low.map((v, i) => "L" + X(n - 1 - i) + " " + Y(o.band.low[n - 1 - i])).join(" ");
svg.appendChild(el("path", { d: up + " " + dn + " Z", fill: "var(--s1-soft)", stroke: "none" }));
}
svg.appendChild(el("path", {
d: o.v.map((v, i) => (i ? "L" : "M") + X(i) + " " + Y(v)).join(" "),
fill: "none", stroke: "var(--s1)", "stroke-width": 2,
"stroke-linejoin": "round", "stroke-linecap": "round" }));
o.v.forEach((v, i) => svg.appendChild(el("circle", {
cx: X(i), cy: Y(v), r: 5, fill: "var(--s1)", stroke: "var(--surface)", "stroke-width": 2 })));
const cross = el("line", { class: "cross", y1: M.t, y2: M.t + ih, opacity: 0 });
svg.appendChild(cross);
const hit = el("rect", { x: M.l, y: M.t, width: iw, height: ih, fill: "transparent" });
svg.appendChild(hit);
b.appendChild(svg);
const tip = mkTip(b);
hit.addEventListener("pointermove", ev => {
const rc = svg.getBoundingClientRect();
const px = ((ev.clientX - rc.left) / rc.width) * W;
let i = 0, best = Infinity;
for (let k = 0; k < n; k++) { const d = Math.abs(X(k) - px); if (d < best) { best = d; i = k; } }
cross.setAttribute("x1", X(i)); cross.setAttribute("x2", X(i)); cross.setAttribute("opacity", 1);
showTip(tip, b, (X(i) / W) * rc.width, (Y(o.v[i]) / H) * rc.height,
`<div class="th">${o.tipHead(i)}</div>` + o.tipBody(i));
});
hit.addEventListener("pointerleave", () => { tip.style.opacity = "0"; cross.setAttribute("opacity", 0); });
}
/* ------------------------------ build ------------------------------ */
if (D.cats.length) {
bars("cb-decode", {
aria: "Median decode throughput per category.",
x: D.cats, yTitle: "DECODE T/S (MEDIAN)",
yMax: niceTop(maxOf([D.decode])), height: 350,
ref: D.combined, refLabel: "combined " + fmt(D.combined, 1),
series: [{ name: "decode t/s", color: "var(--s1)", v: D.decode }],
tipVal: v => fmt(v, 1) + " t/s",
extra: i => row(null, "±IQR", fmt(D.decodeIqr[i], 1)) +
row(null, "CV", fmt(D.cv[i], 1) + "%") +
row(null, "passes", D.runs[i])
});
if (D.batched) {
/* Grouped bars, not a floating range bar: p50 and p99 can differ by two
orders of magnitude (a 17 ms rhythm against a 1.3 s stall), and a bar
floating between them collapses the p50 end onto the axis. */
bars("cb-itl", {
aria: "Stream-update gap p50 and p99 by category.",
x: D.cats, yTitle: "UPDATE GAP (MS)",
yMax: niceTop(maxOf([D.updP99, D.updP50])), height: 320,
series: [{ name: "p50", color: "var(--s1)", v: D.updP50 },
{ name: "p99", color: "var(--s2)", v: D.updP99 }],
tipVal: v => fmt(v, 1) + " ms",
extra: i => row(null, "tok/update", fmt(D.tokPerUpd[i], 2)) +
row(null, "passes", D.runs[i])
});
} else {
rangeBars("cb-itl", {
aria: "Inter-token latency range per category, 1% low to 99% high.",
x: D.cats, yTitle: "INSTANTANEOUS T/S",
yMax: niceTop(maxOf([D.itlHigh])),
low: D.itlLow, med: D.itlMed, high: D.itlHigh,
tipVal: v => fmt(v, 1) + " t/s",
extra: i => row(null, "spread", has(D.itlHigh[i]) && has(D.itlLow[i])
? fmt(D.itlHigh[i] - D.itlLow[i], 1) + " t/s" : "—")
});
}
}
if (D.conc.levels.length > 1) {
line("cb-conc", {
aria: "Aggregate throughput as concurrency rises.",
x: D.conc.levels.map(String), xTitle: "CONCURRENCY LEVEL",
yTitle: "AGGREGATE T/S", yMin: 0, yMax: niceTop(maxOf([D.conc.agg])),
v: D.conc.agg,
tipHead: i => "concurrency " + D.conc.levels[i] + " · " + D.conc.ok[i] + "/" + D.conc.req[i] + " ok",
tipBody: i => row(null, "aggregate", fmt(D.conc.agg[i], 1) + " t/s") +
row(null, "per-req", fmt(D.conc.per[i], 1) + " t/s") +
row(null, "TTFT p50", fmt(D.conc.t50[i], 1) + " ms")
});
bars("cb-ttft", {
aria: "TTFT p50 and p99 by concurrency level.",
x: D.conc.levels.map(String), yTitle: "TTFT (MS)",
yMax: niceTop(maxOf([D.conc.t99, D.conc.t50])), height: 300,
series: [{ name: "p50", color: "var(--s1)", v: D.conc.t50 },
{ name: "p99", color: "var(--s2)", v: D.conc.t99 }],
tipVal: v => fmt(v, 1) + " ms",
extra: i => row(null, "requests", D.conc.ok[i] + "/" + D.conc.req[i])
});
}
if (D.pre.depths.length > 1) {
const lo = Math.min(...D.pre.low.filter(has).concat(D.pre.med.filter(has)));
const hi = Math.max(...D.pre.high.filter(has).concat(D.pre.med.filter(has)));
const pad = (hi - lo) * 0.25 || hi * 0.1;
line("cb-prefill", {
aria: "Prefill throughput by input depth.",
x: D.pre.depths.map(d => d >= 1000 ? (d / 1000) + "k" : String(d)),
xTitle: "TARGET INPUT DEPTH (TOKENS)", yTitle: "PP T/S (MEDIAN)",
yMin: Math.max(0, lo - pad), yMax: hi + pad,
v: D.pre.med, band: { low: D.pre.low, high: D.pre.high },
tipHead: i => D.pre.depths[i].toLocaleString() + " target · "
+ fmt(D.pre.tok[i], 0) + " actual tok",
tipBody: i => row(null, "99% high", fmt(D.pre.high[i], 1)) +
row(null, "median", fmt(D.pre.med[i], 1)) +
row(null, "1% low", fmt(D.pre.low[i], 1)) +
row(null, "TTFT p50", fmt(D.pre.t50[i], 0) + " ms")
});
}
</script>
</body>
</html>