Shogitest is a command-line tool for running shogi engine tournaments, and for shogi engine testing. Its command line interface is designed to be very familiar to users of Fastchess.
You can configure shogi-specific time controls for engines, execute matches concurrently, calculate pentanomial statistics, and test new patches for engines with the generalized sequential probability ratio test.
Building and installing Shogitest from source is the same as any other Rust application:
git clone https://github.com/87flowers/shogitestcd shogitestcargo install --path .
This will add shogitest to your ~/.cargo/bin/ directory.
A Makefile is in the repository, but this is intented for use in automated building by distributed testing frameworks like OpenBench.
You must provide an opening book, and at least two engines.
shogitest.exe \
-engine cmd=engine1.exe -engine cmd=engine2.exe \
-each tc=10+0.1 -rounds 200 -concurrency 4 \
-openings file=4moves_shogi.sfen.epdshogitest.exe \
-engine cmd=engine-dev.exe \
-engine cmd=engine-base.exe \
-each tc=10+0.1 \
-concurrency 4 \
-openings file=4moves_shogi.sfen.epd order=random \
-sprt elo0=0 elo1=5 alpha=0.05 beta=0.05- Specifying
-roundsis not required, as infinite is the default option. - Specifying
-repeatis not required, as this is the default option (shogitest doesn't allow you to not have game pairs).
-
-concurrency NPlay N games concurrently. Default value is
1. -
-rounds NPlay N rounds. All games within the round use the same opening. If left unspecified, the default value is infinite. Must be non-zero.
-
-sprt elo0=ELO0 elo1=ELO1 alpha=ALPHA beta=BETASet parameters for a generalised sequential probability ratio test (GSPRT).
- Elo are specified in normalized elo (nElo), for each of the hypotheses under test.
alphais the desired false positive rate, andbetais the desired false negative rate.- We recommend using
-sprtwith an infinite number of rounds, as the GSPRT will automatically terminate when confidence thresholds are reached. -sprtis only valid when exactly two-engines are specified.
-
-games NPlay N games within each round. Must be a non-zero multiple of two. Default value is
2. All games within a round use the same opening. This is provided mainly for compatibility as any value other than two is not recommended. -
-repeatThis is equivalent to
-games 2. Provided mainly for compatibility, as this the default. -
-variant standardThis is provided for compatibility with external tooling. The only valid value for variant is
standard.
-
-each OPTIONS*Apply the options list to all engines. See below for a list of possible options.
-
-engine OPTIONS*Declare an engine with the specified configuration specified by the options list.
name=NAME: Overwrite the default name detection (which looks at UCIid name).cmd=CMD: Specify engine executable.dir=DIR: Specify engine working directory.proto=usi: Specify the engine protocol. Onlyusiis supported.tc=MIN:SEC+INC: Specify Fischer time control.tc=MIN:SEC,BYOYOMI: Specify Byoyomi time control.tc=movetime=SEC: Specify movetime time control.tc=N=NODES: Specify node count time control. (e.g.tc=N=5000)st=SEC: Compatibility alias fortc=movetime=SECnodes=NODES: Compatibility alias fortc=N=NODESoption.NAME=VALUE: Set engine-specific USI options.timemargin=MILLISECS: Set time margin for exceeding time limit.restart=(on|off): Restart engine in between games, defaults tooff.
You can only specify one time control. Multiple time controls do not stack.
-
-maxmoves NAdjudicate a draw if the game reaches N moves. Defaults to
512. You can specifyinfto lift this limit. -
-draw movenumber=N movecount=N score=NEnables draw adjudication.
movenumber: Number of ply before checking for a draw. Opening book ply are not considered here.movecount: Number of consecutive moves (both sides) that need to be below the score threshold.score: Score threshold in cp.
-
-resign movecount=N score=N [twosided=(false|true)]Enables resign adjudication.
movecount: Number of consecutive moves that need to be above the score threshold.score: Score threshold in cp.twosided: Determines if the consecutive moves are from both sides or just one side. Defaults tofalse(one-sided).
An opening book is required.
-
-openings file=NAME [format=epd] [order=(sequential|random)] [start=N]file=NAME: Specifies the location of the openings fileformat=epd: Optional. Only valid format. File is a list of sfens.order=(sequential|random): Specifies whether we shuffle openings. Defaults tosequential.start=N: Specifies the starting index of the opening book. This is one-indexed. Default is1.
-
-srand SEEDSpecify the seed for opening book shuffling.
-
-ratinginterval NSet a interval for rating reports. Default value is
10. Specifying0turns off interval reporting. -
-pgnout file=FILE [nodes=(true|false)] [seldepth=(true|false)] [nps=(true|false)] [hashfull=(true|false)] [timeleft=(true|false)] [latency=(true|false)]Output games in a pseudo-PGN format with optional tracking of other statistics. Default for all tracking options is
false. This is primarily intended for OpenBench compatibility. -
-event NAMESet event name for PGN header.
-
-site NAMESet site name for PGN header.
-
-testEnvAdjust output for running Shogitest in a test environment such as OpenBench.