Hi,
Since I am not a C++ coder, can you describe what is the sorting method of RootMove in Stockfish 9 ? In other words IMHO how the moves are sorted and fed into AlphaBeta ?
RootMove sorting in Stockfish
Moderators: hgm, Rebel, chrisw
-
- Posts: 366
- Joined: Thu Jun 05, 2014 2:14 pm
- Location: Iran
- Full name: Mehdi Amini
RootMove sorting in Stockfish
Farewell.
-
- Posts: 4567
- Joined: Sun Mar 12, 2006 2:40 am
- Full name:
Re: RootMove sorting in Stockfish
I'm not really the one to ask but, as far as I know, no special Root move sorting in Stockfish. This is by design because, apparently, it works better not changing the order in which moves are searched. Only the best move found so far is at the top, immediately below that earlier best moves found by search (I think, but admittedly I have not checked). The rest of the order, moves which were never best move, is the order in which the moves are placed by movepick.cpp on characteristics of the moves alone, so not sorted by eval or search in any way, (but SEE plays a role). This is usually referenced as 'move sorting' in theory, so if that is what you were asking I must refer to movepick.cpp
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
-
- Posts: 366
- Joined: Thu Jun 05, 2014 2:14 pm
- Location: Iran
- Full name: Mehdi Amini
Re: RootMove sorting in Stockfish
I may ask about a mission here:
Modify Stockfish 9 such that given a "command FEN", it would output the FEN and the move sort of the root moves. That is, how moves are sorted before being given to Alpha-Beta.
Modify Stockfish 9 such that given a "command FEN", it would output the FEN and the move sort of the root moves. That is, how moves are sorted before being given to Alpha-Beta.
Farewell.
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: RootMove sorting in Stockfish
Your signature suggests you at least know some basic C. You should be able to accomplish your mission...
You might learn then that, as has already been explained by Eelco, the root moves are sorted as the search iterates through its iterations. So there is no "the move sort of the root moves".
-
- Posts: 5566
- Joined: Tue Feb 28, 2012 11:56 pm
Re: RootMove sorting in Stockfish
And if you know C but somehow cannot understand C++, just have a look at how Cfish sorts the root moves (identically to Stockfish):
https://github.com/syzygy1/Cfish
https://github.com/syzygy1/Cfish