late move reduction

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

flok

late move reduction

Post by flok »

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.
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: late move reduction

Post by Henk »

Skipper reduces all non captures (idea from Muller).
flok

Re: late move reduction

Post by flok »

Henk wrote:Skipper reduces all non captures (idea from Muller).
And what gain did that give? Did you "measure" the elo rating change?
Henk
Posts: 7220
Joined: Mon May 27, 2013 10:31 am

Re: late move reduction

Post by Henk »

I don't measure ELO. I remember it is a gain. Probably less than 100 ELO.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: late move reduction

Post by tpetzke »

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%.
Last edited by tpetzke on Thu Jan 21, 2016 3:33 pm, edited 1 time in total.
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
User avatar
hgm
Posts: 27814
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: late move reduction

Post by hgm »

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?
You forget to mention the most important aspect:

When the move scores above alpha, you don't reduce it.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: late move reduction

Post by tpetzke »

When the move scores above alpha, you don't reduce it.
You mean "when the reduced search for a move scores above alpha you search it to full depth", don't you
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
flok

Re: late move reduction

Post by flok »

hgm wrote:
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?
You forget to mention the most important aspect:

When the move scores above alpha, you don't reduce it.
Ah darn, that must be 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!
User avatar
hgm
Posts: 27814
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: late move reduction

Post by hgm »

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.
flok

Re: late move reduction

Post by flok »

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.
Right!

It was in the code but I had:

Code: Select all

                                if &#40;score < alpha && reduction&#41;
                                        score = -search&#40;...);
instead of:

Code: Select all

                                if &#40;score > alpha && reduction&#41;
                                        score = -search&#40;...);