Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Meta

Comments on Leaderboard sorting bug

Parent

Leaderboard sorting bug

+2
−0

The leaderboard that shows below a code golf challenge can either sort the answers to show the winner for each language separately (if "Group by language" is ticked) or it can show all the answers from all the languages sorted as a single list, to give an overall winner.

There seems to be a bug in sorting, for at least the single list format. This can be seen in the challenge Make $2 + 2 = 5$, where a recent answer with a score of 6 shows above previous answers with a score of 5, with "Group by language" not ticked:

Leaderboard showing 6, "undefined", and 5 as joint 1st place

There is also an answer that did not provide a score, which shows in the leaderboard with a score of "undefined" and is also sorted above the answers with score 5, but below the answer with score 6.

The right hand side of the leaderboard shows the ranking for each answer, with answers with the same score showing the same ranking. Notice that the top 4 answers all show as a joint 1st place (indicated by a picture of a trophy instead of "#1"). This suggests that 6 and "undefined" are not being treated as better scores than 5, but as equivalent scores.

The rest of the leaderboard appears to be sorted correctly, with rankings only being the same where scores are the same.

To decide

  • How do we fix the sorting bug that puts (in this particular case) a score of 6 above a score of 5?
  • What should be the leaderboard behaviour for answers that do not provide a score (or in general provide an invalid entry format)?
    • Omit from the leaderboard?
    • Sort to the bottom to avoid distraction?
    • Sort to the top to draw attention to what needs to be fixed?
    • Display with distinctive formatting?

Whether people should be permitted to post non-competing answers that do not have a score can be raised as a separate Meta discussion if anyone wishes to. Here we just need to decide how an invalid entry format should be treated in the leaderboard code.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

Post
+1
−0

Some time has passed, and the leaderboard there now looks like this:

5, 6, 7, 26, undefined, 5, 9, ascending from there

It appears that the entry showing as undefined is confusing the leaderboard. I don't know what governs the placement of that entry in the list, but it seems to cause a reset. (I would have expected it to sort either first or last, not in the middle.)

While acknowledging that yes this is a bug, the expedient thing to do might be to edit that answer. How often does this happen?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

2 comment threads

Thanks for the extra data (3 comments)
Even better, document the requirements properly. (1 comment)
Thanks for the extra data
trichoplax‭ wrote 5 months ago

Thanks for spotting the new evidence - hopefully that helps someone understand the underlying cause(s).

I think that this is rare, as most challenges do not have invalid format answers. However, there may be a problem even when all answers are formatted correctly:

I tried ticking and unticking the "Group by language" checkbox above the leaderboard on that challenge, and the order changed but then did not end up in the same order after changing back. This suggests the sort used is unstable (may give a different order for answers with identical scores). When someone works on this (I definitely don't see it as high priority) it may be worth sorting by first score and then datetime of posting (or post id - those should be the same order, I think). This would keep the order consistent between ticking, unticking, and reticking (and that way use of an unstable sort will have no consequence).

trichoplax‭ wrote 5 months ago

As for editing the undefined score answer, I haven't made any edit myself because it's not just a different format - the answer is labelled as "not a golfing answer". I don't know whether higher Meta traffic in future might bring a consensus on whether non-competing answers are to be allowed, and whether they should still include a bytecount, but as there is no rule on that at present (that I can find) I'm leaving it as is.

Monica Cellio‭ wrote 5 months ago

That all makes sense. I definitely don't understand the norms here well enough to propose changes either.