bbc icon indicating copy to clipboard operation
bbc copied to clipboard

Aspiration window with "wrong" depth ?

Open mkd opened this issue 3 years ago • 0 comments

Hi Maksim,

First of all, a HUGE THANKS for your code and video tutorials on YouTube. You inspired me to retake my old chess engine Chess0 and include the NNUE evaluation. It has been a success thanks to you and Daniel Shawul.

I'm now trying to optimize the search code, and I'm learning from your code a lot! However, there's one thing I still don't get:

In your search_position, you set a kind of aspiration window (alpha = alpha - 50; beta = beta + 50). If you fall outside and try to do a full search, you tell in your comment that it should be a full-width window at the same depth. However, after doing "continue" in the code below, current_depth gets incremented when starting the loop over (current_depth++).

See code below:

    // we fell outside the window, so try again with a full-width window (and the same depth)
    if ((score <= alpha) || (score >= beta)) {
        alpha = -infinity;    
        beta = infinity;      
        // current_depth--    should you add this to search at the same depth??
        continue;
    }
    

Thanks again for the excellent video tutorials and taking all the time. I'm sure it has inspire many more people!

Cheers, --Claudio

mkd avatar Feb 18 '22 14:02 mkd