Sven Schüle wrote:hgm wrote:Sven Schüle wrote:That would be once in about 1000 games for this example. Too much for my taste.
Well, as they say, there is no accounting for tatste. But it escapes me why it would be offending if discarding a valid result would happen
every game, or even
every move. Even at the ultra-fast TC you mention that would only be one (or a few) out of 50,000 results.
Wrong. You discard a whole tree (subtree of a root move), not just one node.
hgm wrote:Have you ever thought about how much it would hurt if you randomly discard 1% of the valid results during a search (i.e. suppress the hash store for no other reason than that 'its number came up')?
We are not talking about not storing information in the hash table. We are talking about unnecessarily discarding the result of searching a root move, which can simply hurt by playing move 1 even though move 2 has been found as new best move right now (but discarded through this unusual timeout handling).
I handle this from two directions.
(1) when I complete a root move, without the abort_search flag being set, I update the best move and PV that will be played. Inside the tree, when abort_search is not set, I do the normal things such as back up scores/PVs, update hash table, etc.
(2) whenever abort_search is set, all search calls unwind changing nothing beyond this point. NO PV/Score updates, no HT updates, etc. Just get out as quickly as possible.
I pull this off by checking the abort_search flag after EVERY recursive call to search() and quiesce(). If the flag is set, I simply return 0 which gets me out of search almost instantly, all the way back to the root. This lets me use partial root searches (I have searched the first 3 moves and found that the 3rd was best and actually play this move, without using the partial results from move 4 or beyond for anything at all.
Simple and doesn't require a lot of thinking... Simple is always good for me.