LMR = 0;
if (i > LMR_N && // only try late moves i> 4
iscapture[realdepth - 1] == 0 && // don't try on captures
depth > LMR_MINDEPTH && // only if some depth is remaining
ischeck[realdepth - 1] == 0 && // not if we are moving out of a check
ispawnpush[realdepth -1] == 0 && // not for passed pawn pushes
ispv == 0 // not for the pv
// TODO: promotions have to be exempt! but this is such a rare occasion that it shouldn't matter
) {
// LMR candidate - check if we are in check
if (p->sidetomove == WHITE && !(isattacked(p, p->wking, BLACK)))
LMR = LMR_REDUCE;
if (p->sidetomove == BLACK && !(isattacked(p, p->bking, WHITE)))
LMR = LMR_REDUCE;
Now I wonder: since reductions are sort of inverted extensions, and LMR reduces all kinds of moves but not checks, and not captures, and not pawn pushes, do I still need these check/recapture/pawnpush extensions or not? Do you still have them?
LMR = 0;
if (i > LMR_N && // only try late moves i> 4
iscapture[realdepth - 1] == 0 && // don't try on captures
depth > LMR_MINDEPTH && // only if some depth is remaining
ischeck[realdepth - 1] == 0 && // not if we are moving out of a check
ispawnpush[realdepth -1] == 0 && // not for passed pawn pushes
ispv == 0 // not for the pv
// TODO: promotions have to be exempt! but this is such a rare occasion that it shouldn't matter
) {
// LMR candidate - check if we are in check
if (p->sidetomove == WHITE && !(isattacked(p, p->wking, BLACK)))
LMR = LMR_REDUCE;
if (p->sidetomove == BLACK && !(isattacked(p, p->bking, WHITE)))
LMR = LMR_REDUCE;
Now I wonder: since reductions are sort of inverted extensions, and LMR reduces all kinds of moves but not checks, and not captures, and not pawn pushes, do I still need these check/recapture/pawnpush extensions or not? Do you still have them?
cheers
Martin
I removed everything but check extensions a couple of years back. Was an Elo gain to do so. Removing check extension hurt, however... Although I found another Elo gain by not extending checks that SEE says loses material...
hgm wrote:Would it help to extend checks and do LMR on them? I.e. only extend if they beat alpha?
I assume you mean, reduce losing checks? That sounds like a reasonable idea but most engines don't do that. (Mine doesn't either although it is a little hard to see why in the code .. I only reduce moves that are in the "history phase" of move generation, and check evasions have no such phase). Last I tried it was not an improvement.
Well, you would only know they are losing after you searched them. So what I mean is reducing all checks (possibly by 0 ply), and then re-search them with an extension if they score above alpha. Just as with any LMR'ed move. Another way to describe this as applying normal LMR after you have given the extension.
hgm wrote:Well, you would only know they are losing after you searched them. So what I mean is reducing all checks (possibly by 0 ply), and then re-search them with an extension if they score above alpha. Just as with any LMR'ed move. Another way to describe this as applying normal LMR after you have given the extension.
Sounds worth testing, but not something I have done...
bob wrote:
I removed everything but check extensions a couple of years back. Was an Elo gain to do so. Removing check extension hurt, however... Although I found another Elo gain by not extending checks that SEE says loses material...
Thanks for sharing. It seems to have done my engine a world of good
How big is your LMR_REDUCE? I am only using one for now. I've tried 4-5 variations of LMR and they always perform significantly worse (60-80 ELO) than my baseline without LMR.