I guess it should be:elcabesa wrote: talking about Razoringwhat still I havent' understood is how big could be razorMargin.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; } } }
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
}
}
}
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