How zaferavci1/chessagent works
This repository combines a Python DQN chess agent with a bundled Stockfish engine. The main user journey is to train the agent using chess positions and Stockfish guidance, then load the trained model to attempt predefined mate puzzles. The README documents these capabilities; the source index confirms Python modules and major Stockfish subsystems, but Python implementation excerpts were not provided. Accordingly, the Stockfish training link is shown as unverified, and the engine’s internal links reflect only relationships supported by the excerpts or source index.
Main entry points: search.cpp Move search · engine.cpp Engine control · chess_agent_training.py Agent training · position.cpp Board position
Components 18
Python chess agent
- Agent training
chess_agent_training.py - DQN model
chess_model.py - Mate puzzles
main.py
Stockfish engine
- UCI interface
stockfish/src/uci.cpp - Engine control
stockfish/src/engine.cpp
Board and search
- Board position
stockfish/src/position.cpp - Bitboard attacks
stockfish/src/bitboard.cpp - Move generation
stockfish/src/movegen.cpp - Move search
stockfish/src/search.cpp - Move ordering
stockfish/src/movepick.cpp - Search threads
stockfish/src/thread.cpp - Transposition table
stockfish/src/tt.cpp
Position evaluation
- Evaluation
stockfish/src/evaluate.cpp - NNUE network
stockfish/src/nnue/network.cpp - NNUE features
stockfish/src/nnue/features/half_ka_v2_hm.cpp - Syzygy tablebases
stockfish/src/syzygy/tbprobe.cpp
Other components
- User
- Stockfish teacher
Connections 20
- User → Agent training: starts training
- Agent training → DQN model: trains
chess_agent_training.py - Agent training → Stockfish teacher: uses guidance
- User → Mate puzzles: runs puzzles
- Mate puzzles → DQN model: loads model
main.py - User → UCI interface: sends commands
- UCI interface → Engine control: routes commands
- Engine control → Search threads: starts search
stockfish/src/engine.cpp - Engine control → Board position: sets position
stockfish/src/engine.cpp - Engine control → Syzygy tablebases: configures
stockfish/src/engine.cpp - Move search → Board position: searches positions
stockfish/src/search.cpp - Move search → Move generation: generates moves
stockfish/src/search.cpp - Move search → Move ordering: orders moves
stockfish/src/search.cpp - Move search → Evaluation: evaluates positions
stockfish/src/search.cpp - Move search → NNUE network: queries network
stockfish/src/search.cpp - Move search → Syzygy tablebases: probes endgames
stockfish/src/search.cpp - Board position → Bitboard attacks: uses attacks
- NNUE network → NNUE features: uses features
- Search threads → Move search: runs search
- Move search → Transposition table: uses cache