fix(inference): stop flagging a complete comparison date range / 修复对比日期范围的误报 - #702
Conversation
…日期范围的误报 Overview's per-cell "Compare curves" link pins both runs through i_dates and sets no i_dstart/i_dend, so the picker read empty and rendered the red pulsing error state even though the comparison was fully specified. The range is only one of two additive sources of comparison series, and a pinned run can only be expressed through i_dates — so gate the error state on resolveComparisonEntries, the same predicate the chart itself uses. 中文:总览页每个单元格的“Compare curves”链接通过 i_dates 固定两次运行,不设置 i_dstart/i_dend,因此日期选择器显示为空并触发红色闪烁的错误状态,尽管对比其实已经 完整。日期范围只是对比曲线的两个叠加来源之一,而固定运行只能通过 i_dates 表达, 因此改用图表自身使用的 resolveComparisonEntries 作为判定条件。
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @edwingao28's task in 1m 37s —— View job 🟢 LGTM — no blocking issues foundReviewed the fix, tests, CI, and verified the flow at runtime. The fix is correct and well-scoped. The error state now gates on Edge cases hold up:
Runtime verification (real-data dev server): loaded Tests: regression coverage in both directions — component tests for the flagged (nothing picked) and unflagged (pinned entries) states, plus an e2e that walks the real Overview → Compare-curves flow. Good. CI: Lint & Format ✅, Tests (Unit) ✅; Tests (E2E) still in progress at review time.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 070d31c5e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude finished @edwingao28's task in 3m 33s —— View job Re-review — 🟢 LGTM (one non-blocking nit)The core fix is correct and I verified the reported flow at runtime. The picker now gates on Runtime verification (real-data dev server): CI: Lint & Format ✅, Tests (Unit) ✅, Tests (E2E) ✅ (the merge commit's runs are all green; only my own Claude job is still in progress). One non-blocking finding (independently confirms Codex's P2 on Tests: regression coverage in both directions (flagged when nothing picked; unflagged when exact entries pinned) plus the Overview→Compare-curves e2e. Good.
|
|
Claude finished @edwingao28's task in 55s —— View job Re-review — 🟢 LGTM (no new issues)The push that triggered this re-review only added merge commits from Fix still correct. The picker gates on Previously-raised WARNING still open (unchanged, non-blocking). Both Codex (P2) and the earlier Claude review noted the picker uses CI: Lint & Format ✅, Tests (Unit) ✅, Code Quality ✅. Tests (E2E) still in progress at review time. Tests: regression coverage in both directions (flagged when nothing picked; unflagged when exact entries pinned) plus the
|
|
Claude finished @edwingao28's task in 1m 4s —— View job Re-review — 🟢 LGTM (no new issues)The push that triggered this re-review added only a Fix still correct. The picker gates the red pulsing border on Previously-raised WARNING still open (unchanged, non-blocking). Both Codex (P2) and the earlier Claude reviews noted the picker uses CI: Lint & Format ✅, CodeQL ✅, Cursor Bugbot ✅, CodeQL/Analyze ✅. Typecheck+unit and E2E shards still pending at review time — the dedicated workflows gate the merge. Tests: unchanged, regression coverage in both directions (component: flagged when nothing picked, unflagged when exact entries pinned) plus the
|
Summary
Following an Overview 30-day cell's Compare curves link landed on
/inferencewith the Comparison Date Range picker flashing red, even though the comparison was fully specified and both curves were already on the chart.Repro: https://inferencex.semianalysis.com/overview?compare=30d → any history cell → Compare curves.
Root cause
The error state was gated on the date range alone:
But the range is only one of two additive sources of comparison series —
resolveComparisonEntries(selectedDates, range)also takes explicit entries fromi_dates, and a pinned run (2026-06-10~r27489075807) can only be expressed that way, never as a range.buildOverviewHistoryDashboardHref(#686) correctly pins both runs throughi_datesand sets noi_dstart/i_dend, so the chart was complete while the picker read empty and raised a false alarm.Fix
Gate the error state on the same predicate the chart itself uses:
This covers every entry point that supplies dates without a range, not just the Overview link. The nudge still fires when a chip config is selected with nothing to compare against.
Testing
/overview?compare=30d→ Compare curves → assert the picker is not flagged). Verified it fails onmasterwith exactly the reported symptom, so it is not vacuous.typecheck/lint/fmtclean; 480 unit, 198 component,overview.cy.ts+inference-chart.cy.tsgreen.中文说明
从总览页 30 天单元格的 Compare curves 链接跳转到
/inference后,即使对比配置已经完整、两条曲线也已经画在图上,Comparison Date Range 选择器仍然会闪红。复现路径:https://inferencex.semianalysis.com/overview?compare=30d → 任意历史单元格 → Compare curves。
根因:错误状态此前只根据日期范围判断。但日期范围只是对比曲线的两个叠加来源之一 ——
resolveComparisonEntries(selectedDates, range)同样接受来自i_dates的显式条目,而固定运行(2026-06-10~r27489075807)只能通过这种方式表达,无法用范围表示。buildOverviewHistoryDashboardHref(#686)正确地用i_dates固定了两次运行且不设置i_dstart/i_dend,于是图表是完整的,选择器却显示为空并误报。修复:改用图表自身使用的判定条件
resolveComparisonEntries(selectedDates, selectedDateRange).length === 0。这覆盖了所有"只给日期、不给范围"的入口,而不仅是总览页链接;当选中 chip 配置但确实没有任何对比对象时,红色提示仍会正常出现。测试:新增 2 个组件测试与 1 个走完整流程的 e2e 测试;已确认该 e2e 测试在
master上会以完全相同的症状失败。typecheck / lint / fmt 通过,480 个单元测试、198 个组件测试、overview.cy.ts与inference-chart.cy.ts全绿,并在基于 fixture 的本地服务上做了双向浏览器验证。Note
Low Risk
UI validation logic only; behavior is narrowed to match existing chart resolution with added regression tests.
Overview
Fixes a false alarm on the inference Comparison Date Range control: the red pulse no longer appears when GPUs are selected but the range is empty while
selectedDates/i_datesalready define a complete comparison (e.g. Overview Compare curves links that pin runs likedate~rID).ChartControlsnow gates the nudge withresolveComparisonEntries(selectedDates, selectedDateRange).length === 0, the same predicate the chart uses, instead of requiringstartDate/endDate. The warning still shows when chip configs are selected with nothing to compare against.Tests: Cypress component cases for flagged vs unflagged picker state, plus an e2e path from
/overview?compare=30dthrough a history Compare curves link.Reviewed by Cursor Bugbot for commit 5fd1dc2. Bugbot is set up for automated code reviews on this repo. Configure here.