A draw position

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

A draw position

Post by Kempelen »

This is a position from Rodin in ICC. Rodin did not saw this was a draw.

[D]6k1/5p1p/4pPpP/3p4/1r1P4/1R6/2K2P2/8 b - - 0 41

I have put the position to various engines (of differents strength) and it is a very curious thing. Same see the draw at very low depth, while others need to go to 26 depth, same fast, same not so fast.

My engine need a lot of time to see a draw. As I know, my TT works well, so what do you think it is needed to see a quick draw here?
Thanks
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: A draw position

Post by Kempelen »

I copy some analysis from Rodin:

Code: Select all

18    149    307   1769763 1... Rc4+ 2.Kd3 Rc8 3.Ke3 Kf8 4.Kf4 Ra8 5.Rb7 Kg8 6.K
e5 Rc8 7.f3 Kf8 8.f4 Ra8 9.Rb3 Ke8 10.Rb7
19    151    421   2689960 1... Rc4+ 2.Kd3 Rc8 3.Ke3 Kf8 4.Kf4 Ra8 5.Rb7 Kg8 6.K
e5 Rc8 7.f3 Kf8 8.f4 Ra8 9.Rc7 Rb8 10.Ra7 Ke8 11.Rc7 Rb3
20    130    603   4181219 1... Rc4+ 2.Rc3 Rxc3+ 3.Kxc3 Kf8 4.Kb4 Ke8 5.Kc5 Kd8
6.Kc6 g5 7.Kd6 g4 8.Ke5 Kd7 9.Kf4 Kd6 10.Kxg4 e5 11.dxe5+ Kxe5 12.Kf3 d4 13.Ke2
Ke4 14.f3+ Kf4
21     26   1628  12955065 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 Kd7
6.Kc5 Kc7 7.d5 exd5 8.Kxd5 Kd7
22     20   2129  17844703 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 Kd7
6.Kc5 Kc7 7.d5 exd5 8.Kxd5 Kd7 9.f3 Kc7 10.Kc5 Kc8 11.Kd6 Kd8 12.f4
23     40   3338  28801787 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 Kd8
6.d5 Kd7 7.Kc5 g5 8.f3 e5 9.Kb4 e4 10.fxe4 g4 11.e5 g3 12.e6+ fxe6 13.f7 Ke7 14.
dxe6 Kxe6
24     36   5896  52571692 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 Kd8
6.Kd3 Kd7 7.f4 Kd6 8.Kd2 Kc6
25     30  15115 135874573 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 Kd8
6.f4 Kc8 7.Kb4 Kd7 8.Kb5
26      9  19484 170558687 1... Rc4+ 2.Rc3 Kf8 3.Rxc4 dxc4 4.Kc3 Ke8 5.Kxc4 g5 6
.d5 Kd7 7.Kc5 e5 8.f3 Kc7 9.Kb5 Kd6 10.Kc4
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
Dann Corbit
Posts: 12538
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: A draw position

Post by Dann Corbit »

Crafty up to version 20 had some code to detect draws caused by pawn wall formations. It did not increase the overall strength of crafty so Dr. Hyatt removed it. However, for analyzing positions of this type, I have a version of crafty compiled with DETECT_DRAW enabled and this is my favorite engine for closed positions, bar none. It took well under one second for crafty to see that this position was a draw. You can download the old code by Jeremiah Pennery in Crafty 20.0 to take a look.

Code: Select all

Q:\>craftydd

Initializing multiple threads.
System is SMP, not NUMA.
EPD Kit revision date: 1996.04.21
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].

Crafty v20.0 (1 cpus)

White(1): mt 4
max threads set to 4
White(1): hash 1024M
hash table memory =  768M bytes.
White(1): hashp 64M
pawn hash table memory =   48M bytes.
White(1): st 180
search time set to 180.00.
White(1): epdpfga draw.epd draw-analyzed.epd
PFGA: EPD record: 1
              time surplus   0.00  time limit 3:00 (3:00)
              depth   time  score   variation (1)
starting thread 1
starting thread 2
starting thread 3
               17->   0.28  -0.82   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Ke5
                                    Kd7 8. Kf4 Kd6 9. Kxg4 e5 10. dxe5+
                                    Kxe5 11. Kg5 (s=2)
               18     0.35     +1   1. ... Rxb3
               18     0.41  -0.06   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kxg4
               18->   0.63  -0.06   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kxg4 (s=2)
               19     0.72  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kg3
               19->   1.14  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kg3 (s=2)
               20     1.23  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               20->   1.86  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               21     1.98  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               21->   3.40  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               22     3.56  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               22->   6.46  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               23     6.69  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               23->  12.36  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               24    12.64  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               24->  24.53  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
               25    25.06  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=4)
               25->  51.54  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
               26    52.40  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=4)
               26->   1:48  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=6)
               27     1:50  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
              time=3:00  mat=-1  n=2156151372  fh=89%  nps=11.97M
              ext-> chk=128940286 cap=4661233 1rep=5030717 mate=1424241
              predicted=0  nodes=2156151372  evals=1047112963  50move=0
              endgame tablebase-> probes=0  hits=0
              hashing-> 47%(raw) 43%(depth)  14%(sat)  99%(pawn)
              hashing-> 0%(exact)  39%(lower)  3%(upper)
              SMP->  split=721331  stop=56265  data=32/32768  elap=3:00
