Alvaro Begue wrote:mjlef wrote:Actually, that is not a probelm. During the search, the program will find both the move played, but also the moves deeper in the game with the lower scores. These low score moves will get propogated back in the search tree and change the best move picked. It actually does work...I had it in my program for a while. And others use it too. Very little work---you can even use the existing hash table and just preload these positions in it before a search.
Mark
Maybe there is something I don't understand, then. Let's see if we can agree on what would happen in a more detailed example.
For simplicity of the argument, let's say we always search to a fixed depth of 12 (granted, the problem is not as systematic in a more realistic setting). Your move number 20 was bad, but you still had a good score for it, which gets stored in the persistent hash. The scores found when searching moves 21 and 22 are also ignorant of the bad move, but the score found when searching move 23 is disastrous.
Now we are playing the game again and we get to the same position on move 20, and now we have the opportunity to do the right thing and avoid the bad move. Whenever the search tries the bad move, it will find the hash entry recorded when searching move 21. Because the depth of the stored search result is larger than the current depth, its score is used and the search of this branch is stopped. So we will probably repeat the bad move.
What do you think would happen differently than I described?
The search would go like this:
at a given depth itteration, the old move would be found with acceptable depth, and the score returned immediately. So in a fraction of a second, you would get the same result and depth as the originial move 20. But then the itterative searchj would increment the depth (lets say from depth 9 to 10). The persistant has move does not have enough depth to be accepted, so the program has to search. During that search it reaches the move played in old 21, and it would have enough depth, probably, so that branch does not ahve to be searched. But this speeds up the whole search process (remember, the old mobve 20 too say a minute to search, but using the persistant hash, that takes a fraction of a seocnd now). Anyway, since the new depth 10 search ends a lot faster since the important lines are found form the persistant has, it will probably get in yet another depth increment. And any of the lines ending in the future moves 21, 22, 23.. will be found immediately, and the move 23 in the PV is refuted.
Will this always find a better move? No, since another line not leading to old move 23 might still not see whatever was found at move 23. But then when a new 22 comes along, it will almost ceratinly see the problem sooner. Bad things tend ti be found 1-2 moves sooner with this method. One move sooner almost always. 2 depends on the nature of the bad line, and how many other misleading lines are left to be discovered.
It is pretty easy to test. Try just saving the hash score and depths for a game, then replaying the game and you will see what happens. A similar idea is opening book expansion. Some program save the hash score and depth for the first few moves after leaving the opening book. This means they will be smarter next game along the same lines. This stuff works well on opponents that keep trying to find a flaw in a program and they play the same lines over and over again. If they win a game, they want to repat it, but this mething will make the program play somethign new.
Mark