Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Nalimov TB question

Author: Heiner Marxen

Date: 12:22:39 11/12/01

Go up one level in this thread


On November 12, 2001 at 08:14:32, Gian-Carlo Pascutto wrote:

>On November 12, 2001 at 06:59:51, Bas Hamstra wrote:
>
>>On November 12, 2001 at 04:46:19, Gian-Carlo Pascutto wrote:
>>
>>>On November 11, 2001 at 19:42:29, Bas Hamstra wrote:
>>>
>>>>Is there any documentation about linking Nalimov?
>>>
>>>probe.txt, which comes with the generator
>>>
>>>>I am not sure what score a probe() should return. I set up a FINE that is a mate
>>>>in 23 (verified on nalimov's online TB site). However, when my probing function
>>>>returns 32756. Some debugging in TBIndex.cpp learns that initially it found 113
>>>>that is then converted to 32756 by macro S_to_L. Doesn't seem right. Shouldn't
>>>>it just return the number of moves to mate eventually? Peeking in Crafty seems
>>>>to indicate so.
>>>
>>>I figured out the conversion formula by setting up some positions
>>>and looking at the values I got back until I figured it out.
>>>
>>>In Sjeng, it looks like this:
>>>
>>>if (tbScore == bev_broken) return KINGCAP;
>>>
>>>  EGTBHits++;
>>>
>>>  if (tbScore > 0)
>>>  {
>>>        return ((tbScore-bev_mi1)*2+INF-ply-1);
>>>  }
>>>  else if (tbScore < 0)
>>>  {
>>>        return ((tbScore+bev_mi1)*2-INF+ply);
>>>  }
>>>  return 0;
>>
>>Hi GianCarlo,
>>
>>I saw this in Crafty too. But that doesn't give me a realistic value at all.
>>However if I use L_bev_mi1 (like in ExChess) in stead it comes more in the right
>>direction. But that gives me a M13 in stead of the M23.
>>
>>(I checked in TBIndex.cpp the right squares are found)
>>
>
>M23 = ((M13-1)*2)-1
>
>If you compare this to the formula above you will see it is similar.
>
>I'm sorry I cannot be of more help, but I think the best thing
>to do is not to try to figure out how other formulas work (depends
>too much on how you represent mate scores in your program), but
>to set up a few positions where you know what the score should be,
>and look at what the probing function gives you back.
>
>By comparing the two, it should not be hard to arrive at the correct
>formula for your program. At least, thats how I did it :)
>
>--
>GCP

Here is the relevant part from Chest:

    v = L_TbtProbeTable(iTb, side, ind);
    XDB(1,  printf("= eg_probe v=%d\n", (int)v); )
    /*
     * Now, we must translate back that value into a value,
     * which we understand...
     */
    if( v == L_bev_broken ) {
        scinc(egsc.prob_broken);
        q = EGQ_DUNNO;
    }else if( v == L_bev_draw ) {
        scinc(egsc.prob_draw);
        q = EGQ_DRAW;
    }else if( v > 0 ) {                 /* wins */
        /*
         * Deeper wins have smaller values.
         */
        scinc(egsc.prob_wins);
        q = EGQ_WINS_Q(1 + (L_bev_mi1 - v));
    }else {                             /* lost */
        /*
         * Deeper losses have larger values (less negative).
         */
        scinc(egsc.prob_loss);
        q = EGQ_LOST_Q(v - L_bev_li0);
    }
    XDB(1,  printf("< eg_probe q=%d\n", (int)q); )
    return q;

EGQ_WINS_Q(N) codes "mate in N"
EGQ_LOST_Q(N) codes "is followed by mate in N"

L_bev_mi1  == "mate in 1"
L_bev_li0  == "lost in 0"

That should be a usable starting point.

Heiner



This page took 0.04 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

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