Skip to content

Working Version of Average_vision Plot - #517

Merged
KartikP merged 26 commits into
masterfrom
nt/historical-models-2
Jul 30, 2026
Merged

KartikP merged 26 commits into
masterfrom
nt/historical-models-2

Conversation

@nnt-git13

@nnt-git13 nnt-git13 commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Author: Nathan Teshome

Summary

This PR adds average_vision trends over time to:

  • The vision model detail page
  • The model comparison page

Plotly line charts are backed by precomputed monthly aggregates in ModelMonthlyAggregate and month-to-month benchmark edges in MonthBenchmarkEdge. 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 trendMeta powers an interactive sidebar:

  • Hover over a point for a quick summary.
  • Click a point to pin a month.
  • Click Release or press Esc to 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 as 0 in the aggregate.

Features Implemented

Scores Tab — Model Detail Page

  • Plotly time series of average_vision using precomputed monthly values.

  • trendMeta attribution containing:

    • Month-to-month score deltas
    • Series-level summaries
    • Coverage-completion bullets
    • Scored-versus-added leaf attribution when new benchmarks enter the aggregate
  • Breakdown of whether each newly added leaf benchmark was:

    • Scored by the model
    • Not run by the model

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.

  • trendMeta attribution containing:

    • Rank movement relative to the previous month
    • Models passed by the focal model
    • Models that passed the focal model
    • New model entrants ranked above the focal model

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:

    • Leaves scored by Model A
    • Leaves scored by Model B
    • Leaves scored by both models
    • Leaves not run by either model
  • Long model names are truncated in legends and sidebar content to keep narrow layouts readable.

Reason Attribution

The trend sidebar distinguishes between:

  • The number of new leaf benchmarks counted globally
  • The number of those benchmarks on which the selected model was actually scored

For the model detail page, every added leaf is marked as:

  • Scored
  • Not run

For the compare page, every added leaf is marked as:

  • Scored by Model A
  • Scored by Model B
  • Scored by both models
  • Not run by either model

The sidebar also includes coverage bullets for existing benchmarks that a model was newly scored on during the selected month.

UX Improvements

  • Added Bulma tabs for Scores and Rankings.
  • Added hover previews and click-to-pin behavior.
  • Added Release and Esc controls for clearing pinned selections.
  • Triggered Plotly resizing when switching tabs.
  • Deferred page-specific script loading.
  • Moved shared Plotly 3.3 loading to base.html.
  • Added Select2 change listeners on the compare page so trends load when default models are populated.

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

@nnt-git13
nnt-git13 requested a review from KartikP April 16, 2026 07:08

@KartikP KartikP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made database migrations. Clean up still required.

Comment thread benchmarks/views/model.py Outdated
COLOR_NONE = '#e0e1e2'
GAMMA = 0.5

_MONTH_BENCHMARK_EDGES = None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. Would recommend moving the bulk of historical-trend analysis functions to a dedicated python file to not bulk up the model.py.

@KartikP

KartikP commented May 17, 2026

Copy link
Copy Markdown
Contributor

In order to apply migrations:

python manage.py migrate benchmarks 0024

In order to back fill all the data:

python manage.py recompute_score_trends --domain vision --mode backfill

@KartikP KartikP closed this May 17, 2026
@KartikP KartikP reopened this May 17, 2026
KartikP and others added 12 commits June 17, 2026 14:52
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.
KartikP added 3 commits July 30, 2026 11:25
…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.
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.

2 participants