Page 1 of 1

calculating statistics about tablebases

PostPosted: 12 Feb 2005, 13:57
by Uri Blass
I have significant problems in calculating statistics about tablebases.

The main problem is that movei is unable to identify broken positions correctly so having a loop on all the positions does not give correct results

I thought to identify broken positions simply based on all possible fen and do a loop on all fen but it seems that it is not so simple.

I remember that dieter suggested that I use the nalimov tablebases to debug knowledge about rules for kbpk with blind bishop but unfortunately I was unable to do it because I did not want to write special function that does a loop only on the positions of KBPK vs K but to have a function that enable me to do a loop on every tablebase position.

Here is my function to probe tablebases and I wonder if there is something wrong in it because it seems that value=bev_broken never happens(even when the distance between the kings is 1)

static int probe_egtb2(POSITION2 *pos,int *score)
{
int idx_tb;
int invert;
int value;
int side;
square *wp,
*bp;
int ep;
INDEX idx;
if (pos->castling_state)
return 0;
if (pos->numpieces>table_pieces)
return 0;
idx_tb = IDescFindFromCounters(pos->piece_count);
if (idx_tb==0)
return 0;

if (idx_tb > 0)
{
side = pos->stm;
invert = 0;
wp = pos->white_squares;
bp = pos->black_squares;
} else {
side = pos->stm ^ 1;
invert = 1;
wp = pos->black_squares;
bp = pos->white_squares;
idx_tb = -idx_tb;
}
if (!FRegisteredFun(idx_tb, side))
return 0;
ep = (pos->eps > 0) ? pos->eps : XX; /* Careful, see comment in
* setboard Note that pos
* uses "Nalimov squares" for
* ep already */
idx = PfnIndCalcFun(idx_tb, side) (wp, bp, ep, invert);
value = L_TbtProbeTable(idx_tb, side, idx);
if (value == bev_broken)
return 0;
*score = value;
return 1;
}

Uri

Re: calculating statistics about tablebases

PostPosted: 12 Feb 2005, 15:50
by GeoffW
Hi Uri

Sorry dont know anything about TB's to help you out, but if you could post code snippets with the code tag on it would be so much easier to read and understand.
Just highlight the code section after you paste then click on the code button. Thanks

Regards Geoff

Re: calculating statistics about tablebases

PostPosted: 13 Feb 2005, 12:59
by Anonymous
I had a fast look at the source code of Nalimov. It expects, not to be called with illegal positions by default.

If you add at the start of tbindex.cpp

#define ILLEGAL_POSSIBLE 1

it might work as you expected it. It will be slightly slower. Expect totally wrong values returned otherwise.

Regards,
Dieter