Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Interesting mate test for hashing

Author: Robert Hyatt

Date: 22:40:07 09/10/99

Go up one level in this thread


On September 10, 1999 at 18:44:33, Steffen Jakob wrote:

>Hi Bob!
>
>On September 10, 1999 at 00:19:37, Robert Hyatt wrote:
>
>[...]
>
>>left them alone.  Wrong answer.  To fix this mate in 4 problem, I decided to
>>adjust the bounds as well, but I now set any bound value that is larger than
>>MATE-300, by reducing it to exactly MATE-300, but still using the "LOWER"
>>flag to say that this is the lowest value this position could have.  For bound
>>values < -MATE+300, I set them to exactly -MATE+300 and leave the flag as is.
>
>[...]
>
>I had a look at your new hash.c from the 16.18 source code. You are
>doing this:
>
>--------------------------------------------------------------
>if (type == EXACT) {
>   if (value > MATE-300) value=value+ply-1;
>   else if (value < -MATE+300) value=value-ply+1;
>   if ((int) tree->pv[ply].pathl >= ply)
>     word1l|=tree->pv[ply].path[ply];
>}
>else if (type == LOWER) {
>   word1l|=tree->current_move[ply];
>   value=Min(value,MATE-300);
>}
>else {
>   value=Max(value,-MATE+300);
>}
>--------------------------------------------------------------
>
>For lower scores you compute the minimum of "value" and
>"MATE-300". But what if "value" is a negative mate score which can
>also be a lower bound?
>
>You have the same problem with the upper bound.
>
>Therefore I think the following is correct:
>
>--------------------------------------------------------------
>if(abs(value > MATE-300))
>{
>   if(value > 0)
>     {
>	switch(mode)
>	  {
>	   case EXACT:
>	     value = value + (ply-1);
>	     break;
>	   case LOWER:
>	   case UPPER:
>	     value = MATE-300;
>	     break;
>	  }
>     }
>   else
>     {
>	switch(mode)
>	  {
>	   case EXACT:
>	     value = value - (ply-1);
>	     break;
>	   case LOWER:
>	   case UPPER:
>	     value = -(MATE-300);
>	     break;
>	  }
>     }
>}
>--------------------------------------------------------------
>
>Greetings,
>Steffen.


I think your code/idea is broken for the following reason:

take LOWER MATE-10

Since I know that MATE-10 is a LOWER bound for this position, I can lower
that bound even further, since if I say true_score >= MATE-10, then I can
absolutely say true_score >= MATE-300.  It is just more conservative.

However, now try LOWER -MATE+10.

you can _lower_ that bound, but you can _not_ raise it because you don't know
that is true.  IE if true_score is >= -MATE+10, I can't say that true_score is
>- -MATE+300.  That doesn't work.

I tried your code above and it totally wrecked your test position.  It couldn't
find the right mate at all...

Same thing happens for UPPER positions.  Bruce's idea works here (just don't
store those bounds since how useful is it to know that the score is >
-infinity+n, or that the score is < +infinity-n??  But adjusting them in the
wrong direction tears things royally...



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.