Black(1):
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: A draw position

Post by Kempelen »

Dann Corbit wrote:Crafty up to version 20 had some code to detect draws caused by pawn wall formations. It did not increase the overall strength of crafty so Dr. Hyatt removed it. However, for analyzing positions of this type, I have a version of crafty compiled with DETECT_DRAW enabled and this is my favorite engine for closed positions, bar none. It took well under one second for crafty to see that this position was a draw. You can download the old code by Jeremiah Pennery in Crafty 20.0 to take a look.

Code: Select all

Q:\>craftydd

Initializing multiple threads.
System is SMP, not NUMA.
EPD Kit revision date: 1996.04.21
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].

Crafty v20.0 (1 cpus)

White(1): mt 4
max threads set to 4
White(1): hash 1024M
hash table memory =  768M bytes.
White(1): hashp 64M
pawn hash table memory =   48M bytes.
White(1): st 180
search time set to 180.00.
White(1): epdpfga draw.epd draw-analyzed.epd
PFGA: EPD record: 1
              time surplus   0.00  time limit 3:00 (3:00)
              depth   time  score   variation (1)
starting thread 1
starting thread 2
starting thread 3
               17->   0.28  -0.82   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Ke5
                                    Kd7 8. Kf4 Kd6 9. Kxg4 e5 10. dxe5+
                                    Kxe5 11. Kg5 (s=2)
               18     0.35     +1   1. ... Rxb3
               18     0.41  -0.06   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kxg4
               18->   0.63  -0.06   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kxg4 (s=2)
               19     0.72  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kg3
               19->   1.14  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kb7 9. Ke5 Kc6 10. Kf4 Kb5
                                    11. Kg3 (s=2)
               20     1.23  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               20->   1.86  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               21     1.98  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               21->   3.40  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               22     3.56  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               22->   6.46  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               23     6.69  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               23->  12.36  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=2)
               24    12.64  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8
               24->  24.53  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
               25    25.06  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=4)
               25->  51.54  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
               26    52.40  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=4)
               26->   1:48  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=6)
               27     1:50  -0.01   1. ... Rxb3 2. Kxb3 g5 3. Kb4 Kf8 4.
                                    Kc5 Ke8 5. Kc6 Kd8 6. Kd6 g4 7. Kc6
                                    Kc8 8. Kd6 Kd8 (s=5)
              time=3:00  mat=-1  n=2156151372  fh=89%  nps=11.97M
              ext-> chk=128940286 cap=4661233 1rep=5030717 mate=1424241
              predicted=0  nodes=2156151372  evals=1047112963  50move=0
              endgame tablebase-> probes=0  hits=0
              hashing-> 47%(raw) 43%(depth)  14%(sat)  99%(pawn)
              hashing-> 0%(exact)  39%(lower)  3%(upper)
              SMP->  split=721331  stop=56265  data=32/32768  elap=3:00
Black(1):
This evening I have dissabled an old code I have to not store 3-rep possitions in TT and this accelerate a bit the detection, but still need many time.

one more question, why Craty says -0.01 and not 0.00 ??
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
UncombedCoconut
Posts: 319
Joined: Fri Dec 18, 2009 11:40 am
Location: Naperville, IL

Re: A draw position

Post by UncombedCoconut »

Kempelen wrote:one more question, why Craty says -0.01 and not 0.00 ??
Black is better if White defends incorrectly. A tiny negative score will make sure the engine won't throw away its extra pawn for no reason. (This is a general principle. In this position White would have to be stupid to lose, but the engine doesn't know that.)
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: A draw position

Post by Kempelen »

Dann Corbit wrote:Crafty up to version 20 had some code to detect draws caused by pawn wall formations. It did not increase the overall strength of crafty so Dr. Hyatt removed it. However, for analyzing positions of this type, I have a version of crafty compiled with DETECT_DRAW enabled and this is my favorite engine for closed positions, bar none. It took well under one second for crafty to see that this position was a draw. You can download the old code by Jeremiah Pennery in Crafty 20.0 to take a look.
Are you sure is v 20.0 ??? I cant find any reference in the code
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/