Hi,
Just be sure am I right that LMR works as follows:
- you find the moves for a position
- sort them
- then, the first 5 or 6 are searched full-depth
- the ones after that with reduced depth (currentDepth -2 for the first and currentDepth * 0.66 for the following) when:
- the move is not a kill move (not killing an opponent piece)
- the move is not a promotion
- the current position has no king under attack
- the currentDepth >= 3
Am I right?
Because my program plays far worse (almost 100 elo points) than the one without LMR.
late move reduction
Moderators: hgm, Rebel, chrisw
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: late move reduction
Skipper reduces all non captures (idea from Muller).
Re: late move reduction
And what gain did that give? Did you "measure" the elo rating change?Henk wrote:Skipper reduces all non captures (idea from Muller).
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: late move reduction
I don't measure ELO. I remember it is a gain. Probably less than 100 ELO.
-
- Posts: 686
- Joined: Thu Mar 03, 2011 4:57 pm
- Location: Germany
Re: late move reduction
Hi,
the conditions what reductions to apply to what moves is subject to tuning. It is not trivial. Overall your description seems okish, however the factor 0,66 can lead to huge reductions for higher depths.
Obviously LMR will not work at all if your move ordering is bad, so maybe this is an indication to work on move ordering first which will give you an ELO boost even without LMR.
As an measurement of move order quality you could measure how often you get a fail high on the first move if there is a fail high in that node. You want that to be over 90%.
the conditions what reductions to apply to what moves is subject to tuning. It is not trivial. Overall your description seems okish, however the factor 0,66 can lead to huge reductions for higher depths.
Obviously LMR will not work at all if your move ordering is bad, so maybe this is an indication to work on move ordering first which will give you an ELO boost even without LMR.
As an measurement of move order quality you could measure how often you get a fail high on the first move if there is a fail high in that node. You want that to be over 90%.
Last edited by tpetzke on Thu Jan 21, 2016 3:33 pm, edited 1 time in total.
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: late move reduction
You forget to mention the most important aspect:flok wrote:Just be sure am I right that LMR works as follows:
- you find the moves for a position
- sort them
- then, the first 5 or 6 are searched full-depth
- the ones after that with reduced depth (currentDepth -2 for the first and currentDepth * 0.66 for the following) when:
- the move is not a kill move (not killing an opponent piece)
- the move is not a promotion
- the current position has no king under attack
- the currentDepth >= 3
Am I right?
When the move scores above alpha, you don't reduce it.
-
- Posts: 686
- Joined: Thu Mar 03, 2011 4:57 pm
- Location: Germany
Re: late move reduction
You mean "when the reduced search for a move scores above alpha you search it to full depth", don't youWhen the move scores above alpha, you don't reduce it.
Re: late move reduction
Ah darn, that must be it.hgm wrote:You forget to mention the most important aspect:flok wrote:Just be sure am I right that LMR works as follows:
- you find the moves for a position
- sort them
- then, the first 5 or 6 are searched full-depth
- the ones after that with reduced depth (currentDepth -2 for the first and currentDepth * 0.66 for the following) when:
- the move is not a kill move (not killing an opponent piece)
- the move is not a promotion
- the current position has no king under attack
- the currentDepth >= 3
Am I right?
When the move scores above alpha, you don't reduce it.
So to be really sure: if the rules I gave are matching I do a reduced depth search. But if the result of that is above alpha, then I do a re-search but with full depth, right?
thanks!
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: late move reduction
Indeed, you have to re-search. (Or set them up to self-deepen in a more efficient implementation.) Moves that score above alpha would be hash move next time you visit the node, (if you won't find an even better move amongst the late moves), and you don't want to reduce the hash move. It might even become the PV, and if there is anything you don't want to reduce it is the PV.
Re: late move reduction
Right!hgm wrote:Indeed, you have to re-search. (Or set them up to self-deepen in a more efficient implementation.) Moves that score above alpha would be hash move next time you visit the node, (if you won't find an even better move amongst the late moves), and you don't want to reduce the hash move. It might even become the PV, and if there is anything you don't want to reduce it is the PV.
It was in the code but I had:
Code: Select all
if (score < alpha && reduction)
score = -search(...);
Code: Select all
if (score > alpha && reduction)
score = -search(...);