Skip to content

Use kernelbot leaderboard rankings API#236

Merged
msaroufim merged 2 commits into
mainfrom
use-kernelbot-leaderboard-rankings
Jun 17, 2026
Merged

Use kernelbot leaderboard rankings API#236
msaroufim merged 2 commits into
mainfrom
use-kernelbot-leaderboard-rankings

Conversation

@msaroufim

@msaroufim msaroufim commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

  • move /api/leaderboard/<id> ranking data from local SQL to kernelbot's canonical rankings endpoint
  • remove duplicated ranked-runs SQL from the API path and legacy server-rendered leaderboard view
  • keep kernelboard's existing response transformation so the frontend contract stays stable
  • add a focused SQL regression guard so leaderboard ranking routes cannot reintroduce local execute/SQL logic
  • fix the local Postgres fixture to preserve PATH when invoking psql

Why

Kernelboard should not own ranking eligibility rules. Kernelbot owns submissions, runs, secret/public validation, and score eligibility. This makes the leaderboard page render kernelbot's canonical view instead of reimplementing rank SQL in the frontend service.

This depends on gpu-mode/kernelbot#493 being deployed first because it introduces GET /leaderboard/{leaderboard_id}/rankings.

Validation

  • REDIS_URL=redis://localhost:6380/0 uv run pytest -q tests/api/test_leaderboard_api.py tests/test_leaderboard.py tests/test_leaderboard_sql_guard.py
  • REDIS_URL=redis://localhost:6380/0 uv run ruff check kernelboard/api/leaderboard.py kernelboard/leaderboard.py kernelboard/lib/kernelbot_client.py tests/api/test_leaderboard_api.py tests/test_leaderboard.py tests/test_leaderboard_sql_guard.py tests/conftest.py
  • REDIS_URL=redis://localhost:6380/0 uv run python -m py_compile kernelboard/api/leaderboard.py kernelboard/leaderboard.py kernelboard/lib/kernelbot_client.py tests/api/test_leaderboard_api.py tests/test_leaderboard.py tests/test_leaderboard_sql_guard.py tests/conftest.py
  • git diff --check

@msaroufim msaroufim merged commit 152795c into main Jun 17, 2026
1 check passed
msaroufim added a commit that referenced this pull request Jun 17, 2026
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