Skip to content

fix(dashboard): load benchmarks in parallel with availability / dashboard 的 benchmarks 与 availability 并行加载 - #1547

Merged
adibarra merged 7 commits into
masterfrom
fix/dashboard-data-waterfall
Oct 29, 2026
Merged

adibarra merged 7 commits into
masterfrom
fix/dashboard-data-waterfall

Conversation

@adibarra

@adibarra adibarra commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 3 of the stack split from #1530. Review and merge in order. CI only runs on PRs that target master, so each layer was verified locally; the combined change passed full CI on #1530.

Stack (merge in order):

  1. fix(next): stop the image optimizer hanging after a cancelled request / 修复请求取消后图片优化器卡住的问题 #1545 Next image optimizer patch
  2. feat(api): negotiate compression, add ETag/304 and stale-while-revalidate purges / API 协商压缩,支持 ETag/304 与 stale-while-revalidate 失效 #1546 API response caching
  3. fix(dashboard): load benchmarks in parallel with availability / dashboard 的 benchmarks 与 availability 并行加载 #1547 Dashboard data waterfall ← this PR
  4. fix(seo): social images, canonicals, titles, intros, structured data and sitemap / SEO:社交图片、canonical、标题、简介、结构化数据与 sitemap #1548 SEO metadata
  5. feat(seo): render compare, run, rankings, overview and blog index with ISR / compare、run、rankings、overview 与博客索引改用 ISR #1549 ISR for programmatic pages
  6. fix(perf): cut client bundle, image and prefetch weight / 减少客户端代码、图片与预取体积 #1550 Client bundle, image and prefetch weight
  7. fix(ux): remove layout shifts and explain blocked legend toggles / 消除布局偏移并说明被禁用的图例切换 #1551 Layout shift and UX
  8. fix(analytics): correct pageviews, proxy PostHog and stop sending search text / 统计:修正 pageview、代理 PostHog 并不再发送搜索文本 #1552 Analytics pageviews and privacy
  9. feat(analytics): cover untracked interactions, add event context and standardize keys / 统计:覆盖未追踪的交互,补充事件上下文并统一键名 #1555 Analytics coverage

The dashboard fetched availability, then benchmarks, then several id lookups, in sequence. On throttled mobile the first chart appeared after about 11 s.

  • Parallel fetch. The latest benchmark rows now load in parallel with /api/v1/availability (prefetchLatestRows in useChartData). The chart keeps its loading state until the sequence resolves, then draws from the cache with no second request, so the default 8K/1K sequence never flashes first.
  • Bulk id lookups. They are chunked to each route's limit, which fixes the log-availability 400 on models with more than 500 ids. They reuse ids already fetched within the stale window, and freshness is tracked per id.
  • Placeholder rows. They no longer cross a query scope, so changing sequence never shows an empty chart.
  • Label overrides. InferenceContext keeps the URL's i_label/i_advlabel overrides until the sequence resolves, fixing a race that dropped them from shared links.
  • Test update. The coach-mark spec waits for the overlay chart to settle, since official points can now draw before the overlay arrives.
Validation details

Targeted Cypress (Chrome): agentic-point-coach-mark 3/3, inference-chart 39/39, landing-dashboard-navigation 23/23, ttft-x-axis-toggle 21/21. Lint, format, typecheck and the full unit suite pass on this layer.

AI model disclosure
  • Model/version: anthropic/claude-opus-5-5 (runtime-exposed identifier for the coordinating agent).
  • Role: audited the site, planned and integrated the change set, split it into this stack, and wrote commit and PR text.
  • Delegated agents (scout, worker and critic subagents) implemented slices, built the stack and ran verification under the same harness. Their exact model identifier was not exposed to the coordinating agent, so it could not be verified.
PR checklist
  • I have completed the AI model disclosure and kept it current
  • Added, changed, or removed filters, views, or pages include the matching API and inferencex-skills changes (no filters or views change)
  • New or changed indexable pages ship their /zh sibling
  • Changed Chinese copy follows the PR review checklist in docs/chinese-copy.md (Chinese maintainer review pending)
中文

