Skip to content

fix(inference): preserve mixed engines across preview scopes / 修复推理预览切换范围后混合引擎丢失问题#577

Merged
cquil11 merged 6 commits into
masterfrom
agent/unofficial-preview-scope-reset
Jul 14, 2026
Merged

fix(inference): preserve mixed engines across preview scopes / 修复推理预览切换范围后混合引擎丢失问题#577
cquil11 merged 6 commits into
masterfrom
agent/unofficial-preview-scope-reset

Conversation

@cquil11

@cquil11 cquil11 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Disable the production engine-family exclusion throughout InferenceProvider while an unofficial run preview is loaded.
  • Preserve every eligible official and unofficial engine series when the preview changes model, sequence, or precision scope.
  • Seed preview-only chart and table selections from the full new scope instead of the production-filtered activeHwTypes set.
  • Suppress stale production conflict notices in preview mode and remove D3 overlay marks when the last unofficial run is dismissed.
  • Keep the production engine-family restriction unchanged when no unofficial run is loaded.

Follow-up to #575 and #576. This addresses the post-merge Bugbot finding in #576 (comment).

Root cause

#576 stored preview-only mixed official selections in localOfficialOverride, while InferenceProvider continued applying the production exclusion to activeHwTypes. Scope changes and provider resets could therefore drop engine families or show a false restriction notice. Dismissing the last run also removed the React overlay data without deleting the previous custom D3 layer's DOM.

Validation

  • pnpm lint
  • pnpm fmt
  • pnpm typecheck
  • Unit suites: 2,987 tests passed
  • Cypress component suite: 182/182 tests passed
  • Real-run browser verification with ?unofficialrun=29272097721: Agentic Traces rendered 10 unofficial points with 3 vLLM and 3 SGLang official rooflines, no engine-conflict toast, and dismissing the run removed all unofficial points and rooflines
  • Vercel deployment passed: https://inferencemax-app-git-agent-unofficial-pre-f700e9-semianalysisai.vercel.app (team SSO-protected; interactive real-run verification performed against the same branch locally)

Works for both official runs and ?unofficialrun= overlays. Official-only views retain the production comparability guard; preview views allow mixed engines across chart, legend, reset, table, scope changes, and run dismissal.

中文说明

  • 加载非官方运行预览时,在 InferenceProvider 全链路停用正式环境的引擎系列互斥规则。
  • 预览切换模型、序列或精度范围时,保留所有符合条件的官方与非官方引擎系列。
  • 图表和表格在进入新的预览范围时,会基于该范围内的完整数据初始化选择,不再回退到受正式环境互斥规则限制的 activeHwTypes
  • 预览模式下不再显示过期的正式环境冲突提示;移除最后一个非官方运行时,也会同步清理 D3 叠加标记。
  • 未加载非官方运行时,正式环境原有的引擎系列限制保持不变。

这是 #575#576 的后续修复,并处理了 #576 合并后 Bugbot 指出的回归问题:https://github.com/SemiAnalysisAI/InferenceX-app/pull/576#discussion_r3575247628。

根因

#576 通过 localOfficialOverride 保存仅用于预览的混合官方引擎选择,但 InferenceProvider 仍会对 activeHwTypes 应用正式环境的互斥规则。因此,切换范围或 Provider 重置时仍可能丢失部分引擎系列,或错误显示限制提示。移除最后一个运行时,React 侧虽然清除了叠加数据,但之前创建的 D3 自定义图层 DOM 没有同步删除。

验证

  • pnpm lint
  • pnpm fmt
  • pnpm typecheck
  • 单元测试:2,987 项全部通过
  • Cypress 组件测试:182/182 项全部通过
  • 使用 ?unofficialrun=29272097721 进行真实运行浏览器验证:Agentic Traces 同时渲染 10 个非官方数据点、3 条 vLLM 与 3 条 SGLang 官方 roofline,未出现引擎冲突提示;移除该运行后,所有非官方数据点和 roofline 均被清理
  • Vercel 部署已通过:https://inferencemax-app-git-agent-unofficial-pre-f700e9-semianalysisai.vercel.app(受团队 SSO 保护;交互式真实运行验证在同一分支的本地环境完成)

官方运行和 ?unofficialrun= 叠加路径均受支持。仅官方数据的视图继续保留正式环境兼容性限制;预览视图则在图表、图例、重置、表格、范围切换和运行移除等路径中允许混合引擎。


Note

Medium Risk
Touches inference legend, table filtering, and exclusion logic on chart/table paths; behavior is split between official and preview modes but covered by expanded Cypress and unit tests.

