|
io-chess
UCI chess engine
|
Main engine controller implementing the UCI protocol. More...
#include <UCI.h>

Public Member Functions | |
| UciProtocol (const std::string &modelPath, bool useSimpleEval=false, const std::string &tbPath="", const std::string &bookPath="", const std::string &bookPath2="", int evalThreads=0) | |
| Constructs the UCI Protocol handler. | |
| ~UciProtocol () | |
| void | loop () |
| The main blocking loop that reads commands from standard input. | |
| void | resizeHash (size_t mb) |
| void | updateThreads (int numThreads) |
| void | reinitEngine () |
| void | updateEvalContexts () |
| void | initTablebase () |
| void | loadBooks () |
| void | setTTDisabled (bool disable) |
| void | setPendingTTLoadFile (const std::string &file) |
Private Member Functions | |
| void | handleUci () |
| void | handleIsReady () |
| void | handleSetOption (std::istringstream &is) |
| void | handleUciNewGame () |
| void | handlePosition (std::istringstream &is) |
| void | handleGo (std::istringstream &is) |
| void | handlePonderHit () |
| void | handleStop () |
| void | handleQuit () |
| void | handleEval () |
| void | initializeEngine () |
| void | sendInfo (int depth, int score, int nodes, int nps, const std::vector< Move > &pv, const Board &board) |
| void | sendBestMove (Move move, Move ponderMove=Move(Move::NO_MOVE)) |
| void | saveTTSnapshotForMove (const std::string &moveUci) |
Static Private Member Functions | |
| static std::string | formatScore (int score) |
| static std::string | sanitizeForFilename (const std::string &value) |
Private Attributes | |
| std::vector< std::unique_ptr< Evaluator > > | evaluators_ |
| std::vector< std::unique_ptr< IEvaluator > > | evalCtxs_ |
| TranspositionTable | tt_ |
| std::unique_ptr< PolyglotBook > | book_ |
| std::vector< std::thread > | threadPool_ |
| std::shared_ptr< SearchSharedData > | searchData_ |
| std::unique_ptr< ISearch > | searcher_ |
| std::thread | searchThread_ |
| std::atomic< bool > | searchRunning_ {false} |
| std::atomic< bool > | searchMayRunForever_ {false} |
| std::atomic< bool > | pondering_ {false} |
| std::atomic< bool > | ponderResultReady_ {false} |
| Move | ponderResultMove_ {} |
| Move | ponderMove_ {} |
| Expected opponent reply (2nd move in PV). | |
| SearchParams | ponderParams_ {} |
| Time params from go ponder for ponderhit use. | |
| std::mutex | ponderMutex_ |
| Board | currentBoard_ |
| UciOptions | options_ |
| std::unique_ptr< PolyglotBook > | book2_ |
| int | consecutiveBookMisses_ = 0 |
| std::string | pendingTTLoadFile_ |
| uint64_t | ttSnapshotCounter_ = 0 |
| uint64_t | searchBaseFullRebuilds_ = 0 |
| uint64_t | searchBaseTbHits_ = 0 |
| uint64_t | searchBaseTtHits_ = 0 |
Static Private Attributes | |
| static constexpr const char * | ENGINE_NAME = "io-chess-engine" |
| static constexpr const char * | ENGINE_AUTHOR = "Alessandro Gobbetti!" |
| static constexpr int | MAX_BOOK_MISSES = 3 |
Main engine controller implementing the UCI protocol.
Orchestrates parsing input from standard input, managing engine options, starting/stopping search threads, and reporting results to standard output.
|
explicit |
Constructs the UCI Protocol handler.

| UciProtocol::~UciProtocol | ( | ) |
|
staticprivate |

|
private |


|
private |


|
private |


|
private |


|
private |


|
private |


|
private |

|
private |

|
private |

|
private |

|
private |

| void UciProtocol::initTablebase | ( | ) |


| void UciProtocol::loadBooks | ( | ) |

| void UciProtocol::loop | ( | ) |
The main blocking loop that reads commands from standard input.


| void UciProtocol::reinitEngine | ( | ) |


| void UciProtocol::resizeHash | ( | size_t | mb | ) |

|
staticprivate |

|
private |



|
private |


|
inline |

| void UciProtocol::setTTDisabled | ( | bool | disable | ) |

| void UciProtocol::updateEvalContexts | ( | ) |

| void UciProtocol::updateThreads | ( | int | numThreads | ) |

|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
private |
|
private |
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
Expected opponent reply (2nd move in PV).
|
private |
|
private |
Time params from go ponder for ponderhit use.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |