|
| 1 | +NAME |
| 2 | + |
| 3 | +fastchess - a command-line tool for managing chess games with engines |
| 4 | + |
| 5 | +SYNOPSIS |
| 6 | + |
| 7 | +fastchess [OPTIONS] |
| 8 | + |
| 9 | +DESCRIPTION |
| 10 | + |
| 11 | +Fastchess is a command-line tool designed to manage and orchestrate |
| 12 | +chess games between engines. It provides a range of options to |
| 13 | +configure game settings, engine parameters, concurrency, and output |
| 14 | +formats. |
| 15 | + |
| 16 | +OPTIONS |
| 17 | + |
| 18 | +The following options are available. Options are grouped by their |
| 19 | +primary function for easier navigation. The default values are the |
| 20 | +first value in parentheses. |
| 21 | + |
| 22 | +## General & Help |
| 23 | + |
| 24 | + - -version |
| 25 | + Print fastchess version number and exit. |
| 26 | + - -help |
| 27 | + Print this help message and exit. |
| 28 | + |
| 29 | +## Tournament Setup |
| 30 | + |
| 31 | + - -quick cmd=ENGINE1 cmd=ENGINE2 book=BOOK |
| 32 | + Shortcut for predefined game settings involving two engines, time |
| 33 | + controls, rounds, and concurrency. |
| 34 | + |
| 35 | + - -concurrency (1|N) |
| 36 | + Play N games concurrently, limited by the number of hardware |
| 37 | + threads. Default value is 1. |
| 38 | + |
| 39 | + - -force-concurrency |
| 40 | + Ignore the hardware concurrency limit and force the specified |
| 41 | + concurrency. |
| 42 | + |
| 43 | + - -rounds (2|N) |
| 44 | + Play N rounds of games where each game within the round uses the |
| 45 | + same opening. Default value is 2. |
| 46 | + |
| 47 | + - -games (2|N) |
| 48 | + Play N games in each round. Default value is 2. Setting this |
| 49 | + higher than 2 does not provide meaningful results. |
| 50 | + |
| 51 | + - -repeat |
| 52 | + Set the number of games to 2. Equivalent to -games 2. |
| 53 | + |
| 54 | + - -sprt elo0=ELO0 elo1=ELO1 alpha=ALPHA beta=BETA |
| 55 | + model=(normalized|logistic|bayesian) |
| 56 | + Set parameters for a Sequential Probability Ratio Test (SPRT). |
| 57 | + |
| 58 | + - model: |
| 59 | + - normalized - Uses nElo (default). |
| 60 | + - logistic - Uses regular/logistic Elo. |
| 61 | + - bayesian - Uses BayesElo. |
| 62 | + |
| 63 | + - -tournament (roundrobin|gauntlet) |
| 64 | + Choose type of tournament. |
| 65 | + |
| 66 | + - roundrobin - each engine plays every other engine (default) |
| 67 | + - gauntlet - the first -seeds engines play against all other |
| 68 | + engines |
| 69 | + |
| 70 | + - -seeds (1|N) |
| 71 | + First N engines are playing the gauntlet. Default value is 1. |
| 72 | + |
| 73 | + - -variant (standard|fischerandom) |
| 74 | + Choose between the following game variants: |
| 75 | + |
| 76 | + - standard - play Standard Chess (default) |
| 77 | + - fischerandom - play Fischer Random Chess |
| 78 | + |
| 79 | + - -noswap |
| 80 | + Prevent swapping of colors. |
| 81 | + |
| 82 | + - -reverse |
| 83 | + Use a tournament schedule with reversed colors. |
| 84 | + |
| 85 | + - -wait (0|N) |
| 86 | + Wait N milliseconds between games. Default is 0. |
| 87 | + |
| 88 | +## Engine Configuration |
| 89 | + |
| 90 | + - -each OPTIONS |
| 91 | + Apply specified OPTIONS to both engines. |
| 92 | + |
| 93 | + - -engine OPTIONS |
| 94 | + Apply specified OPTIONS to the next engine. |
| 95 | + |
| 96 | + - cmd=COMMAND - Specify engine command. |
| 97 | + - name=NAME - Set engine name. If not specified, the executable’s |
| 98 | + filename would be used. |
| 99 | + - args="ARGS" - Pass multiple arguments using args="ARG1 ARG2”. |
| 100 | + - tc=moves/minutes:seconds+increment - Time control in |
| 101 | + Cute-Chess format. |
| 102 | + - timemargin=N - Time margin for exceeding time limit. |
| 103 | + - st=N - Movetime in seconds. |
| 104 | + - nodes=N - Max number of nodes to search. |
| 105 | + - restart=(off|on) - Enable or disable engine restarts between |
| 106 | + games, default is off. |
| 107 | + - plies=N - Max number of plies (depth) to search. The alias |
| 108 | + depth can also be used. |
| 109 | + - proto=uci - Specify the engine protocol. Only uci is |
| 110 | + supported. |
| 111 | + - dir=DIRECTORY - Working directory for the engine. |
| 112 | + - option.name=VALUE - Set engine-specific options. The value |
| 113 | + for a button option should be “true” or “false”. |
| 114 | + |
| 115 | +## Adjudication & Rules |
| 116 | + |
| 117 | + - -draw movenumber=(0|N) movecount=(1|N) score=(0|N) |
| 118 | + Enables draw adjudication based on number of moves, move count, |
| 119 | + and score threshold. |
| 120 | + |
| 121 | + - movenumber - number of moves before checking for a draw. |
| 122 | + Default is 0. |
| 123 | + - movecount - number of consecutive moves below the score |
| 124 | + threshold. Default is 1. |
| 125 | + - score - score threshold (in centipawns) for a draw. Default |
| 126 | + is 0. |
| 127 | + |
| 128 | + - -resign movecount=(1|N) score=(0|N) [twosided=(false|true)] |
| 129 | + Configures engine resignation based on move count and score |
| 130 | + threshold. |
| 131 | + |
| 132 | + - movecount - number of consecutive moves above the score |
| 133 | + threshold. Default is 1. |
| 134 | + - score - score threshold (in centipawns) to resign. Default is |
| 135 | + 0. |
| 136 | + - twosided - if true, enables two-sided resignation. Defaults |
| 137 | + to false. |
| 138 | + |
| 139 | + - -maxmoves N |
| 140 | + Enables draw adjudication if the game reaches N moves without a |
| 141 | + result. |
| 142 | + |
| 143 | + - -tb PATHS |
| 144 | + Adjudicate games using Syzygy tablebases. PATHS must be a |
| 145 | + semicolon-separated (on Windows) or colon-separated (other |
| 146 | + platforms) list of paths to the tablebase directories. Only the |
| 147 | + WDL tablebase files are required. |
| 148 | + |
| 149 | + - -tbpieces N |
| 150 | + Only use tablebase adjudication for positions with N pieces or |
| 151 | + less. |
| 152 | + |
| 153 | + - -tbignore50 |
| 154 | + Disable the fifty move rule for tablebase adjudication. |
| 155 | + |
| 156 | + - -tbadjudicate (BOTH|WIN_LOSS|DRAW) |
| 157 | + Control when tablebase adjudication is applied. SETTING can be: |
| 158 | + |
| 159 | + - BOTH - Adjudicate both wins and draws (default) |
| 160 | + - WIN_LOSS - Only adjudicate won/lost positions |
| 161 | + - DRAW - Only adjudicate drawn positions |
| 162 | + |
| 163 | +## Opening Book Management |
| 164 | + |
| 165 | + - -openings file=NAME format=(epd|pgn) [order=(sequential|random)] |
| 166 | + [plies=(Max plies|N)] [start=(1|N)] |
| 167 | + Specifies an opening book file and its format for game starting |
| 168 | + positions. |
| 169 | + |
| 170 | + - format - file format, either epd or pgn. |
| 171 | + - order - order of openings (random or sequential). Default is |
| 172 | + sequential. |
| 173 | + - plies - number of plies for pgn. Defaults to max available |
| 174 | + plies. |
| 175 | + - start - starting index of the opening book. Default is 1. |
| 176 | + |
| 177 | + - -srand SEED |
| 178 | + Specify the seed for opening book randomization. |
| 179 | + |
| 180 | +## Output & Reporting |
| 181 | + |
| 182 | + - -output format=(fastchess|cutechess) |
| 183 | + Choose the output format for game results (fastchess or |
| 184 | + cutechess). Default is fastchess. |
| 185 | + |
| 186 | + - -pgnout [file=NAME] [notation=(san|lan|uci)] |
| 187 | + [append=(true|false)] [nodes=(false|true)] |
| 188 | + [seldepth=(false|true)] [nps=(false|true)] |
| 189 | + [hashfull=(false|true)] [tbhits=(false|true)] [pv=(false|true)] |
| 190 | + [timeleft=(false|true)] [latency=(false|true)] [min=(false|true)] |
| 191 | + [match_line=REGEX] Export games in PGN format with specified |
| 192 | + notations and optional tracking of nodes, seldepth, and others. |
| 193 | + |
| 194 | + - notation: |
| 195 | + |
| 196 | + - san - Standard Algebraic Notation (default) |
| 197 | + - lan - Long Algebraic Notation |
| 198 | + - uci - Universal Chess Interface |
| 199 | + |
| 200 | + - file - Specify filename. Default is |
| 201 | + fastchess_(date)_(time).pgn. |
| 202 | + |
| 203 | + - append - Append to file. Default is true. |
| 204 | + |
| 205 | + - nodes - Track node count. Default is false. |
| 206 | + |
| 207 | + - seldepth - Track seldepth. Default is false. |
| 208 | + |
| 209 | + - nps - Track nps. Default is false. |
| 210 | + |
| 211 | + - hashfull - Track hashfull. Default is false. |
| 212 | + |
| 213 | + - tbhits - Track tbhits. Default is false. |
| 214 | + |
| 215 | + - pv - Track the full pv. Default is false. |
| 216 | + |
| 217 | + - timeleft - Track time left at end of move. Default is false. |
| 218 | + |
| 219 | + - latency - Track difference between measured time and engine |
| 220 | + reported time at end of move. Default is false. |
| 221 | + |
| 222 | + - min - Minimal PGN format. Default is false. |
| 223 | + |
| 224 | + - match_line - Add lines to the PGN that match the given regex. |
| 225 | + |
| 226 | + - -epdout [file=NAME] [append=(true|false)] Export the final |
| 227 | + position of each game in EPD format. |
| 228 | + |
| 229 | + - file - Specify filename. Default is |
| 230 | + fastchess_(date)_(time).epd. |
| 231 | + - append - Append to file. Default is true. |
| 232 | + |
| 233 | + - -event NAME |
| 234 | + Set the event name for the PGN header. |
| 235 | + |
| 236 | + - -site NAME |
| 237 | + Set the site name for the PGN header. |
| 238 | + |
| 239 | + - -ratinginterval (10|N) |
| 240 | + Set rating interval for the report. Default is 10. Set to 0 to |
| 241 | + disable. |
| 242 | + |
| 243 | + - -scoreinterval (1|N) |
| 244 | + For cutechess output, set interval for printing score results. |
| 245 | + Default is 1. |
| 246 | + |
| 247 | + - -report penta=(true|false) |
| 248 | + Reports pentanomial statistics (for Fastchess output). Defaults |
| 249 | + to true. |
| 250 | + |
| 251 | +## Persistence & Recovery |
| 252 | + |
| 253 | + - -config [file=NAME] [discard=(false|true)] |
| 254 | + [outname=(config.json|NAME)] [stats=(true|false)] |
| 255 | + Load engine configurations to resume games from previous |
| 256 | + sessions. |
| 257 | + |
| 258 | + - file - the file name to load the configuration from. |
| 259 | + - discard - discard the loaded configuration after loading. |
| 260 | + Defaults to false. This lets you specify a filename to save |
| 261 | + the configuration to, while ignoring it for the current |
| 262 | + session. |
| 263 | + - outname - the auto-generated file name of the config. Default |
| 264 | + is “config.json”. |
| 265 | + - stats - load the stats from the config file, and ignore |
| 266 | + append=false for -pgnout and -epdout. Defaults to true. |
| 267 | + |
| 268 | + - -recover |
| 269 | + Enables crash recovery to attempt to recover the engine after a |
| 270 | + crash and continue the tournament. |
| 271 | + |
| 272 | + - -autosaveinterval (20|N) |
| 273 | + Automatically saves the tournament state every N games. Default |
| 274 | + is 20. Set to 0 to disable. |
| 275 | + |
| 276 | +## Testing & Debugging |
| 277 | + |
| 278 | + - --compliance ENGINE_PATH [ARGS] |
| 279 | + Check the UCI compliance of an engine by running it with the |
| 280 | + specified arguments. |
| 281 | + |
| 282 | + - -crc32 pgn=true |
| 283 | + Calculate the CRC32 checksum for the PGN file. |
| 284 | + |
| 285 | + - -check-mate-pvs Check that PVs for mate scores have the correct |
| 286 | + length and end in checkmate. |
| 287 | + |
| 288 | + - -show-latency |
| 289 | + Show the “think” latency (difference between measured and |
| 290 | + reported time) for each engine. Note that a lot of engines add |
| 291 | + 1ms to the time they report, so the latency will be 1ms higher |
| 292 | + than the actual latency. It is also possible that the latency is |
| 293 | + negative, due to different measurement methods or missing |
| 294 | + synchronization of the clocks between different threads. |
| 295 | + |
| 296 | + - -testEnv Specifies that the program is running in a test |
| 297 | + environment (OpenBench/Fishtest). This will change some |
| 298 | + outputs/settings. |
| 299 | + |
| 300 | + - -strict Makes fastchess exit and return 1 on any warning. |
| 301 | + |
| 302 | + - -log file=NAME level=(warn|trace|info|err|fatal) |
| 303 | + append=(true|false) compress=(false|true) realtime=(true|false) |
| 304 | + engine=(false|true) Specify a log file with a specific log level. |
| 305 | + Set append to false to overwrite existing file. Default is true. |
| 306 | + Set compress to true to write to gzipped file with timestamp |
| 307 | + (ignores append). Default is false. By default engine logs are |
| 308 | + disabled. Set engine to true to enable them. |
| 309 | + |
| 310 | + - LEVEL: |
| 311 | + - trace |
| 312 | + - info |
| 313 | + - warn (default) |
| 314 | + - err |
| 315 | + - fatal |
| 316 | + |
| 317 | + - -use-affinity [CPUS] |
| 318 | + Enable thread affinity for binding engines to CPU cores. |
| 319 | + |
| 320 | + - CPUS - The cpus to use as a list of the form “3,5,7-11,13”. |
| 321 | + |
| 322 | + - -startup-ms N |
| 323 | + Set the maximum time to wait for engine UCI initialization in |
| 324 | + milliseconds. Default is 10000. |
| 325 | + |
| 326 | + - -ucinewgame-ms N |
| 327 | + Set the maximum time to wait for engine UCI new game |
| 328 | + initialization in milliseconds. Default is 60000. |
| 329 | + |
| 330 | + - -ping-ms N |
| 331 | + Set the maximum time to wait for engine ping responses in |
| 332 | + milliseconds, this is everything else which doesn’t fit the above |
| 333 | + categories. Default is 60000. |
| 334 | + |
| 335 | +EXAMPLES |
| 336 | + |
| 337 | +To start a match between two engines using random openings from |
| 338 | +book.epd: |
| 339 | + |
| 340 | + | $ fastchess -engine cmd=Engine1.exe name=Engine1 -engine cmd=Engine2.exe \ |
| 341 | + | name=Engine2 -openings file=book.epd format=epd order=random \ |
| 342 | + | -each tc=60+0.6 option.Hash=64 -rounds 200 -repeat -concurrency 4 |
| 343 | + |
| 344 | +To start a SPRT test between two engines up to 100000 rounds (200000 |
| 345 | +games) with 3 concurrent games with one engine playing with 2 million |
| 346 | +nodes per move and 1 thread and the other playing with 1 million |
| 347 | +nodes per move and 2 threads, and both having a time control of 5 |
| 348 | +minutes plus 5 seconds increment per move, using random openings from |
| 349 | +UHO_Lichess_4852_v1.epd, Fishtest adjudication rules, and saving the |
| 350 | +games to a file in a specific folder with SAN notation and nodes |
| 351 | +count: |
| 352 | + |
| 353 | + | $ fastchess \ |
| 354 | + | -engine cmd=Engine1.exe name=Engine1 option.Threads=1 nodes=2000000 \ |
| 355 | + | -engine cmd=Engine2.exe name=Engine2 option.Threads=2 nodes=1000000 \ |
| 356 | + | -openings file=UHO_Lichess_4852_v1.epd format=epd order=random \ |
| 357 | + | -each tc=300+5 -resign movecount=3 score=600 -draw movenumber=34 movecount=8 score=20 \ |
| 358 | + | -sprt elo0=0 elo1=2 alpha=0.05 beta=0.05 \ |
| 359 | + | -rounds 100000 -concurrency 3 -pgnout notation=san nodes=true file=./games/sprt.pgn |
| 360 | + |
| 361 | +AUTHORS |
| 362 | + |
| 363 | +Fastchess was written by Disservin, Szil, PGG106, and contributors. |
| 364 | + |
| 365 | +REPORTING BUGS |
| 366 | + |
| 367 | +Report any bugs to https://github.com/Disservin/fastchess/issues. |
| 368 | + |
| 369 | +COPYRIGHT |
| 370 | + |
| 371 | +This software is licensed under the MIT license. See the LICENSE file |
| 372 | +for details. |
0 commit comments