Overview
Fixes preview (?unofficialrun=) charts losing mixed engine families or showing wrong legend/table rows when model, sequence, or precision changes, or when official data loads after overlays.

Unofficial preview now skips the production engine-family exclusion via comparisonExclusion in InferenceProvider, so activeHwTypes resets and legend toggles are not filtered by the Agentic comparability guard. Engine conflict toasts are suppressed while a preview is loaded.

Scope transitions in ScatterGraph and ChartDisplay treat overlay scope changes as preview-only, wait out loading with empty official graphs before committing localOfficialOverride, and seed selections from the full eligible official scope instead of production-filtered activeHwTypes. Official-only charts no longer get stuck ignoring legend toggles after a scope key change.

Dismissal: when overlay data is removed, a useLayoutEffect strips leftover D3 .unofficial-overlay-pt and .overlay-roofline-path nodes.

Cypress and unit tests cover delayed official fetch, table/chart sync, and overlay dismissal.

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

Seed each new unofficial-preview scope from all eligible official and overlay series so model, sequence, and precision changes do not restore the production engine-family filter.

Add component coverage for mixed vLLM and SGLang series surviving a scope change, rerender, and overlay dismissal.

中文:修复非官方运行预览在切换模型、序列或精度后丢失部分引擎系列的问题。新预览范围会保留所有符合条件的官方与叠加系列,并新增覆盖范围切换、重新渲染及叠加运行隐藏操作的组件测试。
@cquil11
cquil11 requested a review from adibarra as a code owner July 14, 2026 00:42
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
inferencemax-app Ready Ready Preview, Comment Jul 14, 2026 1:17am

Request Review

Comment thread packages/app/src/components/inference/ui/ChartDisplay.tsx
Bypass the production engine-family exclusion throughout InferenceProvider while an unofficial run is loaded, reset the full hardware scope when preview mode changes, and suppress stale conflict notices.

Remove D3 overlay marks when the last preview run is dismissed and cover both the preview-only exclusion policy and overlay cleanup with regressions.

中文:非官方运行加载期间,在 InferenceProvider 全链路停用正式环境的引擎系列互斥规则;切换预览模式时重置完整硬件范围,并隐藏过期的冲突提示。最后一个预览运行被移除后会同步清理 D3 叠加标记,同时新增针对预览互斥策略和叠加清理的回归测试。
Do not persist an empty official selection while benchmark graphs for a new unofficial-preview scope are still loading. Commit the scope only after official data arrives or loading finishes.

Extend the scope-transition regression to render overlays first, then load mixed vLLM and SGLang official rows and verify that all four series remain visible.

中文:切换非官方运行预览范围时,如果官方基准图表仍在加载,不再把临时空集合持久化为官方选择。仅在官方数据到达或加载结束后提交新范围,并扩展回归测试,覆盖叠加数据先到、vLLM 与 SGLang 官方数据后到的场景。
Comment thread packages/app/src/components/inference/ui/ScatterGraph.tsx
Keep overlay scope transition seeding limited to charts with preview data so official-only legend toggles continue to follow activeHwTypes. Add a component regression for switching scopes without an unofficial run.

中文:将预览范围切换逻辑限定在包含 unofficial run 数据的图表中,确保仅官方数据的图表切换范围后,图例筛选仍会正确跟随 activeHwTypes;并新增无 unofficial run 场景的组件回归测试。
Comment thread packages/app/src/components/inference/ui/ChartDisplay.tsx
Use local official selection overrides only while an unofficial run preview is active, keeping official-only chart, table, and export visibility synchronized with activeHwTypes after scope changes. Add a component regression for the official table path.

中文:仅在加载 unofficial run 预览时使用本地官方硬件选择覆盖,确保仅官方数据的图表、表格和导出在切换范围后仍与 activeHwTypes 保持同步;并新增官方表格路径的组件回归测试。

@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 7f4920f. Configure here.

Comment thread packages/app/src/components/inference/ui/ScatterGraph.tsx
Keep ScatterGraph preview scope transitions pending while official benchmarks are still loading so overlay reconciliation cannot clear or replace the mixed-engine selection before ChartDisplay seeds the new scope. Add delayed-data component coverage.

中文:官方基准测试仍在加载时,保持 ScatterGraph 的预览范围切换处于待处理状态,避免叠加数据对账在 ChartDisplay 初始化新范围前清空或替换混合引擎选择;并新增延迟数据场景的组件测试。
@cquil11
cquil11 merged commit 2dafb87 into master Jul 14, 2026
26 checks passed
@cquil11
cquil11 deleted the agent/unofficial-preview-scope-reset branch July 14, 2026 01:18
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