The tiny correct matchmaking rating kit. Elo for head-to-head, Glicko-2 for rating periods β drop it in, stop reimplementing it badly.
Elo: expected score = 1 / (1 + 10(RbβRa)/400); updates are zero-sum. Glicko-2 (Mark Glickman) adds a ratings deviation (RD) β how sure the system is β plus volatility, updated once per rating period. Full algorithm in the library; see README for the citation. 100% local β no network, no server.