Fastchess(7)

๐Ÿ“ฆ
version 1.8.2-alpha ยท 2 versions
, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

okay so bestie, gather round โ€” this is fastchess, the manual page (that's the Fastchess(7) one, miscellaneous information section, if you're keeping track ๐ŸŽ€). it's a command-line tool for managing chess games with engines. yes. engines. plural. it's giving chess matchmaker energy and honestly? obsessed. ๐Ÿ‘‘

โœจ SYNOPSIS โœจ

like, the whole vibe in one line:

fastchess [OPTIONS]

that's it. that's the entrance. you show up with some [OPTIONS] and fastchess does the rest ๐Ÿ’…

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so here's the tea, bestie: Fastchess is a command-line tool built to manage and orchestrate chess games between engines, and the way that it literally just handles all of that for you? iconic. it's not out here playing chess itself โ€” it's the main character organizer, the group-chat admin of your engine matchups ๐Ÿซถ

and it comes stacked with a whole range of options so you can configure, like, everything:

  • ๐ŸŽฎ game settings โ€” all the rules-of-play stuff, your call
  • ๐Ÿง  engine parameters โ€” the knobs and dials for the engines themselves
  • โšก concurrency โ€” more than one thing happening at once, no cap
  • ๐Ÿ“„ output formats โ€” how you want the results to come out looking
lowkey the important thing to remember: fastchess is the orchestrator, not the player. it sets the stage, you bring the engines ๐Ÿ’€โœจ

and that's just the opening act โ€” there's more coming, so don't go anywhere, the rest of this page is gonna eat ๐Ÿ”ฅ

๐Ÿ’… OPTIONS ๐Ÿ’…

okay bestie, here's the whole menu of options โœจ they're grouped by what they actually do so you're not scrolling forever, and just so you know โ€” the default value is always the first value in the parentheses. iykyk ๐Ÿซถ


๐ŸŽ€ General & Help ๐ŸŽ€

  • -version โ€” prints the fastchess version number and dips. that's it, that's the whole job ๐Ÿ’…
  • -help โ€” prints this help message and exits. your little safety net ๐Ÿงš

๐ŸŒธ Tournament Setup ๐ŸŒธ

  • -quick cmd=ENGINE1 cmd=ENGINE2 book=BOOK โ€” the shortcut for a whole predefined setup: two engines, time controls, rounds, and concurrency. literally the "just make it work" button ๐Ÿ”ฅ
  • -concurrency (1|N) โ€” play N games at the same time, capped by how many hardware threads you've got. default is 1.
  • -force-concurrency โ€” ignores that hardware concurrency limit and forces whatever concurrency you asked for. bold of you, but slay ๐Ÿ’€
  • -rounds (2|N) โ€” play N rounds, where every game inside a round uses the same opening. default is 2.
  • -games (2|N) โ€” play N games in each round. default is 2. and ngl, setting this higher than 2 doesn't give you meaningful results โ€” so like, don't ๐Ÿซ 
  • -repeat โ€” sets the number of games to 2. it's literally equivalent to -games 2.
  • -sprt elo0=ELO0 elo1=ELO1 alpha=ALPHA beta=BETA model=(normalized|logistic|bayesian) โ€” sets the parameters for a Sequential Probability Ratio Test (SPRT). the mathy main character energy โœจ
    • model:
      • normalized โ€” uses nElo (this is the default).
      • logistic โ€” uses regular/logistic Elo.
      • bayesian โ€” uses BayesElo.
  • -tournament (roundrobin|gauntlet) โ€” picks the tournament type ๐Ÿ‘‘
    • roundrobin โ€” every engine plays every other engine (default).
    • gauntlet โ€” the first -seeds engines play against all the other engines.
  • -seeds (1|N) โ€” the first N engines are the ones playing the gauntlet. default is 1.
  • -variant (standard|fischerandom) โ€” choose your chess variant, bestie:
    • standard โ€” play Standard Chess (default).
    • fischerandom โ€” play Fischer Random Chess. chaos, but chess ๐Ÿฆ‹
  • -noswap โ€” prevents the swapping of colors.
  • -reverse โ€” uses a tournament schedule with reversed colors.
  • -wait (0|N) โ€” waits N milliseconds between games. default is 0.

๐Ÿ’œ Engine Configuration ๐Ÿ’œ

  • -each OPTIONS โ€” applies the OPTIONS you give it to both engines. equal love ๐Ÿซถ
  • -engine OPTIONS โ€” applies the OPTIONS you give it to the next engine.
    • cmd=COMMAND โ€” specify the engine command.
    • name=NAME โ€” set the engine name. if you don't specify one, the executable's filename gets used.
    • args="ARGS" โ€” pass multiple arguments using args="ARG1 ARG2".
    • tc=moves/minutes:seconds+increment โ€” time control in Cute-Chess format.
    • timemargin=N โ€” time margin for exceeding the time limit.
    • st=N โ€” movetime in seconds.
    • nodes=N โ€” max number of nodes to search.
    • restart=(off|on) โ€” enable or disable engine restarts between games. default is off.
    • plies=N โ€” max number of plies (depth) to search. the alias depth works too.
    • proto=uci โ€” specify the engine protocol. only uci is supported, so yeah.
    • dir=DIRECTORY โ€” working directory for the engine.
    • option.name=VALUE โ€” set engine-specific options. for a button option, the value should be true or false ๐Ÿ’…

