Cutochess cli

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

Moderator: Ras

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

Re: Cutochess cli

Post by Ferdy »

Krzysztof Grzelak wrote: Tue Mar 09, 2021 6:14 pm Thank you so much Ferdy. I still have such a problem with the three options UCI_ShowWDL=true; OwnBook=false; Ponder=false;. The program writes that there are no such options in the engine Stockfish.
SF has no OwnBook option so don't use it.

If the match is ponder off, there is no need to use Ponder. To set ponder just use.

Code: Select all

cmd=c:\Cute\stockfish_13_win_x64_modern.exe proto=uci option.Threads=4 ponder=true 

For UCI_ShowWDL you can use initstr.

Code: Select all

cmd=c:\Cute\stockfish_13_win_x64_modern.exe proto=uci option.Threads=4 initstr="setoption name UCI_ShowWDL value true" 
Krzysztof Grzelak
Posts: 1586
Joined: Tue Jul 15, 2014 12:47 pm

Re: Cutochess cli

Post by Krzysztof Grzelak »

Fredy big thanks. I have two more questions (for today). Why doesn't the option work option.OwnBook=false and option.UCI_ShowWDL=true. Is it possible to save the game like here?

[Event "TCEC Season 20 - Superfinal"]
[Site "https://tcec-chess.com"]
[Date "2021.01.16"]
[Round "1.1"]
[White "Stockfish 20210113"]
[Black "LCZero 0.27.0d-Tilps-dje-magic_JH.94-100"]
[Result "1/2-1/2"]
[BlackElo "3586"]
[ECO "C40"]
[GameDuration "03:37:57"]
[GameEndTime "2021-01-16T20:51:32.535 UTC"]
[GameStartTime "2021-01-16T17:13:34.869 UTC"]
[Opening "Latvian"]
[PlyCount "102"]
[Termination "adjudication"]
[TerminationDetails "TCEC draw rule"]
[TimeControl "7200+10"]
[Variation "Polerio variation"]
[WhiteElo "3601"]

