Skip to content

Matchmaker: play short-handed games instead of freezing the ladder#131

Open
byte-the-bot wants to merge 2 commits into
mainfrom
matchmaker-variable-match-size
Open

Matchmaker: play short-handed games instead of freezing the ladder#131
byte-the-bot wants to merge 2 commits into
mainfrom
matchmaker-variable-match-size

Conversation

@byte-the-bot

Copy link
Copy Markdown
Collaborator

Fixes the silent matchmaker starvation that froze ranked play Jul 5–15 (root cause of the "no ranked games in days" report).

What happened

The health sweeper (correctly) disabled a dead snake on Jul 5, dropping the Standard 11x11 ladder to 3 enabled entries. run_matchmaker_for_leaderboard required exactly MATCH_SIZE (4) and returned Ok(()) with only a debug! log — invisible at prod's info level. The matchmaker no-opped every 2 minutes for 10 days.

Changes

  • New MIN_MATCH_SIZE = 2: the matchmaker sizes games to min(pool, MATCH_SIZE), so a 2–3 snake pool keeps playing instead of freezing (Weng-Lin ratings handle variable player counts).
  • Starvation (pool < 2) now logs at warn! instead of debug!.
  • The leaderboard page's "Next matchmaker run" stat shows "paused — needs at least 2 healthy snakes (N enabled)" when starved, instead of an ever-staler timestamp computed from the last created game.

Tests

  • select_match unit tests for short-handed pools (2 and 3, uniqueness preserved)
  • DB tests: 3 enabled snakes produce 3-snake games; 1 enabled snake pauses cleanly

Companion PR (health sweeper auto-recovery) coming separately.

🤖 Generated with Claude Code

When enabled entries drop below MATCH_SIZE (4), the matchmaker now
creates games sized to the pool, down to MIN_MATCH_SIZE (2). Below that
it pauses with a warn-level log instead of the old silent debug no-op.
The leaderboard page's 'Next matchmaker run' stat now says why
matchmaking is paused instead of showing an ever-staler timestamp.

A health-disabled snake dropped the Standard 11x11 ladder to 3 enabled
snakes on Jul 5 and the 4-or-nothing check silently froze ranked play
for 10 days.
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.

1 participant