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.