{WhiteEngineOptions: Protocol=uci; Threads=172; Hash=131072; SyzygyPath=/home/syzygy/; Use NNUE=true; Contempt=24; Move Overhead=1000; UCI_ShowWDL=true; OwnBook=false; Ponder=false;, BlackEngineOptions: Protocol=uci; MoveOverheadMs=1000; WeightsFile=J94-100; Threads=2; Backend=demux; BackendOptions=backend=cuda-fp16,res_block_fusing=true,(gpu=0),(gpu=1),(gpu=2),(gpu=3); NNCacheSize=50000000; RamLimitMb=96000; MinibatchSize=320; MaxPrefetch=160; MaxCollisionEvents=917; MaxOutOfOrderEvalsFactor=2.4; RootHasOwnCpuctParams=false; CPuct=1.745; CPuctBase=38739; FpuValue=0.330; CPuctFactor=3.894; PolicyTemperature=1.359; SmartPruningMinimumBatches=300; MovesLeftMaxEffect=0.2; MovesLeftThreshold=0.0; MovesLeftSlope=0.004; MovesLeftQuadraticFactor=0.0; MovesLeftScaledFactor=1.0; MovesLeftConstantFactor=0.0; TimeManager=legacy(steepness=4.0); VerboseMoveStats=true; SyzygyPath=/home/syzygy; LogFile=lc0.log; Ponder=false; UCI_ShowWDL=true; UCI_ShowMovesLeft=true; StrictTiming=true; CommandLineOptions=--show-hidden;}
1. e4 {book, mb=+0+0+0+0+0,} e5 {book, mb=+0+0+0+0+0,}
2. Nf3 {book, mb=+0+0+0+0+0,} f5 {book, mb=+0+0+0+0+0,}
3. Bc4 {book, mb=+0+0+0+0+0,}
fxe4 {d=32, sd=68, mt=68128, tl=7141872, s=50479, n=3438341, pv=fxe4 Nxe5 d5 Qh5+ g6 Nxg6 hxg6 Qxh8 Kf7 Be2 Bg7 Qh7 Qg5 g4 Bxg4 h4 Qf4 Bxg4 Nf6 Be6+ Kxe6 Qxg7 Qf3 Rg1 Nc6 Rxg6 Qh1+ Rg1 Qf3 Rg3 Qh1+ Rg1, tb=0, h=0.0, ph=0.0, wv=0.05, R50=50, Rd=-11, Rr=-1000, mb=-1+0+0+0+0,} 4. Nxe5 {d=70, sd=72, mt=177533, tl=7032467, s=105681508, n=18761849606, pv=Nxe5 d5 Qh5+ g6 Nxg6 hxg6 Qxg6+ Kd7 Bxd5 Qf6 Bxe4 Nc6 Nc3 Qxg6 Bxg6 Nf6 h4 Nd4 h5 Kc6 Ne2 Nxe2 Kxe2 Bg4+ f3 Bxh5 g4 Bxg6 Rxh8 Re8+ Kd1 Bf7 d4 Bc4 Bg5 Nd7 Rh3 b5 Bf4 a5 a4 bxa4 Rxa4 Bb4 Bd2 Nb6 Ra1 Be2+ Kc1 Bxd2+ Kxd2 Nc4+ Ke1 Bxf3+ Kf2 Bxg4 Rc3 Kb5 b3 Re2+ Kg3 Re3+ Rxe3 Nxe3 Re1 Nxc2 Re5+ Kb4 Kxg4 Kxb3 Rxa5, tb=2564060, h=79.7, ph=0.0, wv=0.00, R50=50, Rd=-11, Rr=-1000, mb=+0+0+0+0+0,}d5 {d=33, sd=70, pd=Nxe5, mt=71508, tl=7080364, s=52334, n=7115853, pv=d5 Qh5+ g6 Nxg6 hxg6 Qxh8 Kf7 Be2 Bg7 Qh7 Qg5 g4 Bxg4 h4 Qf4 Bxg4 Nf6 Be6+ Kxe6 Qxg7 Qf3 Rg1 Nc6 Rxg6 Qh1+ Rg1 Qf3 Rg3 Qh1+ Rg1, tb=2, h=0.0, ph=100.0, wv=0.04, R50=50, Rd=-11, Rr=-1000, mb=+0+0+0+0+0,}
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cutochess cli

Post by Ferdy »

Krzysztof Grzelak wrote: Tue Mar 09, 2021 8:58 pm Fredy big thanks. I have two more questions (for today). Why doesn't the option work option.OwnBook=false
Stockfish 13 does not have that option.

Try this.
* double click the stockfish file
* type uci

Code: Select all

id name Stockfish 13
id author the Stockfish developers (see AUTHORS file)

option name Debug Log File type string default
option name Contempt type spin default 24 min -100 max 100
option name Analysis Contempt type combo default Both var Off var White var Black var Both
option name Threads type spin default 1 min 1 max 512
option name Hash type spin default 16 min 1 max 33554432
option name Clear Hash type button
option name Ponder type check default false
option name MultiPV type spin default 1 min 1 max 500
option name Skill Level type spin default 20 min 0 max 20
option name Move Overhead type spin default 10 min 0 max 5000
option name Slow Mover type spin default 100 min 10 max 1000
option name nodestime type spin default 0 min 0 max 10000
option name UCI_Chess960 type check default false
option name UCI_AnalyseMode type check default false
option name UCI_LimitStrength type check default false
option name UCI_Elo type spin default 1350 min 1350 max 2850
option name UCI_ShowWDL type check default false
option name SyzygyPath type string default <empty>
option name SyzygyProbeDepth type spin default 1 min 1 max 100
option name Syzygy50MoveRule type check default true
option name SyzygyProbeLimit type spin default 7 min 0 max 7
option name Use NNUE type check default true
option name EvalFile type string default nn-62ef826d1a6d.nnue
uciok
As you can see there is no OwnBook option.
Krzysztof Grzelak wrote: Tue Mar 09, 2021 8:58 pm Why doesn't the option work option.UCI_ShowWDL=true.
Perhaps cutechess-cli does not support that option. The trick was to send the command via initstr.
Krzysztof Grzelak
Posts: 1586
Joined: Tue Jul 15, 2014 12:47 pm

