fix(db): build each chart line from a single run, no cross-run/date stitching#491
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
cquil11
pushed a commit
that referenced
this pull request
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
getLatestBenchmarksnow treats a line as(config_id, benchmark_type, isl, osl): pick the newest run (date, thenrun_started_at, thenworkflow_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 ofDISTINCT ON (…, conc, …);json-providermirrors the same logic for dump/test mode.Migration 007 rebuilds the
latest_benchmarksmatview with the same rule and addsbenchmark_typeto 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.