I do not know if this tip works but I noticed that glaurung has the following code:kaustubh wrote:I have glaurung source , can anyone give me any tips for making changes in the source.
Code: Select all
if(moveCount == 1)
value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1, threadID);
else {
if(UseLMR && depth >= 2*OnePly && !isCheck && ext == Depth(0)
&& moveCount >= 7 && !moveIsCapture && !move_promotion(move)
&& !moveIsPassedPawnPush && !move_is_castle(move)
&& H.ok_to_reduce(pos.piece_at(move_to(move)), move)) {
ss[ply].reduction = OnePly;
value = -search(pos, ss, -alpha, newDepth-OnePly, ply+1, true,
threadID);
}
else value = alpha + 1;
if(value > alpha) {
ss[ply].reduction = Depth(0);
value = -search(pos, ss, -alpha, newDepth, ply+1, true, threadID);
if(value > alpha && value < beta)
value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1,
threadID);
}
}
1)Is it a good idea to have 2 similiar functions and writing the code twice
Namely search_pv and search?
2)In case that reduced move fail high glaurung does not research with alpha beta but with alpha and alpha+1 and only if the second search fail high again it researches with alpha and beta.
I wonder if it is a good idea to do it.
After fail high with alpha+1 you can expect another fail high so the question is if there is a reason to spend time on 2 researches instead of one research.
Uri