futility pruining, razoring question

Discussion of chess software programming and technical issues.

Moderator: Ras

mar
Posts: 2659
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: futility pruining, razoring question

Post by mar »

elcabesa wrote: talking about Razoring

Code: Select all

if(!isCheck && beta ==alpha+1 && depth<=3 && abs(beta) < CHECKMATESCORE - 1000){

	int score=board.eval();

        if ( score + razoringMargin(depth) < alpha )
        {

            int res = qsearch( ply, alpha-razoringMargin(depth), beta - razoringMargin(depth) );
           if (res - razoringMargin(depth) <= alpha)   
             return score; 
        }
    }
}

what still I havent' understood is how big could be razorMargin.
I guess it should be:

Code: Select all

if(!isCheck && beta ==alpha+1 && depth<=3 && abs(beta) < CHECKMATESCORE - 1000){

	int score=board.eval();

        if ( score + razoringMargin(depth) < alpha )
        {

            int res = qsearch( ply, alpha-razoringMargin(depth), beta - razoringMargin(depth) );
           if (res + razorMargin(depth) <= alpha )   
             return score; // or res or alpha
        }
    }
}
as for razormargin, i guess you are looking for values between 1 to 4 pawns. Best is to test which values are optimal for your engine.
I tried to measure razoring success for static margin of a minor piece in my engine and got something like 99.5% success rate, which means in 0.5% it razored cut nodes instead of all nodes; but it will depend on a type of position. In balanced positions it will be much closer to 100%. My guess is that you can try lower margin when you are closer to the leafs.
I hope I didn't write a BS :)

Martin
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: futility pruining, razoring question

Post by elcabesa »

you are right, I'm just testing the new code!
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: futility pruining, razoring question

Post by elcabesa »

I'm just trying all the ideas you gave me, and it looks like I have gained more thank 50 Elo point
mar
Posts: 2659
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: futility pruining, razoring question

Post by mar »

elcabesa wrote:I'm just trying all the ideas you gave me, and it looks like I have gained more thank 50 Elo point
Good to hear we could help you :)