Thank you for your reply.
Daniel Shawul wrote:I have spent quite some time with how to make progress with bitbases alone. Here is a summary. For further info, look into scorpio source code.
I have known Scorpio and its bitbase for long time (I have read almost all posts about bitbases on this forum, including Scorpio). But still delay looking into its code, just to keep my mind fresh. Definitely I will study it later. Thank for publishing it.
a) First you have to convet the WDL score into something that differentiates b/n won positions. I do this in egbbprobe.dll. Eg. 4 men are a 1000 points better than 5 men, higher material difference is better than lower, passed pawn ranks etc...
Very good idea and details. Just hope that mine will be simpler because for first try, I will keep all 4 men as normal (full DTM values - not bitbase) so my search can stop right at 4 men and I can delay implementing a such complicated score system.
In short I have a lot of heuristics and these combined with the rest had made it almost a perfect solver without tbs.
Amazing, do you mean you don't need any endgame file at all?
b) Integrate PLY into the score. This is like we do it for mates but the ply is multiplied by a factor so say 40 * PLY. So shorter wins are preferred.
Good point!
c) Do not probe bitbases within the first 2/3 * search_depth. Without this you will not be able to make progress when the position is already a 5 men. This applies whether in normal or qsearch.
Very helpful idea. My first attempts of searching have just crashed because of too many probes.
d) Captures , promotions and pawn moves (those that zero 50-move counter) allow probing anywhere even in the 2/3 zone. We are definately making progress here.
e) ... Not necessary for making progress, but I also filter root moves based on bitbase score to make move rapidly when there is one move left.
Not very clear at this point. Do you mean you will make that move if it is the best?
How about if at root, you have some winning moves, some draws, and some losses? Probe and search only few winning moves still save a lot of time, right?
Maybe some others that I forget. Anyway here is the code for probing bitbases in scorpio. The code for scoring the position is too long so I recommend you look in egbbprobe.cpp if you are interested
Code: Select all
bool SEARCHER::bitbase_cutoff() {
#ifdef EGBB
/*
. Cutoff tree only if we think "progress" is being made
. after captures
. after pawn moves
. or just after a certain ply (probe_depth)
*/
if( egbb_is_loaded
&& all_man_c <= 5
&& (ply >= probe_depth
|| is_cap_prom((pstack - 1)->current_move)
|| PIECE(m_piece((pstack - 1)->current_move)) == pawn
)
) {
/*
Probe bitbases at leafs ,only if they are loaded in RAM
*/
register int score;
if((ply <= probe_depth
|| (egbb_load_type >= 1 && all_man_c <= 4)
|| egbb_load_type == 3)
&& probe_bitbases(score)
) {
egbb_probes++;
/*prefer wins near root*/
if(score > 0)
score -= WIN_PLY * (ply + 1);
else if(score < 0)
score += WIN_PLY * (ply + 1);
pstack->best_score = score;
return true;
}
}
#endif
/*
. no cutoff
*/
return false;
}
Thanks again for your ideas and code!