本 PR 为从 #1530 拆分的 stack 中的第 3 部分,请按顺序审核与合并。CI 只在以 master 为目标的 PR 上运行,因此每一层都在本地验证;整体改动已在 #1530 上通过完整 CI。

dashboard 此前按顺序请求 availability、benchmarks 以及多个 id 查询,在限速移动网络下首个图表约 11 秒后才出现。

  • 并行请求。 最新 benchmark 数据现在与 /api/v1/availability 并行加载(useChartData 中的 prefetchLatestRows)。图表在序列确定前保持加载状态,确定后直接从缓存绘制、无需再次请求,因此不会先闪现默认的 8K/1K 序列。
  • 批量 id 查询。 按各接口上限分片,修复 id 超过 500 的模型上 log-availability 返回 400 的问题;复用有效期内已获取的 id,并按 id 记录新鲜度。
  • 占位数据。 不再跨查询范围复用,切换序列时不会出现空图表。
  • 标签参数。 InferenceContext 在序列确定前保留 URL 中的 i_label/i_advlabel,修复分享链接丢失这两个参数的竞争问题。
  • 测试调整。 官方数据点现在可能先于叠加数据绘制,coach-mark 测试改为等待叠加图表稳定。

验证:定向 Cypress(Chrome):agentic-point-coach-mark 3/3、inference-chart 39/39、landing-dashboard-navigation 23/23、ttft-x-axis-toggle 21/21。本层的 lint、格式、类型检查与完整单元测试均通过。

AI 模型使用说明:协调 agent 使用 anthropic/claude-opus-5-5(运行环境提供的标识),负责审计、规划与整合改动、拆分 stack 以及撰写提交与 PR 文本;委派的子 agent 在同一环境中实现各部分、构建 stack 并运行验证,其确切模型标识无法获取,因此无法确认。


Note

Medium Risk
Touches core chart data fetching, React Query caching, and URL sync on the inference dashboard; behavior changes are intentional but affect first paint and bulk API traffic patterns.

Overview
Removes the availability → benchmarks waterfall on the inference dashboard by prefetching latest benchmark rows in parallel with availability (prefetchLatestRows in useChartData). While the sequence is still provisional, the chart stays loading instead of painting rows for the default 8K/1K slice, then uses the warmed cache once the sequence resolves—avoiding a second fetch and a flash of the wrong sequence.

Bulk ?ids= lookups are centralized in benchmark-id-query: requests are chunked to each route’s limit (fixing large-model log-availability 400s), query keys are canonical, and only missing or stale ids are refetched with per-id freshness so filter churn doesn’t repeat work. Derived agentic metrics drop their local chunk helper in favor of this path.

Placeholder benchmark data no longer crosses query scope, so compare/seed keys can’t briefly render an empty chart. InferenceContext keeps raw URL label params until the sequence resolves, and the agentic coach-mark Cypress test waits for overlay legend + settled chart width before pinning tooltips.

Reviewed by Cursor Bugbot for commit 0160146. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
inferencemax-app Ready Ready Preview Oct 29, 2026 4:23am UTC

Request Review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6792abe. Configure here.

Patch [email protected] through root patchedDependencies. Unpatched, the
self-hosted optimizer reads a local source image through a mocked request
that reuses the browser socket. When the browser cancels the image, the
read is dropped and every later request for that variant hangs until the
server restarts. A unit test fails if a Next upgrade loses the patch, and
the unit and E2E workflows now run when patches/ changes.

中文:通过根目录 patchedDependencies 为 [email protected] 打补丁。未打补丁时,
自托管图片优化器复用浏览器 socket 读取本地源图,浏览器取消请求后读取被丢弃,
同一尺寸的后续请求会一直挂起,直到服务重启。新增单元测试在升级 Next 丢失补丁
时失败,patches/ 变更也会触发单元测试与 E2E 工作流。
…mediately

