today I finally found the problem why aspiration windows never really worked for me.
I had this code:
Code: Select all
Ply newDepth = depth;
Value newAlpha = alpha;
Value newBeta = beta;
// aspiration window
if(height == 0)
{
Value estimate = -ss.tt->get(newPosition.zobristKey).value;
if(estimate != NO_VALUE)
{
newAlpha = estimate - ASPIRATION_WINDOW;
newBeta = estimate + ASPIRATION_WINDOW;
if(newAlpha < alpha)
{
newAlpha = alpha;
}
}
}
// principal variation search
else if(nodeType == PV_NODE)
{
newBeta = alpha+1;
}
// late move reduction
if(
depth >= 2 &&
moveCounter > 3 &&
not move.isTactical() &&
not inCheck &&
not givingCheck
)
{
newDepth = depth - 1;
if(moveCounter > 10)
{
newDepth -= depth/4;
}
}
value = -search(ss, newPosition, newDepth - 1, height + 1, -newBeta, -newAlpha);
if(value > alpha && (newAlpha > alpha || newBeta < beta)) // re-search full window reduced depth
{
value = -search(ss, newPosition, newDepth - 1, height + 1, -beta, -alpha);
}
if(value > alpha && newDepth < depth) // re-search full window full depth
{
value = -search(ss, newPosition, depth - 1, height + 1, -beta, -alpha);
}
I solved this bug by only adding something to the transposition table when I am not in an aspiration window search. However, it seems like the search is with that fix is even slower than without aspiration window.
What were your solutions to this problem? Should I add an extra flag to the hash table if I am in an aspiration window search?