Cutechess-cli: A command line tool for engine-engine matches

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Werner
Posts: 2960
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Werner »

Hi thanks a lot!
Great Program!

May I please ask for a bit help for TheKing engine. I would like to send such a start sequence to the engine:

cm_parm default tts=134217728 opk=933250 opp=100 opn=100 opb=100 opr=100 opq=100 myp=100 myn=100 myb=100 myr=100 myq=100 mycc=100 mymob=100 myks=100 mypp=100 mypw=100 opcc=100 opmob=100 opks=100 oppp=100 oppw=100 cfd=0 sop=100 avd=0 rnd=0 sel=14 md=99\ShowThinkingMove=false\n

as this start.bat did not work:

cutechess-cli -fcp name=TheKing350def arg=cm_parm default tts=136217728 sel=16 cmd=TheKing350.exe proto=xboard -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn -repeat -pgnout games.pgn

got an error message: invalide engine option default
Werner
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Marc Lacrosse wrote:May I suggest a slight modification for Windows XP (and Vista - what is this thing?) users?
I would prefer that cutechess first checks its own directory for its ini file and defaults to writing it locally in the same place.
Then cutechess-cli would continue to be perfectly "portable" for those who like myself go from PC to PC with everything on a USB drive.
The path to the configuration file is determined by Qt, which makes it easy for the Cute Chess GUI and CuteChess-cli to use the same file. But what you suggest, or some variation of it, is definitely doable. In that case the file would probably have to be hand-edited because Cute Chess stores absolute paths in the file, which wouldn't work if you put it on a USB drive.
ilari wrote:- Finally great news for Windows users: I've written a custom class for interprocess communication on Windows. It reads new data instantly (in less than 1 millisecond)
Wonderful !
Thanks. It was not wonderful to write that code. But it had to be done, and I'm glad I did it.
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Werner wrote:Hi thanks a lot!
Great Program!

May I please ask for a bit help for TheKing engine. I would like to send such a start sequence to the engine:

cm_parm default tts=134217728 opk=933250 opp=100 opn=100 opb=100 opr=100 opq=100 myp=100 myn=100 myb=100 myr=100 myq=100 mycc=100 mymob=100 myks=100 mypp=100 mypw=100 opcc=100 opmob=100 opks=100 oppp=100 oppw=100 cfd=0 sop=100 avd=0 rnd=0 sel=14 md=99\ShowThinkingMove=false\n

as this start.bat did not work:

cutechess-cli -fcp name=TheKing350def arg=cm_parm default tts=136217728 sel=16 cmd=TheKing350.exe proto=xboard -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn -repeat -pgnout games.pgn

got an error message: invalide engine option default
You have to wrap the arg options' value in quotes if it contains spaces. Then it will all be sent as one argument. So the command would be:

Code: Select all

cutechess-cli -fcp name=TheKing350def arg="cm_parm default tts=136217728 sel=16" cmd=TheKing350.exe proto=xboard  -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn  -repeat -pgnout games.pgn
If you want to send multiple arguments, you can use the arg option several times:

Code: Select all

cutechess-cli -fcp name=TheKing350def arg=cm_parm arg=default arg="tts=136217728" arg="sel=16" cmd=TheKing350.exe proto=xboard  -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn  -repeat -pgnout games.pgn
User avatar
Werner
Posts: 2960
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Werner »

You have to wrap the arg options' value in quotes if it contains spaces. Then it will all be sent as one argument. So the command would be:

Code: Select all

cutechess-cli -fcp name=TheKing350def arg="cm_parm default tts=136217728 sel=16" cmd=TheKing350.exe proto=xboard  -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn  -repeat -pgnout games.pgn
If you want to send multiple arguments, you can use the arg option several times:

Code: Select all

cutechess-cli -fcp name=TheKing350def arg=cm_parm arg=default arg="tts=136217728" arg="sel=16" cmd=TheKing350.exe proto=xboard  -scp cmd=sloppy.exe proto=xboard -both tc=40/2 -games 2 -pgnin top25.pgn  -repeat -pgnout games.pgn
and what to do if this is not a commandline parameter like /t2 for using 2 CPUs but I want to use an "init String" as I can do it in Arena configure under the Special Folder ???