cachedJson now takes the request. It answers with brotli, gzip or plain
JSON per Accept-Encoding, always sends Vary and a strong ETag, and returns
304 for a matching If-None-Match. Browsers reuse a response for 60 s.
Route data, ISR page data (db-page) and CDN responses (db-cdn) carry
separate tags, so an ingest expires route data at once and lets pages and
the CDN refresh in the background. purgeAll, purgeCollectiveX and
purgeOperatorX accept immediate, exposed through /api/v1/invalidate and the
admin scripts. Fixture builds send no-store. The ingest and deploy
workflows warm the dashboard APIs with a browser Accept-Encoding. The
datasets route shares a per-slug cache helper. Docs, API reference text
and catalog digests follow.

中文:cachedJson 改为接收请求对象,按 Accept-Encoding 返回 brotli、gzip 或
未压缩 JSON,并始终携带 Vary 与强 ETag,命中 If-None-Match 时返回 304;浏览器
复用响应 60 秒。路由数据、ISR 页面数据(db-page)与 CDN 响应(db-cdn)使用
独立标签,ingest 后路由数据立即失效,页面与 CDN 在后台刷新。purgeAll、
purgeCollectiveX、purgeOperatorX 支持 immediate,并通过 /api/v1/invalidate
与管理脚本提供。fixture 构建返回 no-store。ingest 与部署工作流以浏览器的
Accept-Encoding 预热仪表板 API。datasets 路由改用按 slug 共享的缓存。同步更新
文档、API 参考文案与路由目录摘要。
…ility

The latest benchmarks request depends only on the model, so useChartData
starts it alongside /api/v1/availability through a second observer on the
same query key. Bulk id lookups split at each route's id limit, skip ids a
fresh lookup already covered, and track freshness per id. Placeholder rows
never cross a query scope. InferenceContext keeps the URL's label
overrides until the sequence resolves. The coach-mark E2E waits for the
overlay chart to settle before pinning a point.

中文:最新 benchmark 请求只依赖模型,useChartData 现通过同一 query key 的
第二个观察者,与 /api/v1/availability 并行发起。批量 ID 查询按各路由上限分片,
跳过已有新鲜结果的 ID,并按 ID 记录新鲜度。占位数据不再跨查询范围复用。
InferenceContext 在序列确定前保留 URL 中的标签设置。coach-mark E2E 等待叠加
图表稳定后再固定数据点。
… resolves

The latest-rows prefetch fills the same query key that the sequence-gated
observer reads, and a disabled React Query observer still returns cached
data. Once the prefetch landed, useChartData filtered those rows by the
provisional 8k/1k default and painted it, then swapped to the resolved
sequence (often AgenticTraces). While prefetching, the hook now ignores
that key's rows and stays loading. The network request still runs in
parallel with availability, and the resolved query reads the cache
without a second fetch.

中文:最新数据预取会写入与按序列门控的查询相同的 query key,而被禁用的
React Query 观察者仍会返回缓存数据。预取完成后,useChartData 会按临时的
8k/1k 默认序列过滤并绘制这些数据,随后再切换到实际序列(通常是
AgenticTraces)。现在预取期间,该 hook 不使用此 key 的数据并保持加载状态。
网络请求仍与 availability 并行发起,序列确定后直接读取缓存,不会再次请求。
@adibarra
adibarra force-pushed the feat/api-response-caching branch from e645ff3 to 3a1c60d Compare October 29, 2026 02:06
@adibarra
adibarra force-pushed the fix/dashboard-data-waterfall branch from 9869176 to 0a00217 Compare October 29, 2026 02:06
Base automatically changed from feat/api-response-caching to master October 29, 2026 04:11
@adibarra
adibarra changed the base branch from feat/api-response-caching to master October 29, 2026 04:11
中文:将 master 合并到 fix/dashboard-data-waterfall
中文:针对 master 重新运行 CI
@blacksmith-sh

This comment has been minimized.

中文:针对 master 重新运行 CI
@blacksmith-sh

This comment has been minimized.

@adibarra
adibarra merged commit 5dccde0 into master Oct 29, 2026
52 of 54 checks passed
@adibarra
adibarra deleted the fix/dashboard-data-waterfall branch October 29, 2026 04:31

This branch was successfully deployed

1 active deployment
Preview — 01601468 Deployed Oct 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant