Not logged inRybka Chess Community Forum
Up Topic Rybka Support & Discussion / Rybka Discussion / What if persistent hash is wrong?
- - By Kapaun (****) Date 2008-08-08 00:47
Imagine this situation: R3 is playing a game and filling the PH file in the course of the game. Now she has evaluated a certain situation in, say, move 20 and found a certain move. But the further development of the game shows that the move was wrong and her position is weakening. Finally she will lose the game.

Now imagine that some time later she will have the same position in another game. Will she now use the PH eval, which was wrong? Or will she try something else?
Parent - - By Banned for Life (Gold) Date 2008-08-08 01:02
What if one of the preferred moves in your book is wrong? You're screwed! I just hope there is some relatively easy way to figure this out...
Parent - - By Kapaun (****) Date 2008-08-08 01:09
Yes, but you can change the book quite easily. Or book learning will make sure that the variation is not very long preferred.
Parent - By Kapaun (****) Date 2008-08-08 06:18
bump
Parent - - By Kapaun (****) Date 2008-08-08 10:41
Well, I'm not so sure anymore if PH is a good thing for her. Look at this game. It's the first one with a freshly installed R3 and a virgin PH file. Especially have a look at the time usage (obviously because of the PH file). Both engines are playing without book, by the way:

[Event "120'/40+60'/20+30'"]
[Site "?"]
[Date "2008.08.08"]
[Round "1"]
[White "Rybka 3 32-bit"]
[Black "Naum 3.1"]
[Result "0-1"]
[ECO "C68"]
[Annotator "0.31;0.26"]
[PlyCount "116"]
[Source ""]
[TimeControl "40/7200:20/3600:1800"]

{Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz 2400 MHz  W=11.6 ply; 115kN/s
B=20.1 ply; 3.941kN/s; 239.554 TBAs} 1. e4 {0.31/18 310} e5 {0.26/21 326} 2.
Nf3 {0.44/18 380} Nc6 {0.25/21 356} 3. Bb5 {0.44/5 0} a6 {0.23/21 413} 4. Bxc6
{0.45/17 132} dxc6 {0.23/21 139} 5. O-O {0.36/18 136} Qd6 {(f6) 0.29/20 263} 6.
Qe2 {(Sa3) 0.47/17 305} Ne7 {(Le6) 0.07/19 201} 7. d3 {0.24/17 188} Ng6 {
0.04/20 165} 8. Be3 {0.42/5 0} Be7 {-0.02/19 211} 9. Nbd2 {(h3) 0.18/18 355}
O-O {-0.04/19 241} 10. a3 {(a4) 0.17/17 302} c5 {(a5) -0.11/18 290} 11. Nc4 {
0.14/17 241} Qe6 {-0.08/19 160} 12. Qd2 {(Sg5) 0.19/5 0} b5 {(b6) -0.26/20 362}
13. Na5 {0.12/13 0} f5 {-0.20/19 161} 14. exf5 {(b4) 0.01/17 146} Qxf5 {
-0.22/19 113} 15. Rae1 {(Lg5) 0.01/5 0} Bd6 {(Le6) -0.37/20 195} 16. Ng5 {
-0.28/16 169} Nf4 {-0.54/22 176} 17. Bxf4 {-0.28/5 0} exf4 {-0.70/22 128} 18.
Nf3 {-0.28/5 0} Qg6 {(Dh5) -0.63/22 268} 19. Kh1 {-0.40/17 251} Qh5 {
-0.73/21 373} 20. c3 {(d4) -0.42/5 0} Rf6 {(Lg4) -1.65/18 130} 21. Nb3 {
(De2) -1.63/15 158} g5 {-2.34/20 246} 22. Nxc5 {(De2) -1.56/5 0} Bxc5 {
-2.41/20 74} 23. Re5 {-1.59/5 0} Rf5 {-2.49/21 83} 24. Qe2 {-1.63/5 0} Bd6 {
-2.58/22 160} 25. Qe4 {-1.92/16 118} Rxe5 {-2.48/22 94} 26. Nxe5 {-1.90/17 122}
Rb8 {-2.50/22 98} 27. Nc6 {-1.82/5 0} f3 {-2.51/22 112} 28. g3 {-1.92/5 0} Rb6
{(Lh3) -2.54/22 185} 29. Qd5+ {(Te1) -2.28/17 312} Kg7 {(Kf8) -2.55/22 174} 30.
Re1 {-1.84/10 2} Qg6 {(Kh6) -2.45/20 121} 31. Ne7 {(Te3) -2.66/16 558} Bxe7 {
-2.66/21 136} 32. Rxe7+ {-2.66/18 251} Kh6 {-2.81/22 402} 33. Re3 {-2.66/5 0}
Rf6 {(Lg4) -2.82/21 106} 34. Qd8 {(Kg1) -2.94/17 345} Bh3 {-3.21/21 73} 35. Re4
{(Kg1) -2.94/5 0} c5 {(Lf5) -3.57/21 77} 36. Qe7 {(Kg1) -2.81/12 11} c4 {
(Df5) -3.94/22 65} 37. dxc4 {-4.90/18 531} bxc4 {-4.08/24 93} 38. g4 {
(Kg1) -4.76/5 0} Qf7 {-4.31/24 65} 39. Qe5 {-5.12/20 753} Rb6 {-4.77/25 81} 40.
Kg1 {-5.12/5 0} Qd7 {(Dg6) -4.77/26 82} 41. Rd4 {(Kh1) -5.12/18 651} Qe6 {
-5.65/29 175} 42. Qxe6+ {-5.12/5 0} Rxe6 {-4.01/4 0} 43. Rd1 {-5.00/12 0} Re2 {
-5.85/31 1139} 44. Rd6+ {-5.12/5 0} Kg7 {-#22/32 585} 45. Rd1 {(Td7+) -5.12/5 0
} Rxb2 {-#15/22 8} 46. Rc1 {(Te1) -5.12/5 0} Kf6 {(Lxg4) -#13/14 0} 47. a4 {
-7.17/16 226} Rd2 {(a5) -#12/12 0} 48. a5 {(Ta1) -6.33/17 316} Ke7 {
(Lg2) -#11/14 0} 49. Re1+ {(Ta1) -7.13/18 543} Kd6 {(Te2) -#10/13 0} 50. Rb1 {
-5.12/5 0} Rc2 {(Kd5) -#9/11 0} 51. Rd1+ {-7.85/16 214} Kc6 {(Kc5) -#8/10 0}
52. Re1 {(Tb1) -7.54/17 637} Rxc3 {(Kb5) -#7/8 0} 53. Rd1 {(Ta1) -5.12/5 0} Rd3
{(Lxg4) -#8/6 0} 54. Re1 {(Ta1) -#10/9 0} Kd5 {(c3) -#5/5 0} 55. Rb1 {
(Tc1) -5.12/5 0} c3 {-#4/3 0} 56. Re1 {(Kh1) -#4/3 0} c2 {-#3/1 0} 57. Kh1 {
-#3/3 0} Rd1 {-#2/1 0} 58. Rg1 {-#2/3 0} Bg2# {-#1/1 0} 0-1
Parent - - By Uly (Gold) Date 2008-08-08 17:25
If Play Depth is set to 64 then Rybka isn't using persistent hash as meant. Seems like a bug.
Parent - - By Kapaun (****) Date 2008-08-08 17:54
Yes, play depth is default (= 64).
Parent - - By Uly (Gold) Date 2008-08-08 17:57
Vas said that that would make Rybka to never play from the persistent hash, but she's clearly doing so. Perhaps she's ignoring the Play Depth parameter.
Parent - - By Kapaun (****) Date 2008-08-08 18:04
In this case I guess he should fix that - else he's up for an unpleasant surprise if people start to play longer games with PH...
Parent - By Vasik Rajlich (Silver) Date 2008-08-08 19:03
Ok, I'll check the play depth to make sure it works properly.

Vas
Parent - - By AndrewWalker (**) Date 2008-08-09 03:40
Can you please check if the same happens for other values such as 63?

Andrew
Parent - - By Uly (Gold) Date 2008-08-09 18:08
Tested with 20 and 30, but seems I'll turn it off.
Parent - - By Kapaun (****) Date 2008-08-09 18:34
Ah, that means even with 20 her move behaviour is bad enough?
Parent - - By Uly (Gold) Date 2008-08-09 18:49
She seems to ignore the parameter altogether. Yes this is bad enough regarding time management with high increment but the opponents are so weak that Rybka can give them this time handicap and still win.
Parent - By Kapaun (****) Date 2008-08-09 20:31
At longer time controls she will have a hard time against some...
Parent - - By Eelco de Groot (***) Date 2008-08-08 13:29 Edited 2008-08-08 13:42
Hello Kapaun,

My simple take on this, if I understand the question right; it depends on the implementation how good this works but persistent hash, or position learning or however you want to call it, is supposed to be made exactly to handle cases like this, well at least a bit better than a normal search.

Consider at move twenty you did a fifteen ply search, you play the preferred move by search, your opponent moves and at move twenty one you do another fifteen ply search. Say you did not ponder when it was your opponent's move, then the previous result you had for this position at move twenty-one was only a thirteen ply search. It will be overwritten in the PH with a new fifteen ply result which in more than 95% - I'm guessing- of the cases will be just a bit more accurate. You lose this first game but in the second game you come in the same position at move twenty, you already have at least a fifteen ply result for this position stored, so the search can go there very fast, but you also have a later fifteen ply result in your main variation two plies deeper. This partly overrides the first result for this position at move twenty, at least for the variation that contains the played moves from the previous game, because of this deeper result stored for the position two plies ahead. It is in fact a 17 ply search for the main move you played and the played  reply but not for the alternatives. (By the same token PH also has search results for positions even further, for all positions that occured in the first game) So now "all" search has to do is build up deeper searches for all your alternatives and for the moves your opponent did not play, and see if this results in a better continuation than what was played previously. It has a much better chance of coming up with something better if it knows the previous choice wasn't good, but we also know the better move may be difficult to find, because this move did not turn up in the first search. The PH saves time but the engine should at this point in an idealized search think longer too, if it had a good way of determining that this is a critical position. Results for all the alternatives may also not have been stored, that depends on the implementation I think, or, if something is stored for all alternative moves, it is probably not yet an exact result (because of the nature of alpha beta like searches, and depends on the implementation of search). So I would say it is almost certain the engine will play something different this second time but it is not so obvious that it will be something much better... You may need a second game lost for that, or a third, or a fourth. But in the end the engine will find out the truth this way!

Regards, Eelco    
Parent - - By Kapaun (****) Date 2008-08-08 13:40
If you are right, then the engine would come up with a different path next time a Ruy Lopez is played (see game above). We will see. What makes me a bit weary is the fact that R3 obviously already utilizes PH while she plays the first game - which seems to be obvious when you have a look at the time usage. Probably when the opponent makes an expected move she doesn't calculate much more but moves nearly instantly. But that alone is rather a bad than a good thing since we all know that evaluations may change from root+2 ply to root... I will watch this behaviour closely, but maybe it is better to let her play games without PH, and use PH only when deeply analyzing. We will see. 
Parent - - By Vasik Rajlich (Silver) Date 2008-08-08 19:04
You could also let het play with Persistent Hash but disable the automatic moves (ie. really high "play depth").

Vas
Parent - - By Uly (Gold) Date 2008-08-08 19:09

> (ie. really high "play depth").


It doesn't allow values higher than 64 and that's what we've been using. Thanks for checking :)
Parent - - By Vasik Rajlich (Silver) Date 2008-08-08 19:26
Yes, I'll have a look.

Vas
Parent - By Uly (Gold) Date 2008-08-08 19:56
I tried Play Depth 30, same result (I've made persistent hash moves bold, if that helps):

[Date "2008.08.08"]
[White "HIARCS Paderborn 2007 SP"]
[Black "Rybka 3 1-cpu 32-bit"]
[Result "0-1"]
[Annotator "1. +0.20   1... +0.02"]
[PlyCount "160"]
[TimeControl "60+7"]

{Pondering=Off} 1. d4 {0.20/13 6} Nf6 {0.02/12 13} 2. e3 {0.38/13 11} g6 {
-0.11/11 6} 3. Nf3 {0.35/12 7} Bg7 {-0.10/12 4} 4. c4 {0.37/11 5} O-O {
-0.05/13 16} 5. Be2 {0.54/12 9} c5 {-0.10/13 13} 6. Nc3 {0.50/12 9} cxd4 {
-0.10/5 0} 7. exd4 {0.40/13 10} d5 {-0.10/5 0} 8. c5 {0.42/12 7} Nc6 {
-0.19/11 7} 9. Be3 {0.39/11 8} Ne4 {-0.11/11 12} 10. O-O {0.34/11 4} b6 {
-0.17/11 13} 11. cxb6 {0.39/10 5} axb6 {-0.32/11 8} 12. Rc1 {0.28/11 11} Qd6 {
-0.23/11 9} 13. Nb5 {0.36/12 7} Qd7 {-0.15/11 3} 14. a4 {0.39/11 4} Ba6 {
-0.24/11 7} 15. Bd3 {0.02/12 17} Rfc8 {-0.48/10 9} 16. Qb3 {0.07/11 7} e6 {
-0.46/10 4} 17. Qa3 {0.05/12 25} Bf8 {-0.59/10 8} 18. Qb3 {0.00/12 5} f6 {
-0.75/10 7} 19. h3 {-0.10/11 8} Na5 {-0.51/11 11} 20. Qd1 {-0.10/12 6} Rxc1 {
-0.51/5 0} 21. Bxc1 {-0.10/12 5} Nc4 {-0.47/11 9} 22. Qe2 {-0.14/12 14} Rc8 {
-0.49/11 10} 23. Bxe4 {-0.03/11 7} dxe4 {-0.64/12 8} 24. Qxe4 {-0.04/11 3} Nd6
{-0.64/5 0} 25. Nxd6 {-0.32/13 9} Bxd6 {-0.64/5 0} 26. Re1 {-0.43/13 9} Bc4 {
-0.64/5 0} 27. Bf4 {-0.40/12 6} Bd5 {-0.67/11 4} 28. Qe3 {-0.62/11 1} Be7 {
-0.67/5 0} 29. Ra1 {-0.32/12 6} Rc2 {-0.82/10 3} 30. b3 {-0.56/13 9} g5 {
-0.86/11 8} 31. Bg3 {-0.57/12 5} Qc6 {-0.79/12 5} 32. h4 {-0.89/12 11} Rc3 {
-0.79/5 0} 33. Qe2 {-0.82/11 6} h6 {-0.83/10 5} 34. Ne1 {-1.06/10 6} Rxb3 {
-1.17/11 8} 35. Qd1 {-1.28/11 7} Rb4 {-1.18/11 21} 36. Ra3 {-1.62/11 8} Kg7 {
-1.45/10 9} 37. h5 {-1.85/11 7} Kf7 {-1.51/10 10} 38. Re3 {-1.83/11 6} Qxa4 {
-2.31/11 5} 39. Qc1 {-2.85/12 7} Rxd4 {-2.31/9 0} 40. Qc8 {-2.95/11 7} Rd1 {
-2.99/10 6} 41. f3 {-3.52/12 6} Qc6 {-3.29/7 0} 42. Qxc6 {-3.32/13 6} Bxc6 {
-3.29/7 0} 43. Kh2 {-3.30/14 6} b5 {-3.79/14 7} 44. Nd3 {-3.83/13 8} b4 {
-4.14/10 0} 45. Nf2 {-4.07/13 6} Rc1 {-4.06/14 10} 46. Ng4 {-4.42/13 7} Bf8 {
-4.06/5 0} 47. Rd3 {-4.00/13 6} Bd5 {-4.06/5 0} 48. Ne3 {-4.14/14 6} Rc3 {
-4.06/5 0} 49. Rxc3 {-4.90/15 6} bxc3 {-4.06/9 0} 50. Be1 {-5.18/16 8} Bb4 {
-4.25/12 2} 51. Nc2 {-4.38/14 7} Ba5 {-4.25/11 0} 52. Na1 {-4.59/14 7} f5 {
-4.70/13 3} 53. Kg1 {-4.74/14 6} Kf6 {-4.50/5 0} 54. Bf2 {-4.88/15 6} e5 {
-4.47/5 0} 55. Bc5 {-5.25/14 7} f4 {-4.83/14 11} 56. Nc2 {-5.25/13 6} Bb3 {
-5.10/13 3} 57. Na1 {-6.33/16 7} Bf7 {-4.98/5 0} 58. Kf1 {-5.62/14 7} Bxh5 {
-5.35/12 6} 59. Ke2 {-5.74/14 6} e4 {-5.10/5 0} 60. Bd4+ {-5.80/13 7} Ke6 {
-5.62/12 6} 61. Nb3 {-5.78/12 7} c2 {-5.10/5 0} 62. Bg7 {-5.99/12 6} exf3+ {
-5.99/11 46} 63. gxf3 {-6.69/15 7} Be8 {-5.10/5 0} 64. Kd3 {-7.02/15 7} Bg6+ {
-5.10/9 0} 65. Ke2 {-7.52/15 7} h5 {-7.09/11 14} 66. Bd4 {-8.19/14 7} g4 {
-7.46/10 5} 67. Bb2 {-7.56/13 6} Bb6 {-8.71/11 7} 68. Bc1 {-8.70/14 7} g3 {
-13.80/14 15} 69. Bxf4 {-13.35/16 7} g2 {-14.58/10 34} 70. Bh2 {-13.60/14 7} h4
{-14.69/10 3} 71. Nc1 {-21.02/15 6} h3 {-19.20/10 12} 72. Ke1 {-24.75/15 6} Be3
{-24.94/12 23} 73. Ke2 {-24.75/14 7} Bxc1 {-#10/9 1} 74. f4 {-#6/12 1} Bb2 {
-#9/7 0} 75. Bg1 {-#6/11 0} c1=Q {-#8/5 0} 76. Kf3 {-#5/9 0} Qxg1 {-#6/3 0} 77.
f5+ {-#4/39 0} Kxf5 {-#6/3 0} 78. Ke2 {-#3/28 0} Qf1+ {-#3/3 0} 79. Kd2 {
-#2/62 0} Kg4 {-#2/3 0} 80. Ke3 {-#1/62 0} Qe1# {-#1/3 0 Checkmate !!} 0-1
Parent - - By Vasik Rajlich (Silver) Date 2008-08-08 19:02
Yes, she'll use the bad move from the PH. The persistent hash is not a replacement for opening books, it's a supplement.

The one thing you could do is analyze manually with her and convince her that the move is bad.

Vas
Parent - - By Kapaun (****) Date 2008-08-08 21:47 Edited 2008-08-08 21:49
So even if PH works as intended it does not have some kind of "self repair mechanism", like Eelco de Groot some posts above believes it has?
Parent - - By billyraybar (***) Date 2008-08-09 14:33
Yeah, there is definitely a glitch with Persistant hash.  I've been testing it and Rybka definitely does not pay attention to Persistant Hash Play Depth Parameter.  For engine vs engine matches, this makes persistant hash absolutely worthless to me.  Hopefully Vas can fix this.
Parent - By Vasik Rajlich (Silver) Date 2008-08-09 16:31
I've found the bug, you can find the details in the FAQ. It's going to be tough to use this during game play, but you can experiment.

Vas
Parent - By Vasik Rajlich (Silver) Date 2008-08-09 16:33
Persistent hash repairs itself when you give Rybka more time to search a position. Once a position is stored, it's not overwritten until a deeper search is done.

Vas
Up Topic Rybka Support & Discussion / Rybka Discussion / What if persistent hash is wrong?

Powered by mwForum 2.27.4 © 1999-2012 Markus Wichitill