Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Why not store both a lower and an upper bound in a hashtable?

Author: Leen Ammeraal

Date: 02:37:18 12/07/00

Go up one level in this thread


On December 07, 2000 at 04:24:02, Bas Hamstra wrote:

>On December 07, 2000 at 02:19:40, Leen Ammeraal wrote:
>
>>On December 07, 2000 at 01:28:35, Leen Ammeraal wrote:
>>
>>>On December 06, 2000 at 16:08:56, Robert Hyatt wrote:
>>>
>>>>On December 06, 2000 at 12:45:30, Leen Ammeraal wrote:
>>>>
>>>>>I have the impression that most chess programmers
>>>>>use their hashtables to store
>>>>>only one evaluation value, along with a flag
>>>>>denoting Lower, Upper, or Exact.
>>>>>Why not store both a lower and an upper bound,
>>>>>where lower = -inf or upper = +inf if only one
>>>>>real bound is available? A flag is then
>>>>>superfluous, since this follows from
>>>>>the two bound values.
>>>>
>>>>If you use mtd(f) you _must_ do this.  For the other search approaches, it
>>>>probably won't help much at all, and it does use more memory.  Nothing wrong
>>>>with trying it to see what you get, of course...
>>>>
>>>>
>>>>
>>>>>For example:
>>>>>LB      UB     Flag value (not stored)
>>>>>-inf    100    Upper
>>>>>-20     +inf   Lower
>>>>>30      30     Exact
>>>>>This also offers the possibility to store
>>>>>two different bounds at the same time, as in
>>>>>LB = -50, UB = 70.
>>>>>This is the way I do it, but, unfortunately,
>>>>>my program is weaker than most others.
>>>>>Could this be because this idea of storing
>>>>>two bounds and no flag is wrong?
>>>>>Leen Ammeraal
>>>
>>>Do you mean: two ints when storing LB and UB
>>>while one int and one byte when storing
>>>a single bound and a flag? Yes, this makes
>>>a difference, so I will reconsider my design,
>>>also because of Cleveland's reply about different
>>>depth for the two bounds. He says you use two
>>>separate entries in Crafty, which I think
>>>I should do too. I assume you also use the depth
>>>values to compute the hash key, is that right?
>>
>>I actually meant the flag, not the depth,
>>as a possible addition to the position
>>to compute the hashkey. But on second
>>thoughts, I doubt if this would be efficient
>>in view of retrievals, for I do not like
>>to search the hash table three times, for
>>each of the flags Exact, Lower and Upper.
>>So I wonder how to proceed, for example,
>>if a lower bound has already been stored with a given
>>depth when, for the same position, an upper bound
>>has to be stored with a different depth.
>>I would much appreciate your help.
>>
>>Leen Ammeraal
>
>Personally I don't store them all in this case. What I do is lookup if the
>position is already stored, and then decide if it should be replaced or not. You
>could for instance replace only if the new to store depth is greater than the
>stored depth, or you could simply always store the last.

I think things are actually more complicated if you
store two bounds and only one depth. I am now implementing
storing a depth for each of the bounds (lower, upper).
Leen Ammeraal




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.