Any WB Shatranj engines out there?

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

hgm wrote:Well, thanks for your efforts, but it doesn't quite seem to work. Dabbaba insists on starting with an illegal move in shatranj (e2-e4).
Did you remember to alter the Dabbaba.ini to select Shatranj ?

Jim.
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Any WB Shatranj engines out there?

Post by hgm »

Remember? I never knew that this was necessary. I thought the .ini file was only needed in variant fairy, to specify which variant exactly should be played, and shatranj is a standard WinBoard variant that it gets through the variant command.

OK, it plays Shatranj now, but something is very wrong with the time management. It plays OK upto some point (20-30 moves), and then it suddenly starts to search 20 ply deep. (And of course immediately forfeits on time because of this. But if I play without autoCallFlag, it does come with a move eventually.) I cannot remember the old Dabbaba that we used for Knightmate behaving like this. Something must be broken.

I noticed that in the ChessWar test tourneys Dabbaba also forfeits almost all its games on time. Try playing a 40/1 game, and see what happens!
User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

hgm wrote:Remember? I never knew that this was necessary. I thought the .ini file was only needed in variant fairy, to specify which variant exactly should be played, and shatranj is a standard WinBoard variant that it gets through the variant command.

OK, it plays Shatranj now, but something is very wrong with the time management. It plays OK upto some point (20-30 moves), and then it suddenly starts to search 20 ply deep. (And of course immediately forfeits on time because of this. But if I play without autoCallFlag, it does come with a move eventually.) I cannot remember the old Dabbaba that we used for Knightmate behaving like this. Something must be broken.

I noticed that in the ChessWar test tourneys Dabbaba also forfeits almost all its games on time. Try playing a 40/1 game, and see what happens!
I haven't experienced this problem. What time control did you use?

Jim.
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Any WB Shatranj engines out there?

Post by hgm »

40/1'. Olivier uses something like 40/5', or 5'+3".

I am running under Windows XP on a Pentium-M.

I tried another game, and it got stuck after 24 moves. The end of the debug file looks like:

Code: Select all

101015 >second: time 1161
101015 >second: otim 2540
101015 >second: c4c5
101095 <second: 
101095 <second: 
101095 <second: 1 116 0        0 g4g5 d4d5 
101095 <second: 1 -106 2        0 c7c6 a7a6 
101095 <second: 2 255 2        3 b6c8 b6d7 e6g4 
101095 <second: 3 384 2       16 d6c5 b6c8 f4d2 e8d7 
101095 <second: 4 387 2      142 d6c5 b6c8 b6d7 e6g4 f4d2 
101445 <second: 5 294 2     1187 d6c5 f4h2 g6g5 d8f7 h6h5 h8h7 
103218 <second: 6 296 2     7206 d6c5 d6d5 g6g5 c7c6 b6d7 h8h7 h8g8 
103218 <second: 23
103218 <second: move Nb6-c8 
machine move 45, castling = -1 -1 -1 -1 -1 -1
move to parse: Nb6-c8
Parser Qa1b2: yyleng=6
parser: b6c8
-1 -1 -1 -1 -1 -1 Legality test? b6c8
TC string = '+40/1'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=23 (1,5)-(2,7) -
move: b6c8
, parse: Nc8 (
)
time odds: 1 1 
Interrupting first
103218 >first : time 2540
103218 >first : otim 941
103218 >first : b6c8
103328 <second: 
103328 <second:   sel.depth=106 332 2     7206 
103328 <second: time: white: 34.60 black: 50.53                    1 -81 0        0 c5c6 c5d6 
103328 <first : -1     48      311     123414 d6c5
103328 <first :  0    -36      311     123415 d6c5
103328 <first : -1     49        0          1 c5d6
103338 <first :  0     36        0          2 c5d6
103338 <first :  1     41        0          3 c3d5
103338 <first :  2     41        0        898 c3d5
103338 <first :  3     41        0       1691 c3d5
103338 <first :  4     37        5       6932 c3d5
103749 <first :  5     23       51      72441 g4g5
105541 <first :  6     31      231     317812 c3d5
105541 <first : move c3d5
machine move 46, castling = -1 -1 -1 -1 -1 -1
move to parse: c3d5
-1 -1 -1 -1 -1 -1 Legality test? c3d5
TC string = '+40/1'
mps=40 tc=60000 inc=0
CoordsToAlgebraic, piece=1 (2,2)-(3,4) -
move: c3d5
, parse: Nd5 (
)
time odds: 1 1 
105541 >second: time 941
105541 >second: otim 2307
105541 >second: c3d5
105641 <second: 
105652 <second: 
105652 <second: 1 -81 0        0 c5c6 c5d6 
105652 <second: 1 -81 0        0 c7c6 b7b6 
105652 <second: 2 415 0        4 e6g4 d6c5 h8g8 
105652 <second: 3 283 0      196 e6g4 d6c5 h6h5 a7a6 
106182 <second: 4 264 0     1775 e6g4 c8b6 c7c6 h8f8 d6c5 
108215 <second: 5 44 0     7696 e6g4 c7c6 e6c4 d8c6 c8b6 g6g5 
116026 <second: 6 73 0    30921 h8f8 c7c6 d8c6 e8d7 h8g8 b7b6 a7a6 
143666 <second: 7 197 0   112223 h8h7 a7a6 h8f8 c8e7 d8c6 b7b6 c7c6 h6h5 
175772 <second: 8 233 0   257058 c7c6 h8h7 h8f8 c8e7 d8c6 b7b6 a7a6 h6h5 e8f7 
221408 <second: 9 145 0   526125 c7c6 h8h7 h8f8 c8e7 d8c6 b7b6 a7a6 h6h5 e8f7 d8f7 
GameEnds(38, aborted, 2)
GameEnds(38, aborted, 2) clock stopped
GameEnds(38, aborted, 2) after test
Interrupting first
254275 >first : result * {aborted}
254275 >second: result * {aborted}
254275 >first : force
254275 >first : ping 4
254275 >first : quit
254285 >second: quit
Process 2120 still alive after timeout, killing... result=1
Dabbaba is second engine. For the last move it had 9.41 sec on the clock. You can see from the WB time marks that it uses 2.6 sec from this (already a lot, with still 16 moves to go...) to get to 5 ply. But then it uses 10.4 sec to reach depth 6 (flag fallen), and then t goes on to 7, 8, 9 ply like nothing happened.
User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

