Answers.Body: <p>The answer is simple for traditional engines like Stockfish and the like: if multiple moves have the same evaluation, they pick whichever move was searched first.</p>
  
  <p>All strong alpha-beta engines employ <a href="https://www.chessprogramming.org/Move_Ordering" rel="nofollow noreferrer">move-ordering heuristics</a> which guess the moves that are likely to be strongest in a position, before actually searching those moves. This is advantageous because the best case for alpha-beta search (especially for PVS) occurs when the strongest move is searched first, allowing beta cutoffs to occur as soon as possible and also avoiding repeated searches.</p>
  
  <p>So when two moves are found to have the same evaluation, the tie is broken by move ordering heuristics.</p>
  
  <p>Evaluation granularity also plays a role. Stockfish evaluates positions to the nearest 1/256th of a pawn, but only reports evaluations in 1/100th of a pawn, so there could be internal differentiation which is not visible to a user. MCTS engines like Lc0 make decisions based on the number of nodes searched in the subtrees of each move. This information wouldn't make sense to report as centipawns, so a conversion function is used. If many nodes have been searched, multiple moves may map to the same centipawn evaluation even if they can be differentiated internally.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-28T02:06:20.353Z
Answers.Text: Not every program does it the same way.  The optimum way to pick between moves that are equal is to do it randomly.
Answers.UserDisplayName: edwina oliver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-28T13:27:54.097Z
Answers.Text: Obviously not, but as I said in my answer, every program that uses PVS will distinguish between moves of equal evaluation with their move ordering heuristics. Chess engines cannot know that two moves are equal (only that they have the same evaluation when searched). If two moves were known to be equal, then it does not matter whether you pick randomly because it does not matter which one you pick.
Answers.UserDisplayName: konsolas
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-28T14:35:50.487Z
Answers.Text: Not every program works the same way.  My answer is CORRECT.
Answers.UserDisplayName: edwina oliver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-29T00:20:25.440Z
Answers.Text: Logic and truth make me happy.  All means ALL  not just most.
Answers.UserDisplayName: edwina oliver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-03T17:06:11.910Z
Answers.LastActivityDate: 2019-10-03T17:31:48.530Z
Answers.LastEditDate: 2019-10-03T17:31:48.530Z
Answers.UserDisplayName: konsolas
Answers.Body: <p>Some engines uses three decimals in its evaluation. That's how can introduce a difference. I have read that its in use a technique to add a really small but ramdom number, to make them different. Don't have the references at hand, but can be known from the read.me of every engine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-29T00:19:51.720Z
Answers.Text: Some is not all.  You know a lot of engines but you do not know them all.
Answers.UserDisplayName: edwina oliver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-03T04:11:34.917Z
Answers.LastActivityDate: 2019-10-03T04:11:34.917Z
Answers.UserDisplayName: djnavas
Body: <p>In many positions, different moves are functionally the same, and an engine should return the same evaluation. For example, in a KR vs. KR endgame, (almost) every move that does not lose the rook should give exactly the same evaluation: 0.00. How does an engine choose between them then?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-03T09:00:05.357Z
Comments.Text: That's probably why computers suck at endgames!
Comments.UserDisplayName: David
Tags: <engines><evaluation>
Title: How does an engine choose between two moves of equal evalulation?
ThreadText: # How does an engine choose between two moves of equal evalulation?
  
  (Asked by: username_0 on 2019-10-03)
  
  In many positions, different moves are functionally the same, and an engine should return the same evaluation. For example, in a KR vs. KR endgame, (almost) every move that does not lose the rook should give exactly the same evaluation: 0.00. How does an engine choose between them then?
  
  **Tags:** engines, evaluation
  
  > **Comments:**
  > **username_1**: That's probably why computers suck at endgames!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-10-03. Score: 4 | Accepted answer
  
  The answer is simple for traditional engines like Stockfish and the like: if multiple moves have the same evaluation, they pick whichever move was searched first.
  
  All strong alpha-beta engines employ [move-ordering heuristics](https://www.chessprogramming.org/Move_Ordering) which guess the moves that are likely to be strongest in a position, before actually searching those moves. This is advantageous because the best case for alpha-beta search (especially for PVS) occurs when the strongest move is searched first, allowing beta cutoffs to occur as soon as possible and also avoiding repeated searches.
  
  So when two moves are found to have the same evaluation, the tie is broken by move ordering heuristics.
  
  Evaluation granularity also plays a role. Stockfish evaluates positions to the nearest 1/256th of a pawn, but only reports evaluations in 1/100th of a pawn, so there could be internal differentiation which is not visible to a user. MCTS engines like Lc0 make decisions based on the number of nodes searched in the subtrees of each move. This information wouldn't make sense to report as centipawns, so a conversion function is used. If many nodes have been searched, multiple moves may map to the same centipawn evaluation even if they can be differentiated internally.
  
  > **Comments:**
  > **username_3**: Not every program does it the same way.  The optimum way to pick between moves that are equal is to do it randomly.  
  > **username_2**: Obviously not, but as I said in my answer, every program that uses PVS will distinguish between moves of equal evaluation with their move ordering heuristics. Chess engines cannot know that two moves are equal (only that they have the same evaluation when searched). If two moves were known to be equal, then it does not matter whether you pick randomly because it does not matter which one you pick.  
  > **username_3**: Not every program works the same way.  My answer is CORRECT.  
  > **username_3**: Logic and truth make me happy.  All means ALL  not just most.  
  
  ---
  
  ### Answer by username_4 on 2019-10-03. Score: 2
  
  Some engines uses three decimals in its evaluation. That's how can introduce a difference. I have read that its in use a technique to add a really small but ramdom number, to make them different. Don't have the references at hand, but can be known from the read.me of every engine.
  
  > **Comments:**
  > **username_3**: Some is not all.  You know a lot of engines but you do not know them all.  
  
  ---
  
  