Peter Fendrich wrote:How do you implement the UCI MultiPV support?
I mean without losing search time.
You can't do it without losing search time. If you use a standard PVS search and the first move at the root remains the best during a full iteration (which is what usually happens), you have no way of knowing the second best move, because all the moves after the first were searched with a zero width window.
The most straightforward (and the fastest, I think) way to implement it is to modify PVS to search the first
k moves at the root with a full window, and not just the 1st move. The remaining moves are searched with a zero window around the
worst of the
k first moves. There are a few other small details you must take care of, but I'm sure you will be able to figure them out yourself when you try to implement it.
Tord