LMR - [for starters] - [Advance] and [Expert]

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

LMR - [for starters] - [Advance] and [Expert]

Post by Rebel »

Two LMR versions (for starters) and one Advanced, my current system. I am interested in feedback naturally but most in similar LMR pseudo code from others. Which with permission I can put on my web site. Could be a good learning experience.

http://rebel13.nl/rebel13/blog/lmr%20advanced.html
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: LMR - [for starters] - [Advance] and [Expert]

Post by Ferdy »

Rebel wrote:Two LMR versions (for starters) and one Advanced, my current system. I am interested in feedback naturally but most in similar LMR pseudo code from others. Which with permission I can put on my web site. Could be a good learning experience.

http://rebel13.nl/rebel13/blog/lmr%20advanced.html
Interesting.

Code: Select all

a=depth; b=movecount; if (b>63) b=63;
Is the movecount the moves that were already made or the sequence of the sorted move list?

In

Code: Select all

 if (score > ALPHA+margin) R--; 
What composes the score?
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: LMR - [for starters] - [Advance] and [Expert]

Post by Rebel »

Ferdy wrote:
Rebel wrote:Two LMR versions (for starters) and one Advanced, my current system. I am interested in feedback naturally but most in similar LMR pseudo code from others. Which with permission I can put on my web site. Could be a good learning experience.

http://rebel13.nl/rebel13/blog/lmr%20advanced.html
Interesting.

Code: Select all

a=depth; b=movecount; if (b>63) b=63;
Is the movecount the moves that were already made or the sequence of the sorted move list?
The first.
In

Code: Select all

 if (score > ALPHA+margin) R--; 
What composes the score?
Evaluation score, changed the page, that was indeed a bit unclear.
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: LMR - [for starters] - [Advance] and [Expert]

Post by PK »

have You tried dividing history by eight at the beginning of a new search and zeroing it only when the game starts?
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: LMR - [for starters] - [Advance] and [Expert]

Post by cdani »

Thanks! I can add for example that late moves in endgames can be reduced a bit more, at least for Andscacs.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: LMR - [for starters] - [Advance] and [Expert]

Post by Rebel »

PK wrote:have You tried dividing history by eight at the beginning of a new search and zeroing it only when the game starts?
Makes sense, will try.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: LMR - [for starters] - [Advance] and [Expert]

Post by Rebel »

cdani wrote:Thanks! I can add for example that late moves in endgames can be reduced a bit more, at least for Andscacs.
I know what you mean, create a second more tight "lmr_tab" for the endgame due to the decreasing number of legal moves. Or something like that.
zenpawn
Posts: 349
Joined: Sat Aug 06, 2016 8:31 pm
Location: United States

Re: LMR - [for starters] - [Advance] and [Expert]

Post by zenpawn »

In your pseudocode, does "move produces a better score" mean a beta cutoff, i.e, score >= beta (that's where I currently increment my history table) or score > alpha? Thanks.
brtzsnr
Posts: 433
Joined: Fri Jan 16, 2015 4:02 pm

Re: LMR - [for starters] - [Advance] and [Expert]

Post by brtzsnr »

Thank you for the ideas, Ed. By comparison my LMR logic is very primitive. All my attempts to improve further have failed, but I see a lot of good ideas in your post.

Code: Select all

                // Late move reduction: search best moves with full depth, reduce remaining moves.
                lmr := int32(0)
                if !sideIsChecked && depth > lmrDepthLimit && !critical {
                        // Reduce quiet moves and bad captures more at high depths and after many quiet moves.
                        // Large numMoves means it's likely not a CUT node.  Large depth means reductions are less risky.
                        if move.IsQuiet() {
                                lmr = 2 + min(depth, numMoves)/6
                        } else if seeSign(pos, move) {
                                lmr = 1 + min(depth, numMoves)/6
                        }
                }

User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: LMR - [for starters] - [Advance] and [Expert]

Post by Rebel »

zenpawn wrote:In your pseudocode, does "move produces a better score" mean a beta cutoff, i.e, score >= beta (that's where I currently increment my history table) or score > alpha? Thanks.
Score > alpha works a little bit better for me.