From 07ae1e8adb24baec41764cac6a700ebd15a739fd Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Wed, 18 Feb 2026 00:10:06 -0800 Subject: [PATCH] Show benchmark shapes in leaderboard description Extract benchmarks from the task JSONB column and display them as a bullet list in the Description section. Seeds are filtered out from the display. --- frontend/src/api/api.ts | 1 + frontend/src/pages/leaderboard/Leaderboard.tsx | 14 ++++++++++++++ kernelboard/api/leaderboard.py | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/api.ts b/frontend/src/api/api.ts index 54c472d..283aaa2 100644 --- a/frontend/src/api/api.ts +++ b/frontend/src/api/api.ts @@ -23,6 +23,7 @@ export interface LeaderboardDetail { description: string; name: string; reference: string; + benchmarks: Record[]; gpu_types: string[]; rankings: Record< string, diff --git a/frontend/src/pages/leaderboard/Leaderboard.tsx b/frontend/src/pages/leaderboard/Leaderboard.tsx index 4828115..86fe666 100644 --- a/frontend/src/pages/leaderboard/Leaderboard.tsx +++ b/frontend/src/pages/leaderboard/Leaderboard.tsx @@ -193,6 +193,20 @@ export default function Leaderboard() { Description + {data.benchmarks && data.benchmarks.length > 0 && ( + + + Benchmark Shapes + +
    + {data.benchmarks.map((b, i) => ( +
  • + {JSON.stringify(Object.fromEntries(Object.entries(b).filter(([k]) => k !== "seed")))} +
  • + ))} +
+
+ )}
diff --git a/kernelboard/api/leaderboard.py b/kernelboard/api/leaderboard.py index b464a8d..bda77f3 100644 --- a/kernelboard/api/leaderboard.py +++ b/kernelboard/api/leaderboard.py @@ -80,6 +80,8 @@ def to_api_leaderboard_item(data: dict[str, Any]): reference = leaderboard_data["reference"] or "" reference = reference.replace("\\n", "\n") + benchmarks = leaderboard_data.get("benchmarks") or [] + gpu_types = leaderboard_data["gpu_types"] gpu_types.sort() @@ -111,6 +113,7 @@ def to_api_leaderboard_item(data: dict[str, Any]): "gpu_types": gpu_types, "description": description, "reference": reference, + "benchmarks": benchmarks, "rankings": rankings, } @@ -126,7 +129,8 @@ def _get_query(): deadline, task->>'lang' AS lang, description AS description, - task->'files'->>'reference.py' AS reference + task->'files'->>'reference.py' AS reference, + task->'benchmarks' AS benchmarks FROM leaderboard.leaderboard WHERE id = %(leaderboard_id)s ), @@ -188,6 +192,7 @@ def _get_query(): 'lang', lang, 'description', description, 'reference', reference, + 'benchmarks', benchmarks, 'gpu_types', (SELECT jsonb_agg(gpu_type) FROM gpu_types) ) FROM leaderboard_info) ) AS result FROM (SELECT gpu_type FROM gpu_types) g;