Option questions on cutechess-cli

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Option questions on cutechess-cli

Post by Ferdy »

From version 0.4.2.
Is nodes=<n> for uci engines only?
In -srand <n> what are the typical values that can be used? Say for a more random selection. I understand this is only applicable for polyglot books. Thank you.

Code: Select all

Usage&#58; cutechess-cli -fcp &#91;eng_options&#93; -scp &#91;eng_options&#93; &#91;options&#93;
Options&#58;
  --help                Display this information
  --version             Display the version number
  --engines             Display a list of configured engines and exit
  --protocols           Display a list of supported chess protocols and exit
  --variants            Display a list of supported chess variants and exit

  -fcp <options>        Apply <options> to the first engine
  -scp <options>        Apply <options> to the second engine
  -both <options>       Apply <options> to both engines
  -variant <arg>        Set the chess variant to <arg>
  -concurrency <n>      Set the maximum number of concurrent games to <n>
  -draw <n> <score>     Adjudicate the game as a draw if the score of both
                        engines is within <score> centipawns from zero after
                        <n> full moves have been played
  -resign <n> <score>   Adjudicate the game as a loss if an engine's score is
                        at least <score> centipawns below zero for at least
                        <n> consecutive moves
  -event <arg>          Set the event name to <arg>
  -games <n>            Play <n> games
  -debug                Display all engine input and output
  -pgnin <file>         Use <file> as the opening book in PGN format
  -pgndepth <n>         Set the maximum depth for PGN input to <n> plies
  -pgnout <file> &#91;min&#93;  Save the games to <file> in PGN format. Use the 'min'
                        argument to save in a minimal PGN format.
  -recover              Restart crashed engines instead of stopping the match
  -repeat               Play each opening twice so that both players get
                        to play it on both sides
  -site <arg>           Set the site/location to <arg>
  -srand <n>            Set the random seed for the book move selector to <n>
  -wait <n>             Wait <n> milliseconds between games. The default is 0.

Engine options&#58;
  conf=<arg>            Use an engine with the name <arg> from Cute Chess'
                        configuration file.
  name=<arg>            Set the name to <arg>
  cmd=<arg>             Set the command to <arg>
  dir=<arg>             Set the working directory to <arg>
  arg=<arg>             Pass <arg> to the engine as a command line argument
  initstr=<arg>         Send <arg> to the engine's standard input at startup
  proto=<arg>           Set the chess protocol to <arg>
  tc=<arg>              Set the time control to <arg>. The format is
                        moves/time+increment, where 'moves' is the number of
                        moves per tc, 'time' is time per tc &#40;either seconds or
                        minutes&#58;seconds&#41;, and 'increment' is time increment
                        per move in seconds.
                        Infinite time control can be set with 'tc=inf'.
  st=<n>                Set the time limit for each move to <n> seconds.
                        This option can't be used in combination with "tc".
  timemargin=<n>        Let engines go <n> milliseconds over the time limit.
  book=<file>           Use <file> &#40;Polyglot book file&#41; as the opening book
  bookdepth=<n>         Set the maximum book depth &#40;in fullmoves&#41; to <n>
  whitepov              Invert the engine's scores when it plays black. This
                        option should be used with engines that always report
                        scores from white's perspective.
  depth=<n>             Set the search depth limit to <n> plies
  nodes=<n>             Set the node count limit to <n> nodes
  option.<name>=<arg>   Set custom option <name> to value <arg>
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Option questions on cutechess-cli

Post by lucasart »

Ferdy wrote:From version 0.4.2.
Is nodes=<n> for uci engines only?
In -srand <n> what are the typical values that can be used? Say for a more random selection. I understand this is only applicable for polyglot books. Thank you.

Code: Select all

