Skip to content

Leaderboard: rank on the average of score rows instead of their sum - #2786

Open
Didayolo wants to merge 1 commit into
developfrom
leaderboard_sum_fix
Open

Didayolo wants to merge 1 commit into
developfrom
leaderboard_sum_fix

Conversation

@Didayolo

@Didayolo Didayolo commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Description

Problem (#2676)

The leaderboard and Best mode ranked submissions on Sum of their score rows. That caused two problems:

  • Old duplicate rows: these come from repeated uploads before Leaderboard Ordering - Reject repeated score uploads for a submission #2608. Sum doubled such a submission's score, so it could rank above better submissions.
  • Multi-task submissions in Best mode: a parent holds the score rows of all its children, and the children were ranked against it. When lower is better, or with negative scores, a single child always won and went on the leaderboard without its other tasks. The first child to finish could also go on the leaderboard alone before its siblings were done.

Changes

  • In strategies.py and serializers/leaderboards.py, Sum was replaced by Avg.

    • A submission with one row per column ranks exactly as before.
    • Duplicate rows give the real score, not a multiple of it.
    • A multi-task parent ranks on its mean across tasks.
  • BestModeStrategy:

    • Only top-level submissions are ranked (parent__isnull=True), so a child can no longer beat its own parent.
    • A child's upload does nothing until every sibling is done. The current best stays on the leaderboard in the meantime, as the "latest" rule already does.
  • Added tests for the multi-tasks case

Behaviour change

In the usual case (higher is better, scores ≥ 0), rankings stay the same, with one exception. A multi-task submission with a failed task is no longer ranked as if that task scored 0.

Notes

This conflicts with #2759 and should be rebased after it.
Old duplicate rows are still in the database. #2608 only rejects new ones.

Issues this PR resolves

Checklist

  • Code review by me
  • Hand tested by me
  • I'm proud of my work
  • Code review by reviewer
  • Hand tested by reviewer
  • CircleCi tests are passing
  • Ready to merge

This branch has not been deployed

No deployments
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.

Leaderboard ranking is computed using Sum of multiple scores

1 participant