Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: null move and mate threat

Author: Michael Henderson

Date: 10:25:14 10/09/04

Go up one level in this thread


On October 09, 2004 at 10:00:05, Stuart Cracraft wrote:

>On October 08, 2004 at 20:37:29, Michael Henderson wrote:
>
>>I'm not sure if I saw code for adjusting mate scores for the hash table.  That's
>>really what I'm worried about.  If you do not adjust them, your mate threat
>>detection will not work!  Btw, are your recaptures _any_ two captures in a
>>row...I don't know if you still have that.  If you do, that will definitely get
>>you in the <10 sec range even w/out mate threat extensions.
>>
>>I also saw this code:
>>   if (MTHR_EXT != 0.0 && value == MATE+ply+2) { threat=1; }
>>isn't it supposed to be if (value == -MATE...) ?
>>
>
>My MATE is -MAXNUM+100 so in the above, it is like value == -MAXNUM+ply+2.
>
>My recaptures is nearly any two captures in a row but I don't want to solve
>141 with that. I'd like to have mate threat working. Not sure about what is
>meant by adjusting mate scores for the hash table. What's to adjust?
>I find a mate, a modify it by +ply, then I store that position with that
>score in the hash table. Don't I want to do that?!?
>
>Stuart

Ok let's say at position A, plyX you store MATED + plyX in the hash table.  Then
that value only applies to plyX.  If you are at position A again, plyY, then you
will get a hash cutoff and return MATED + plyX, *not* the correct MATED + plyY.

It gets more messed up when you start backing up MATE values.  For example, in
position B, plyX you see that any move you make gets you mated.  The value
backed up would be MATED + plyX + 2.  Now when you reach position B again, you
have to account *somehow* for the fact that you were at plyX and the distance to
mate is 2.  Otherwise you will return the completely wrong value at a different
ply :)

The easiest way to do this is to calculate the distance to mate, which is just
2.  It's easy math.  Then, store that info along with the mate score (MATED +
distance, if you want).  Then when you reach position B again, extract the
distance.  Add the distance to the current ply you are on.  Now you know the
actual distance from ROOT to MATED.  Return accordingly :) Don't get fooled by
a-b bound mate scores...use logic and you will figure that out too!

best of luck,
Michael



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.