Usage&#58; cutechess-cli -fcp &#91;eng_options&#93; -scp &#91;eng_options&#93; &#91;options&#93;
Options&#58;
  --help                Display this information
  --version             Display the version number
  --engines             Display a list of configured engines and exit
  --protocols           Display a list of supported chess protocols and exit
  --variants            Display a list of supported chess variants and exit

  -fcp <options>        Apply <options> to the first engine
  -scp <options>        Apply <options> to the second engine
  -both <options>       Apply <options> to both engines
  -variant <arg>        Set the chess variant to <arg>
  -concurrency <n>      Set the maximum number of concurrent games to <n>
  -draw <n> <score>     Adjudicate the game as a draw if the score of both
                        engines is within <score> centipawns from zero after
                        <n> full moves have been played
  -resign <n> <score>   Adjudicate the game as a loss if an engine's score is
                        at least <score> centipawns below zero for at least
                        <n> consecutive moves
  -event <arg>          Set the event name to <arg>
  -games <n>            Play <n> games
  -debug                Display all engine input and output
  -pgnin <file>         Use <file> as the opening book in PGN format
  -pgndepth <n>         Set the maximum depth for PGN input to <n> plies
  -pgnout <file> &#91;min&#93;  Save the games to <file> in PGN format. Use the 'min'
                        argument to save in a minimal PGN format.
  -recover              Restart crashed engines instead of stopping the match
  -repeat               Play each opening twice so that both players get
                        to play it on both sides
  -site <arg>           Set the site/location to <arg>
  -srand <n>            Set the random seed for the book move selector to <n>
  -wait <n>             Wait <n> milliseconds between games. The default is 0.

Engine options&#58;
  conf=<arg>            Use an engine with the name <arg> from Cute Chess'
                        configuration file.
  name=<arg>            Set the name to <arg>
  cmd=<arg>             Set the command to <arg>
  dir=<arg>             Set the working directory to <arg>
  arg=<arg>             Pass <arg> to the engine as a command line argument
  initstr=<arg>         Send <arg> to the engine's standard input at startup
  proto=<arg>           Set the chess protocol to <arg>
  tc=<arg>              Set the time control to <arg>. The format is
                        moves/time+increment, where 'moves' is the number of
                        moves per tc, 'time' is time per tc &#40;either seconds or
                        minutes&#58;seconds&#41;, and 'increment' is time increment
                        per move in seconds.
                        Infinite time control can be set with 'tc=inf'.
  st=<n>                Set the time limit for each move to <n> seconds.
                        This option can't be used in combination with "tc".
  timemargin=<n>        Let engines go <n> milliseconds over the time limit.
  book=<file>           Use <file> &#40;Polyglot book file&#41; as the opening book
  bookdepth=<n>         Set the maximum book depth &#40;in fullmoves&#41; to <n>
  whitepov              Invert the engine's scores when it plays black. This
                        option should be used with engines that always report
                        scores from white's perspective.
  depth=<n>             Set the search depth limit to <n> plies
  nodes=<n>             Set the node count limit to <n> nodes
  option.<name>=<arg>   Set custom option <name> to value <arg>
