Severity: Important (fairness)
The sort uses strict > comparison:
if avg > scores.get(j).unwrap() {
// insert
}
Two teams with identical average scores are ranked by iteration order over storage — effectively arbitrary. Team A gets first prize, Team B gets second, with no defined tiebreaker.
Fix
Define a documented tiebreaker. Recommendation:
- Higher average score wins.
- Tie → earlier
submitted_at wins (rewards early submission).
- Still tied → more distinct judges scoring (
score_count) wins.
- Still tied → lower address hash (deterministic fallback).
Tests
- Two identical-score submissions: earlier submitter wins
- Same submission time: more judges wins
- All tied: deterministic across runs
Severity: Important (fairness)
The sort uses strict
>comparison:Two teams with identical average scores are ranked by iteration order over storage — effectively arbitrary. Team A gets first prize, Team B gets second, with no defined tiebreaker.
Fix
Define a documented tiebreaker. Recommendation:
submitted_atwins (rewards early submission).score_count) wins.Tests