Re: Cutochess cli

Post by Krzysztof Grzelak »

Ferdy thank you again. I understand that, like at TCEC, I cannot save games. I have another question. They are playing two engine chess and are using from tablebase Nalimov and Gaviota. What commands to use in cutochess-cli for tablebase Nalimov and Gaviota.
Modern Times
Posts: 3770
Joined: Thu Jun 07, 2012 11:02 pm

Re: Cutochess cli

Post by Modern Times »

Why do you want to use cutecherss-cli rather that cutechess GUI ? Using the GUI will be 1000 times easier for you.
Krzysztof Grzelak
Posts: 1586
Joined: Tue Jul 15, 2014 12:47 pm

Re: Cutochess cli

Post by Krzysztof Grzelak »

Modern Times wrote: Wed Mar 10, 2021 2:08 am Why do you want to use cutecherss-cli rather that cutechess GUI ? Using the GUI will be 1000 times easier for you.
I gave myself my word of honor that I will learn this application.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cutochess cli

Post by Ferdy »

Krzysztof Grzelak wrote: Tue Mar 09, 2021 8:58 pmIs it possible to save the game like here?

[Event "TCEC Season 20 - Superfinal"]
[Site "https://tcec-chess.com"]
[Date "2021.01.16"]
[Round "1.1"]
[White "Stockfish 20210113"]
[Black "LCZero 0.27.0d-Tilps-dje-magic_JH.94-100"]
[Result "1/2-1/2"]
[BlackElo "3586"]
[ECO "C40"]
[GameDuration "03:37:57"]
[GameEndTime "2021-01-16T20:51:32.535 UTC"]
[GameStartTime "2021-01-16T17:13:34.869 UTC"]
[Opening "Latvian"]
[PlyCount "102"]
[Termination "adjudication"]
[TerminationDetails "TCEC draw rule"]
[TimeControl "7200+10"]
[Variation "Polerio variation"]
[WhiteElo "3601"]
...
There is a repo tceccutechess. I tried compiling it and can be downloaded here. Sample command line and help are also included.

Be aware that this cutechess also generates other files like crosstable and schedule.

Sample output.
[Event "?"]
[Site "?"]
[Date "2021.03.10"]
[Round "1.2"]
[White "Lc0 v0.27.0 w67900 30x384 GTX-1650s"]
[Black "Stockfish 13 2-threads"]
[Result "1/2-1/2"]
[ECO "A07"]
[GameDuration "00:01:25"]
[GameEndTime "2021-03-10T01:44:10.408 UTC"]
[GameStartTime "2021-03-10T01:42:44.624 UTC"]
[Opening "Reti"]
[PlyCount "200"]
[Termination "adjudication"]
[TerminationDetails "TCEC draw rule"]
[TimeControl "30+0.1"]
[Variation "King's Indian attack (Barcza system)"]

