futility pruining, razoring question

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mar
Posts: 2571
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&#40;!isCheck && beta ==alpha+1 && depth<=3 && abs&#40;beta&#41; < CHECKMATESCORE - 1000&#41;&#123;

	int score=board.eval&#40;);

        if ( score + razoringMargin&#40;depth&#41; < alpha )
        &#123;

            int res = qsearch&#40; ply, alpha-razoringMargin&#40;depth&#41;, beta - razoringMargin&#40;depth&#41; );
           if &#40;res - razoringMargin&#40;depth&#41; <= alpha&#41;   
             return score; 
        &#125;
    &#125;
&#125;

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

Code: Select all

if&#40;!isCheck && beta ==alpha+1 && depth<=3 && abs&#40;beta&#41; < CHECKMATESCORE - 1000&#41;&#123;

	int score=board.eval&#40;);

        if ( score + razoringMargin&#40;depth&#41; < alpha )
        &#123;

            int res = qsearch&#40; ply, alpha-razoringMargin&#40;depth&#41;, beta - razoringMargin&#40;depth&#41; );
           if &#40;res + razorMargin&#40;depth&#41; <= alpha )   
             return score; // or res or alpha
        &#125;
    &#125;
&#125;
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: 2571
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 :)