jwilson82 wrote: ↑Sun Jan 17, 2021 9:04 pm
ydebilloez wrote: ↑Sun Jan 17, 2021 12:30 pm
I store the score of each move in the movelist and sort accordingly to find the best move.
If there are other moves at root level that return the same score, a wrong move can be selected. So hence the +1.
While I agree with HGM that sorting the entire list is overkill because...
- You only need the best move
- Bounded scores and exact scores aren't really the same, so you're sorting apples with oranges
...it sounds like your problem could be that your sort is unstable. A stable sort guarantees that elements with the same sort key maintain their relative order in the sorted list. That is, whichever move gave the best score first (ie earliest in the unsorted list) would be the first move in the sorted list
Sort algorithm: c++11 std::algorithm. But a lot of positions have the same score because I am only counting material.
I do not agree that you only need the best move. A move down 0.x pawns compared to another might be played.
- because this is how I play as a human player
- position evaluation might not be accurate
- we introduce some randomness in the move selection
- fewer variations in a tree lead to worse position
Some elaboration on point 1. How many times as a human player haven't you thought of a move for 30 minutes and finally reverting to the safer move because: it is more like likely played in this opening, just developing a piece, consolidating a defence, just because in the last minute you saw a possible refutation to your best move that you don't want to evaluate, you try to trick your opponent in playing in zeitnot....
A program could use parallel algorithms and select the move that comes out more frequently with different algorithms in the top list...
The idea is to count everything up to ply x, and then research with only the best x moves to ply y. So therefore, an algorithm that only returns the best move without caring for the others might not be filling its refutation tables right.