hgm wrote:Uri Blass wrote:How can you say that in 98% of the cases iid would involve no work at all?
In a stable search, the ALL node will have been searched before in a previous iteration controlled by a node closer to the root. (This an be the root itself through ID, or IID in the PV node the current branch sprouts from, or IID in the CUT node directly beow the ALL node.) In such a case IID is a no-op:
The search starts with probing the hash table for this node, gets a hit, and finds that it already has been searched to a depth one step lower then the currently requested depth. There is then no need to redo a search at that depth, or any depth below it. The only 'IID iteration' that is done is the final one, the full-depth search. The fact that the engine does IID in every node does not result in any extra work.
The flaw is that this is an ALL node, so what point is there in doing a search (IID) that is going to fail low, and when you get back to the current position, you don't know a thing you didn't know before you started the process. Namely that you don't have a best move because there is no best move. If there is a best move, this is not an ALL node. Doing an IID search to the same depth as the current search makes absolutely no sense to me. And, in fact, all my IID searches are limited to a max of depth-2 anyway, but since when I am at a PV node with no hint of a best move, the depth-2 IID search won't have a hash move, and will first do a depth-4 IID search, which will do a depth-6 search, until depth-n is <= 0 where we start to do real searches and then back up the results by storing the best move in the hash table...
I do not follow the concept of doing anything that has a cost, in an attempt to order moves at a node where ordering is completely irrelevant (ALL nodes).
At a PV node, ordering is _critical_ and when I have no hash move, I am willing to spend the time necessary to do IID in order to find the move to search first, as that results in significant savings. Best example is where you fail high on a move at the last iteration, and then time runs out. The hash table will have no best move for ply=2, or ply=4, etc. I do a "puzzle search" to find a move to ponder, then I start a search at what was ply=3 in the last search, and try what was the best move (stored in hash). But at ply=2 (what was ply=4 last move) that was an ALL node with no best move stored in the hash, so an IID search saves a lot of time. I typically see 15-20% speed improvements in this case (search fails high, but a real score/PV can't be discovered before time runs out).
Only when you start searching a node that has not been searched in the previous iteration you can get into a situation where IID would actually have to do pilot searches at reuced depth. This happens when the underlying CUT node now searches a move that it did not search in the previous iteration. It only does this when its previous cut-move now has failed low. Under such conditions it is in fact very likely that the move they try to replace it with will fail low as well (meaning the current 'ALL node' is in fact a CUT node). You did not order that move after the previous cut-move for nothing. It is either a move that you did search (at lower depth) before you found the now-failing cut-move, and which failed low at that time, so you went on searching for another cut-move, or it is a move that was ordered behind the now-failing cut-move because you considerd it less likely to produce a cutoff.
On your last remark:
I do not try any moves at reduced depth (to get hash hits on them) if I know from the hash hit of the current node that these moves have already been searched at this depth (and all failed low).