Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Collecting PVs: hashtables vs. lists passing in search

Author: Richard Pijl

Date: 08:41:51 06/18/02

Go up one level in this thread



>
>>I know that some programs collect PV after search by browsing hashtable, while
>>others (including my GreKo) do that dynamically in search by passing move lists
>>(by reference, of course :)) in recursive calls.
>>
>>I think that the first method (get PV from hashtable) should be better - simply
>>because we will get only one PV per search and do not waste time for passing
>>data of no use. But I have two questions before switching to this method in my
>>program:
>>
>>1. Is it REALLY much faster? (Did anybody measure the difference?)
>
>Although I didn't measure it, I'm pretty sure the difference is very small.
>Passing the movelists by reference are just 4(or whatever) bytes more to copy
>per search() call. And the (potential) PV doesn't change that often, if the
>move-ordering is good anyway. (that's why Bruce even uses memcpy of the whole
>list in his examples (at http://www.seanet.com/~brucemo/chess.htm)

It is not only passing the list, also building and maintaining it.
When I changed my pv array to retrieving from the hashtable, it saved me about
5%. I also simplified my moveordering (as I first checked for a PV move before
probing the hashtable), but that could have been done anyway.

I keep the rootnode move in a separate variable, to prevent it from being
overwritten in the hashtable.

>
>I think there are more important reasons for either side to consider though. For
>example, using movelists has the advantage that you still have your PV when you
>turn off hashtables. (e.g. during debugging)

Ok, but you could turn of probing of hashtables during search using a compile
switch, retaining the hash-pv.

>With hashtables it's more likely
>that your PV won't be big, because of overwritten hash entries. I'm sure there
>are other things to consider (for both sides)

Depends on the hashtablesize and the used timecontrol.
On the other hand I have a full PV-line on a 1 ply search depth when reusing
hash entries from a previous search, also on unexpected moves by the opponent
...

Richard.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.