gui: a model's speed leads with the figure from more replies, counts written out, TTFT on its own line
Fallmonkey (Discord) read "75 tok/s (3) · ≥54 tok/s (289)" on the Output
speed card and the Usage ranking as the 3-reply figure being the model's
speed, with the 289-reply floor tucked behind it, and "(3)" not saying
what was counted.
Now, everywhere a group's speed shows (the Output speed card, the
overview lists and the Usage ranking by speed):
- the figure from more replies comes first and is the big one; a tie
keeps the measured one first. The ranking orders and bars by it.
- counts are written out, without parentheses:
"≥54 tok/s · 289 replies; 75 tok/s · 3 timed replies"
zh "≥54 token/秒 · 289 次回复;75 token/秒 · 3 次计时",
with zh-TW, ja and de strings of their own.
- on the card the second figure is its own line, and the average wait
for the first token is a line of its own with its count
("first token in 1.2 s on average · 3 timed replies"), wrapping rather
than cut off. In the big figure the count is a muted caption without
the dot, so a wrapped count never starts a line with "·".
- the tooltips are unchanged; the threshold for the floor is unchanged.
What was run:
- usage-speed and usage-ttft-rounding now expect the TTFT line's
count; green in both engines.
- usage-speed-count.test.cjs (rewritten for the new rule) in Chromium
and WebKit, 5 languages x widths 1400/983/789/700/560: 26/26 each.
On origin/main's assets it fails ("125 tok/s (1) · ≥50 tok/s (259)").
- 55 related suites (usage-*, ledger-*, reasoning-speed, routing-*-speed/
metrics, panel-usage, gui-de/ja/zh-tw, i18n-keys, click-scroll,
tray-usages) in both engines: all green.
- gofmt -l, go vet darwin, GOOS=linux -tags nogui, GOOS=windows on
internal/gui; go test -tags nogui ./internal/gui: ok.
- Screenshots of the card and ranking at 560 and 1400 in en, zh, de.
Reported-by: Fallmonkey (GitHub MonkeyLeeT)
Co-authored-by: MonkeyLeeT <MonkeyLeeT@users.noreply.github.com>
This commit is contained in:
+11
-10
@@ -349,16 +349,17 @@ high. A floor never mixes into a measured speed: the Speed trend and
|
||||
A group's speed (a row of the Usage page's ranking, by model, provider or
|
||||
agent, its Output speed card, and the overview's lists) says how many
|
||||
replies it is of, by one rule: with replies whose speed was measured, their
|
||||
speed and how many they are (`125 tok/s (1)`, not beside "260 requests"
|
||||
alone); with rows that tell a floor, the least those wrote at and how many
|
||||
(`≥100 tok/s (30)`); with both, both, the measured first
|
||||
(`125 tok/s (1) · ≥50 tok/s (259)`), as a few measured replies may not
|
||||
stand for the rest and a floor is no measure; with neither, nothing. The
|
||||
Output speed card shows the measured speed as its figure and the floor
|
||||
under it. The tooltip says what each is of. A ranking by speed orders and
|
||||
bars a group by its measured speed, or its floor when it has none
|
||||
(`usage.Totals` `decode_n`, `floor_out`, `floor_ms`, `floor_n`;
|
||||
`usage.Row.Floor`).
|
||||
speed and how many they are (`62 tok/s · 2 timed replies`, not beside "260
|
||||
requests" alone); with rows that tell a floor, the least those wrote at and
|
||||
how many (`≥100 tok/s · 30 replies`); with both, both, the one of more
|
||||
replies first (`≥50 tok/s · 259 replies; 125 tok/s · 1 timed reply`), as a
|
||||
few measured replies may not stand for the rest; with neither, nothing.
|
||||
Counts are words, never a bare number in parentheses. The Output speed card
|
||||
shows the first as its figure, its count beside it, the other under it, and
|
||||
the mean wait for the first token on a line of its own with how many timed
|
||||
replies it is of. The tooltip says what each is of. A ranking by speed
|
||||
orders and bars a group by the figure it shows first (`usage.Totals`
|
||||
`decode_n`, `floor_out`, `floor_ms`, `floor_n`; `usage.Row.Floor`).
|
||||
|
||||
It lists **accounts** too: each Codex, Claude or other subscription account's
|
||||
tokens and cost, by the account that actually answered — the one that took
|
||||
|
||||
@@ -1062,10 +1062,14 @@ body.window .field.solo { grid-column: auto; }
|
||||
narrow for both (#1623, fanbuz: "48 token/秒(781 次)" ran past it) */
|
||||
.led-strip .v.parts { white-space: normal; }
|
||||
.led-strip .v.parts > span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
|
||||
/* a figure's count after it, as a caption: "≥67 tok/s 181 replies" */
|
||||
.led-strip .v.parts > span + span { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); padding-top: 8px; }
|
||||
.led-strip .sub { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.led-strip .sub b { font-weight: 600; color: var(--fg-2); }
|
||||
/* a count on the Requests card that lists its requests */
|
||||
.led-strip .sub.jumps { white-space: normal; overflow: visible; }
|
||||
/* the wait for the first token and its count wrap rather than cut the count off */
|
||||
.led-strip .sub.ttft { white-space: normal; }
|
||||
.led-strip .led-jump { text-align: start; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
|
||||
.led-strip .led-jump.bad { color: var(--red); }
|
||||
.led-strip .led-jump:hover, .led-strip .led-jump.on { text-decoration-style: solid; }
|
||||
|
||||
+30
-23
@@ -17653,36 +17653,40 @@ const ledSpeed = (x) => x?.decode_ms > 0 ? (1000 * x.decode_out) / x.decode_ms :
|
||||
const ledFloor = (x) => x?.floor_ms > 0 ? (1000 * x.floor_out) / x.floor_ms : 0;
|
||||
// a group's speed as every ranking and the Output speed card say it, by one
|
||||
// rule (Fallmonkey on Discord): with replies whose speed was measured, their
|
||||
// speed and how many they are, "125 tok/s (1)", not beside "260 requests"
|
||||
// alone; with replies read from a session file that tell the least they
|
||||
// wrote at, that floor and how many, "≥100 tok/s (30)"; with both, both,
|
||||
// the measured first, "62 tok/s (2) · ≥71 tok/s (54)", as two replies are
|
||||
// too few to stand for 56 and a floor is no measure; else nothing. The
|
||||
// Requests tab says the same of each row: "125 tok/s" or "≥100 tok/s". v is
|
||||
// the figure a speed ranking orders by and bars: the measured speed when
|
||||
// there is one, else the floor. main is the first part, floor the second.
|
||||
// speed and how many they are, "125 tok/s · 1 timed reply", not beside "260
|
||||
// requests" alone; with replies read from a session file that tell the least
|
||||
// they wrote at, that floor and how many, "≥100 tok/s · 30 replies"; with
|
||||
// both, both, the one of more replies first, "≥71 tok/s · 54 replies; 62
|
||||
// tok/s · 2 timed replies", as two replies are too few to stand for 56; else
|
||||
// nothing. Counts are words, not a bare "(2)" only its tooltip explains. The
|
||||
// Requests tab says each row's alone: "125 tok/s" or "≥100 tok/s". v is the
|
||||
// figure a speed ranking orders by and bars, the first one's; main is the
|
||||
// first, other the second ("" with one).
|
||||
function ledGroupSpeed(x) {
|
||||
const v = ledSpeed(x), f = ledFloor(x), kv = x?.decode_n || 0, kf = x?.floor_n || 0;
|
||||
if (!v && !f) return null;
|
||||
const say = (s, k) => k ? t("{n} tok/s ({k})", { n: ledNum(Math.round(s)), k: ledNum(k) }) : t("{n} tok/s", { n: ledNum(Math.round(s)) });
|
||||
const measured = v ? say(v, kv) : "", floor = f ? "≥" + say(f, kf) : "";
|
||||
const tok = (s) => t("{n} tok/s", { n: ledNum(Math.round(s)) });
|
||||
const count = (k, timed) => !k ? "" : t(timed ? (k === 1 ? "{k} timed reply" : "{k} timed replies") : (k === 1 ? "{k} reply" : "{k} replies"), { k: ledNum(k) });
|
||||
const vTitle = !v || !kv ? "" : f ? t(kv === 1 ? "Measured on {k} reply, from its first token to its end" : "Measured on {k} replies, from their first token to their end", { k: ledNum(kv) })
|
||||
: t(kv === 1 ? "Measured on {k} reply, from its first token to its end; the others tell no speed" : "Measured on {k} replies, from their first token to their end; the others tell no speed", { k: ledNum(kv) });
|
||||
const fTitle = !f || !kf ? "" : t(kf === 1 ? "At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too" : "At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too", { k: ledNum(kf) });
|
||||
// main's parts: the speed and the replies it is of, so a narrow card can
|
||||
// put the second under the first rather than run past its edge (#1623)
|
||||
const parts = (s, k, pre) => {
|
||||
const whole = pre + say(s, k), head = pre + t("{n} tok/s", { n: ledNum(Math.round(s)) });
|
||||
return k && whole.startsWith(head) && whole.length > head.length ? [head, whole.slice(head.length)] : [whole];
|
||||
};
|
||||
return { v: v || f, text: [measured, floor].filter(Boolean).join(" · "), main: measured || floor, mainParts: v ? parts(v, kv, "") : parts(f, kf, "≥"), floor: measured ? floor : "", title: [vTitle, fTitle].filter(Boolean).join("\n") };
|
||||
// each figure as its speed and its count, kept apart so a narrow card can
|
||||
// put the count under the speed rather than run past its edge (#1623); the
|
||||
// card sets the count as a caption, with no "·" to lead a wrapped line
|
||||
const measured = v ? { s: v, head: tok(v), count: count(kv, true), title: vTitle } : null;
|
||||
const floor = f ? { s: f, head: "≥" + tok(f), count: count(kf, false), title: fTitle } : null;
|
||||
// the larger sample first; a tie keeps the measured one first
|
||||
const [a, b] = measured && floor && kf > kv ? [floor, measured] : [measured || floor, measured && floor];
|
||||
const say = (p) => p.count ? p.head + " · " + p.count : p.head;
|
||||
const main = say(a), other = b ? say(b) : "";
|
||||
return { v: a.s, text: other ? t("{a}; {b}", { a: main, b: other }) : main, main, mainParts: a.count ? [a.head, " " + a.count] : [a.head], other, title: [a.title, b?.title].filter(Boolean).join("\n") };
|
||||
}
|
||||
// their mean wait for the first token, 0 for none
|
||||
const ledTTFT = (x) => x?.timed > 0 ? x.ttft_ms / x.timed : 0;
|
||||
// a metric's value of a point or a share, as the chart counts it
|
||||
const ledValue = (m, x) => m === "speed" ? ledSpeed(x) : m === "cost" ? +x.cost || 0 : m === "calls" ? +x.calls || 0 : allTokens(x);
|
||||
// of a share in the ranking: a speed is what its row says, the floor of a
|
||||
// group none of whose replies was measured (ledGroupSpeed)
|
||||
// of a share in the ranking: a speed is what its row says first, the one of
|
||||
// more replies (ledGroupSpeed)
|
||||
const ledRankValue = (m, x) => m === "speed" ? ledGroupSpeed(x)?.v || 0 : ledValue(m, x);
|
||||
// of a point's part, which has its calls, tokens, cost and speed
|
||||
const ledPart = (m, x) => m === "speed" ? ledSpeed(x) : m === "cost" ? +x.cost || 0 : m === "calls" ? +x.calls || 0 : +x.tokens || 0;
|
||||
@@ -18058,12 +18062,15 @@ function renderLedgerDash(l) {
|
||||
fill.style.width = (100 * rate).toFixed(1) + "%";
|
||||
meter.append(fill);
|
||||
hit.append(meter);
|
||||
// how fast the streamed replies wrote, and how long they took to begin (#860)
|
||||
// a floor beside a measured speed goes under it, the card's figure kept whole
|
||||
// how fast the streamed replies wrote, and how long they took to begin (#860):
|
||||
// the figure of more replies, its count beside it; the other under it; the
|
||||
// wait for the first token on a line of its own, with how many it is of
|
||||
// (Fallmonkey on Discord)
|
||||
const gs = ledGroupSpeed(l);
|
||||
block("Output speed", gs ? gs.mainParts : "—",
|
||||
line(...[ledTTFT(l) ? t("first token in {ms} on average", { ms: ledTook(ledTTFT(l)) }) : t("no streamed replies timed")].concat(gs?.floor ? [" · ", gs.floor] : [])),
|
||||
const ttft = ledTTFT(l) ? t("first token in {ms} on average", { ms: ledTook(ledTTFT(l)) }) + " · " + t(l.timed === 1 ? "{k} timed reply" : "{k} timed replies", { k: ledNum(l.timed) }) : t("no streamed replies timed");
|
||||
const speedCard = block("Output speed", gs ? gs.mainParts : "—", gs?.other ? line(gs.other) : null,
|
||||
"", [gs?.title, t("Output tokens a second after the first, over the streamed replies") + ". " + t("A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it") + ". " + t("No answer text: speed includes reasoning only when visible reasoning streamed; hidden reasoning has no speed")].filter(Boolean).join("\n"));
|
||||
speedCard.append(Object.assign(line(ttft), { className: "sub ttft" }));
|
||||
drawLedTrend();
|
||||
}
|
||||
|
||||
|
||||
@@ -3686,7 +3686,11 @@ const I18N = {
|
||||
"first token in {ms}": "{ms} 后首响",
|
||||
"first text in {ms}": "{ms} 后出现正文",
|
||||
"{n} tok/s": "{n} token/秒",
|
||||
"{n} tok/s ({k})": "{n} token/秒({k} 次)",
|
||||
"{k} timed reply": "{k} 次计时",
|
||||
"{k} timed replies": "{k} 次计时",
|
||||
"{k} reply": "{k} 次回复",
|
||||
"{k} replies": "{k} 次回复",
|
||||
"{a}; {b}": "{a};{b}",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "实测 {k} 次回复:从首字到结束;其余请求测不出速度",
|
||||
"Measured on {k} reply, from its first token to its end": "实测 {k} 次回复:从首字到结束",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "实测 {k} 次回复:从首字到结束;其余请求测不出速度",
|
||||
@@ -8210,7 +8214,11 @@ const I18N = {
|
||||
"first token in {ms}": "{ms} 後首響",
|
||||
"first text in {ms}": "{ms} 後出現正文",
|
||||
"{n} tok/s": "{n} token/秒",
|
||||
"{n} tok/s ({k})": "{n} token/秒({k} 次)",
|
||||
"{k} timed reply": "{k} 次計時",
|
||||
"{k} timed replies": "{k} 次計時",
|
||||
"{k} reply": "{k} 次回覆",
|
||||
"{k} replies": "{k} 次回覆",
|
||||
"{a}; {b}": "{a};{b}",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "實測 {k} 次回覆:從首字到結束;其餘請求測不出速度",
|
||||
"Measured on {k} reply, from its first token to its end": "實測 {k} 次回覆:從首字到結束",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "實測 {k} 次回覆:從首字到結束;其餘請求測不出速度",
|
||||
@@ -12748,7 +12756,11 @@ const I18N = {
|
||||
"first token in {ms}": "最初のトークンまで {ms}",
|
||||
"first text in {ms}": "最初のテキストまで {ms}",
|
||||
"{n} tok/s": "{n} トークン/秒",
|
||||
"{n} tok/s ({k})": "{n} トークン/秒({k} 件)",
|
||||
"{k} timed reply": "計測 {k} 件",
|
||||
"{k} timed replies": "計測 {k} 件",
|
||||
"{k} reply": "応答 {k} 件",
|
||||
"{k} replies": "応答 {k} 件",
|
||||
"{a}; {b}": "{a}/{b}",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "{k} 件の応答で実測:最初のトークンから終わりまで。ほかのリクエストは速度を計れません",
|
||||
"Measured on {k} reply, from its first token to its end": "{k} 件の応答で実測:最初のトークンから終わりまで",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "{k} 件の応答で実測:最初のトークンから終わりまで。ほかのリクエストは速度を計れません",
|
||||
@@ -17289,7 +17301,11 @@ const I18N = {
|
||||
"first token in {ms}": "erstes Token nach {ms}",
|
||||
"first text in {ms}": "erster Text nach {ms}",
|
||||
"{n} tok/s": "{n} Token/s",
|
||||
"{n} tok/s ({k})": "{n} Token/s ({k})",
|
||||
"{k} timed reply": "{k} gemessene Antwort",
|
||||
"{k} timed replies": "{k} gemessene Antworten",
|
||||
"{k} reply": "{k} Antwort",
|
||||
"{k} replies": "{k} Antworten",
|
||||
"{a}; {b}": "{a}; {b}",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "Gemessen an {k} Antwort, vom ersten Token bis zum Ende; die übrigen Anfragen zeigen kein Tempo",
|
||||
"Measured on {k} reply, from its first token to its end": "Gemessen an {k} Antwort, vom ersten Token bis zum Ende",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "Gemessen an {k} Antworten, vom ersten Token bis zum Ende; die übrigen Anfragen zeigen kein Tempo",
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
// Codex turn its session file times) beside "260 requests", while Claude
|
||||
// Code, whose rows on the Requests tab say "≥100 tok/s" by the dozen, showed
|
||||
// none. A group with replies whose speed was measured now says that speed and
|
||||
// how many replies it is of, "125 tok/s (1)"; one with none, but floors, the
|
||||
// least they wrote at, "≥100 tok/s (30)"; one with both, both, the measured
|
||||
// first, "125 tok/s (1) · ≥50 tok/s (259)", and the Output speed card its
|
||||
// measured speed with the floor under it; one with neither, nothing. The
|
||||
// how many replies it is of, "62 tok/s · 2 timed replies"; one with none, but
|
||||
// floors, the least they wrote at, "≥100 tok/s · 30 replies"; one with both,
|
||||
// both, the one of more replies first, "≥50 tok/s · 259 replies; 125 tok/s ·
|
||||
// 1 timed reply", and the Output speed card that one as its figure, the other
|
||||
// under it and the wait for the first token on a line of its own with its
|
||||
// count; one with neither, nothing. Counts are words, never a bare "(2)". The
|
||||
// rows of the Requests tab say each one's the same way. Codex's rows tell a
|
||||
// floor too: a call in a turn of several, timed from what asked for it, its
|
||||
// output over that time; a turn of one call that reasoned, its answer over
|
||||
@@ -100,27 +102,27 @@ function server(lang) {
|
||||
|
||||
const L = {
|
||||
en: { speed: "Speed", kpi: "Output speed",
|
||||
tok: (n, k) => `${n} tok/s (${k})`,
|
||||
m: (n, k) => `${n} tok/s · ${k} timed ${k === 1 ? "reply" : "replies"}`, f: (n, k) => `≥${n} tok/s · ${k} replies`, join: "; ", timed: (k) => ` · ${k} timed replies`,
|
||||
measured: (k, others) => (k === 1 ? `Measured on ${k} reply, from its first token to its end` : `Measured on ${k} replies, from their first token to their end`) + (others ? "; the others tell no speed" : ""),
|
||||
floorTip: (k) => `At least: ${k} replies read from session files, which don't say when their answers began, so time before that is counted too`, row: "125 tok/s", rowFloor: "≥100 tok/s",
|
||||
cx: "≥50 tok/s", luna: "≥329 tok/s", lunaTip: "At least: 272 answer tokens in " },
|
||||
zh: { speed: "速度", kpi: "输出速度",
|
||||
tok: (n, k) => `${n} token/秒(${k} 次)`,
|
||||
m: (n, k) => `${n} token/秒 · ${k} 次计时`, f: (n, k) => `≥${n} token/秒 · ${k} 次回复`, join: ";", timed: (k) => ` · ${k} 次计时`,
|
||||
measured: (k, others) => `实测 ${k} 次回复:从首字到结束` + (others ? ";其余请求测不出速度" : ""),
|
||||
floorTip: (k) => `下限:${k} 次读自会话文件的回复。会话文件不记录正文何时开始,之前的时间也算在里面`, row: "125 token/秒", rowFloor: "≥100 token/秒",
|
||||
cx: "≥50 token/秒", luna: "≥329 token/秒", lunaTip: "输出 272 个正文 token,224 个推理 token 不计" },
|
||||
"zh-TW": { speed: "速度", kpi: null,
|
||||
tok: (n, k) => `${n} token/秒(${k} 次)`,
|
||||
m: (n, k) => `${n} token/秒 · ${k} 次計時`, f: (n, k) => `≥${n} token/秒 · ${k} 次回覆`, join: ";", timed: (k) => ` · ${k} 次計時`,
|
||||
measured: (k, others) => `實測 ${k} 次回覆:從首字到結束` + (others ? ";其餘請求測不出速度" : ""),
|
||||
floorTip: (k) => `下限:${k} 次讀自會話檔案的回覆。會話檔案不記錄正文何時開始,之前的時間也算在裡面`, row: "125 token/秒", rowFloor: "≥100 token/秒",
|
||||
cx: "≥50 token/秒", luna: "≥329 token/秒", lunaTip: "輸出 272 個正文 token,224 個推理 token 不計" },
|
||||
ja: { speed: null, kpi: null,
|
||||
tok: (n, k) => `${n} トークン/秒(${k} 件)`,
|
||||
m: (n, k) => `${n} トークン/秒 · 計測 ${k} 件`, f: (n, k) => `≥${n} トークン/秒 · 応答 ${k} 件`, join: "/", timed: (k) => ` · 計測 ${k} 件`,
|
||||
measured: (k, others) => `${k} 件の応答で実測:最初のトークンから終わりまで` + (others ? "。ほかのリクエストは速度を計れません" : ""),
|
||||
floorTip: (k) => `下限:セッションファイルから読んだ ${k} 件の応答。回答が始まった時刻がないため、その前の時間も含まれます`, row: "125 トークン/秒", rowFloor: "≥100 トークン/秒",
|
||||
cx: "≥50 トークン/秒", luna: "≥329 トークン/秒", lunaTip: "で回答 272 トークン(推論 224 トークンは含めず)" },
|
||||
de: { speed: null, kpi: null,
|
||||
tok: (n, k) => `${n} Token/s (${k})`,
|
||||
m: (n, k) => `${n} Token/s · ${k} gemessene ${k === 1 ? "Antwort" : "Antworten"}`, f: (n, k) => `≥${n} Token/s · ${k} Antworten`, join: "; ", timed: (k) => ` · ${k} gemessene Antworten`,
|
||||
measured: (k, others) => `Gemessen an ${k} ${k === 1 ? "Antwort" : "Antworten"}, vom ersten Token bis zum Ende` + (others ? "; die übrigen Anfragen zeigen kein Tempo" : ""),
|
||||
floorTip: (k) => `Mindestens: ${k} Antworten aus Sitzungsdateien. Sie sagen nicht, wann die Antworten begannen, also zählt die Zeit davor mit`, row: "125 Token/s", rowFloor: "≥100 Token/s",
|
||||
cx: "≥50 Token/s", luna: "≥329 Token/s", lunaTip: "Mindestens: 272 Antwort-Token in " },
|
||||
@@ -136,12 +138,13 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
// fanbuz); 789: guzi171's window (#1634)
|
||||
for (const width of [1400, 983, 789, 700, 560]) {
|
||||
const w = L[lang];
|
||||
// sol: one measured at 125 and 259 floors at 50; astra: two measured
|
||||
// at 62; Claude Code: 30 floors at 100; the period: three measured
|
||||
// at 75 (1,492 tokens over 20 s), 289 floors at 54
|
||||
const sol = w.tok(125, 1) + " · ≥" + w.tok(50, 259), solTip = w.measured(1, false) + "\n" + w.floorTip(259);
|
||||
const astra = w.tok(62, 2), astraTip = w.measured(2, true);
|
||||
const cc = "≥" + w.tok(100, 30), ccTip = w.floorTip(30);
|
||||
// sol: one measured at 125 and 259 floors at 50, the floors first;
|
||||
// astra: two measured at 62; Claude Code: 30 floors at 100; the
|
||||
// period: three measured at 75 (1,492 tokens over 20 s), 289 floors
|
||||
// at 54
|
||||
const sol = w.f(50, 259) + w.join + w.m(125, 1), solTip = w.floorTip(259) + "\n" + w.measured(1, false);
|
||||
const astra = w.m(62, 2), astraTip = w.measured(2, true);
|
||||
const cc = w.f(100, 30), ccTip = w.floorTip(30);
|
||||
await t.test(lang + " " + width, async () => {
|
||||
const errors = [];
|
||||
const ctx = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: "reduce" });
|
||||
@@ -183,11 +186,26 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
assert.equal(await speedOf("gpt-6-astra"), astra);
|
||||
assert.equal(await rk("gpt-6-astra").locator(".rk-speed").getAttribute("title"), astraTip);
|
||||
|
||||
// the period's speed: the measured one, with its count, and the floor under it
|
||||
// the period's speed: the 289 floors' as its figure, the three
|
||||
// measured under it, and the wait for the first token on a line of
|
||||
// its own with how many it is of
|
||||
const kpi = p.locator("#ledKpi .blk").nth(4);
|
||||
assert.equal((await kpi.locator(".v").textContent()).trim(), w.tok(75, 3));
|
||||
assert((await kpi.locator(".sub").textContent()).includes("≥" + w.tok(54, 289)), "the floor under it: " + (await kpi.locator(".sub").textContent()));
|
||||
assert((await kpi.getAttribute("title")).startsWith(w.measured(3, false) + "\n" + w.floorTip(289)), "the card says what it is of");
|
||||
// (in the card the count is a caption after the figure, no "·" to
|
||||
// lead it when it wraps under the figure)
|
||||
const card = (x) => x.replace(" · ", " ");
|
||||
assert.equal((await kpi.locator(".v").textContent()).trim(), card(w.f(54, 289)));
|
||||
assert.deepEqual(await kpi.locator(".v > span").allTextContents(), w.f(54, 289).split(" · "), "the speed, then its count");
|
||||
const subs = kpi.locator(".sub");
|
||||
assert.equal(await subs.count(), 2);
|
||||
assert.equal((await subs.nth(0).textContent()).trim(), w.m(75, 3));
|
||||
assert((await subs.nth(1).textContent()).endsWith(w.timed(3)), "the first token's line says its count: " + (await subs.nth(1).textContent()));
|
||||
assert(!(await subs.nth(1).textContent()).includes("/"), "no speed on the first token's line");
|
||||
assert(await subs.nth(1).evaluate((e) => e.scrollWidth <= e.clientWidth + 1), "the first token's count is read whole");
|
||||
const [b0, b1] = [await subs.nth(0).boundingBox(), await subs.nth(1).boundingBox()];
|
||||
assert(b1.y >= b0.y + b0.height - 1, "the first token's line is under the other speed");
|
||||
assert((await kpi.getAttribute("title")).startsWith(w.floorTip(289) + "\n" + w.measured(3, false)), "the card says what it is of");
|
||||
// no count is a bare number in parentheses
|
||||
assert(!/[((]\d+[^))]*[))]/.test(await kpi.textContent()), "no parenthesised count: " + (await kpi.textContent()));
|
||||
if (w.kpi) assert.equal((await kpi.locator(".k").textContent()).trim(), w.kpi);
|
||||
// every card's figure, and each part of it, stays inside its card
|
||||
// (#1623: "48 token/秒(781 次)" ran 32px past it at 983px), the
|
||||
@@ -206,11 +224,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await reader.click(p, p.locator("#ledMetric .opt").nth(3));
|
||||
await p.waitForTimeout(150);
|
||||
const vals = await p.locator("#ledRank .rk").evaluateAll((bs) => bs.map((b) => [b.querySelector(".rk-nm").textContent, b.querySelector(".rk-val").textContent.trim(), b.querySelector(".rk-val").title]));
|
||||
assert.deepEqual(vals, [["gpt-6.1-sol", sol, solTip], ["claude-opus-5-5", cc, ccTip], ["gpt-6-astra", astra, astraTip], ["glm-5", "—", ""]]);
|
||||
assert.deepEqual(vals, [["claude-opus-5-5", cc, ccTip], ["gpt-6-astra", astra, astraTip], ["gpt-6.1-sol", sol, solTip], ["glm-5", "—", ""]]);
|
||||
const bar = async (i) => p.locator("#ledRank .rk").nth(i).locator(".rk-bar i").evaluate((e) => parseFloat(e.style.width));
|
||||
assert.equal(await bar(0), 100);
|
||||
assert.equal(await bar(1), 80, "≥100 against 125");
|
||||
assert.equal(await bar(2), 49.6, "62 against 125: sol, with both, orders and bars by its measured speed");
|
||||
assert.equal(await bar(1), 62, "62 against ≥100");
|
||||
assert.equal(await bar(2), 50, "sol, with both, orders and bars by the figure it shows first, its 259 floors' ≥50");
|
||||
const clipped = await p.locator("#ledRank .rk-val").evaluateAll((vs) => vs.filter((v) => v.scrollWidth > v.clientWidth + 1).length);
|
||||
assert.equal(clipped, 0, "every figure is read whole");
|
||||
|
||||
@@ -218,7 +236,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
await reader.click(p, rk("claude-opus-5-5"));
|
||||
await p.waitForFunction(() => document.querySelectorAll(".led tbody tr.led-row").length === 2);
|
||||
await p.waitForTimeout(150);
|
||||
assert.equal((await p.locator("#ledKpi .blk").nth(4).locator(".v").textContent()).trim(), cc);
|
||||
assert.equal((await p.locator("#ledKpi .blk").nth(4).locator(".v").textContent()).trim(), cc.replace(" · ", " "));
|
||||
assert((await p.locator("#ledKpi .blk").nth(4).getAttribute("title")).startsWith(ccTip));
|
||||
|
||||
// no sideways scroll of the page: the view is what scrolls, not the document
|
||||
|
||||
@@ -96,8 +96,8 @@ function server(lang) {
|
||||
}
|
||||
|
||||
const L = {
|
||||
en: { speed: "Speed", kpi: "Output speed", fast: "75 tok/s", slow: "10 tok/s", all: "72 tok/s", first: "first token in 600 ms on average", sent: "Sent", hint: "Sent, Effort and the cache are in each row's details" },
|
||||
zh: { speed: "速度", kpi: "输出速度", fast: "75 token/秒", slow: "10 token/秒", all: "72 token/秒", first: "首字平均 600 毫秒", sent: "发送模型", hint: "窗口较窄:发送模型、推理强度和缓存在每行的详情里" },
|
||||
en: { speed: "Speed", kpi: "Output speed", fast: "75 tok/s", slow: "10 tok/s", all: "72 tok/s", first: "first token in 600 ms on average · 28 timed replies", sent: "Sent", hint: "Sent, Effort and the cache are in each row's details" },
|
||||
zh: { speed: "速度", kpi: "输出速度", fast: "75 token/秒", slow: "10 token/秒", all: "72 token/秒", first: "首字平均 600 毫秒 · 28 次计时", sent: "发送模型", hint: "窗口较窄:发送模型、推理强度和缓存在每行的详情里" },
|
||||
};
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
|
||||
@@ -61,8 +61,8 @@ function server(lang) {
|
||||
}
|
||||
|
||||
const L = {
|
||||
en: { speed: "Speed", kpi: "Output speed", first: "first token in 782 ms on average", fast: "TTFT 762 ms", slow: "TTFT 1.2 s" },
|
||||
zh: { speed: "速度", kpi: "输出速度", first: "首字平均 782 毫秒", fast: "首字 762 毫秒", slow: "首字 1.2 秒" },
|
||||
en: { speed: "Speed", kpi: "Output speed", first: "first token in 782 ms on average · 62 timed replies", fast: "TTFT 762 ms", slow: "TTFT 1.2 s" },
|
||||
zh: { speed: "速度", kpi: "输出速度", first: "首字平均 782 毫秒 · 62 次计时", fast: "首字 762 毫秒", slow: "首字 1.2 秒" },
|
||||
};
|
||||
// a long fraction anywhere: 761.949…, 1166.66…
|
||||
const ragged = /\d[.,]\d{2,} ?(ms|s|毫秒|秒)/;
|
||||
|
||||
Reference in New Issue
Block a user