using the new tablebase code of nalimov

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

using the new tablebase code of nalimov

Postby Uri Blass » 08 Mar 2005, 19:48

I got good advice how to use the old code of nalimov

see http://wbforum.volker-pittlik.name/view ... sc&start=0

Now my question is what exactly I need to replace to use the new code of nalimov.

I already have the function in the bottom of this post in order to probe the nalimov tablebases and all I miss is relevant new files tbdecode.h and tbindex.cpp that I can compile with no errors.

If someone can help me to give me instruction what files to use exactly it can be productive(I guess that the files are the same for all programs but I am afraid that I need to modify the files of nalimov that I have in order not to have error).

The instructions that dieter gave were already instruction for modificationof crafty (I followed them without understanding) and I want to know what modification is needed to be done and what is the reason to modify(I would like simply to add specific files without modification and I wonder if there is a reason that Nalimov did not give files that programmers can simply add to their program and after it defining the relevant function to probe egtb)

Uri


static int probe_egtb(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;
}
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: using the new tablebase code of nalimov

Postby Anonymous » 11 Mar 2005, 00:55

Uri Blass wrote:Now my question is what exactly I need to replace to use the new code of nalimov.


You need to do the same steps, as with the older source - where you seemed to succeed. I gave a "context diff", which shows the lines, that I needed to change, together with line numbers. The reason for the context are: line numbers may change easily (for example add a comment ...), but with a small context, the change is still clear. Probably you will only need the change around lock.h. Probing should not have changed.

Regards,
Dieter
Anonymous
 


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 30 guests