Stockfish unbeatable at modest settings

  

Back to forum


Scott Ligon    (2025-01-07)
Stockfish unbeatable at modest settings?

I am running an experiment where each move will be selected by Stockfish 17 in a deterministic configuration, so it will be possible to predict my response to any given move with certainty. I believe Stockfish 17 at these settings is so strong that it will be difficult if not impossible to exploit this strategy. However, if I reach a position where it looks like this strategy is going to lose, I reserve the right to deviate. If this happens, I will message my opponent to let them know that I am no longer following this system.

I'm using a python script to interact with Stockfish, but you should be able to get the same results running Stockfish 17 from the command line. I am currently running the search with the parameter nodes = 10 million (previously I tried nodes = 5 million but I found a way for white to win against Stockfish at that setting). From the command line:

go nodes 10000000

In order for Stockfish to be deterministic, it needs to be running on just 1 thread and from the command line that's the default. If for some reason Threads has a different value on your machine:

setoption name Threads value 1

I'm using the default size for the hash table, but if you run the search a second time without clearing the hash, you will get a different search result. So either close and restart Stockfish between searches or else clear the hash table:

setoption name Clear Hash

Lastly you need to be able to input the position before running the search. It is important that you enter the position via FEN string rather than by inputting the moves, because you might get different search results otherwise. Use only the first four fields of the FEN string, like this to get black's response after 1 e4:

position fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq -

From that position if you run Stockfish with nodes = 10 million, the last two lines of text output should say:

info depth 32 seldepth 46 multipv 1 score cp -26 lowerbound nodes 10000376 nps 462252 hashfull 999 tbhits 0 time 21634 pv c7c5
bestmove c7c5 ponder g1f3

