I still don't follow. how is it wasted effort to search with a null window, when you propose to replace this with a search of a _non-null_ window that is somehow offset from the current bounds? A null-window search is the most efficient search you can do. We don't do them at the first move of the root because we need to know the actual score. But once you have searched the few PV nodes, knowing the exact score becomes worthless...
Hmm, perhaps my understanding of PVS is wrong. My understanding of PVS -
assume the first move is going to be the best move
search the first move with a full window
search the remainder of the moves with a null window, but research with full window if the move turns out the be greater than alpha (meaning the initial assumption is incorrect)
When I say wasted effort, I was referring to the research that the engine will have to do if a move happens to be above alpha. In that case, the search with null window (although relatively cheap) is wasted.
What I am proposing is that, before doing the null window search, check the transposition table first. If, for instance, a search to depth 8 is needed, but a transposition table entry exists (for the position to be searched) to depth 6, and it indicates that the value of the node is between alpha and beta, we can skip the null window search (because we expect it to improve alpha), and search with a aspiration window (around the tabulated value) instead.
In pseudo code:
Code: Select all
Score search(alpha, beta) {
check TT for a result that can be used directly(); //normal lookup
check TT for a "suggestion"(); //same as normal lookup, except we want the result even if depth is not sufficient
if ("suggestion" is a value between alpha and beta) {
do an aspiration search around "suggestion"();
} else if ("suggestion" > beta) {
do a null window search to verify();
if (returned score < beta) {
research with original window();
}
} else if ("suggestion" < alpha) {
do a null window search to verify();
if (returned score > alpha) {
research with original window();
}
}
//...
}