fix(inference): rename J/total-token title to avoid input-metric heuristic#396
Merged
Merged
Conversation
…istic The chart auto-detects "input metrics" by checking if the Y-axis title contains the word "input" — and if so, swaps the X-axis from interactivity to P99 TTFT (correct behavior for input-throughput / input-cost metrics). My J/total-token title was "Measured Joules per Token (input + output)" which tripped that heuristic incorrectly: J/total-token covers ALL tokens, so the X-axis should stay on interactivity, not switch to P99 TTFT. Rename to "Measured Joules per Token (incl. prompt)" — same meaning, no "input" trigger word.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @arygupt's task in 53s —— View job Claude PR Review🟢 LGTM — no blocking issues found.
Verification
Note (non-blocking, out of scope)The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hot-fix on top of #393: rename the Measured J per Token chart title so it doesn't accidentally trigger the input-metric X-axis swap.
What was wrong
The inference scatter chart has a heuristic in
ChartControls.tsx:This is correct behavior for true input-only metrics (input throughput, input cost) — but my title for the new J/total-token metric was
"Measured Joules per Token (input + output)", which contained the word "input" and tripped the heuristic incorrectly.Visible symptom: selecting "Measured J per Token" auto-changed the X-axis to P99 TTFT instead of staying on interactivity.
Fix
Renamed the title from
"Measured Joules per Token (input + output)"→"Measured Joules per Token (incl. prompt)". Same meaning, no "input" trigger word.Why not patch the heuristic instead
The substring check is intentional — it's how the codebase routes metrics into the right X-axis. Changing it would require either:
_isInputMetric: true)Both are bigger changes than this hot-fix needs. Renaming one title string keeps the diff minimal and preserves the existing convention.
Test plan
pnpm typecheckcleanpnpm test:unit1944/1944 passing (no test changes needed)Note
Low Risk
Copy-only chart config label changes with no logic, API, or data-path impact.
Overview
Renames the Measured J per Token chart title in
inference-chart-config.jsonfrom "(input + output)" to "(incl. prompt)" for both interactivity and e2e chart definitions.The wording still describes total-token energy (prompt + generation), but drops the substring "input" so it no longer matches the existing
isInputMetrictitle heuristic that swaps the interactivity chart X-axis to TTFT. Measured J per Token should keep the default interactivity X-axis instead of jumping to P99 TTFT.Reviewed by Cursor Bugbot for commit ec9ceca. Bugbot is set up for automated code reviews on this repo. Configure here.