Repository navigation
Working Version of Average_vision Plot - #517
Merged
Merged
Conversation
KartikP
requested changes
May 6, 2026
KartikP
left a comment
Contributor
There was a problem hiding this comment.
Made database migrations. Clean up still required.
| COLOR_NONE = '#e0e1e2' | ||
| GAMMA = 0.5 | ||
|
|
||
| _MONTH_BENCHMARK_EDGES = None |
Contributor
There was a problem hiding this comment.
nit. Would recommend moving the bulk of historical-trend analysis functions to a dedicated python file to not bulk up the model.py.
Contributor
|
In order to apply migrations: In order to back fill all the data: |
Resolved conflicts: - benchmarks/models.py: kept both ModelMonthlyAggregate/MonthBenchmarkEdge (this branch) and ResourceUsage (master) -- independent model classes. - benchmarks/tests/test_ag_grid.py: took master's refactor, which replaces brittle hard-coded top-5 rank/model/score expectations with data-refresh-robust invariants (assert_scores_descending). Supersedes the V1/V2/IT case fix from d903207. Renumbered the master-side migration 0023_resourceusage_* to 0025_* and re-pointed its dependency at 0024_modelmonthlyaggregate_coverage_leaves_added_vs_prev so the chain is linear: 0022 -> 0023 (mma+edge) -> 0024 (coverage_leaves) -> 0025 (resourceusage).
The trend tables were numbered 0024/0025 and collided with master's 0024_resourceusage. Renumber to 0025/0026 and depend on master's 0024 so the migration graph resolves to a single leaf.
The compare-page trend endpoint had no auth and returned any model's monthly aggregates by id. Gate mid_a/mid_b to public models in the domain and 404 otherwise, matching the public-only compare page.
Cache the public rank frame instead of rebuilding the model-by-month matrix per model-card load, batch the per-month scored-leaf queries into one, drop the identity rank remap, and keep only the prior month's coverage sets during recompute.
The trend panel showed misleading vision-only copy on language model pages; render it only for vision. Guard the hover script against a missing BrainScoreTrendHover, matching compare-trend.js.
The attribution sidebar grew the row as its content grew on the model card; cap it to the plot height and scroll internally (the compare page already did this). Add a draggable divider so the plot and attribution columns can be resized on both pages -- keyboard-accessible and synced across the Scores/Rankings tabs.
Rewrite the hover/idle sidebar copy to be shorter and more scannable: proper singular/plural, merged value+delta lines, dropped the summary that duplicated the bullets below it, Mon-YYYY dates, 3-dp scores, and plain-word rank moves. Rank movement text now names only model changes; benchmark churn is shown once as bullets. Tests updated to the new strings.
Give the attribution sidebar a readable hierarchy (bold headline, semibold section labels, muted dot bullets, spacing) via per-line classes assigned in renderAttributionList; render the classed default on wire so the idle state matches hover. Default the plot/attribution columns to 2/3 and 1/3.
…month Extract the shared Plotly axis/template/config into helpers used by both the single-model and compare builders; move the duplicated responsive resize into trend-hover.js. Memoize the max-month cache key (was queried on every cache access) and cache the month list.
Convert model-trend.css to model-trend.sass, import it from main.sass so it compiles through django-compressor, and drop the per-page raw <link> tags. Compiled output is unchanged.
Compare content had no max-width, so its width:100% charts stretched with the viewport. Wrap it in a left-aligned 1500px .compare-layout. The D3 and Plotly charts also sized themselves once at load and never recomputed; give them debounced window-resize handlers that redraw at the current width, and drop the Plotly responsive:true that reflowed inconsistently.
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.
Author: Nathan Teshome
Summary
This PR adds
average_visiontrends over time to:Plotly line charts are backed by precomputed monthly aggregates in
ModelMonthlyAggregateand month-to-month benchmark edges inMonthBenchmarkEdge. As a result, each page load reads stored trend data instead of performing a runtime hierarchical re-aggregation.Users can switch between Scores and Rankings. Rankings are computed per month on the server from the public score matrix, using rounded scores and the minimum-rank method to preserve leaderboard-consistent tie-breaking.
The x-axis extends through the current date, with month-level continuity added after the final known month when necessary.
Structured attribution data in
trendMetapowers an interactive sidebar:Escto clear the pinned selection.For ranking trends, transitions summarize the other models involved in each rank change.
For score trends, newly introduced leaf benchmarks are sourced from
MonthBenchmarkEdge. The sidebar reports how many of those new leaves the focal model was actually scored on by month-end, defined as nonzero and non-NaN, versus how many were not run and therefore counted as0in the aggregate.Features Implemented
Scores Tab — Model Detail Page
Plotly time series of
average_visionusing precomputed monthly values.trendMetaattribution containing:Breakdown of whether each newly added leaf benchmark was:
Rankings Tab — Model Detail Page
Per-month global model rank computed from the public score table.
Scores are rounded before ranking.
Ties use the minimum-rank method, consistent with the leaderboard.
trendMetaattribution containing:Compare Page
Overlaid score trends for two selected models.
Overlaid ranking trends for two selected models.
Shared hover and click-to-pin sidebar behavior.
Per-model month-over-month change summaries.
Shared new-leaf benchmark breakdown showing:
Long model names are truncated in legends and sidebar content to keep narrow layouts readable.
Reason Attribution
The trend sidebar distinguishes between:
For the model detail page, every added leaf is marked as:
For the compare page, every added leaf is marked as:
The sidebar also includes coverage bullets for existing benchmarks that a model was newly scored on during the selected month.
UX Improvements
Esccontrols for clearing pinned selections.3.3loading tobase.html.Final Visualization Demo
Screen.Recording.2026-04-16.at.3.04.14.AM.mov
Screen.Recording.2026-05-05.at.2.44.38.AM.mov