Skip to content

fix(db): build each chart line from a single run, no cross-run/date stitching#491

Merged
adibarra merged 1 commit into
masterfrom
fix/line-single-run
Jun 23, 2026
Merged

fix(db): build each chart line from a single run, no cross-run/date stitching#491
adibarra merged 1 commit into
masterfrom
fix/line-single-run

Conversation

@adibarra

@adibarra adibarra commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes core benchmark read paths and chart semantics (lines may lose concurrencies after partial re-sweeps); matview behavior lags until migration 007 is applied in prod.

Overview
Fixes “frankenlines” where one chart line mixed concurrencies from different workflow runs when a newer partial re-sweep skipped some concurrencies.

getLatestBenchmarks now treats a line as (config_id, benchmark_type, isl, osl): pick the newest run (date, then run_started_at, then workflow_run_id) and return only that run’s concurrencies—partial re-sweeps shorten the line instead of backfilling from older runs. The date-filtered SQL path uses a winners CTE + join instead of DISTINCT ON (…, conc, …); json-provider mirrors the same logic for dump/test mode.

Migration 007 rebuilds the latest_benchmarks matview with the same rule and adds benchmark_type to the unique index. Until prod runs this migration, the no-date “latest” path can still serve the old matview while the date path is already fixed.

New unit tests cover truncation, per-sequence independence, same-day tiebreaks, and as-of-run behavior.

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

@vercel

vercel Bot commented Jun 23, 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 Jun 23, 2026 11:23pm

Request Review

@adibarra adibarra merged commit 9fecd46 into master Jun 23, 2026
18 checks passed
@adibarra adibarra deleted the fix/line-single-run branch June 23, 2026 23:34
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