{WhiteEngineOptions: Protocol=uci; WeightsFile=F:\Chess\Engines\Lc0\id\weights_run1_67900.pb.gz;, BlackEngineOptions: Protocol=uci; Threads=2; UCI_ShowWDL=true;}
1. Nf3 {book, mb=+0+0+0+0+0,} d5 {book, mb=+0+0+0+0+0,}
2. g3 {book, mb=+0+0+0+0+0,} Nf6 {book, mb=+0+0+0+0+0,}
3. Bg2 {book, mb=+0+0+0+0+0,} c6 {book, mb=+0+0+0+0+0,}
4. c4 {d=6, sd=16, mt=1459, tl=28641, s=1630, n=2358, pv=c4 Bg4 Ne5 Bf5 cxd5 cxd5 d3 Nc6 Bf4 Bd7 O-O Nxe5 Bxe5 Bc6, tb=0, h=0.0, ph=0.0, wv=0.11, R50=50, Rd=-13, Rr=-9, mb=+0+0+0+0+0,}
dxc4 {d=17, sd=26, mt=638, tl=29462, s=1593018, n=1016346, pv=dxc4 O-O g6 Na3 Be6 Qc2 b5 Ne5 Nd5 d3 cxd3 Nxd3 Bg7 Nc5 O-O Nxe6 fxe6, tb=0, h=0.0, ph=0.0, wv=0.05, R50=50, Rd=-13, Rr=-9, mb=-1+0+0+0+0,}
5. O-O {d=8, sd=19, pd=Bg4, mt=770, tl=27971, s=1403, n=1120, pv=O-O Nbd7 Qc2 Nb6 Na3 Be6 Ne5 h5 Naxc4 Nxc4 Nxc4 h4 Ne5 hxg3 hxg3 Qc8 Rd1 Bh3, tb=0, h=0.0, ph=0.0, wv=0.12, R50=49, Rd=-13, Rr=-9, mb=-1+0+0+0+0,}
e6 {d=22, sd=29, pd=O-O, mt=1695, tl=27867, s=1655424, n=2807600, pv=e6 a4 Nbd7 Qc2 e5 Qxc4 a5 Qc2 Bd6 d4 O-O Rd1 Re8 Nbd2 Qe7 b3 exd4 Nxd4 Bb4 Bb2 Nb6 Nc4 Nxc4 Qxc4, tb=0, h=86.3, ph=100.0, wv=0.16, R50=50, Rd=-13, Rr=-9, mb=-1+0+0+0+0,}
...
The sample output you showed is using https://github.com/TCEC-Chess/tcecgui, so perhaps there could be difference to the tcec_cutechess that I have uploaded.
Krzysztof Grzelak
Posts: 1586
Joined: Tue Jul 15, 2014 12:47 pm

Re: Cutochess cli

Post by Krzysztof Grzelak »

Ferdy thank you very much. How to properly configure the file yourself engines.JSON. Preparing him for the tournament. You can give an example.
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cutochess cli

Post by Ferdy »

Krzysztof Grzelak wrote: Wed Mar 10, 2021 9:45 am Ferdy thank you very much. How to properly configure the file yourself engines.JSON. Preparing him for the tournament. You can give an example.
I think the best way to generate engines.json file is to use the GUI. Open cutechess GUI and install each engine. Once done, you can go to the folder (in windows 10)

Code: Select all

C:\Users\username\AppData\Roaming\cutechess
and open the engines.json file to see which engines are installed.

If you use the tcec_cutechess-cli:

Code: Select all

tcec_cutechess-cli.exe -tournament round-robin ^
-tournamentfile t1.trn ^
-livepgnout live.pgn ^
-rounds 4 -repeat -games 2 ^
-concurrency 1 ^
-resign movecount=4 score=900 ^
-draw movenumber=60 movecount=6 score=0 ^
-tcecadj ^
-pgnout tcec_cutechess.pgn ^
-openings file=Noomen_3move.pgn format=pgn order=random ^
-each tc=0/30+0.1 proto=uci ^
-engine conf="Stockfish 13" ^
-engine conf="Lc0 0.27.0 w703810 10x128"
In conf=value, value is the name of the engine in cutechess GUI or in engines.json

If you setup both engines in the GUI, the cli can find the conf="Stockfish 13" and conf="Lc0 0.27.0 w703810 10x128" in the engines.json at the users roaming cutechess folder.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Cutochess cli

Post by MikeB »

when I saw all the json files which needed to be update , I just went the shell script method. for me it was so much easier, and it is nice that it can run in the background without any GUI involved at all.

Image

Right click and select > Open in New Window to see larger picture.
Image