i haven't looked at the code, but quite logically i would answer any integer number you want. for example zero!
the point of setting the seed of a random generator is to make the random numbers always the same (same seed +> same sequence. if you don't use an srand, I would expect cutechess-cli to initialise the seed with the system clock.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Option questions on cutechess-cli

Post by ilari »

Ferdy wrote:From version 0.4.2.
Is nodes=<n> for uci engines only?
In -srand <n> what are the typical values that can be used? Say for a more random selection. I understand this is only applicable for polyglot books. Thank you.
Yes, the node limit only applies to UCI engines, for now. And Lucas already answered the second question.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Option questions on cutechess-cli

Post by Ferdy »

ilari wrote:
Ferdy wrote:From version 0.4.2.
Is nodes=<n> for uci engines only?
In -srand <n> what are the typical values that can be used? Say for a more random selection. I understand this is only applicable for polyglot books. Thank you.
Yes, the node limit only applies to UCI engines, for now. And Lucas already answered the second question.
A new xboard/winboard command nps was introduced by HGM. I hope you will implement this in cutechess-cli.

Code: Select all

Version 2; implemented in xboard/WinBoard 4.2.1 and later. &#40;Sept 3, 2009&#41;
Changes since version 1 are indicated in red.
Changes for WinBoard 4.3.xx are indicated in green.
Changes for WinBoard 4.4.xx are indicated in blue.
New command nps, text is green in engine-intf.html file.

Code: Select all

nps NODE_RATE
The engine should not use wall-clock time to make its timing decisions, but an own internal time measure based on the number of nodes it has searched &#40;and will report as "thinking output", see section 10&#93;), converted to seconds through dividing by the given NODE_RATE. Example&#58; after receiving the commands "st 8" and "nps 10000", the engine should never use more that 80,000 nodes in the search for any move. In this mode, the engine should report user CPU time used &#40;in its thinking output&#41;, rather than wall-clock time. This even holds if NODE_RATE is given as 0, but in that case it should also use the user CPU time for its timing decisions. The effect of an "nps" command should persist until the next "new" command.
Section 10.

Code: Select all

10. Thinking Output

If the user asks your engine to "show thinking", xboard sends your engine the "post" command. It sends "nopost" to turn thinking off. In post mode, your engine sends output lines to show the progress of its thinking. The engine can send as many or few of these lines as it wants to, whenever it wants to. Typically they would be sent when the PV &#40;principal variation&#41; changes or the depth changes. The thinking output should be in the following format&#58;

ply score time nodes pv
Where&#58;

ply	Integer giving current search depth.
score	Integer giving current evaluation in centipawns.
time	Current search time in centiseconds &#40;ex&#58;1028 = 10.28 seconds&#41;.
nodes	Nodes searched.
pv	Freeform text giving current "best" line. You can continue the pv onto another line if you start each continuation line with at least four space characters.
Example&#58;

  9 156 1084 48000 Nf3 Nc6 Nc3 Nf6
Meaning&#58;

9 ply, score=1.56, time = 10.84 seconds, nodes=48000, PV = "Nf3 Nc6 Nc3 Nf6"
Longer example from actual Crafty output&#58;

  4    109      14   1435  1. e4 d5 2. Qf3 dxe4 3. Qxe4 Nc6
  4    116      23   2252  1. Nf3 Nc6 2. e4 e6
  4    116      27   2589  1. Nf3 Nc6 2. e4 e6
  5    141      44   4539  1. Nf3 Nc6 2. O-O e5 3. e4
  5    141      54   5568  1. Nf3 Nc6 2. O-O e5 3. e4
You can use the PV to show other things; for instance, while in book, Crafty shows the observed frequency of different reply moves in its book. In situations like this where your engine is not really searching, start the PV with a '(' character&#58;

  0      0       0      0  &#40;e4 64%, d4 24%)
GNU Chess output is very slightly different. The ply number is followed by an extra nonblank character, and the time is in seconds, not hundredths of seconds. For compatibility, xboard accepts the extra character and takes it as a flag indicating the different time units. Example&#58;

 2.     14    0       38   d1d2  e8e7 
 3+     78    0       65   d1d2  e8e7  d2d3 
 3&     14    0       89   d1d2  e8e7  d2d3 
 3&     76    0      191   d1e2  e8e7  e2e3 
 3.     76    0      215   d1e2  e8e7  e2e3 
 4&     15    0      366   d1e2  e8e7  e2e3  e7e6 
 4.     15    0      515   d1e2  e8e7  e2e3  e7e6 
 5+     74    0      702   d1e2  f7f5  e2e3  e8e7  e3f4 
 5&     71    0     1085   d1e2  e8e7  e2e3  e7e6  e3f4 
 5.     71    0     1669   d1e2  e8e7  e2e3  e7e6  e3f4 
 6&     48    0     3035   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
 6.     48    0     3720   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
 7&     48    0     6381   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
 7.     48    0    10056   d1e2  e8e7  e2e3  e7e6  e3e4  f7f5  e4d4 
 8&     66    1    20536   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5 
 8.     66    1    24387   d1e2  e8e7  e2e3  e7e6  e3d4  g7g5  a2a4  f7f5 
 9&     62    2    38886   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4 
                           d4e4 
 9.     62    4    72578   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  a2a4  h5h4 
                           d4e4 
10&     34    7   135944   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4 
                           d4e4  f7f5  e4f4 
10.     34    9   173474   d1e2  e8e7  e2e3  e7e6  e3d4  h7h5  c2c4  h5h4 
                           d4e4  f7f5  e4f4 
If your engine is pondering &#40;thinking on its opponent's time&#41; in post mode, it can show its thinking then too. In this case your engine may omit the hint move &#40;the move it is assuming its opponent will make&#41; from the thinking lines if and only if it sends xboard the move in the usual "Hint&#58; xxx" format before sending the first line.