I've been looking at Stockfish source code and I always wonder how I can improve it. So please can anyone tell me if I can even improve it?
I've been looking at Stockfish source code and I always wonder how I can improve it. So please can anyone tell me if I can even improve it?
You certainly can't improve it and there is also no need to improve it.
1914 games against the best available engines: 287 wins, 7 losses, 1620 draws (84.6%), score: 57.3%
for example.
You certainly can't improve it and there is also no need to improve it.
1914 games against the best available engines: 287 wins, 7 losses, 1620 draws (84.6%), score: 57.3%
for example.
There are many ways to change it, and most will worsen it but some will improve it.
Stockfish gets better each year.
There are many ways to change it, and most will worsen it but some will improve it.
Stockfish gets better each year.
@pGOD1000 said in #1:
I've been looking at Stockfish source code and I always wonder how I can improve it. So please can anyone tell me if I can even improve it?
Improve in what way?
It's open source... feel free to experiment with it any way you want.
As there are many people working on it (who have been doing this for years), there are no low-hanging fruits around. It has been optimised in most ways imaginable, and thousands of modifications have been tested.
But as @tpr says: as there are still improvements made every year, there is surely something that can be done.
If you expect quick positive results, you are likely to be disappointed.
@pGOD1000 said in #1:
> I've been looking at Stockfish source code and I always wonder how I can improve it. So please can anyone tell me if I can even improve it?
Improve in what way?
It's open source... feel free to experiment with it any way you want.
As there are many people working on it (who have been doing this for years), there are no low-hanging fruits around. It has been optimised in most ways imaginable, and thousands of modifications have been tested.
But as @tpr says: as there are still improvements made every year, there is surely something that can be done.
If you expect quick positive results, you are likely to be disappointed.
https://m.youtube.com/watch?v=U4ogK0MIzqk
This might be of interest to you.
Thank you!@nadjarostowa said in #4:
Improve in what way?
It's open source... feel free to experiment with it any way you want.
As there are many people working on it (who have been doing this for years), there are no low-hanging fruits around. It has been optimised in most ways imaginable, and thousands of modifications have been tested.
But as @tpr says: as there are still improvements made every year, there is surely something that can be done.
If you expect quick positive results, you are likely to be disappointed.
I would like to make it better
Thank you!@nadjarostowa said in #4:
> Improve in what way?
>
> It's open source... feel free to experiment with it any way you want.
>
> As there are many people working on it (who have been doing this for years), there are no low-hanging fruits around. It has been optimised in most ways imaginable, and thousands of modifications have been tested.
>
> But as @tpr says: as there are still improvements made every year, there is surely something that can be done.
>
> If you expect quick positive results, you are likely to be disappointed.
I would like to make it better
@lonelypeanut said in #5:
This might be of interest to you.
Thank you!
@lonelypeanut said in #5:
> This might be of interest to you.
Thank you!
Double-search the PV lines with the final FEN code and re-evaluate those given end positions. To test the approach before trying to modify the engine create a python script to get the top 2 PV lines, extract the end-FEN for each PV line, analyze those FENs at depth 30, and than compare the two results to see if PV2 now overtakes PV1. If PV2 does over take PV1 than the horizon speculation is complete and you play the PV2 move. This approach would be searching beyond the horizon of the initial best moves.
Double-search the PV lines with the final FEN code and re-evaluate those given end positions. To test the approach before trying to modify the engine create a python script to get the top 2 PV lines, extract the end-FEN for each PV line, analyze those FENs at depth 30, and than compare the two results to see if PV2 now overtakes PV1. If PV2 does over take PV1 than the horizon speculation is complete and you play the PV2 move. This approach would be searching beyond the horizon of the initial best moves.
Starting speculative horizon analysis...
Engine started.
Running initial analysis at depth 20
Analyzing FEN: rnbqkb1r/pppp1ppp/5n2/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 0 1 at depth 20 with MultiPV=2
Number of legal moves: 27
Engine closed successfully.
PV1 secondary score: -0.33, PV2 secondary score: -0.01
Speculation suggests PV2 is better beyond the horizon!
PV1:
Moves: f3e5 d7d6 e5f3 f6e4 d2d4 d6d5 f1d3 f8d6 e1g1 e8g8 c2c4 c7c6 c4d5 c6d5 b1c3 e4c3 b2c3 c8g4 a1b1 b8d7 h2h3 g4h5 b1b5 d7f6 c1g5 f8e8 g5f6 d8f6 b5d5 h5f3 d1f3 f6f3 g2f3
Initial Score: 0.47
Secondary Score: -0.33
PV2:
Moves: d2d4 f6e4 f1d3 d7d5 f3e5 b8d7 e5d7 c8d7 e1g1 f8e7 b1d2 e4f6 d2f3 d7g4 f1e1 e8g8 c1g5 c7c6 e1e3 g4h5 c2c3
Initial Score: 0.32
Secondary Score: -0.01
Recommended move: d2d4 (PV2)
Script completed at Tue Sep 23 22:46:41 2025
Starting speculative horizon analysis...
Engine started.
Running initial analysis at depth 20
Analyzing FEN: rnbqkb1r/pppp1ppp/5n2/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 0 1 at depth 20 with MultiPV=2
Number of legal moves: 27
Engine closed successfully.
PV1 secondary score: -0.33, PV2 secondary score: -0.01
Speculation suggests PV2 is better beyond the horizon!
PV1:
Moves: f3e5 d7d6 e5f3 f6e4 d2d4 d6d5 f1d3 f8d6 e1g1 e8g8 c2c4 c7c6 c4d5 c6d5 b1c3 e4c3 b2c3 c8g4 a1b1 b8d7 h2h3 g4h5 b1b5 d7f6 c1g5 f8e8 g5f6 d8f6 b5d5 h5f3 d1f3 f6f3 g2f3
Initial Score: 0.47
Secondary Score: -0.33
PV2:
Moves: d2d4 f6e4 f1d3 d7d5 f3e5 b8d7 e5d7 c8d7 e1g1 f8e7 b1d2 e4f6 d2f3 d7g4 f1e1 e8g8 c1g5 c7c6 e1e3 g4h5 c2c3
Initial Score: 0.32
Secondary Score: -0.01
Recommended move: d2d4 (PV2)
Script completed at Tue Sep 23 22:46:41 2025
https://blog.lukesalamone.com/posts/chess-engine-history/