I am afraid, The King does not use the correct parameters the way I tried :cry:
Werner
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Werner wrote:and what to do if this is not a commandline parameter like /t2 for using 2 CPUs but I want to use an "init String" as I can do it in Arena configure under the Special Folder ???

I am afraid, The King does not use the correct parameters the way I tried :cry:
Oh, you mean you want Cutechess-cli to send the init string to your program's stdin after it has started? The "arg" option is only for command line arguments, so I'll have to write a new option for init strings.
User avatar
Werner
Posts: 2960
Joined: Wed Mar 08, 2006 10:09 pm
Location: Germany
Full name: Werner Schüle

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Werner »

ilari wrote:
Werner wrote:and what to do if this is not a commandline parameter like /t2 for using 2 CPUs but I want to use an "init String" as I can do it in Arena configure under the Special Folder ???

I am afraid, The King does not use the correct parameters the way I tried :cry:
Oh, you mean you want Cutechess-cli to send the init string to your program's stdin after it has started? The "arg" option is only for command line arguments, so I'll have to write a new option for init strings.
ups - sorry I made it more and more complicated.....

and thanks for the answer

but it works fine with other engines!

Werner
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by ilari »

Werner wrote: ups - sorry I made it more and more complicated.....

and thanks for the answer

but it works fine with other engines!

Werner
No, it was just an oversight on my part. It's an easy feature to add, so you'll see it in the next version.
Edsel Apostol
Posts: 803
Joined: Mon Jul 17, 2006 5:53 am
Full name: Edsel Apostol

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Edsel Apostol »

ilari wrote:Cutechess-cli version 0.1.4 has been released with a good number of changes:

- Millisecond-precision time controls are now properly written in PGN files

- It's possible to use Cute Chess' engine configurations. This means that one can use the conf=engine_name option instead of "cmd=command dir=directory proto=protocol" options. The engine configuration file should be in ~/.config/cutechess/cutechess.ini on Linux, ~/.config/cutechess.org/cutechess.ini on Mac, and on Windows Vista in /Users/username/AppData/Roaming/cutechess/cutechess.ini. On Windows XP it's probably something like Vista. It looks like this:

Code: Select all

[engines]
1\name=Engine1
1\command=engine1_cmd
1\working_directory=engine1_dir
1\protocol=0
2\name=Engine2
2\command=engine2_cmd
2\working_directory=engine2_dir
2\protocol=1
Protocol 0 is Xboard and 1 is UCI.
To display a list of configured engines, run "cutechess-cli --engines".

- KxR style castling moves are now accepted in Polyglot books

- The syntax for setting UCI options was changed from "uci/option" to "uci.option"

- UCI options with empty defaults are now accepted. Eg. Naum 3.1 sends the NalimovPath with an empty default, which was previously rejected.

- The UCI_Opponent option is now used if an engine supports it

- d7d8=q style promotions are now accepted, even though they violate the protocol. At least Thinker sends promotions in this format.

- Finally great news for Windows users: I've written a custom class for interprocess communication on Windows. It reads new data instantly (in less than 1 millisecond), so the communication lag is completely gone. This means that superfast games (eg. 1 second per whole game) should now work even without a time increment, as long as the engine can keep up with the pace.
This is great. Big thanks Ilari! It works fine here at tc 1+0.1 though some engines couldn't tolerate such fast time control.
User avatar
Graham Banks
Posts: 43850
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Graham Banks »

ilari wrote:
Werner wrote: ups - sorry I made it more and more complicated.....

and thanks for the answer

but it works fine with other engines!

Werner
No, it was just an oversight on my part. It's an easy feature to add, so you'll see it in the next version.
Hi Ilari,

amongst all your hard work on this, how is Sloppy coming along? :P

Cheers, Graham.
gbanksnz at gmail.com
User avatar
Matthias Gemuh
Posts: 3245
Joined: Thu Mar 09, 2006 9:10 am

Re: Cutechess-cli: A command line tool for engine-engine mat

Post by Matthias Gemuh »

ilari wrote: - d7d8=q style promotions are now accepted, even though they violate the protocol. At least Thinker sends promotions in this format.

Hi Ilari,
I have caught you there :D :) :D :)
I will wait and see what comes next :wink:
It is sad that we must do such things.
regards,
Matthias.
My engine was quite strong till I added knowledge to it.
http://www.chess.hylogic.de