Skip to content

Export displayed metrics in inference CSV downloads / 在推理 CSV 下载中导出当前显示指标 - #712

Merged
Oseltamivir merged 2 commits into
masterfrom
agent/fix-inference-csv-displayed-metrics
Aug 10, 2026
Merged

Export displayed metrics in inference CSV downloads / 在推理 CSV 下载中导出当前显示指标#712
Oseltamivir merged 2 commits into
masterfrom
agent/fix-inference-csv-displayed-metrics

Conversation

@Oseltamivir

@Oseltamivir Oseltamivir commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • include the selected Y-axis metric and current X-axis value in inference CSV downloads
  • resolve nested derived metrics such as costh.y, so CSV fields match the table view
  • export the same displayed fields for both official rows and visible ?unofficialrun= overlay rows
  • retain the existing benchmark summary columns

Root cause

The inference table resolved the selected metric dynamically from chart data, while the CSV helper exported only a fixed set of raw benchmark fields. Derived metrics such as cost per million total tokens were therefore visible in the table but absent from downloads.

Validation

  • bun run typecheck
  • bun run fmt
  • cd packages/app && bun --env-file=../../.env vitest run src/lib/csv-export-helpers.test.ts (32 tests passed)
  • git diff --check
  • works for both official runs and ?unofficialrun= overlays (covered by the regression test)

中文说明

  • 在推理 CSV 下载中加入当前选择的 Y 轴指标和 X 轴值
  • 支持解析 costh.y 等嵌套派生指标,使 CSV 字段与表格视图保持一致
  • 官方数据和可见的 ?unofficialrun= overlay 数据都会导出相同的当前显示字段
  • 保留现有的基准测试摘要列

根本原因

推理表格会根据图表数据动态解析当前选择的指标,而 CSV helper 仅导出一组固定的原始基准测试字段。因此,每百万总 token 成本等派生指标虽然会显示在表格中,却不会出现在下载文件里。

验证

  • bun run typecheck
  • bun run fmt
  • cd packages/app && bun --env-file=../../.env vitest run src/lib/csv-export-helpers.test.ts(32 项测试通过)
  • git diff --check
  • 官方数据与 ?unofficialrun= overlay 数据均受支持(已通过回归测试覆盖)

Note

Low Risk
Export-only change with optional API parameter; existing callers without displayedMetrics behave as before, covered by new unit tests.

Overview
Inference chart CSV downloads now include the same Y and X values the table shows, not only the fixed benchmark summary columns.

ChartDisplay passes the selected axis labels and the chart definition path (e.g. costh.y) into inferenceChartToCsv, which inserts those columns after Date and resolves nested derived metrics via nestedMetric. Official rows and visible unofficial-run overlay rows get the same displayed fields. Columns are skipped when the header already exists in the export schema (e.g. agentic P99 Interactivity), so headers stay unique.

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

Include the selected Y-axis metric and current X-axis value in inference CSV downloads for official and unofficial overlay rows.\n\n中文:在推理 CSV 下载中加入表格当前显示的 Y 轴指标和 X 轴值,同时支持官方数据与 unofficial run overlay 数据。
@vercel

vercel Bot commented Aug 10, 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 10, 2026 3:03am

Request Review

@Oseltamivir
Oseltamivir marked this pull request as ready for review August 10, 2026 02:36
@Oseltamivir
Oseltamivir requested a review from adibarra as a code owner August 10, 2026 02:36

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

Comment thread packages/app/src/lib/csv-export-helpers.ts Outdated
Skip displayed metric columns whose headers already exist in the fixed inference CSV schema, and cover the agentic P99 case.\n\n中文:当当前显示指标的表头已存在于固定推理 CSV schema 中时不再重复插入,并新增 agentic P99 场景的回归测试。
@Oseltamivir
Oseltamivir merged commit d525d9e into master Aug 10, 2026
27 checks passed
@Oseltamivir
Oseltamivir deleted the agent/fix-inference-csv-displayed-metrics branch August 10, 2026 03: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