calculating statistics about tablebases
Posted: 12 Feb 2005, 13:57
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
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