It happens to be easy with Stockfish, but disabling LMR (and related ideas) need not be so easy.
For instance, in IvanHoe, not only is there LMR, but also various "ignore this move" futility conditions. I don't how much these "extended futility checks" interact with LMR.
Here are some relevant parts (I chose
all_node.c):
Code: Select all
if (cnt > 5 && NextMove->phase == ORDINARY_MOVES
&& (move & 0xe000) == 0 && SqSet[fr] & ~MyXRAY && depth < 20)
{
if ((5 << (depth - 6)) + MAX_POSITIONAL (move) +
(POS0->Value) < VALUE + 35 + 2 * cnt)
{
cnt++;
continue;
}
}
if (depth < 20 && (2 << (depth - 6)) + (POS0->Value) < VALUE + 125
&& NextMove->phase == ORDINARY_MOVES && MyKingSq != fr
&& SqSet[fr] & ~MyXRAY && (move & 0x8000) == 0
&& !MySEE (POSITION, move))
{
cnt++;
continue;
}
Those are "pre-make" futile conditions. There is also one after the make_move:
Code: Select all
if (cnt > 5 && depth < 20 && POS1->cp == 0
&& (2 << (depth - 6)) - POS1->Value < VALUE + cnt - 15)
{
UNDO (POSITION, move);
cnt++;
continue;
}
Finally there is the LMR proper:
Code: Select all
if (NextMove->phase == ORDINARY_MOVES && cnt >= 3)
{
new_depth = depth - 2 + EXTEND - BSR (1 + cnt);
/* usa BSR32 con 32-bits ? */
if (QSEARCH_CONDITION)
v = -OppQsearch (POSITION, 1 - VALUE, 0);
else if (LOW_DEPTH_CONDITION)
v = -OppLowDepth (POSITION, 1 - VALUE, new_depth);
else
v = -OppCut (POSITION, 1 - VALUE, new_depth);
if (v < VALUE)
goto DONE;
}
Given that "cnt > 5" is a condition with the first/third futility checks, there might be some overlap with LMR. To further complicate matters,
low_depth search has no explicit LMR (to my eye), and varies these futility checks (also, when
depth is more than maybe 12 half-ply in the above, I think the conditions become almost always false).