๐Ÿ”ฅ Adjudication & Rules ๐Ÿ”ฅ

  • -draw movenumber=(0|N) movecount=(1|N) score=(0|N) โ€” turns on draw adjudication based on number of moves, move count, and the score threshold.
    • movenumber โ€” number of moves before it starts checking for a draw. default is 0.
    • movecount โ€” number of consecutive moves below the score threshold. default is 1.
    • score โ€” the score threshold (in centipawns) for a draw. default is 0.
  • -resign movecount=(1|N) score=(0|N) [twosided=(false|true)] โ€” configures engine resignation based on move count and score threshold.
    • movecount โ€” number of consecutive moves above the score threshold. default is 1.
    • score โ€” the score threshold (in centipawns) to resign. default is 0.
    • twosided โ€” if true, enables two-sided resignation. defaults to false.
  • -maxmoves N โ€” enables draw adjudication if the game reaches N moves without a result.
  • -tb PATHS โ€” adjudicates games using Syzygy tablebases. PATHS has to be a semicolon-separated list (on Windows) or a colon-separated list (on other platforms) of paths to the tablebase directories. only the WDL tablebase files are required โ€” you don't need the whole buffet ๐Ÿ“
  • -tbpieces N โ€” only uses tablebase adjudication for positions with N pieces or less.
  • -tbignore50 โ€” disables the fifty move rule for tablebase adjudication. yeah, we're bending the rules, don't @ me.
  • -tbadjudicate (BOTH|WIN_LOSS|DRAW) โ€” controls when tablebase adjudication gets applied. SETTING can be:
    • BOTH โ€” adjudicate both wins and draws (default).
    • WIN_LOSS โ€” only adjudicate won/lost positions.
    • DRAW โ€” only adjudicate drawn positions.

๐Ÿฆ‹ Opening Book Management ๐Ÿฆ‹

  • -openings file=NAME format=(epd|pgn) [order=(sequential|random)] [plies=(Max plies|N)] [start=(1|N)] โ€” specifies an opening book file and its format for the starting positions of games.
    • format โ€” the file format, either epd or pgn.
    • order โ€” the order of the openings, random or sequential. default is sequential.
    • plies โ€” number of plies for pgn. defaults to the max available plies.
    • start โ€” starting index of the opening book. default is 1.
  • -srand SEED โ€” specifies the seed for opening book randomization. deterministic vibes only โœจ

๐ŸŽ€ Output & Reporting ๐ŸŽ€

  • -output format=(fastchess|cutechess) โ€” picks the output format for game results, fastchess or cutechess. default is fastchess.
  • -pgnout [file=NAME] [notation=(san|lan|uci)] [append=(true|false)] [nodes=(false|true)] [seldepth=(false|true)] [nps=(false|true)] [hashfull=(false|true)] [tbhits=(false|true)] [pv=(false|true)] [timeleft=(false|true)] [latency=(false|true)] [min=(false|true)] [match_line=REGEX] โ€” exports games in PGN format with the notation you pick, plus optional tracking of nodes, seldepth, and the rest of the crew ๐Ÿ‘‘
    • notation:
      • san โ€” Standard Algebraic Notation (default).
      • lan โ€” Long Algebraic Notation.
      • uci โ€” Universal Chess Interface.
    • file โ€” specify the filename. default is fastchess_(date)_(time).pgn.
    • append โ€” append to the file. default is true.
    • nodes โ€” track node count. default is false.
    • seldepth โ€” track seldepth. default is false.
    • nps โ€” track nps. default is false.
    • hashfull โ€” track hashfull. default is false.
    • tbhits โ€” track tbhits. default is false.
    • pv โ€” track the full pv. default is false.
    • timeleft โ€” track time left at the end of the move. default is false.
    • latency โ€” track the difference between measured time and the engine-reported time at the end of the move. default is false.
    • min โ€” minimal PGN format. default is false.
    • match_line โ€” adds lines to the PGN that match the given regex.
  • -epdout [file=NAME] [append=(true|false)] โ€” exports the final position of each game in EPD format.
    • file โ€” specify the filename. default is fastchess_(date)_(time).epd.
    • append โ€” append to the file. default is true.
  • -event NAME โ€” sets the event name for the PGN header.
  • -site NAME โ€” sets the site name for the PGN header.
  • -ratinginterval (10|N) โ€” sets the rating interval for the report. default is 10. set it to 0 to disable it entirely.
  • -scoreinterval (1|N) โ€” for cutechess output, sets the interval for printing score results. default is 1.
  • -report penta=(true|false) โ€” reports pentanomial statistics (for Fastchess output). defaults to true.

