The algorithm described here is very similar to the one used in Gull. I've got some comments and questions.
This issue can be solved with the use of setjmp/longjmp. However I found the gain from using such jumps to be minimal (it's buggy in Gull 2.1 but fixing the bug doesn't provide a significant improvement). Although in this particular case (master searching the very first move) such jumps may be useful.Peter Österlund wrote:If the master thread is searching move one at a SplitPoint, and a helper thread is searching move two, and the helper thread fails high, the master thread still finishes searching move one before it finds the fail high result for move two in the transposition table and propagates the fail high result up in the search tree. In this case there is an opportunity for the parallel search to search fewer nodes than the serial search would search, by immediately aborting the master thread. I don't know if the DTS algorithm handles this case but I would guess that it does.
Another option is for the master thread to just start searching move three without aborting the helper thread working on move two. The helper thread should be aborted only if the master reached and searched (or skipped due to some helper already working on it) the last move in the list.Peter Österlund wrote:If the master thread is searching move one at a SplitPoint, and a helper thread is searching move two, and the master thread fails low on move one, it will start searching move two. When this happens the helper thread is "kicked out" of that branch and has to start searching somewhere else.
especially if aggressive LMR is used... I think there are two ways of fixing this: 1) using setjmp create a return point for the master thread and have it join the helper as a helper thread; 2) try to obtain the state of a search tree from the helper (easy) and reproduce it within the master (hard). I tried both options but didn't obtain any measurable gain. Perhaps because my implementations were buggy.Peter Österlund wrote:The idea is that the master thread should quickly get to the same point where the helper thread was interrupted because of transposition table hits. However, there is still some overhead involved
I think this is the very same thing but with depth>=SplitDepth restriction, which is necessary (with any algorithm) for two reasons:Robert Hyatt wrote:The main problem with this is that DTS depended on being able to choose a split point in ANY subtree, of ANY thread
-splitting at depth too low increases overhead;
-if a helper thread chooses a move with a small depth there isn't going to be enough time (cutoffs) for the history table to get up-to-date.
How so? PositionInfo PI[MaxDistanceFromRoot] array will do the job.Recursion makes that a pain.
At depth >= 5 Ply overhead is negligible.Robert Hyatt wrote:In practice, the book-keeping details are simply not worth the effort
No stack: just shared memory.Robert Hyatt wrote:and are likely non-portable as well since you have to deal with the stack in an ugly way...