Skip to content

Fix Best per SKU in MP4 replay / 修复 MP4 回放中的“每个 SKU 最佳配置” - #809

Open
Oseltamivir wants to merge 6 commits into
masterfrom
fix/inference-replay-best-per-sku
Open

Fix Best per SKU in MP4 replay / 修复 MP4 回放中的“每个 SKU 最佳配置”#809
Oseltamivir wants to merge 6 commits into
masterfrom
fix/inference-replay-best-per-sku

Conversation

@Oseltamivir

@Oseltamivir Oseltamivir commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Recompute the metric-aware Best per SKU winner after interpolation for every replay frame, so the MP4 preview and export can switch hwKeys as benchmark history advances while keeping one winner per physical SKU.
  • Reuse the current parent chart winner's color for every historical winner of the same physical SKU, preventing older hwKeys from falling back to gray while their config labels change.
  • Give historical winners for one physical SKU a stable roofline identity and encode a deterministic ~480 ms geometry morph directly into replay fractions. The live preview and exported MP4 now consume the same intermediate line positions instead of relying on a wall-clock D3 transition that the encoder could miss.
  • Offer 3×, 4×, and 5× playback only while Best per SKU is enabled; disabling the mode clamps playback back to the regular 2× ceiling. Best-per-SKU MP4 mode keeps its explicitly requested animation active even when the ambient reduced-motion preference is enabled; regular replay still uses the stepped, non-animated fallback.
  • Apply the selected Best-per-SKU speed to MP4 duration while retaining 30 FPS, cutting a maximum-length export from 900 frames at 1× to 180 at 5×. Wait for one paint boundary instead of two before rasterizing each frame; regular replay export remains unchanged.
  • Build fixed replay axes from the configurations that can actually appear, and honor the current precision, quick-filter, and hardware visibility state.
  • Carry visible unofficial-run data into replay, date-gate it at the playhead, apply the same Best per SKU policy, and avoid writing historical winners back into the live parent chart.
  • Add unit and Cypress regression coverage for changing historical winners, stable SKU colors, encoded intermediate winner geometry, exact settled geometry, speed gating, and unofficial-run overlay filtering.

Unofficial run overlays

Works for both official runs and ?unofficialrun= overlays. Overlay rows respect active hardware visibility, per-run dismissal through the assembled overlay input, precision filters, quick filters, and the faster Best-per-SKU playhead. Unofficial runs have one observed benchmark date, so they have no cross-date winning-config geometry to morph; they remain date-gated and use their run colors. The overlay path is covered by the unit regression; the official replay winner transition, historical color reuse, deterministic geometry, and speed gating are verified by unit and Cypress tests. Vercel preview is deployed and ready.

Testing

  • bun run typecheck
  • bun run lint
  • bun run fmt
  • bun run test:unit — 4,112 tests passed across workspaces
  • bun vitest run src/components/inference/replay/__tests__/replayFrameData.test.ts — 31 tests passed; verifies an encoded intermediate MP4 frame differs from the snapped winner and that the line settles exactly on the incoming config
  • bunx cypress run --spec cypress/e2e/inference-replay-best-per-sku.cy.ts — 1 test passed; forces reduced motion on and verifies continuous progress within 300 ms, stable path reuse, deterministic geometry updates, 5× selection, and removal of 5× outside Best per SKU
  • bun run test:e2e:quick:component — 27/27 component smoke tests passed
  • DB-backed smoke integration remains unavailable locally because DATABASE_READONLY_URL is not set

中文说明

  • 在每个回放帧完成插值后,按当前指标重新计算“每个 SKU 最佳配置”,使 MP4 预览和导出能够随着基准测试历史推进动态切换 hwKey,同时确保每个物理 SKU 始终保留一个胜出配置。
  • 同一物理 SKU 的所有历史胜出配置沿用当前父图表胜出配置的颜色,避免旧 hwKey 在配置标签变化时回退为灰色。
  • 为同一物理 SKU 的历史胜出配置复用稳定的 roofline 标识,并将约 480 ms 的确定性几何变形直接编码到回放进度中。实时预览和导出的 MP4 现在使用完全相同的中间曲线位置,不再依赖编码器可能错过的实际时间 D3 过渡。
  • 仅在启用“每个 SKU 最佳配置”时提供 3×、4× 和 5× 回放速度;关闭该模式后,播放速度自动降至常规上限 2×。即使系统启用了“减少动态效果”,Best-per-SKU MP4 模式仍会保留用户明确请求的动画;常规回放则继续采用分步且无动画的降级方式。
  • MP4 导出时长遵循所选的 Best-per-SKU 速度并保持 30 FPS,使最长回放的帧数从 1× 时的 900 帧降至 5× 时的 180 帧。每帧光栅化前只等待一次绘制边界而非两次;常规回放导出保持不变。
  • 固定坐标轴只覆盖回放中实际可能出现的配置,并遵循当前 precision、快速筛选和硬件可见性状态。
  • 将可见的 unofficial run 数据纳入回放:根据播放时间点控制出现时机,应用相同的“每个 SKU 最佳配置”规则,同时避免把历史帧的胜出配置写回实时父图表。
  • 补充单元测试和 Cypress 回归测试,覆盖历史胜出配置动态变化、SKU 颜色稳定性、编码后的中间曲线几何、最终稳定几何、速度范围限制以及 unofficial run overlay 的筛选逻辑。

