fix(worker): use winner identity for Glicko-2 pairwise scoring

Raw game scores (capture points) are tied in most matches since the
winner is determined by an energy/bots-alive tiebreaker. This caused
Glicko-2 delta=0, leaving rating_mu frozen at 1500 for all bots.

Now winner gets 1.0, non-winners 0.0, draws 0.5 — correct pairwise
win/loss signal for Glicko-2 convergence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-04-24 17:29:36 -04:00
parent ea2f1b50b7
commit 38ae4c6303

View file

@ -452,8 +452,16 @@ func (w *Worker) computeRatingUpdates(claimData *JobClaimData, result *MatchResu
Phi: p.RatingPhiBefore,
Sigma: p.RatingSigmaBefore,
}
// Normalize scores for Glicko-2 (higher is better)
scores[i] = float64(result.Scores[p.BotID])
// Use winner identity for pairwise Glicko-2 scoring.
// Raw game scores (captures) are often tied, so we use the declared
// winner as the discriminator: winner=1.0, others=0.0, draw=0.5.
if result.WinnerID == "" {
scores[i] = 0.5
} else if result.WinnerID == p.BotID {
scores[i] = 1.0
} else {
scores[i] = 0.0
}
}
// Compute rating updates