So far I've never tried sorting root moves any different than the other moves (best move of the previous iteration first, MVVLVA next, killers, remaining quiets based on history) and thinking about it now it makes sense that they deserve special treatment.Mergi wrote: ↑Thu Sep 02, 2021 2:24 pm Sorting moves at the root node is different. During the search itself, you sort moves by kinda just guessing how good they are in the most basic way, usually just by MVVLVA. However that is just a very rough guess, you don't want to spend too much time on trying to figure out precisely how good a move somewhere down in the search tree is. However in the iterative deepening framework, we can do much better than that for the root moves. Those can be sorted much more precisely based on how well they performed during the previous iterations. This can be done in multitude of different ways. First, you would search the best move that was found during the previous iteration, as for the rest of the moves, I like to keep track of their current score (there's a little caveat to that), previous iteration score and how many nodes were explored for that particular root move (more nodes explored means that the move was harder to refute, meaning it's probably a decent move) and sort them based on these 3 statistics.
Sorting by node counts makes sense. But how do I sort by score? Intuitively I would say that when I'm starting to search the next depth all I know is that one move was the previously the best and the others were worse. But not how much worse because I never searched them with a full window but one constrained by the score of the best move. None of the others managed to raise alpha above that and returned alpha as their score. They all appear equally bad.

