Back to browse
GitHub Repository

a ~1200 Elo chess engine that fits within 2KB

195 starsC

Sameshi – a ~1200 Elo chess engine that fits within 2KB

by datavorous_·Feb 14, 2026·230 points·69 comments

AI Analysis

●●●●GemWizardryZero to OneNiche Gem

Full chess engine in 2KB — demoscene-grade constraint coding transcends gaming.

Strengths
  • Genuinely impressive constraint: legit engine, legal moves, checkmate detection packed into 2KB.
  • Rigorous methodology: 240-game empirical Elo measurement with 95% CI against Stockfish levels.
  • Demoscene ritual done right: transcends 'golf code' novelty—this is real craft with depth.
Weaknesses
  • Deliberately incomplete: no castling, en passant, or promotion limits its depth as a complete engine.
  • Niche appeal: impressive to programmers but lacks staying power outside constraint-coding community.
Category
Target Audience

Programming enthusiasts, demoscene fans, constraint-coding hobbyists

Similar To

Chess.js · Stockfish.js · Other size-constrained engines (Luna, Weakfish)

Post Description

I made a chess engine today, and made it fit within 2KB. I used a variant of MinMax called Negamax, with alpha beta pruning. For the board representation I have used a 120-cell "mailbox". I managed to squeeze in checkmate/stalemate in there, after trimming out some edge cases.

I am a great fan of demoscene (computer art subculture) since middle school, and hence it was a ritual i had to perform.

For estimating the Elo, I measured 240 automated games against Stockfish Elo levels (1320 to 1600) under fixed depth-5 and some constrained rules, using equal color distribution.

Then converted pooled win/draw/loss scores to Elo through some standard logistic formula with binomial 95% confidence interval.

Similar Projects