๐ŸŒˆ Persistence & Recovery ๐ŸŒˆ

  • -config [file=NAME] [discard=(false|true)] [outname=(config.json|NAME)] [stats=(true|false)] โ€” loads engine configurations so you can resume games from previous sessions. your little save file ๐Ÿซถ
    • file โ€” the file name to load the configuration from.
    • discard โ€” discards the loaded configuration after loading. defaults to false. this lets you specify a filename to save the configuration to, while ignoring it for the current session.
    • outname โ€” the auto-generated file name of the config. default is config.json.
    • stats โ€” loads the stats from the config file, and ignores append=false for -pgnout and -epdout. defaults to true.
  • -recover โ€” enables crash recovery, so it tries to recover the engine after a crash and keep the tournament going ๐Ÿ’€โžก๏ธ๐Ÿ˜Œ
  • -autosaveinterval (20|N) โ€” automatically saves the tournament state every N games. default is 20. set it to 0 to disable.

โญ Testing & Debugging โญ

  • --compliance ENGINE_PATH [ARGS] โ€” checks the UCI compliance of an engine by running it with the specified arguments.
  • -crc32 pgn=true โ€” calculates the CRC32 checksum for the PGN file.
  • -check-mate-pvs โ€” checks that PVs for mate scores have the correct length and end in checkmate.
  • -show-latency โ€” shows the "think" latency (the difference between measured and reported time) for each engine. quick heads up bestie: a lot of engines add 1ms to the time they report, so the latency will be 1ms higher than the actual latency. it's also possible for the latency to be negative, thanks to different measurement methods or missing synchronization of the clocks between different threads ๐Ÿ˜ญ
  • -testEnv โ€” specifies that the program is running in a test environment (OpenBench/Fishtest). this changes some outputs/settings.
  • -strict โ€” makes fastchess exit and return 1 on any warning. zero tolerance, periodt ๐Ÿ’…
  • -log file=NAME level=(warn|trace|info|err|fatal) append=(true|false) compress=(false|true) realtime=(true|false) engine=(false|true) โ€” specifies a log file with a specific log level. set append to false to overwrite an existing file โ€” default is true. set compress to true to write to a gzipped file with a timestamp (this ignores append) โ€” default is false. by default engine logs are disabled, so set engine to true to enable them.
    • LEVEL:
      • trace
      • info
      • warn (default)
      • err
      • fatal
  • -use-affinity [CPUS] โ€” enables thread affinity for binding engines to CPU cores.
    • CPUS โ€” the cpus to use, as a list of the form "3,5,7-11,13".
  • -startup-ms N โ€” sets the maximum time to wait for engine UCI initialization, in milliseconds. default is 10000.
  • -ucinewgame-ms N โ€” sets the maximum time to wait for engine UCI new game initialization, in milliseconds. default is 60000.
  • -ping-ms N โ€” sets the maximum time to wait for engine ping responses, in milliseconds. this is everything else which doesn't fit the above categories. default is 60000.

โœจ EXAMPLES โœจ

Okay so you wanna see this in action? Say less, bestie. These are the exact command lines from the page, no cap.

๐ŸŽ€ Example 1: match with random openings ๐ŸŽ€

To start a match between two engines using random openings from book.epd:

$ fastchess -engine cmd=Engine1.exe name=Engine1 -engine cmd=Engine2.exe \
  name=Engine2 -openings file=book.epd format=epd order=random \
  -each tc=60+0.6 option.Hash=64 -rounds 200 -repeat -concurrency 4

๐Ÿงš Example 2: big SPRT test ๐Ÿงš

To start a SPRT test between two engines up to 100000 rounds (200000 games) with 3 concurrent games with one engine playing with 2 million nodes per move and 1 thread and the other playing with 1 million nodes per move and 2 threads, and both having a time control of 5 minutes plus 5 seconds increment per move, using random openings from UHO_Lichess_4852_v1.epd, Fishtest adjudication rules, and saving the games to a file in a specific folder with SAN notation and nodes count:

$ fastchess \
  -engine cmd=Engine1.exe name=Engine1 option.Threads=1 nodes=2000000 \
  -engine cmd=Engine2.exe name=Engine2 option.Threads=2 nodes=1000000 \
  -openings file=UHO_Lichess_4852_v1.epd format=epd order=random \
  -each tc=300+5 -resign movecount=3 score=600 -draw movenumber=34 movecount=8 score=20 \
  -sprt elo0=0 elo1=2 alpha=0.05 beta=0.05 \
  -rounds 100000 -concurrency 3 -pgnout notation=san nodes=true file=./games/sprt.pgn

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Fastchess was written by Disservin, Szil, PGG106, and contributors.

๐Ÿซถ REPORTING BUGS ๐Ÿซถ

Report any bugs to https://github.com/Disservin/fastchess/issues.

This software is licensed under the MIT license. See the LICENSE file for details.


๐Ÿ’– Thatโ€™s the whole page, bestie. The footer/source-version line says Fastchess(7), and thereโ€™s no date printed in that footer. Now go slay your engine testing era ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from