LMR revisited.

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: LMR revisited.

Post by Desperado »

this is the way i tested it (hope the pseudocode is good enough)

Code: Select all


search()
{
...
	 bool use_lmr = false;

	 if(ntyp == NODE_ALL && rdp>2 && !ick && cdp>3)
		{
		 //test "best" move known for alpha bound
		 if(tt_mve!=movenone)
			{
			 ndp = newdepth(tid,brd,lmove,tt_mve,rdp,cdp,ick,alpha,beta,vstatic,ntyp);

			 move_do(brd,undo,tt_mve);
			 vcur = -search(tid,brd,-alpha-1,-alpha,ndp-2,cdp+1,npv,NODE_CUT,tt_mve);
			 move_undo(brd,undo);

			 if&#40;vcur <= alpha&#41;
				&#123;
				 use_lmr = true; //or setting conditions you like 
                    (- maybe return&#40;alpha&#41;
                     - maybe set percentage level for hscores
                     - maybe switch from "early-late"move to "late-late"move reduction...)
				&#125;
			&#125;
		&#125;

...

   while&#40;moves && !cut&#41;
    &#123;
      ...

    //HISTORY REDUCTION&#40;LMR&#41;
    //--------------------------------------

    // your pruning mechanics...
    //in my case
   
    if&#40;use_lmr&#41;
    if&#40;all_conditions_are_true&#41;
        continue;

    ....
   &#125;

...

&#125;//end search		 
So i am doing something similar like IID, but restricted to the tt_mve,
and on allnodes.Not locking the mechanics in the subtree.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: LMR revisited.

Post by bob »

Another test done. For the record, reducing captures is bad. After 16,000 games, it is about 20 Elo down from the normal version, which means about 1/2 the effectiveness of LMR in general has been lost. So this idea is a flop on the first cut. Next test is reducing captures with a SEE > 0 as those are likely easy moves to refute a prior ply.

More later.

My original hope was that one could reduce moves (or not) based on information gleaned from the search. That appears to be wrong. It appears that perhaps there is improvement left if one uses some selectivity based on the characteristics of the move itself. I don't reduce positions where I am in check. I am going to try with this removed. I am also trying right now with the passed pawn push moves included in the reducible set as well. First thing is to carefully identify which move types need to avoid reductions, and then add to this.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: LMR revisited.

Post by Greg Strong »

I'd like to suggest something that both (A) you've probably tried, and (B) is heading in totally the opposite direction of your current move towards greater reductions ... Have you tried not reducing any pawn moves at all? Or reducing them only half a ply instead of a full ply?

In Quadrox, I've noticed that any reductions of pawn moves at all makes it weaker (even excluding passed-pawn moves.) Of course, Quadrox is not nearly as strong as Crafty, and has a couple of unusual design decisions.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: LMR revisited.

Post by bob »

Greg Strong wrote:I'd like to suggest something that both (A) you've probably tried, and (B) is heading in totally the opposite direction of your current move towards greater reductions ... Have you tried not reducing any pawn moves at all? Or reducing them only half a ply instead of a full ply?

In Quadrox, I've noticed that any reductions of pawn moves at all makes it weaker (even excluding passed-pawn moves.) Of course, Quadrox is not nearly as strong as Crafty, and has a couple of unusual design decisions.
I can no longer reduce by a half-ply since I removed fractional extensions a few months back, but I can certainly try not reducing pawn moves at all...
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: LMR revisited.

Post by Greg Strong »

bob wrote:
Greg Strong wrote:I'd like to suggest something that both (A) you've probably tried, and (B) is heading in totally the opposite direction of your current move towards greater reductions ... Have you tried not reducing any pawn moves at all? Or reducing them only half a ply instead of a full ply?

In Quadrox, I've noticed that any reductions of pawn moves at all makes it weaker (even excluding passed-pawn moves.) Of course, Quadrox is not nearly as strong as Crafty, and has a couple of unusual design decisions.
I can no longer reduce by a half-ply since I removed fractional extensions a few months back, but I can certainly try not reducing pawn moves at all...
Cool. I'm interested to hear :) Reducing them by a half ply wasn't a winner for me anyway. Any pawn move reductions weakened me.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: LMR revisited.

Post by bob »

Greg Strong wrote:
bob wrote:
Greg Strong wrote:I'd like to suggest something that both (A) you've probably tried, and (B) is heading in totally the opposite direction of your current move towards greater reductions ... Have you tried not reducing any pawn moves at all? Or reducing them only half a ply instead of a full ply?

In Quadrox, I've noticed that any reductions of pawn moves at all makes it weaker (even excluding passed-pawn moves.) Of course, Quadrox is not nearly as strong as Crafty, and has a couple of unusual design decisions.
I can no longer reduce by a half-ply since I removed fractional extensions a few months back, but I can certainly try not reducing pawn moves at all...
Cool. I'm interested to hear :) Reducing them by a half ply wasn't a winner for me anyway. Any pawn move reductions weakened me.
Queued up. Should have results tomorrow.
Uri Blass
Posts: 10282
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: LMR revisited.

Post by Uri Blass »

I wonder if you tried not reducing only when you are close to the root(in other words not reducing the first n plies for different values of n)

I understood that you tried not reducing close to the leaves and it had a negative influence.

Uri
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: LMR revisited.

Post by bob »

Uri Blass wrote:I wonder if you tried not reducing only when you are close to the root(in other words not reducing the first n plies for different values of n)

I understood that you tried not reducing close to the leaves and it had a negative influence.

Uri
Done. Even tried a percentage such as N% where N could be 10, 20, ... (100% would disable LMR of course). Was worse in every case...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: LMR revisited.

Post by bob »

Final result, -15 Elo. So far, nothing has helped...
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: LMR revisited.

Post by Kempelen »

Another stupid idea came to me mind: what about to reduce moves does goes backward? i.e, for white side those with goes from file>4 to a file<=2 . Even maybe with a few more conditions to recognize a useless moves
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/