Unofficial stockfish 28.04.2013 with rtb tablebases support

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

Moderator: Ras

syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by syzygy »

zamar wrote:I'd like to force loading all 5-men WDL bases directly into RAM and then see how it goes...
I was thinking of placing all 5-men WDL files in a single file, but it will take a bit of programming.
I'm just wondering if doing popcnt(pos.pieces()) every time in search is more expensive than keeping track of the total number of pieces under Position class...
In my own engine I keep track of the total number of pieces. The use of popcnt was a quick hack, although it shouldn't be very expensive if the CPU has popcnt support, since it is used only in the search and not in the qsearch. If native popcnt is not used it might be different.
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by syzygy »

Milos wrote:
Uri Blass wrote:Can you explain why?

I think that the main advantage of tablebases should be at fast time control when engines do many mistakes without them.
You think totally wrongly.
Higher depth reached=>more TB access, more TB access=>better score.
Statistically it's quite obvious...
Could also look the other way around. Looking at TB at higher depth, means seeing a correct score earlier, meaning more chance to select a correct move.
This is also kind of obvious... ;)
I would say higher depth means larger distance from the root to the positions being probed and therefore more possibilities of steering the game into a won (or drawn) endgame position. However, I have not done much testing.

For the moment I have the impression that the tables make a considerably bigger difference for my own engine than for Stockfish. This might be due to better native endgame knowledge of Stockfish.
Uri Blass
Posts: 10825
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by Uri Blass »

Milos wrote:
Uri Blass wrote:Can you explain why?

I think that the main advantage of tablebases should be at fast time control when engines do many mistakes without them.
You think totally wrongly.
Higher depth reached=>more TB access, more TB access=>better score.
Statistically it's quite obvious...
Could also look the other way around. Looking at TB at higher depth, means seeing a correct score earlier, meaning more chance to select a correct move.
This is also kind of obvious... ;)
If the depth is big enough the engines do no mistakes even without tablebases so tablebases give no advantage.


When the depth is small the engines may often blunder even when the root position is tablebase position and they may often fail to win KRP vs KR or KQP vs KQ because of lack of tablebases.
Milos
Posts: 4190
Joined: Wed Nov 25, 2009 1:47 am

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by Milos »

Uri Blass wrote:If the depth is big enough the engines do no mistakes even without tablebases so tablebases give no advantage.


