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

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Rebel
Posts: 4148
Joined: Thu Aug 18, 2011 10:04 am

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

Post by Rebel » Mon May 01, 2017 12:30 am

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: 3607
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

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

Post by Ferdy » Mon May 01, 2017 1:39 am

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: 4148
Joined: Thu Aug 18, 2011 10:04 am

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

Post by Rebel » Mon May 01, 2017 6:18 am

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: 755
Joined: Mon Jan 15, 2007 10:23 am
Location: Warsza
Contact:

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

Post by PK » Mon May 01, 2017 6:20 am

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: 2047
Joined: Sat Jan 18, 2014 9:24 am
Location: Andorra
Contact:

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

Post by cdani » Mon May 01, 2017 8:19 am

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: 4148
Joined: Thu Aug 18, 2011 10:04 am

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

Post by Rebel » Mon May 01, 2017 1:27 pm

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: 4148
Joined: Thu Aug 18, 2011 10:04 am

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

Post by Rebel » Mon May 01, 2017 1:31 pm

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: 260
Joined: Sat Aug 06, 2016 6:31 pm
Location: United States

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

Post by zenpawn » Mon May 01, 2017 9:51 pm

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: 426
Joined: Fri Jan 16, 2015 3:02 pm
Contact:

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

Post by brtzsnr » Mon May 01, 2017 11:43 pm

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: 4148
Joined: Thu Aug 18, 2011 10:04 am

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

Post by Rebel » Tue May 02, 2017 6:43 am

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.

Post Reply