Body: <p>I've downloaded the c++ source code for Stockfish here:</p>
  <p><a href="https://github.com/official-stockfish/Stockfish" rel="nofollow noreferrer">https://github.com/official-stockfish/Stockfish</a></p>
  <p>And implemented a basic program to get the next move.</p>
  <p>I see that Stockfish is playing really bad and I don't understand why. The skill level is 20 (default, maximum) and I'm not using the NNUE files. (Are they really needed?)</p>
  <p>Any ideas why this might happen?</p>
  <p>Here's an example for this FEN:<br />
  r1b1kbnr/1ppqpppp/p1n5/1B1p4/3P4/P3P3/1PP2PPP/RNBQK1NR</p>
  <pre><code>[FEN &quot;r1b1kbnr/1ppqpppp/p1n5/1B1p4/3P4/P3P3/1PP2PPP/RNBQK1NR w - - 0 1&quot;]
  </code></pre>
  <p>My implementation with Stockfish proposes B5 to A6. The official app from the App Store for Stockfish yields the results one would expect.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-25T00:15:04.777Z
Comments.Text: "_My implementation with Stockfish proposes B5 to A6._"   Do you mean **1. Bxa6** ?
Comments.UserDisplayName: SecretAgentMan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-25T02:03:39.177Z
Comments.Text: I'd guess that it's because you're not using NNUE files. Stockfish did away with its handcrafted evaluation some time ago, so if you don't have NNUE, you're playing without an evaluation function - whereupon it does stupid things.
Comments.UserDisplayName: Allure
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T06:13:11.640Z
Comments.Text: @Allure Hey, that was right, I was not using NNUE files. I was under the impression that these are optional.
  
  SecretAgentMan: Yes, white bishop capturing the pawn in front of the rook.
Comments.UserDisplayName: EfficientCoconut2739
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T07:11:58.500Z
Comments.Text: @Allure: I did some testing and after including the NNUE files it seems it plays the way it should. I've noticed something strange though when playing with black. For this FEN: I'm sending to Stockfish: position fen R2KQB1R/PPP2P1P/4PPN1/8/6p1/2n1p1p1/ppp4p/r2kqbnr w - - 0 1 So basically asking what should white play (even though for that position it's blacks turn), and the engine replies with: b7b8q Which is weird, because those white pawns should move upwards not backwards. Why is that ?
Comments.UserDisplayName: EfficientCoconut2739
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T08:34:26.420Z
Comments.Text: You sure your FEN is correct? It looks like it's supposed to be a black-to-play position, but you've given one with white to play, and white's pawns are moving upwards instead of downwards.
Comments.UserDisplayName: Allure
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T13:37:47.450Z
Comments.Text: It is a black to play position yes, in this case, should the fen look different, or just the "w" part on the end should be "b" ?
Comments.UserDisplayName: EfficientCoconut2739
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T14:39:04.003Z
Comments.Text: As a comparison, seems from the same board I construct the fen as:
  
  RN1KQB1R/PPP2PPP/3P1N2/4P3/4p1B1/2n2n2/pppp1ppp/r1bkqb1r b - - 0 1
  
  while 
  
  r1bqkb1r/ppp1pppp/2n2n2/1B1p4/3P4/2N1P3/PPP2PPP/R1BQK1NR b KQkq - 0 1
  
  Seems I start from the top and going left to right, while this other software goes from the bottom right to left.
Comments.UserDisplayName: EfficientCoconut2739
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-10-26T22:49:37.687Z
Comments.Text: More than that, you need to put your b2 pawn on b2 and not b7. FENs are standard, every engine agrees on how to read them, and the first row in the FEN corresponds to the 8th rank.
Comments.UserDisplayName: Allure
Tags: <engines><strategy><software><development>
Title: Why does Stockfish play really bad?
ThreadText: # Why does Stockfish play really bad?
  
  (Asked by: username_0 on 2024-10-24)
  
  I've downloaded the c++ source code for Stockfish here:
  https://github.com/official-stockfish/Stockfish
  And implemented a basic program to get the next move.
  I see that Stockfish is playing really bad and I don't understand why. The skill level is 20 (default, maximum) and I'm not using the NNUE files. (Are they really needed?)
  Any ideas why this might happen?
  Here's an example for this FEN:
  r1b1kbnr/1ppqpppp/p1n5/1B1p4/3P4/P3P3/1PP2PPP/RNBQK1NR
  [FEN "r1b1kbnr/1ppqpppp/p1n5/1B1p4/3P4/P3P3/1PP2PPP/RNBQK1NR w - - 0 1"]
  
  My implementation with Stockfish proposes B5 to A6. The official app from the App Store for Stockfish yields the results one would expect.
  
  **Tags:** engines, strategy, software, development
  
  > **Comments:**
  > **username_1**: "_My implementation with Stockfish proposes B5 to A6._"   Do you mean **1. Bxa6** ?  
  > **username_2**: I'd guess that it's because you're not using NNUE files. Stockfish did away with its handcrafted evaluation some time ago, so if you don't have NNUE, you're playing without an evaluation function - whereupon it does stupid things.  
  > **username_0**: @username_2 Hey, that was right, I was not using NNUE files. I was under the impression that these are optional.  username_1: Yes, white bishop capturing the pawn in front of the rook.  
  > **username_0**: @username_2: I did some testing and after including the NNUE files it seems it plays the way it should. I've noticed something strange though when playing with black. For this FEN: I'm sending to Stockfish: position fen R2KQB1R/PPP2P1P/4PPN1/8/6p1/2n1p1p1/ppp4p/r2kqbnr w - - 0 1 So basically asking what should white play (even though for that position it's blacks turn), and the engine replies with: b7b8q Which is weird, because those white pawns should move upwards not backwards. Why is that ?  
  > **username_2**: You sure your FEN is correct? It looks like it's supposed to be a black-to-play position, but you've given one with white to play, and white's pawns are moving upwards instead of downwards.  
  > **username_0**: It is a black to play position yes, in this case, should the fen look different, or just the "w" part on the end should be "b" ?  
  > **username_0**: As a comparison, seems from the same board I construct the fen as:  RN1KQB1R/PPP2PPP/3P1N2/4P3/4p1B1/2n2n2/pppp1ppp/r1bkqb1r b - - 0 1  while   r1bqkb1r/ppp1pppp/2n2n2/1B1p4/3P4/2N1P3/PPP2PPP/R1BQK1NR b KQkq - 0 1  Seems I start from the top and going left to right, while this other software goes from the bottom right to left.  
  > **username_2**: More than that, you need to put your b2 pawn on b2 and not b7. FENs are standard, every engine agrees on how to read them, and the first row in the FEN corresponds to the 8th rank.  
  
  ---
  
  ## 0 answers
  
  