When the depth is small the engines may often blunder even when the root position is tablebase position and they may often fail to win KRP vs KR or KQP vs KQ because of lack of tablebases.
You apply human chess thinking to engines which is just wrong.
Word "often" that you mention doesn't mean a thing. Also looking into specific endgames simply means nothing (these situations are far too rare to count for anything).
TB advantage is all about statistics. You can see TB access advantage in 2 ways, reducing necessary search time (since from that node where TB is accessed there is no more search deepening, the score is final, it's like a hash entry with infinite depth) and having less faulty evaluation (in nodes where TBs are accessed). Of course there is a penalty in loading a particular TB in memory and decoding a position, but once you start doing it at high enough depth (meaning there will be more TB hits) the penalty is minimized.
The advantage of TBs translates directly to how many nodes out of total nodes have been evaluated in TB's. The more there are, the bigger TB advantage is. And this is directly proportional to the depth reached.
This is pretty straight forward (I do realize that for ppl who are not chess programmers and still think in terms of particular endgame positions this is quite hard to understand) but would expect you to think more as a programmer and less as a chess player...
gotogo
Posts: 92
Joined: Tue Jan 26, 2010 5:03 am

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by gotogo »

Houdini 3 pro x64 vs Stockfish28.04.2013 rtb



55. Kg1 {-10.40/21 6 (a5)} Nxc4 {-21.69/
21 1 (Ra3)} 56. Bb5 {-10.69/20 3 (d6+)} Ne5 {-101.04/19 18 (Nb6)} 57. Kf2 {-13.
88/21 6 (Bf1)} c4 {-#59/16 1 (Kd6)} 58. Ke1 {-21.55/22 9 (Ba6)} c3 {-#57/16 1
(Kd6)} 59. Kd1 {-14.93/19 1} c2+ {-#56/18 1 (Rb2)} 60. Kxc2 {-7.11/19 2 (Kd2)}
Rxb5 {-#54/21 1 (Rf3)} 61. axb5 {-13.56/25 3 (Kc3)} Kd6 {-#52/27 2} 62. b6 {
-13.04/23 0 (Kc1)} g5 {#0/100 0 (Nd7)} 63. Kd2 {-12.58/22 1} g4 {#0/100 0
(Kxd5)} 64. Ke3 {0.00/19 0} Nf7 {0.00/35 1} 65. Kf4 {0.00/24 1} g3 {0.00/51 2
(Nh6)} 66. b7 {0.00/25 1 (Kxg3)} Kc7 {0.00/47 1} 67. b8=Q+ {0.00/40 1} Kxb8 {
0.00/100 0} 68. Kxg3 {0.00/99 0} Ne5 {0.00/1 0 (Kc7)} 69. Kf4 {0.00/99 0} Nd3+
{0.00/1 0} 70. Kf5 {0.00/99 0} Kb7 {0.00/1 0} 71. d6 {0.00/99 0} Kb8 {0.00/1 0}
72. d7 {0.00/99 0} Kc7 {0.00/1 0} 73. Kg4 {0.00/99 0} Nb4 {0.00/1 0} 74. Kf4 {
0.00/99 0} Na6 {0.00/1 0} 75. Kg4 {0.00/99 0} Kd8 {0.00/1 0} 76. Kf5 {0.00/99 0
} Kxd7 {0.00/1 0 Draw accepted} 1/2-1/2 this game was won... looks like rtb still needs more work
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by syzygy »

gotogo wrote:Houdini 3 pro x64 vs Stockfish28.04.2013 rtb



55. Kg1 {-10.40/21 6 (a5)} Nxc4 {-21.69/
21 1 (Ra3)} 56. Bb5 {-10.69/20 3 (d6+)} Ne5 {-101.04/19 18 (Nb6)} 57. Kf2 {-13.
88/21 6 (Bf1)} c4 {-#59/16 1 (Kd6)} 58. Ke1 {-21.55/22 9 (Ba6)} c3 {-#57/16 1
(Kd6)} 59. Kd1 {-14.93/19 1} c2+ {-#56/18 1 (Rb2)} 60. Kxc2 {-7.11/19 2 (Kd2)}
Rxb5 {-#54/21 1 (Rf3)} 61. axb5 {-13.56/25 3 (Kc3)} Kd6 {-#52/27 2} 62. b6 {
-13.04/23 0 (Kc1)} g5 {#0/100 0 (Nd7)} 63. Kd2 {-12.58/22 1} g4 {#0/100 0
(Kxd5)} 64. Ke3 {0.00/19 0} Nf7 {0.00/35 1} 65. Kf4 {0.00/24 1} g3 {0.00/51 2
(Nh6)} 66. b7 {0.00/25 1 (Kxg3)} Kc7 {0.00/47 1} 67. b8=Q+ {0.00/40 1} Kxb8 {
0.00/100 0} 68. Kxg3 {0.00/99 0} Ne5 {0.00/1 0 (Kc7)} 69. Kf4 {0.00/99 0} Nd3+
{0.00/1 0} 70. Kf5 {0.00/99 0} Kb7 {0.00/1 0} 71. d6 {0.00/99 0} Kb8 {0.00/1 0}
72. d7 {0.00/99 0} Kc7 {0.00/1 0} 73. Kg4 {0.00/99 0} Nb4 {0.00/1 0} 74. Kf4 {
0.00/99 0} Na6 {0.00/1 0} 75. Kg4 {0.00/99 0} Kd8 {0.00/1 0} 76. Kf5 {0.00/99 0
} Kxd7 {0.00/1 0 Draw accepted} 1/2-1/2 this game was won... looks like rtb still needs more work
Could you post the position before move 55?
gotogo
Posts: 92
Joined: Tue Jan 26, 2010 5:03 am

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by gotogo »

here is another

95. Ra5
{4.76/16 0} Kc7 {2.54/18 0} 96. Kf3 {5.89/18 0} Kb6 {2.75/19 2 (Rf6)} 97. Rb5+
{5.89/17 0} Kxb5 {2.76/17 0 (Kc7)} 98. c7 {25.73/11 0} Rxd5 {2.64/17 0 (Kb4)}
99. c8=Q {#53/18 0} Rd4 {2.90/18 0} 100. Qh8 {#52/23 0 (Qe6)} Kc4 {#34/18 0}
101. Qxd4+ {#0/100 0 (Qxh6)} Kxd4 {0.00/99 0} 102. Kxf4 {0.00/1 0} h5 {0.00/99
0} 103. Kf3 {0.00/1 0} h4 {0.00/99 0} 104. Kg4 {0.00/1 0} h3 {0.00/99 0} 105.
Kf3 {0.00/1 0} Ke5 {0.00/99 0} 106. Kg3 {0.00/1 0} Kf6 {0.00/99 0} 107. Kxh3 {
0.00/1 0 Draw accepted} 1/2-1/2
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by syzygy »

It seems my Stockfish adaptation of the probing code contains a bug.
I should have tested it better. The tables are fine.

I'll fix it and report back.
syzygy
Posts: 5697
Joined: Tue Feb 28, 2012 11:56 pm

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by syzygy »

I have fixed a bug which is probably the bug causing these two games to be drawn, although I can't verify this without knowing the positions...

I suppose Jean-François will update the executable once he has applied the 1-line fix.
j_romang
Posts: 79
Joined: Mon May 16, 2011 2:52 am

Re: Unofficial stockfish 28.04.2013 with rtb tablebases supp

Post by j_romang »

Thanks Ronald ; 1-line fix applied : https://github.com/jromang/Stockfish/co ... 785dc92ba2 :D
I will try to build a new executable later today.