Unofficial run overlay 支持

该改动同时支持 official run 和 ?unofficialrun= overlay。Overlay 数据遵循硬件可见性、组装 overlay 输入中的单次 run 关闭状态、precision 筛选、快速筛选和更快的“每个 SKU 最佳配置”播放进度。Unofficial run 只有一个观测日期,因此不存在可进行跨日期变形的胜出配置曲线;它们仍按播放时间点出现并使用对应 run 的颜色。单元测试覆盖 overlay 路径;单元测试和 Cypress 测试共同验证 official replay 的胜出配置切换、历史 SKU 颜色复用、确定性几何变化和速度范围限制。Vercel preview 已部署并就绪。

测试

  • bun run typecheck
  • bun run lint
  • bun run fmt
  • bun run test:unit — 所有 workspace 共 4,112 个测试通过
  • bun vitest run src/components/inference/replay/__tests__/replayFrameData.test.ts — 31 个测试通过;验证 MP4 中间帧不同于直接跳变后的胜出配置,并验证曲线最终精确落在新配置上
  • bunx cypress run --spec cypress/e2e/inference-replay-best-per-sku.cy.ts — 1 个测试通过;强制启用“减少动态效果”,并验证回放在 300 ms 内持续推进、稳定复用 SVG path、更新确定性几何、支持 5× 选择,以及关闭“每个 SKU 最佳配置”后移除 5×
  • bun run test:e2e:quick:component — component smoke suite 27/27 通过
  • 由于本地未配置 DATABASE_READONLY_URL,依赖数据库的 smoke integration 无法运行

Recompute the winning hardware series for every historical replay frame, keep fixed axes aligned with visible winners, and carry eligible unofficial-run overlays into the export preview.

Add unit and Cypress coverage proving that replay winners change over time while every visible SKU retains a best configuration.

中文:在 MP4 历史回放的每一帧重新计算“每个 SKU 最佳配置”,让固定坐标轴覆盖所有可见胜出配置,并将符合筛选条件的 unofficial run overlay 纳入导出预览。补充单元测试与 Cypress 测试,验证胜出配置会随时间动态变化,且每个可见 SKU 始终保留最佳配置。
@vercel

vercel Bot commented Aug 21, 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 Aug 21, 2026 8:26am

Request Review

Map every historical Best per SKU winner to the current parent-chart winner for the same physical SKU, keeping colors stable as configurations change. Add unit and Cypress regression coverage for the color alias.

中文:让历史“每个 SKU 最佳配置”沿用当前父图表中同一物理 SKU 胜出配置的颜色,在配置变化时保持颜色稳定。补充颜色映射的单元测试和 Cypress 回归测试。
Offer 3x, 4x, and 5x playback only in Best per SKU mode. Reuse a stable physical-SKU roofline identity and apply a speed-aware D3 transition so historical winner changes morph instead of snapping. Add Cypress coverage for the transition and speed gating.

中文:仅在“每个 SKU 最佳配置”模式中提供 3x、4x 和 5x 回放速度。为同一物理 SKU 复用稳定的 roofline 标识,并采用随速度调整的 D3 过渡动画,使历史胜出配置切换时平滑变形而非瞬间跳变。补充覆盖动画和速度范围限制的 Cypress 测试。
Replace the wall-clock D3 transition with deterministic Best per SKU frame geometry so exported MP4s capture intermediate winner-line positions. Keep the morph scoped to Best per SKU and reduced-motion preferences, and add regression coverage for intermediate and settled frames.

中文:将依赖实际时间的 D3 过渡改为确定性的“每个 SKU 最佳配置”帧几何变化,使导出的 MP4 能捕获胜出曲线切换过程中的中间位置。动画仍仅适用于该模式并遵循“减少动态效果”偏好,同时补充中间帧和最终稳定帧的回归测试。
@Oseltamivir
Oseltamivir marked this pull request as ready for review August 21, 2026 05:52
@Oseltamivir
Oseltamivir requested a review from adibarra as a code owner August 21, 2026 05:52
Do not route explicitly animated Best per SKU replay through the reduced-motion slideshow, which disabled winner morphs and made lines teleport. Extend the deterministic morph to about 480ms and reproduce the reduced-motion bypass in Cypress.

中文:不再让明确需要动画的“每个 SKU 最佳配置”回放进入“减少动态效果”的幻灯片分支;该分支此前会禁用胜出配置变形并导致曲线瞬移。将确定性变形时长延长至约 480ms,并在 Cypress 中复现和覆盖这一绕过问题。
@cursor

cursor Bot commented Aug 21, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Apply the selected Best-per-SKU replay speed to MP4 duration while retaining 30 FPS, and reduce the per-frame paint wait from two refreshes to one. Add duration regression tests and document the export behavior.

中文:让 MP4 导出时长遵循所选的“每个 SKU 最佳配置”回放速度,同时保持 30 FPS,并将每帧等待从两次刷新减少为一次。补充时长回归测试并记录导出行为。
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