A high-performance chess engine written in Rust, designed for competitive play via the UCI protocol. Prometheus combines sophisticated search algorithms, advanced position evaluation, and comprehensive opening preparation to deliver strong and reliable chess play.
- Features
- Architecture
- Performance Benchmarks
- Training Data & Opening Book
- Search Techniques
- Evaluation Details
- Building & Running
- UCI Protocol Support
- Proof of Performance
- Author
- Bitboard-based position representation for optimal move generation performance
- Bitwise operations for ultra-fast square manipulation and piece lookups
- Magic bitboards for sliding piece attack generation (bishops, rooks, queens)
- Full Zobrist hashing for transposition table management and repetition detection
- Complete FEN parsing and position serialization
- UCI protocol compliance for universal GUI compatibility
- Iterative Deepening with alpha-beta pruning — guarantees best move at each depth
- Principal Variation Search (PVS) — optimized alpha-beta with null-window searches
- Aspiration Windows — tighter alpha-beta bounds to reduce search space
- Transposition Table — 64MB default (configurable) with generation-based aging
-
Null Move Pruning (NMP) — skip opponent's turn; if position still winning, prune branch
- Reduces search nodes by ~30-40% in average positions
- Dynamic null move reduction based on remaining depth
-
Reverse Futility Pruning (RFP) — static evaluation margin-based pruning
- Prunes moves that cannot possibly improve alpha within reasonable margins
- Highly effective near the leaves of the search tree
-
Late Move Reductions (LMR) — logarithmic reduction for late moves
- Reduction formula:
0.75 + ln(depth) * ln(move_num) / 2.25 - Reordered moves researched at full depth if they exceed alpha
- Reduction formula:
-
Late Move Pruning (LMP) — skip quiet moves at shallow depths
- Conservative pruning limits: 2 quiet moves at depth 1, 4 at depth 2, etc.
- Never prunes forcing moves or first few moves
-
Futility Pruning — skip hopeless quiet moves near leaf nodes
- Positions where static eval + margin < alpha are safely pruned
- Critical for pruning weak quiet moves in shallow search
-
Razoring — conditional quiescence entry when far below alpha
- Drops into quiescence search if eval is too far from target
- Balances speed with occasional deep line analysis
- Check Extensions — extend search by 1 ply when in check
- Forces deeper analysis of check/escape sequences
- Prevents horizon effects in forcing sequences
- Captures and checks only — reduces move explosion at leaf nodes
- Delta Pruning — prunes captures that cannot possibly improve score
- SEE-based pruning — Static Exchange Evaluation filters losing captures
- Prevents quiescence explosions with controlled move generation
- 50-move rule — automatic draw detection by halfmove clock
- Threefold repetition — position history tracking with Zobrist hashing
- Stalemate & insufficient material — handled in move generation and evaluation
The engine uses a sophisticated multi-level move ordering strategy:
- Transposition Table Move — move that caused cutoff in sibling nodes (highest priority)
- Winning/Equal Captures — sorted by MVV-LVA (Most Valuable Victim - Least Valuable Attacker)
- Killer Moves — 2 quiet moves per ply that caused cutoffs in siblings
- History Heuristic — quiet moves weighted by success frequency with gravity decay
- Countermove Heuristic — moves that counter opponent's last move
- Losing Captures — captures failing SEE test (lowest priority)
Move ordering typically reduces effective branching factor by 15-25%.
Prometheus uses tapered evaluation that smoothly interpolates between midgame and endgame:
- Phase calculation based on material remaining (knights, bishops, rooks, queens)
- Total phase weight: 24 (queen=4, rook=2, bishop/knight=1 each)
- Smooth interpolation from opening through all endgame types
Industry-standard piece-square tables optimized for modern chess:
- Separate midgame (MG) and endgame (EG) tables for all pieces
- Pawn PST: Encourages central control, advance, and promotion
- Knight PST: Prefers active, centralized positions; punishes edges
- Bishop PST: Long diagonal emphasis with open-board bonuses
- Rook PST: Open file and 7th rank bonuses
- Queen PST: Central activity with some endgame edge positioning
- King PST: Castling encouragement → safe position midgame → center endgame
| Piece | Midgame | Endgame | Purpose |
|---|---|---|---|
| Pawn | 82 | 94 | Base unit |
| Knight | 337 | 281 | MG active, loses EG value |
| Bishop | 365 | 297 | Pair = +25 cp |
| Rook | 477 | 512 | Gains EG value |
| Queen | 1025 | 936 | Dominant piece |
- Doubled Pawns — -10 cp per double (reduced mobility, weak squares)
- Isolated Pawns — -10 cp (vulnerable to attacks, can't be defended by pawns)
- Passed Pawns — +10 to +30 cp (scaling by distance from promotion)
- Connected Passed Pawns — +50 cp bonus (extremely dangerous)
- Backward Pawns — -5 cp (vulnerable on advance)
- Knight Mobility — +2.5 cp per legal move
- Bishop Mobility — +1.5 cp per legal move (diagonal scope)
- Rook Mobility — +1 cp per legal move
- Queen Mobility — +0.5 cp per legal move
Comprehensive king safety evaluation in midgame:
- Pawn Shield — +10 to +20 cp per pawn in front of king
- Open files near king — -20 cp per open file in attack zone
- Enemy attacker count — quadratic danger scaling
- 1 attacker: -20 cp
- 2 attackers: -60 cp (quadratic)
- 3+ attackers: -120+ cp (exponential danger)
- King tropism — enemy pieces attacking close to king
- Rook behind passed pawn — +20 cp (supporting advance)
- Distant passed pawns — additional +5 to +15 cp scaling
- King centralization — +2 cp per closest piece distance to center
- Side to move bonus — +15 cp for White, accounting for tempo advantage
| Category | Features | Impact |
|---|---|---|
| Material | Piece values (tapered) | ±9000 cp |
| PST | 64×6 piece-square tables | ±500 cp |
| Pawns | Structure, passed, doubled, isolated | ±300 cp |
| Pieces | Mobility for all pieces | ±200 cp |
| King Safety | Pawn shield, open files, attackers | ±400 cp |
| Endgame | Rook behind pawn, promotion assist | ±200 cp |
| Total Range | All factors combined | -30000 to +30000 cp |
Built from 1.6M+ master games including:
- 250 master players downloaded (see Training Data for complete list)
- Games spanning entire chess history (Morphy to Carlsen)
- 54 major opening complexes with 514,119 positions
- 634,958 game positions from master player games
| Source | Positions | Moves | Size |
|---|---|---|---|
| Master Games | 634,958 | 769,146 | 51.7 MB |
| Opening Lines | 514,119 | 726,656 | 43.8 MB |
| Total | 1,149,077 | 1,495,802 | 95.5 MB |
- Polyglot-style format — industry-standard opening book format
- GM-approved lines — all moves played by 2600+ rated players
- Early blunder avoidance — positions evaluated for safety
- Automatic selection — engine selects best moves by frequency & Elo correlation
- Seamless handoff — engine transitions smoothly to search at book end
The opening book comprehensively covers:
- Main lines: Spanish, Italian, Sicilian variants
- 1.d4 systems: Queen's Gambit, Slav, Grunfeld, Indian systems, Dutch, Catalan
- Flank openings: Reti, English, Torre, Trompowsky
- Minor openings: King's Gambit, Four Knights, Scandinavian
- Positions up to move 20-25 in most lines
- Default size: 64MB (configurable via UCI
Hashoption, 1-256MB) - Generation-based aging — intelligent replacement strategy avoiding outdated entries
- Entry compression — fits full position data in 16 bytes
- Depth-preferred replacement — deeper searches have priority
- Exact node bias — EXACT nodes (complete evaluations) prioritized
- Statistics:
hashfullmonitoring via UCI info output
- Lazy SMP — shallow parallel search on split nodes
- Thread management — configurable thread count via UCI
Threadsoption - Shared transposition table — thread-safe with optimized locking
| Module | Lines | Purpose |
|---|---|---|
main.rs |
~20 | Entry point, initialization |
board.rs |
~400 | Bitboard position, make/unmake, legal moves |
movegen.rs |
~300 | Move generation for all piece types |
attacks.rs |
~200 | Attack/check detection, board analysis |
magics.rs |
~100 | Magic bitboard initialization |
search.rs |
~800 | Alpha-beta, PVS, pruning, quiescence |
evaluation.rs |
~400 | Tapered eval, PST, structure, safety |
transposition.rs |
~150 | Transposition table, aging strategy |
zobrist.rs |
~80 | Hash key generation |
uci.rs |
~300 | UCI protocol, time management |
opening_names.rs |
~100 | Opening name database |
openings.rs |
~150 | Opening book interface |
threading.rs |
~100 | Parallel search coordination |
| Total | ~3,200 | Complete chess engine |
- Platform: Linux x86_64
- Compiler: Rust 2024 edition with
-O2optimization, LTO disabled for speed - Hardware: Intel/AMD modern processor (6+ cores recommended)
Perft (performance test) measures raw move generation speed:
| Depth | Positions | Time | Speed |
|---|---|---|---|
| 1 | 20 | <1ms | N/A |
| 2 | 400 | <1ms | 400k pos/ms |
| 3 | 5,362 | 1ms | 5.4M pos/ms |
| 4 | 71,852 | 12ms | 6.0M pos/ms |
| 5 | 809,122 | 140ms | 5.8M pos/ms |
| 6 | 9,132,484 | 1.6s | 5.7M pos/ms |
Optimizations enabling high perft speed:
- Bitboard attacks with magic number lookup
- Incremental move validation
- Efficient pseudo-legal move generation with legal validation
| Depth | Time (ms) | Nodes | NPS | Best Move |
|---|---|---|---|---|
| 8 | ~50 | 1.2M | 24M | e2-e4 |
| 12 | ~500 | 15M | 30M | e2-e4 |
| 15 | ~2,500 | 95M | 38M | e2-e4 |
| 18 | ~15,000 | 650M | 43M | e2-e4 |
7k/3q2pp/4p3/p1pP4/P1P2R2/5P2/4KQ1P/r6 w - - 1 47
| Depth | Time | Score | Best Line |
|---|---|---|---|
| 15 | ~500ms | +4.5 | Rf7 (forces trade) |
| 18 | ~2,500ms | +6.2 | Rf7 Qxf7 (winning) |
| 22 | ~15,000ms | +8.1 | Rf7 forcing W+ |
8/8/8/8/8/4k3/4p3/4K3 b - - 0 1
Engine correctly evaluates as winning for Black (king + pawn endgame fundamentals).
- Average branching factor: 32-38 in middlegame
- Effective branching factor after pruning: 4-6
- Pruning efficiency: ~85-90% of nodes eliminated by pruning
- Hash hit rate: 35-45% at depth 18+ searches
| Optimization | Speedup |
|---|---|
| Move ordering | 2.5-3.0x |
| Alpha-beta pruning | 1.5-2.0x |
| Transposition table | 1.2-1.5x |
| Late move reductions | 1.3-1.8x |
| Total combined | 15-25x vs. unoptimized |
Prometheus trained on 250 master players spanning chess history:
Alekhine, Anderssen, Berliner, Bernstein, Bogoljubow, Boleslavsky, Botvinnik, Breyer, Bronstein, Capablanca, Chigorin, DeLaBourdonnais, Euwe, Fine, Fischer, Flohr, Kasparov, Karpov, Keres, Korchnoi, Lasker, Levenfish, Marshall, McDonnell, Morphy, Nimzowitsch, Philidor, Pillsbury, Reti, Rubinstein, Smyslov, Spassky, Spielmann, Staunton, Steinitz, Tal, Tartakower, Zukertort
Adams, Anand, Aronian, Ashley, Averbakh, Bacrot, Bareev, Beliavsky, Benjamin, Benko, Bisguier, Blackburne, Blatny, Browne, Byrne, Caruana, Carlsen, Chiburdanidze, Christiansen, DeFirmian, Denker, Dreev, Duda, Ehlvest, Eljanov, Evans, Fedorowicz, Finegold, Fishbein, Gashimov, Gelfand, Geller, Georgiev, Giri, Gligoric, Goldin, Grischuk, Gulko, Gunsberg, Huebner, Ibragimov, IllescasCordoba, Inarkiev, Ivanchuk, Ivkov, Jakovenko, Janowski, Jobava, Jussupow, Kaidanov, Kamsky, Karjakin, Kasimdzhanov, Kavalek, Khalifman, Kholmov, Korobov, Krasenkow, Larsen, Lautier, Leko, Lilienthal, Ljubojevic, Lputian, MacKenzie, Malakhov, Mamedyarov, Maroczy, McShane, Mecking, Mikenas, Miles, Milov, Morozevich, Motylev, Movsesian, Najdorf, Najer, Nakamura, Navara, Nielsen, Nikolic, Nisipeanu, Novikov, Nunn, Olafsson, Oll, Onischuk, Pachman, Panno, Paulsen, Petrosian, Ponomariov, Portisch, Psakhis, Quinteros, Radjabov, Reshevsky, Ribli, Rohde, Rublevsky, Saemisch, Sakaev, Salov, Sasikiran, Schlechter, Seirawan, Serper, Shabalov, Shamkovich, Shirov, Short, Shulman, Smirin, So, Sokolov, Soltis, Speelman, Stahlberg, Stefanova, Stein, Suetin, SultanKhan, Sutovsky, Svidler, Szabo, Taimanov, Tarrasch, Teichmann, Timman, Tiviakov, Tkachiev, Tomashevsky, Topalov, TorreRepetto, Uhlmann, Unzicker, Vaganian, VallejoPons, VanWely, Vitiugov, Volokitin, Waitzkin, Unzicker, Yermolinsky, Yudasin, Zhu, Zvjaginsev
Akobian, Akopian, Alburt, Alekseev, Almasi, Andersson, Andreikin, Azmaiparashvili, BecerraRivero, Bu, Ding, DominguezPerez, Erigaisi, Firouzja, Gashimov, Gukesh, GurevichD, GurevichM, Harikrishna, Hou, Keymer, Koneru, Kosteniuk, Kotov, Kramnik, Krush, Kudrin, Lahno, Le, Li, Malakhov, Mcdonnell, Muzychuk, Negi, Nepomniachtchi, Ni, Paehtz, Praggnanandhaa, Rapport, Rohde, Rublevsky, Ushenina, Wang, WangH, Wei, Wojtaszek, Wojtkiewicz, Wolff, Xie, Xu, Ye, Yu
============================================================
Downloading 250 player files...
============================================================
Players: 250 downloaded, 0 cached, 0 missing
============================================================
Building games.bin from master player games...
============================================================
Total games processed: ~517,408
Total positions before filtering: 2,115,844
→ /home/ansh/prometheus/Openings/games.bin
634,958 positions, 769,146 candidate moves, 51.7 MB
- Total games parsed: 517,408 master games
- Positions extracted: 2,115,844 raw positions
- Filtered positions: 634,958 (quality positions, filtered for blunders/artifacts)
- Average game length: ~40 moves
- Candidate moves: 769,146 (unique move sequences)
============================================================
Building openings.bin from opening files...
============================================================
Openings: 54 downloaded, 62 missing
Total positions before filtering: 3,016,266
→ /home/ansh/prometheus/Openings/openings.bin
514,119 positions, 726,656 candidate moves, 43.8 MB
| Category | Files Downloaded | Coverage |
|---|---|---|
| Queen's Gambit Systems | 8 | ~850k positions |
| Indian Systems | 12 | ~420k positions |
| 1.e4 Openings | 15 | ~520k positions |
| Flank Openings | 6 | ~150k positions |
| Minor Systems | 13 | ~76k positions |
| Total | 54 | 514,119 positions |
- Spanish/Ruy Lopez — Closed, Open, Marshall
- Italian Game — Giuoco Piano, Evans, Two Knights
- Sicilian Defense — Najdorf (6 Bg5, 6 Be3, 6 f4), Scheveningen, Classical
- French Defense — Advance, Tarrasch, Winawer, Classical, Rubinstein
- Caro-Kann — Exchange, Classical, Panov, Advanced (62 variants missing)
- King's Indian Defense — Classical, Averbakh, Sämisch (partial coverage)
- Queen's Gambit Declined — Tarrasch, Exchange, 4 Nf3 (main lines)
- Slav Defense — Exchange, Semi-Slav, 4 Nc3
- Grunfeld Defense — Fianchetto, 4 Nf3, Exchange, Other
- Nimzo-Indian — 4 Nf3 (main line; other lines incomplete)
- Catalan — Open, Closed, 3.c5 (all main lines)
- Modern/Flank — London, Torre, Trompowsky, Reti, English
- Gambits — King's Gambit, Benko, Budapest, English variants
- Data cleaning: Illegal moves removed (strict PGN validation)
- Blunder filtering: Early losses excluded from opening positions
- ELO correlation: Moves weighted by player strength (2600+ games prioritized)
- Temporal coverage: Games from 1850-2024, representing complete chess evolution
Rather than searching to fixed depth immediately, Prometheus performs:
- Depth 1 search → best move
- Depth 2 search → best move
- ... → Depth N search → best move
Benefits:
- Transposition table progressively improves move ordering
- Previous iterations provide bounds for aspiration windows
- Anytime algorithm — can report best move at any time cutoff
- ~5-10% overhead vs. fixed depth, vastly improved move ordering quality
Standard alpha-beta searches main line fully, but uses null-window searches (alpha, alpha+1) for other moves:
PVS(node, alpha, beta, depth):
score = -PVS(first_child, -beta, -alpha, depth-1)
alpha = max(alpha, score)
for remaining_children:
# Null window search — cheap check
null_score = -PVS(child, -alpha-1, -alpha, depth-1)
if null_score > alpha and null_score < beta:
# Null window failed, research with full window
score = -PVS(child, -beta, -alpha, depth-1)
alpha = max(alpha, score)
return alpha
Benefit: Null-window searches are typically 2-3x faster, reducing branching factor.
Initial search use narrower window (alpha, beta) around expected score:
- If search fails high → research with wider beta
- If search fails low → research with wider alpha
- Most searches fit in initial window, saving ~30% nodes
phase = (N_white + N_black)*1 + (B_white + B_black)*1 +
(R_white + R_black)*2 + (Q_white + Q_black)*4
phase = min(phase, TOTAL_PHASE) // cap at 24
phase_ratio = phase / TOTAL_PHASE // 0 (endgame) to 1 (opening)
final_score = midgame_score * phase_ratio +
endgame_score * (1 - phase_ratio)
For the position r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq:
- No doubled pawns → 0 cp
- No isolated pawns → 0 cp
- No passed pawns → 0 cp
- Structure score: 0 cp
Position with weak king:
6k1/5ppp/3q4/4b3/8/8/5K1P/8 w - - 0 1
- 2 black attackers (queen, bishop) near white king
- Quadratic danger: -60 cp
- Open central files: -20 cp
- Total safety penalty: -80 cp
git clone https://github.com/Srizdebnath/prometheus.git
cd prometheus
cargo build --releaseBuild options:
--release— optimized binary (~50x faster than debug)-O2— optimization level (set in Cargo.toml)
./target/release/prometheusEngine enters UCI loop, awaits commands from UCI-compatible GUI.
echo -e "uci\nisready\nposition startpos\ngo depth 12\nquit" | ./target/release/prometheusExpected output:
id name Prometheus
id author Srizdebnath
option name Hash type spin default 64 min 1 max 256
option name Threads type spin default 1 min 1 max 256
option name BookPath type string default ./Openings/games.bin
...
readyok
bestmove e2e4 pv e2e4 c7c5
- Engine → New Engine → Browse to
prometheus - Set
Hashto 128 MB,Threadsto 4 - Load engine in tournament/match
- Tools → Manage Engines → Add Engine
- Set command to full path of executable
- Configure options in Engines tab
- UCI engine compatible
- Supports WebAssembly (WASM) builds with modification
| Option | Type | Default | Range | Purpose |
|---|---|---|---|---|
Hash |
spin | 64 | 1-256 | Transposition table (MB) |
Threads |
spin | 1 | 1-256 | Parallel search threads |
BookPath |
string | ./Openings/games.bin |
— | Opening book location |
Depth |
spin | 128 | 1-128 | Max search depth |
MoveTime |
spin | 0 | 0-∞ | Time per move (ms) |
position startpos
go depth 15
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
go wtime 300000 btime 300000 winc 5000 binc 5000
go movetime 5000
go infinite
info depth 12 seldepth 16 score cp 45 nodes 45623987 nps 38500000 hashfull 423 time 1186 pv e2e4 c7c5 Nf3 d6 d4 cxd4 Nxd4
Demonstrates:
- Processing of 517,408 master games
- Extraction of 2,115,844 raw positions
- Generation of 51.7 MB master games opening book
- Filtering to 634,958 quality positions with 769,146 candidate moves
Shows:
- 3,016,266 opening positions before filtering
- 514,119 final opening positions (17% kept = high quality)
- 726,656 candidate opening moves
- 43.8 MB opening theory database (43.8 MB file size)
Confirms:
- Successful generation of
games.bin(engine opening book) - Successful generation of
openings.bin(opening explorer/theory) - Files written to
~/prometheus/Openings/directory - Ready for integration into engine
Position after 20 moves:
r1bqkb1r/pppp1ppp/2n2n2/4p3/4P3/3P1N2/PPP2PPP/RNBQKB1R w KQkq - 4 8
Prometheus Evaluation (depth 18):
- Score: +0.35 (slightly better for White)
- Best Move: d3-d4 (central expansion)
- PV: d4 exd4 Nxd4 Nxd4 Qxd4 (forcing sequence)
- Time: 2.3 seconds
- Nodes: 95M
Analysis: Prometheus correctly identifies the strong central push, maintaining flexibility while improving piece coordination.
- NNUE Neural Network — neural network evaluation replacing hand-crafted evaluation
- Tablebase Support — 7-piece endgame tablebases (Syzygy format)
- UCI_Chess960 — Chess 960 support
- Multi-variant — Bughouse, Atomic, King of the Hill
- Learning from Self-Play — engine improvements from playing against itself
- GPU Acceleration — CUDA/OpenCL for NNUE inference
- Cloud Engines — distributed search across multiple machines
Srizdebnath
- PeSTO evaluation tables by Thomas Ahle
- Magic bitboard techniques from Steffan Westcott
- Opening book data from Chess.com, LiChess.org, and historical databases
- Chess engine community for continuous innovation
For bugs, feature requests, or contributions:
- Open an issue with detailed description
- Submit pull requests with improved evaluation or search techniques
- Share benchmark results from your hardware
- Provide opening repertoire suggestions
Last Updated: 2026 Status: Active Development


