tuning info

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Daniel Shawul
Posts: 3751
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: tuning info

Post by Daniel Shawul » Fri Jan 05, 2018 12:04 am

I think clop may support different optimization algorithms.

I see an C2SPSA.cpp in there though i am not sure what it is used for.

P.S: Does anybody know why latest cutechess-cli does not display results on stdout ?
It plays the game and saves it to a pgn but there is no result output on the screen.
I tried cutechess-cli 1.0 and 0.85, on ubuntu 17.10 -- Qt version 5.9.1

Daniel

petero2
Posts: 581
Joined: Mon Apr 19, 2010 5:07 pm
Location: Sweden
Contact:

Re: tuning info

Post by petero2 » Fri Jan 05, 2018 3:04 pm

Daniel Shawul wrote:P.S: Does anybody know why latest cutechess-cli does not display results on stdout ?
It plays the game and saves it to a pgn but there is no result output on the screen.
I tried cutechess-cli 1.0 and 0.85, on ubuntu 17.10 -- Qt version 5.9.1
I had this problem in fedora 24. I solved it by adding the following to ~/.config/QtProject/qtlogging.ini:

Code: Select all

[Rules]
*.debug=true

Daniel Shawul
Posts: 3751
Joined: Tue Mar 14, 2006 10:34 am
Location: Ethiopia
Contact:

Re: tuning info

Post by Daniel Shawul » Fri Jan 05, 2018 5:26 pm

It works like a charm!

Thanks a lot Peter!

Daniel

Ferdy
Posts: 4083
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: tuning info

Post by Ferdy » Sun Jan 07, 2018 2:27 pm

elcabesa wrote:The spsa Perl tuner doesn't work very well with vajolet and I don't like to debug the uci interaction between them.
Couple of notes when using spsa from
https://github.com/zamar/spsa/blob/master/spsa.pl

1. Be aware of the game adjudication on stalemate.
When your engine received a stalemate position what bestmove it prints?
Stockfish would print

Code: Select all

bestmove (none)
If your engine returns bestmove 0000,
then the code in line 446,

Code: Select all

$flag_stalemate = 1 if ($array[1] eq '(none)');
should be change to:

Code: Select all

$flag_stalemate = 1 if ($array[1] eq '0000');
2. When parsing engine output info line, make sure the splitted line converted into an array is properly read. At line 452,

Code: Select all

# Check for mate in one
if ($#array >= 9 && $array[0] eq 'info' && $array[1] eq 'depth' &&
    $array[7] eq 'score' && $array[8] eq 'mate' && $array[9] eq '1') 
{
    $flag_mate = 1;
    $winner = $engine_to_move;
}
With typical uci engine search output for example.

Code: Select all

info depth 1 score mate 1 nodes 20 nps 1818 tbhits 0 time 11 pv e2e4
The code above must be revised to:

Code: Select all

if ($#array >= 5 && $array[0] eq 'info' && $array[1] eq 'depth' &&
    $array[3] eq 'score' && $array[4] eq 'mate' && $array[5] eq '1') 
{
...
}
3. There is an unsafe code in line 461, revised this depending on your engine output.

Code: Select all

# Record score
if ($#array >= 7 && $array[0] eq 'info' && $array[1] eq 'depth' &&
    $array[7] eq 'score') 
{    
    $score = $array[9] if ($array[8] eq 'cp');
    $score = +100000   if ($array[8] eq 'mate' && $array[9] > 0);
    $score = -100000   if ($array&#91;8&#93; eq 'mate' && $array&#91;9&#93; < 0&#41;;
&#125;
That,

Code: Select all

$#array >= 7
should be change to:

Code: Select all

$#array >= 9

elcabesa
Posts: 806
Joined: Sun May 23, 2010 11:32 am
Contact:

Re: tuning info

Post by elcabesa » Sun Jan 07, 2018 5:05 pm

I don't like reinventing the well, we already have the beatiful cutechess-cli to play games.
I think I'll probably port spsa script to python and use cutechess to play games

Ferdy
Posts: 4083
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: tuning info

Post by Ferdy » Tue Jan 09, 2018 3:14 am

elcabesa wrote:I don't like reinventing the well, we already have the beatiful cutechess-cli to play games.
I think I'll probably port spsa script to python and use cutechess to play games
That is what I understand, you encountered problems running the perl script and you like to use cutechess-cli to run the match. If you follow my suggestions especially the #1 in my previous post, it would solve most of your problems.

There is another somewhat inappropriate behaviour of that perl script when sending

Code: Select all

position fen &#91;FEN&#93; moves m1 m2 ...
It would also send a leading space before the first move.
Example.

Code: Select all

position &#91;FEN&#93; moves  e2e4
Notice the extra space between "moves" and "e2e4"

It would have been.

Code: Select all

position &#91;FEN&#93; moves e2e4
My program does not like that extra space there. After fixing all of these, I successfully run that perl script without problems.

So far, spsa does not give any rating improvement on Deuterium, but the tuned parameters are not really bad. The values are different but the performance is close. I thought that this is interesting when applied to variants like, shogi, xiangqi, spartan or on the big boards like capablanca/gothic, grand chess and others.

Post Reply