What's Your Engine's Maximum LMR Reduction?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: What's Your Engine's Maximum LMR Reduction?

Post by Henk »

op12no2 wrote:My soul is already sold and we don't have chickens - but we do have lot's of sheep around here - I may try that before HGM's next tourney...

FWIW my LMR is very basic - I'm trying to creep up on it with lots of testing.

Currently R=1 if: numMovesTried > 2 && depth >= 3 && !inCheck && !givesCheck && !(hash||promote||capture||killer||castle).

That's it. The >=3 is so it doesn't drop into QSearch (I do the same with NMP).

I think I came up with numMovesTried > 2 from measuring the average move number that beta cutoffs happen at - which was 1.x. Need to try > 1 as well in LMR.
For those about to .. We salute you.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: What's Your Engine's Maximum LMR Reduction?

Post by Ferdy »

op12no2 wrote:My soul is already sold and we don't have chickens - but we do have lot's of sheep around here - I may try that before HGM's next tourney...

FWIW my LMR is very basic - I'm trying to creep up on it with lots of testing.

Currently R=1 if: numMovesTried > 2 && depth >= 3 && !inCheck && !givesCheck && !(hash||promote||capture||killer||castle).

That's it. The >=3 is so it doesn't drop into QSearch (I do the same with NMP).

I think I came up with numMovesTried > 2 from measuring the average move number that beta cutoffs happen at - which was 1.x. Need to try > 1 as well in LMR.
Basically started from this.
Reduction = 0.3 * e ^(0.112*legal_move)
The fun is in the tuning. The legal move is just the numMovesTried.

Image
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: What's Your Engine's Maximum LMR Reduction?

Post by Daniel Anulliero »

Actually my LMR is :

reduce 2 plys if movescount > 5 else reduce one ply
conditions :
ok to reduce if :
depth >=3
no give check
"quiet" move (how is a move quiet) ? :wink:
!PV
not the moves extended (pawn on 7th move , incheck)

Oh yes .. I skip (again) my tests from this topic :
http://talkchess.com/forum/viewtopic.php?t=55526

Because I found a bad bug in my passers eval ..
Now I'm running a self test
Isa "HGM tourney" vs Isa "passers bug fix"
The bug fix version have 58% after 500 games (TC 10s + 0.3)
We'll see ...
brtzsnr
Posts: 433
Joined: Fri Jan 16, 2015 4:02 pm

Re: What's Your Engine's Maximum LMR Reduction?

Post by brtzsnr »

Reduction = 0.3 * e ^(0.112*legal_move)
Strange reduction formula. How did you come up with it?
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: What's Your Engine's Maximum LMR Reduction?

Post by Dann Corbit »

brtzsnr wrote:
Reduction = 0.3 * e ^(0.112*legal_move)
Strange reduction formula. How did you come up with it?
Looks to me like it is driven by mobility.
The more probable is Zugzwang, the lower the reduction.
When you have many, many choices, the reduction becomes large.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's Your Engine's Maximum LMR Reduction?

Post by bob »

Dann Corbit wrote:
brtzsnr wrote:
Reduction = 0.3 * e ^(0.112*legal_move)
Strange reduction formula. How did you come up with it?
Looks to me like it is driven by mobility.
The more probable is Zugzwang, the lower the reduction.
When you have many, many choices, the reduction becomes large.
LMR really isn't influenced by zugzwang, that's null-move's issue. LMR just reduces the depth. Being in zugzwang doesn't really do anything pro or con. The general idea is that at an ALL node, the more moves you search, the lower the probability of failing high, so you ramp up the reductions to get through 'em that much quicker.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's Your Engine's Maximum LMR Reduction?

Post by bob »

Steve Maughan wrote:I'm working on improving Maverick's LMR.

Suppose you have a depth of 10 ply remaining in the search (e.g. you're doing a 20 ply search and you have 10 ply remaining).

What is the maximum reduction you'd make? And what are the conditions for that reduction?

- Steve
This is a compressed version of my LMR reduction array. # moves searched across the top, remaining depth down left hand side, every other row (depth) is omitted in this shortened output, three of every 4 columns are also omitted to keep this short. (This is output from crafty "lmr" command which can be used to adjust this matrix easily):

Code: Select all

                 LMR reductions[depth][moves]
  ----------------------moves searched-----------------
 |       2  6 10 14 18 22 26 30 34 38 42 46 50 54 58 62
 |  3:   1  1  1  1  1  1  1  1  1  1  1  1  1  1  1  1
 |  5:   1  1  2  2  2  2  2  3  3  3  3  3  3  3  3  3
 d  7:   1  1  2  2  3  3  3  3  3  3  3  4  4  4  4  4
 e  9:   1  2  2  3  3  3  3  3  4  4  4  4  4  4  4  4
 p 11:   1  2  2  3  3  3  3  4  4  4  4  4  4  4  4  5
 t 13:   1  2  2  3  3  3  4  4  4  4  4  4  5  5  5  5
 h 15:   1  2  3  3  3  4  4  4  4  4  5  5  5  5  5  5
   17:   1  2  3  3  4  4  4  4  4  5  5  5  5  5  5  5
 l 19:   1  2  3  3  4  4  4  4  5  5  5  5  5  5  5  5
 e 21:   1  2  3  3  4  4  4  5  5  5  5  5  5  5  6  6
 f 23:   1  2  3  4  4  4  4  5  5  5  5  5  5  6  6  6
 t 25:   1  2  3  4  4  4  5  5  5  5  5  5  6  6  6  6
 | 27:   1  2  3  4  4  4  5  5  5  5  5  6  6  6  6  6
 | 29:   1  2  3  4  4  4  5  5  5  5  6  6  6  6  6  6
 | 31:   1  2  3  4  4  5  5  5  5  5  6  6  6  6  6  6
    note:  table is shown compressed, each index is in
    units of 1, all rows/columns are not shown above
My array is reductions[depth][moves], or reductions[32][64]. I might go to 64x64 although this has been the best results so far (been using this maybe a year with very minor tuning).

I don't do LMR until I start searching history-ordered moves, or beyond. No LMR on hash move, good captures, or killers, nor while in check, and not on any move that is a non-losing check (those are the only moves I extend in fact).
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: What's Your Engine's Maximum LMR Reduction?

Post by bob »

BTW, one thing I can guarantee. You can NOT tune this stuff with 10s +0.1s type games. We've been tuning null-move parameters, and until you get to something decent (5m+5s or so) you won't get anything useful tuning-wise. Some things look bad (particularly in self-play), some things look break-even. But at decent time controls, some of this will actually start to work. But it takes a ton of testing time.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: What's Your Engine's Maximum LMR Reduction?

Post by Ferdy »

brtzsnr wrote:
Reduction = 0.3 * e ^(0.112*legal_move)
Strange reduction formula. How did you come up with it?
Excel can generate a formula given a graph - linear, power, exponential, polynomial and others.

Can also do regression easily like the following, given STS test suite score
percentage give a formula that would estimate its rating comparable to that of CCRL 40/4.

STS rating = 44.657 * scorePercentage - 252.22

Image
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: What's Your Engine's Maximum LMR Reduction?

Post by lucasart »

brtzsnr wrote:
Reduction = 0.3 * e ^(0.112*legal_move)
Strange reduction formula. How did you come up with it?
dubious...

better concave than convex IMO.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.