I think only the values of "nps" and "time" will vary, everything else should be identical between runs / machines. So in this case Stockfish 17 recommends the Sicilian Defense and gives an evaluation of +0.26. (cp -26 is the evaluation in centipawns from the perspective of the side to move, but usually evals are given from white's POV).


Scott Ligon    (2025-01-07 20:14:22)
Stockfish unbeatable at modest settings?

And then type "quit" to close Stockfish.

If you're trying to run Stockfish from the command line for the first time, it's not very user friendly, but here's a link:

https://official-stockfish.github.io/docs/stockfish-wiki/UCI-&-Commands.html


Ulises Pineda    (2025-01-17 14:34:09)
Stockfish unbeatable at modest settings?

That's very interesting. Can you share the line that defeats Stockfish at 5 million nodes per move? If it has reached perfection at ten million, we could investigate how many nodes it needs for it.


Scott Ligon    (2025-01-17 14:44:57)
Stockfish unbeatable at modest settings?

To be clear, I still don't know if it can be beaten at 10 million nodes. Someone might eventually find a line with white that beats Stockfish 17 at these settings. But the longer the experiment goes without anyone finding such a line, the more confident I will be that it can't be beaten.

Here is a line that beats Stockfish 17 at 5 million nodes.

1. e4 c5 2. Nf3 Nc6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 e5 6. Ndb5 d6 7. Nd5 Nxd5 8. exd5 Nb8 9. a4 Be7 10. Bd2 O-O 11. a5 f5 12. Be2 Bd7 13. O-O Be8 14. Ra2 h6 15. Kh1 Bg5 16. Be1 a6 17. Na3 Nd7 18. Nc4 Qc7 19. Bb4 Nc5 20. Ra3 Bb5 21. Nb6 Rad8 22. c4 Be8 23. Be1 Nd7 24. Nxd7 Qxd7 25. b4 Rc8 26. f3 Bh5 27. Bf2 e4 28. c5 dxc5 29. Bxc5 Rfe8 30. d6 Kh8 31. f4 Bxe2 32. Qxe2 Bf6 33. Qh5 Rf8 34. Rd1 Kh7 35. Rg3 Bd8 36. Rd5 Rf6 37. Qd1 Rf7 38. Re3 g5 39. Qh5 gxf4 40. Re1 e3 41. Rf1 Rf8 42. Rd4 Bf6 43. Rdxf4 Bg5 44. R4f3 Qf7 45. Qxf7+ Rxf7 46. Bxe3 Bxe3 47. Rxe3 Kg7 48. g3 Rc4 49. Rf4 Rc1+ 50. Kg2 Rd1 51. Re7 Rd2+ 52. Rf2 Rxd6 53. Rxf7+ Kxf7 54. Rxf5+ Kg6 55. Rc5 Rd2+ 56. Kf3 Rb2 57. Rc4


Scott Ligon    (2025-01-21 23:17:17)
Stockfish unbeatable at modest settings?

And now I have found a line that defeats Stockfish 17 at 10 million nodes, so that strategy is not safe to play as black. I won't post the line yet because I don't want to give away information that might be relevant for my opponents in games that are still running, but I intend to post it later.

I will continue to use the 10 million node strategy in the tournaments I had already started, but in my upcoming tournaments I will switch to the 15 million node version of this strategy, to test whether or not there's a line that defeats it. As mentioned in the first post, if Stockfish's recommended move gets to what appears to be a losing position, I will deviate from these strategies to try to avoid losing, and I will message my opponent to let them know this has happened. In my games so far, I have not deviated from the 10 million node strategy, unless it happened by mistake. But I'm not aware of any such mistakes.


Scott Ligon    (2025-02-09 21:47:17)
Stockfish unbeatable at modest settings?

My remaining games where I'm using the 10 million node strategy as black have gone past the point where they could transpose into white's winning lines against the 10 million node strategy (at least the two winning lines that I managed to find), so I will post them now. I found both lines while analyzing games that have now finished.

Game 147097: Kruse vs Ligon
https://ficgs.com/game_147097.html

Due to a repetition, the position after black's move 22 in the game was the same as the position after black's move 20 in the following line where white wins.

1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Re1 e5 6. Bxc6 dxc6 7. a4 Nh6 8. d3 O-O 9. Be3 Qd6 10. Na3 f6 11. Nc4 Qe7 12. a5 Ng4 13. Bd2 Nh6 14. Qe2 Be6 15. h4 Ng4 16. Ra4 Rf7 17. Rb1 Bf8 18. h5 Qd7 19. b3 Re8 20. Re1 Rg7 21. Rb1 g5 22. Ne1 Nh6 23. Ne3 Qc8 24. g3 Bd6 25. N1g2 Bf8 26. f3 Qb8 27. Rba1 Nf7 28. Ng4 Qd8 29. Qf2 Nd6 30. Be3 b5 31. axb6 axb6 32. b4 Bxg4 33. fxg4 cxb4 34. Rxb4 b5 35. Rbb1 Qd7 36. Qf3 Rf7 37. Kh2 Rb8 38. Ba7 Rc8 39. Bf2 b4 40. Be1 c5 41. Ne3 Nb5 42. Nd5 Qc6 43. Bd2 Nc7 44. Ra7 c4 45. Rba1 Bc5 46. Nxb4 Bxb4 47. Bxb4 cxd3 48. cxd3 Rb8 49. Be1 Rb2+ 50. Bf2 Ne6 51. Ra8+ Rf8 52. Rxf8+ Nxf8 53. h6 Kf7 54. Kh3 Rb3 55. Ra2 Ke8 56. Ra7

Game 147106: Pineda vs Ligon
https://ficgs.com/game_147106.html

First 36 moves are the same as the following line where white wins. Black got the win only because white made a mistake in entering the final move, otherwise we were headed for a draw.

1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Bxc6 dxc6 6. d3 a5 7. h3 b6 8. a3 Nf6 9. Qe2 O-O 10. Nc3 Ne8 11. e5 Nc7 12. Qe4 Ne6 13. Re1 Qd7 14. Qh4 f6 15. Be3 h6 16. Qg3 g5 17. h4 Qd8 18. Bd2 b5 19. b3 Kh7 20. Rac1 Kg8 21. Rcd1 Ra7 22. Rb1 Ra8 23. Rbc1 Ra7 24. Rcd1 Rb7 25. Bc1 Ra7 26. a4 b4 27. Ne2 Qe8 28. Bb2 Qf7 29. Nd2 Qh5 30. hxg5 fxg5 31. Qe3 Rd7 32. Nc4 Rdd8 33. Ng3 Qg6 34. Nxa5 h5 35. Qe4 Qe8 36. Ne2 h4 37. f3 Nd4 38. Rf1 Bf5 39. Qe3 Ne6 40. Bc1 Qg6 41. Nxc6 Rd7 42. Na5 Rf7 43. Rde1 Rd8 44. Nc4 Rdf8 45. Nb6 h3 46. Rf2 hxg2 47. Rxg2 Qh5 48. Rh2 Bh3 49. f4 g4 50. Qg3 Ng5 51. Rf1 Bxe5 52. Nd7 Bc7 53. Nxf8 Kxf8 54. Kh1 Qh6 55. Rff2


Herbert Kruse    (2025-02-15 06:16:06)
Stockfish unbeatable at modest settings?

I dont See a win in my game


Scott Ligon    (2025-02-15 15:43:10)
Stockfish unbeatable at modest settings?

The position after 56 Ra7 is clearly winning if you run an analysis with Stockfish. I'm not saying it's obvious from a human perspective but if both players are using engines, black should resign at that point (and probably a few moves earler).

The move numbers don't line up with your game because I removed a repetition, but from your game if you go to the position after 22. Re1 Rg7, it's the same position as the line shown in this thread after 20. Re1 Rg7 and you can follow the line from there.


Herbert Kruse    (2025-02-15 19:00:32)
Stockfish unbeatable at modest settings?

but 21.-g5 is already weak, so ...


Scott Ligon    (2025-02-15 22:20:35)
Stockfish unbeatable at modest settings?

What I'm calling the winning line is only winning if black is restricted to the strategy of Stockfish 17 using 10 million node searches, though by the end of the line it is also objectively winning. Some of black's responses when using this strategy are mistakes, otherwise white wouldn't have a winning line. 21... g5 might not be black's best response but the position should still be defensible at that point. It starts to get very bad after 27 Rba1 Nf7 which I think is black's fatal error or close to it. Prior to that black should still have some defense.


Herbert Kruse    (2025-02-16 08:07:53)
Stockfish unbeatable at modest settings?

OK, as chessplayer i See, that 2.- Nc6 ist Not as good as 2.- d6


Scott Ligon    (2025-02-16 09:39:42)
Stockfish unbeatable at modest settings?

I wouldn't draw that conclusion, but when I was looking at the 15 million node strategy as compared with 10 million nodes, I was happy to see that black switched from 2... Nc6 to 2... d6 in the Sicilian. Only because the 10 million node strategy lost in that line, so I wanted it to try something different. I would also have been happy with a switch from the Sicilian to 1 e4 e5.

It doesn't always stay with 2... d6 at higher node values either. At 19 million it goes to 2... e6 and at 20 million it's back to 2... Nc6.


Ulises Pineda    (2025-02-16 20:29:13)
Stockfish unbeatable at modest settings?

In our game I tried to apply some psychology, reach a position that is lost for black where the engine gives a low evaluation so you don't take over the defense of the position until it's too late, too bad I was incapable of making the move I intended to play.

I'd like to request that if we ever play again and I am white and you are black, that we repeat the same game and you turn on the 10 million nodes script after I play the correct move, and we see what would have happened, while I ignore the winning line found against the script.

That's the only chance I have for all the hours of analysis I spent in our game to not go to waste.


Scott Ligon    (2025-02-16 21:19:28)
Stockfish unbeatable at modest settings?

Since I only won because you made a mistake entering the last move, I will give you a return match at 10 million nodes. You can play it however you want but if we reach a position where I can see that the 10 million node strategy takes me into a losing position, I will take over at that point. Other than that one game, I'm officially retiring the 10 million node strategy since I already know that white can win against it.

Check the waiting lists. I think there's a tournament where I'm first on the list and there's one other player. If you enter third, I believe you would have white against me. I think that's how it works.


Scott Ligon    (2025-02-17 02:42:51)
Stockfish unbeatable at modest settings?

Or if you just want to see what would have happened if you had played 52. Nxa8, we can analyze the game here. My impression during the game was that we were headed for a draw but I can take a closer look.


Scott Ligon    (2025-02-17 04:20:15)
Stockfish unbeatable at modest settings?

Here are three lines I analyzed with Stockfish. I think black should be able to hold the draw in all of them, but the 10 million node strategy makes some mistakes. Notably 54. Qf3 Bd6 is bad and black should have played Bg3 there, but apparently not bad enough to lose unless further mistakes are made. Anyway these are the lines I looked at.

1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Bxc6 dxc6 6. d3 a5 7. h3 b6 8. a3 Nf6 9. Qe2 O-O 10. Nc3 Ne8 11. e5 Nc7 12. Qe4 Ne6 13. Re1 Qd7 14. Qh4 f6 15. Be3 h6 16. Qg3 g5 17. h4 Qd8 18. Bd2 b5 19. b3 Kh7 20. Rac1 Kg8 21. Rcd1 Ra7 22. Rb1 Ra8 23. Rbc1 Ra7 24. Rcd1 Rb7 25. Bc1 Ra7 26. a4 b4 27. Ne2 Qe8 28. Bb2 Qf7 29. Nd2 Qh5 30. hxg5 fxg5 31. Qe3 Rd7 32. Nc4 Rdd8 33. Ng3 Qg6 34. Nxa5 h5 35. Qe4 Qe8 36. Ne2 h4 37. Rf1 Nf4 38. f3 Be6 39. Nxf4 Rxf4 40. Qe2 g4 41. Bc1 gxf3 42. Rxf3 Rg4 43. Rdf1 Rg6 44. Nc4 Bg4 45. Be3 Rd5 46. a5 Bxf3 47. Rxf3 Bxe5 48. Nb6 Rd8 49. a6 Re6 50. a7 Bc7 51. a8=Q Rxa8 52. Nxa8 Qxa8 53. Rf1 Qe8 54. Qf3 Bd6 55. Bg5 Kg7 56. Bxh4 Be5

1. e4 c5 2. Nf3 Nc6 3. Bb5 g6 4. O-O Bg7 5. Bxc6 dxc6 6. d3 a5 7. h3 b6 8. a3 Nf6 9. Qe2 O-O 10. Nc3 Ne8 11. e5 Nc7 12. Qe4 Ne6 13. Re1 Qd7 14. Qh4 f6 15. Be3 h6 16. Qg3 g5 17. h4 Qd8 18. Bd2 b5 19. b3 Kh7 20. Rac1 Kg8 21. Rcd1 Ra7 22. Rb1 Ra8 23. Rbc1 Ra7 24. Rcd1 Rb7 25. Bc1 Ra7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