Time problems hopefully fixed now.

Dabbaba 1.22
http://www.zshare.net/download/1657062808abb7b8/

Use the dabbaba.ini included (already set up for Shatranj :) )

If you find Dabbaba is still using too much time, or not enough for your chosen time control,
you can make some adjustments yourself in the dabbaba.ini file using the 'adjust_time' parameter.

Jim.
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Any WB Shatranj engines out there?

Post by hgm »

Perhaps a silly question: are you sure Dabbaba interprets the time and otim commands correctly? I just played a game where Fairy-Max went through the flag (with autoCallFlag off), and suddenly Dabbaba started to play instantly.
User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

Thanks for the tip. Dabbaba doesn't use otim at all, but I had a close look
at the time command and it looks like I implemented it incorrectly.

Here's a new version. I've played fifty 40/1 Shatranj test games, autoflag off, with no problems so far.
This version also has some eval bugs fixed by Jens Baek Nielsen. Use included dabbaba.ini.

Dabbaba 1.23
http://www.zshare.net/download/1661004143f8c9e2/

Jim.
User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

Sorry Harm, Dabbaba may hang in memory after a game. I compiled with exit(0) instead of ExitProcess(0).

Please download this new build >

http://mihd.net/aj72mpg

Jim.
User avatar
hgm
Posts: 28356
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Any WB Shatranj engines out there?

Post by hgm »

Indeed it works now. In fact Dabbaba plays a bit fast. How exactly does this adjust_time parameter do? I reduced it from 15 to 1, but it seems to me Dabbaba is still a bit fast. Is it safe to set that parameter to 0 or negative values?

Of course Fairy-Max will crush Dabbaba anyway. :lol: It seems Dabbaba's eval is not really adapted to Shatranj. As it cannot castle, but attaches enormous value to King safety behind Pawns, it immediately walks his King to g8, trapping its Rook on h8, badly losing on the rest of the board where it is short a Rook...

[edit] I have never seen it hang so far. But I just played a handful of games.
User avatar
Jim Ablett
Posts: 2183
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Any WB Shatranj engines out there?

Post by Jim Ablett »

hgm wrote:Indeed it works now. In fact Dabbaba plays a bit fast. How exactly does this adjust_time parameter do? I reduced it from 15 to 1, but it seems to me Dabbaba is still a bit fast. Is it safe to set that parameter to 0 or negative values?

Of course Fairy-Max will crush Dabbaba anyway. :lol: It seems Dabbaba's eval is not really adapted to Shatranj. As it cannot castle, but attaches enormous value to King safety behind Pawns, it immediately walks his King to g8, trapping its Rook on h8, badly losing on the rest of the board where it is short a Rook...

[edit] I have never seen it hang so far. But I just played a handful of games.

The adjust time parameter just increases/decreases the divisor in the secs per move formula.

New version. Time management much better now. I've also changed some eval for Shatranj. King still has a tendency to head for the corners, but it's playing a bit better - should last a bit longer against Fairy-max :) Use the included dabbaba.ini.

Dabbaba 1.24
http://www.zshare.net/download/1666352949b9ccb1/


Here's a strange Shatranj game I just watched. At the end Dabbaba's lone rook chases Fairy-Max's king around the board, but Fairy-Max refuses to take it. When it finally does, game is declared as mate for white.

[Event "Computer Chess Game"]
[Site "JIMS"]
[Date "2008.08.07"]
[Round "-"]
[White "Dabbaba 1.24 JA by Jens B‘k Nielsen"]
[Black "Fairy-Max 4.8x"]
[Result "1-0"]
[TimeControl "40/120"]
[Variant "shatranj"]
[Annotator "2. +2.35 1... +0.21"]

1. Nf3 f6 2. Be3 e6 3. Nc3 b6 4. Bh3 Nc6 5. d3 Nge7 6. d4 d6 7. Rf1 e5 8.
dxe5 Be6 9. exf6 gxf6 10. Ne4 Ng8 11. Bf5 d5 12. Ng3 Bd6 13. c3 a6 14. Nd4
Nxd4 15. cxd4 Ne7 16. h3 Nc6 17. Nh5 Nxd4 18. Nxf6 c6 19. Bxh7 Rf8 20. Nh5
Ra7 21. Ng3 Rxh7 22. Rc1 Rg7 23. Rg1 Bc4 24. Ra1 Rfg8 25. Bg5 Rxg5 26. h4
Rg4 27. e3 Nb5 28. Rh1 Rh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