Hi there!
I have been working recently on a chess engine as a hobby, and I'm finally happy to release it after 4 months of (occasional) work ! It isn't based or derived from another engine, and should play at around 1450 Elo. It is written in C, and UCI-compliant.
Link: https://gitlab.com/mhouppin/stash-bot
Any feedback would be really appreciated !
New engine: Stash
Moderators: hgm, Rebel, chrisw
-
- Posts: 115
- Joined: Wed Feb 12, 2020 5:00 pm
- Full name: Morgan Houppin
-
- Posts: 20
- Joined: Fri Feb 07, 2020 2:48 am
- Location: United States
- Full name: Tom R
Re: New engine: Stash
Hey! I'm just getting into this stuff too, and it gets to be a fun little side project
as for improvements to the engine, I just took a look at your search, and would recommend adding a form of null move pruning. It really helps with reaching higher depths, and can give a ton of elo. Also, I just recently had a lot of success with a tapered evaluation (added 100 selfplay elo to my engine with the tapered eval + some better PSQT) so that could be something to take a look at.
Overall, it's super fun to figure out improvements, and a lot of people here are super helpful in that type of stuff!
as for improvements to the engine, I just took a look at your search, and would recommend adding a form of null move pruning. It really helps with reaching higher depths, and can give a ton of elo. Also, I just recently had a lot of success with a tapered evaluation (added 100 selfplay elo to my engine with the tapered eval + some better PSQT) so that could be something to take a look at.
Overall, it's super fun to figure out improvements, and a lot of people here are super helpful in that type of stuff!
-
- Posts: 640
- Joined: Sat Jun 08, 2013 10:07 am
- Location: France
- Full name: Roland Chastain
Re: New engine: Stash
Hello! Congratulations.
I could compile it without any problem under Linux. The code looks very clean and well organized. The engine is nor too weak neither too strong. Exactly the kind of program that I like.
I could compile it without any problem under Linux. The code looks very clean and well organized. The engine is nor too weak neither too strong. Exactly the kind of program that I like.
Qui trop embrasse mal étreint.
-
- Posts: 4606
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: New engine: Stash
I had tons of conversion type warnings with gcc for a windows compile.Roland Chastain wrote: ↑Sat Feb 15, 2020 8:23 am Hello! Congratulations.
I could compile it without any problem under Linux. The code looks very clean and well organized. The engine is nor too weak neither too strong. Exactly the kind of program that I like. :)
-
- Posts: 115
- Joined: Wed Feb 12, 2020 5:00 pm
- Full name: Morgan Houppin
Re: New engine: Stash
Fixed now ^^ I forgot that Windows was having some weird format strings for size types ("%I64u" instead of "%zu")Guenther wrote: ↑Sat Feb 15, 2020 9:12 amI had tons of conversion type warnings with gcc for a windows compile.Roland Chastain wrote: ↑Sat Feb 15, 2020 8:23 am Hello! Congratulations.
I could compile it without any problem under Linux. The code looks very clean and well organized. The engine is nor too weak neither too strong. Exactly the kind of program that I like.
Also thank you for your help bctboi, I am currently testing Null Move Search and it seems to really improve the performances of my engine
-
- Posts: 4606
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: New engine: Stash
Yeah that really looked funny (before it crashed) ;-)mhouppin wrote: ↑Sat Feb 15, 2020 10:28 amFixed now ^^ I forgot that Windows was having some weird format strings for size types ("%I64u" instead of "%zu")Guenther wrote: ↑Sat Feb 15, 2020 9:12 amI had tons of conversion type warnings with gcc for a windows compile.Roland Chastain wrote: ↑Sat Feb 15, 2020 8:23 am Hello! Congratulations.
I could compile it without any problem under Linux. The code looks very clean and well organized. The engine is nor too weak neither too strong. Exactly the kind of program that I like. :)
Also thank you for your help bctboi, I am currently testing Null Move Search and it seems to really improve the performances of my engine :)
-
- Posts: 4606
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: New engine: Stash
Thanks all well now as expected.
I will add Stash to my chronology of available XB/UCI programs soon.
I am I right that you are French? (for the nationality of the entry in the chronology)
Congrats for your first release.
Code: Select all
uci
id name Stash v8.0
id author Morgan Houppin (@mhouppin)
option name Threads type spin default 1 min 1 max 32
option name Hash type spin default 16 min 1 max 4096
option name Clear Hash type button
option name Minimum Thinking Time type spin default 20 min 0 max 30000
option name Move Overhead type spin default 20 min 0 max 1000
uciok
ucinewgame
position startpos
go
info depth 1 nodes 22 nps 0 time 0 score cp 55 pv e2e4
info depth 2 nodes 145 nps 0 time 0 score cp 27 pv e2e4
info depth 3 nodes 1967 nps 196700 time 10 score cp 27 pv g1f3
info depth 4 nodes 14944 nps 747200 time 20 score cp 20 pv g1f3
info depth 4 nodes 49152 nps 1638400 time 30 score cp 20 pv g1f3
bestmove g1f3
-
- Posts: 115
- Joined: Wed Feb 12, 2020 5:00 pm
- Full name: Morgan Houppin
Re: New engine: Stash
Yup, French developer ^^Guenther wrote: ↑Sat Feb 15, 2020 10:50 amThanks all well now as expected.
I will add Stash to my chronology of available XB/UCI programs soon.
I am I right that you are French? (for the nationality of the entry in the chronology)
Congrats for your first release.
Code: Select all
uci id name Stash v8.0 id author Morgan Houppin (@mhouppin) option name Threads type spin default 1 min 1 max 32 option name Hash type spin default 16 min 1 max 4096 option name Clear Hash type button option name Minimum Thinking Time type spin default 20 min 0 max 30000 option name Move Overhead type spin default 20 min 0 max 1000 uciok ucinewgame position startpos go info depth 1 nodes 22 nps 0 time 0 score cp 55 pv e2e4 info depth 2 nodes 145 nps 0 time 0 score cp 27 pv e2e4 info depth 3 nodes 1967 nps 196700 time 10 score cp 27 pv g1f3 info depth 4 nodes 14944 nps 747200 time 20 score cp 20 pv g1f3 info depth 4 nodes 49152 nps 1638400 time 30 score cp 20 pv g1f3 bestmove g1f3
-
- Posts: 4606
- Joined: Wed Oct 01, 2008 6:33 am
- Location: Regensburg, Germany
- Full name: Guenther Simon
Re: New engine: Stash
Morgan, I noticed that Stash uses one cpu also in ponder off games, when it is not its turn?
Maybe another windows glitch. Some kind of polling?
BTW I wonder why you have the threads option enabled - is this release really smp? (haven't checked the code)
Maybe another windows glitch. Some kind of polling?
BTW I wonder why you have the threads option enabled - is this release really smp? (haven't checked the code)
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: New engine: Stash
Congratulations on your first release
I am thrilled to read that you are starting from scratch without using another engine as a reference. It's a lot of work, but that way, you can establish a baseline ELO, and see the strength gains your engine makes with each new function you implement. (In the beginning, those gains will be positively huge; possibly >100 ELO for implementing a search optimization or an extra evaluation parameter. Search Madchess.net for more info. Erik Madsen chronicled the development of Madchess 2 and 3 after establishing the baseline.)
I've looked at your code. Congratulations about that as well. It's one of the most readable implementations I've seen in a long time. It avoids the pitfall of having lots of if/switch/for/while blocks wrapped into one-another. If you remove the numbers that appear throughout (replace them by constants) and add a lot of comments, this could be a great reference engine.
It compiles cleanly under Windows (MSYS2 / MinGW64). A suggestion: change the build script so it compiles statically. Now you need to have libwinpthread-1.dll in the same folder as stash-bot.exe. This is just a matter of taste obviously, but in the case of chess engines, my preference is to have a single executable that works without any dependencies.
===
As an aside: Some months ago, I _finally_ started writing my own chess engine, using the Rust programming language. (My one constraint with regard to writing a chess engine is to NOT use C or C++, because everybody and their dog has a C/C++ chess engine. C/C++ are fast, but they're also ancient with lots of pitfalls.)
Your engine seems to use board iteration to find the pieces, and then iterates over the squares in each direction the piece can move. My engine is using magic bitboards, and I've just reached the stage where I start to implement the move generator. (I reserve the engine name to for myself, because I haven't decided yet :p)
I can't wait to finish by engine to a playable baseline and then pit it against this version of Stash, because they're both original, not derived from any other engines, in the beginning stages of development, they use different programming languages, and different board representations.
Good luck to you
(Some output of the partially complete move generator of my engine...)
I am thrilled to read that you are starting from scratch without using another engine as a reference. It's a lot of work, but that way, you can establish a baseline ELO, and see the strength gains your engine makes with each new function you implement. (In the beginning, those gains will be positively huge; possibly >100 ELO for implementing a search optimization or an extra evaluation parameter. Search Madchess.net for more info. Erik Madsen chronicled the development of Madchess 2 and 3 after establishing the baseline.)
I've looked at your code. Congratulations about that as well. It's one of the most readable implementations I've seen in a long time. It avoids the pitfall of having lots of if/switch/for/while blocks wrapped into one-another. If you remove the numbers that appear throughout (replace them by constants) and add a lot of comments, this could be a great reference engine.
It compiles cleanly under Windows (MSYS2 / MinGW64). A suggestion: change the build script so it compiles statically. Now you need to have libwinpthread-1.dll in the same folder as stash-bot.exe. This is just a matter of taste obviously, but in the case of chess engines, my preference is to have a single executable that works without any dependencies.
===
As an aside: Some months ago, I _finally_ started writing my own chess engine, using the Rust programming language. (My one constraint with regard to writing a chess engine is to NOT use C or C++, because everybody and their dog has a C/C++ chess engine. C/C++ are fast, but they're also ancient with lots of pitfalls.)
Your engine seems to use board iteration to find the pieces, and then iterates over the squares in each direction the piece can move. My engine is using magic bitboards, and I've just reached the stage where I start to implement the move generator. (I reserve the engine name to for myself, because I haven't decided yet :p)
I can't wait to finish by engine to a playable baseline and then pit it against this version of Stash, because they're both original, not derived from any other engines, in the beginning stages of development, they use different programming languages, and different board representations.
Good luck to you
(Some output of the partially complete move generator of my engine...)
Code: Select all
Finished dev [unoptimized + debuginfo] target(s) in 0.54s
Running `target\debug\xyz.exe`
Engine: xyz
Author: mvanthoor
8 . . . r . . . .
7 . . b k . . . .
6 . . . I N . . .
5 . . . . . . . i
4 . i I . . n . .
3 . . . i . . . I
2 N n . . . . . .
1 K R . B . . . .
A B C D E F G H
Kd7d6 (capture)
Kd7e6 (capture)
Kd7c6 (normal)
Kd7e7 (normal)
Kd7c8 (normal)
Kd7e8 (normal)
Nb2d1 (capture)
Nb2c4 (capture)
Nb2a4 (normal)
Nf4h3 (capture)
Nf4e6 (capture)
Nf4e2 (normal)
Nf4g2 (normal)
Nf4d5 (normal)
Nf4g6 (normal)
Done.