Repository navigation
Replies: 1 comment 1 reply
|
I traced both ends of this on Where the denominator is produced. Where it is rendered — three sites, not one. Why I am not shipping this as a plugin. The dock seam is real — Of your three suggestions, (1) is the only one a plugin could honestly do — and only for the pill; (2) is the one I would take upstream, at |
Uh oh!
There was an error while loading. Please reload this page.
Version:
@deepseek-ai/dsh-desktop0.2.1-rc.3 (dshBuildCommitbe72761ee1a6736ebcdf4f3739363b083ae53c98, channel nightly), Windows 11 desktop.Symptom
The stats pill and per-message line report absurd decode speeds — I have seen
41,188 tok/sand582 tok/sfrom a local model whose engine reports ~150 tok/s in its owntimingsblock. Off by 2–3 orders of magnitude, and intermittent: most steps look plausible, then one turn goes to five figures.Where the number comes from
dsh/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.jsSame aggregation in the projection,
dsh/node_modules/@deepseek-ai/dsh-session-stats/lib/index.js:decodeTokensis the whole step's output token count (tool-call JSON arguments included), whiledecodeMsis only the span between the first and last recorded stream chunk. On tool-call steps those are not the same interval.Root cause
For a step that ends in a tool call, the recorded stream chunks are flushed once the call becomes complete/parseable, so every chunk record carries essentially the same timestamp and the per-chunk arrival time is lost.
completedTime - firstTokenTimetherefore collapses to a few milliseconds whileusage.outputTokensstill counts the full step.The real step duration is on the event envelope and is orders of magnitude larger:
103 tokens / 0.004 s = 25,750 tok/s reported for a step that actually took 1.39 s.
Note
dsh-client-ui-trajectory/lib/client.jsguards the neighbouring case:but it only catches
<= 0. The chat UI path has no lower bound at all, so a denominator of 1–4 ms passes straight through.Measurements
Scanned every
session.v4.jsonl.zstdin the profile session directory (4 sessions, 7,584 tool-call steps), selecting steps withcompletedTime - firstTokenTime < 5 msandoutputTokens >= 50:Of the steps matching
span < 5 ms && output >= 50, 7 were pure tool-call steps and 0 were pure text steps — so this is specific to tool-call steps, not a general timing problem:Because it fires on well under 1% of steps it looks intermittent from the outside.
Impact
tok/scan be off by 2–3 orders of magnitude.decodeMsanddecodeTokensare summed across steps measured on inconsistent bases, so even a session with no individually-degenerate step can drift.Suggested fixes (any one removes the five-figure readings)
decodeMs >= 50, or clamp the computed tps to a sane ceiling) and render—instead.step/start.time→assistant/message.time) instead of first-to-last chunk, so numerator and denominator describe the same interval.decodeTokens.I can provide the raw session file or a reproducer script if useful.
All reactions