New engine: Stash

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: New engine: Stash

Post by Gabor Szots »

mhouppin wrote: Fri Dec 18, 2020 9:34 am Hi there, version 25 is out !
Thanks Morgan. I've already uploaded my first games* so I it is going to appear on our blitz list this tomorrow.

*Günther reported it in the new engines thread so I was already aware of its existence.
Gabor Szots
CCRL testing group
mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Gabor Szots wrote: Fri Dec 18, 2020 12:40 pm
mhouppin wrote: Fri Dec 18, 2020 9:34 am Hi there, version 25 is out !
Thanks Morgan. I've already uploaded my first games* so I it is going to appear on our blitz list this tomorrow.

*Günther reported it in the new engines thread so I was already aware of its existence.
Hi Gabor,

I checked the results this weekend on CCRL Blitz page, and they were quite surprising... Only +6 Elo over the span of 4 major versions seemed very weird for me.
So I ran a small self-test against version 21, and as expected, it showed +290 Elo.
I thought it could just be that Stash performed poorly against other opponents, so I checked his results against GreKo, showing -66 Elo (+9 -15 =8).
I downloaded the GreKo version it played, ran a small match against it (2'+1", 256MB hash, 1 thread, +500 cp resign adjudication, TB adjudication), and got +177 Elo ! (+20 -5 =7)

I'm a bit confused seeing all my local tests showing me massive improvements (in both self-tests and regression tests), yet not showing up in CCRL Blitz rating. Do you have any idea what could cause these large Elo differences ?

Thanks a lot again for the testing ! ^^
Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: New engine: Stash

Post by Gabor Szots »

mhouppin wrote: Tue Dec 22, 2020 6:33 pm I'm a bit confused seeing all my local tests showing me massive improvements (in both self-tests and regression tests), yet not showing up in CCRL Blitz rating. Do you have any idea what could cause these large Elo differences ?
Yes, I have. I installed Stash 25 under Arena by making a copy of Stash 21 and renaming it. Only, I forgot to change the executables...

That of course comes in very handy because Stash 21 has been most extensively tested.

Thank you for noticing this. By the next update I'm going to replay the tournament and submit the games. Unfortunately, you are already the 3rd person this year whom I owe a beer.

I hope this has not spoiled your Christmas.
Best wishes,

Gabor
Gabor Szots
CCRL testing group
carldaman
Posts: 2283
Joined: Sat Jun 02, 2012 2:13 am

Re: New engine: Stash

Post by carldaman »

Been there, done that. What I now like to do in Arena is first change the path to the newer executables and only then change the name to match that. Sometimes, if I like an old version, I'll leave it be. :)
mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Hi there, version 26 is out ! Here are the improvements made:

- Slight speed optimizations on evaluation;
- Changed Initiative static value to a dynamic one, based on the number of attacked pieces for each side + side to move if not in check;
- Rewritten the time management to change usage based on bestmove stability, score improvement, and type of bestmove (capture/check/etc.);
- Allowed Stash to crunch a lot more time to finish an iteration before returning bestmove;
- Reordered quiescence search features (placed stand pat evaluation after TT probing/cutoffs);
- Added endgame score scaling (e.g. for OCB endgames);
- Retuned LMR formula constants, and reducing more if we are not on a PV node.

I also fixed a bug where Stash would crash during search by increasing the stack frame size to 4 MB, and a potential overflow on King Safety table when the number of attackers was exactly 8.

The regression tests show a gain of about +68 Elo against version 25, although I expect them to be quite smaller against other opponents (probably about 40-45 Elo).

As usual, the release binaries are available here: https://gitlab.com/mhouppin/stash-bot/-/releases/v26.0

Good evening to everyone ! ^^
mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Hi there, version 27 is out ! This one only has a few changes (due to large Elo gainers):

- Simplified the piece moves' generation;
- Improved mobility code by excluding rammed pawns and pawns on low ranks from the accessible zone;
- Added countermove and continuation histories;
- Removed the endgame scaling code for KPK endgames (I may do a specialized eval function for these in the future);
- Stopped analyzing negative-SEE moves during qsearch if we already have a score (from the static eval or the first analyzed move).

I also raised supported Hash size to 32 TB (by using a 128-bit multiplication to get the index of the entry), merged some source files with small functions, and changed Makefile default builds to prefetch+popcnt (it is easy to disable, simply pass "ARCH=unknown" in your make command).

The regression tests show a gain of about +76 Elo against version 26, probably smaller against other engines.

The release binaries are available here: https://gitlab.com/mhouppin/stash-bot/-/releases/v27.0

Good morning to everyone !
mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Hi there, version 28 is out ! Here are the improvements made:

- Removed some redundant code for TT filling;
- Added Knight Outposts to the eval (with additional bonuses for supported Outposts and Outposts on center files);
- Added Shielded minors to the eval (minor pieces with a friendly pawn just above them);
- Added a specialized function to score King + mating material versus lone King (including a KBNK helper);
- Raised Pawn Table cache size, now resetting it only when a new game is started;
- Increased History scores' granularity;
- Changed Passed Pawns' detection to also include Candidate Passers;
- Changed LMR conditions from "not when in check" to "not for a capture or promotion";
- Disabled NMP when the side to move has no pieces left(since there is a high risk of zugzwang);
- Adjusted LMR based on the move history;
- Added Singular Extensions in search;
- Some minor changes to make the engine faster.

This version also has a faster bitboard initialisation (I simply changed the initial seed used to generate magic bitboards), a single PV search function (I merged the one used for root nodes), a smaller movegen code (using some more generic functions) and a cleaner IID function (I moved the code used to print the PV to a new function).

This version scored +55 Elo against version 27. Getting there took me 40 days, and it is a pleasure to see there is still a lot of room for improvements. Hopefully I can get the next version under two months ^^

The release binaries are available here: https://gitlab.com/mhouppin/stash-bot/-/releases/v28.0

Good evening to everyone !
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New engine: Stash

Post by Guenther »

mhouppin wrote: Tue Feb 23, 2021 7:50 pm Hi there, version 28 is out ! Here are the improvements made:

- Removed some redundant code for TT filling;
- Added Knight Outposts to the eval (with additional bonuses for supported Outposts and Outposts on center files);
- Added Shielded minors to the eval (minor pieces with a friendly pawn just above them);
- Added a specialized function to score King + mating material versus lone King (including a KBNK helper);
- Raised Pawn Table cache size, now resetting it only when a new game is started;
- Increased History scores' granularity;
- Changed Passed Pawns' detection to also include Candidate Passers;
- Changed LMR conditions from "not when in check" to "not for a capture or promotion";
- Disabled NMP when the side to move has no pieces left(since there is a high risk of zugzwang);
- Adjusted LMR based on the move history;
- Added Singular Extensions in search;
- Some minor changes to make the engine faster.

This version also has a faster bitboard initialisation (I simply changed the initial seed used to generate magic bitboards), a single PV search function (I merged the one used for root nodes), a smaller movegen code (using some more generic functions) and a cleaner IID function (I moved the code used to print the PV to a new function).

This version scored +55 Elo against version 27. Getting there took me 40 days, and it is a pleasure to see there is still a lot of room for improvements. Hopefully I can get the next version under two months ^^

The release binaries are available here: https://gitlab.com/mhouppin/stash-bot/-/releases/v28.0

Good evening to everyone !
Ha, I was watching your repo and the progress and just some minutes ago I saw the change from 27.11 to 27.12 and thought,
28 is coming now very soon :)

You have put a lot of work into Stash the last weeks!
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy
mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Guenther wrote: Tue Feb 23, 2021 7:52 pm
Ha, I was watching your repo and the progress and just some minutes ago I saw the change from 27.11 to 27.12 and thought,
28 is coming now very soon :)

You have put a lot of work into Stash the last weeks!
Hi Guenther, thanks for the support ! Yeah, this is probably the version that took me the most work: 11 Elo gainers, 59 test runs, and ~2700 line edits... I still thank all the OpenBench developers and contributors for their support and their hardware, without them I wouldn't have had a new version before months !

I already have patch ideas for the next version, I still need to work a lot on the eval (King Safety seems to be one of the weak points of Stash, I'm working on fixing it).

Since I saw a conversation in another thread about Stash getting NNUE, I will say that I haven't planned adding any neural network technology to the engine yet, because I'm still studying machine learning in my school projects. I will however very likely take a look at this once I will be able to write my own inference code and training process.

Good evening !
Gabor Szots
Posts: 1362
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: New engine: Stash

Post by Gabor Szots »

mhouppin wrote: Tue Feb 23, 2021 8:14 pmI already have patch ideas for the next version, I still need to work a lot on the eval (King Safety seems to be one of the weak points of Stash, I'm working on fixing it).

Since I saw a conversation in another thread about Stash getting NNUE, I will say that I haven't planned adding any neural network technology to the engine yet, because I'm still studying machine learning in my school projects. I will however very likely take a look at this once I will be able to write my own inference code and training process.
Congratulations for your efforts! Steady progress. It is also nice to see your plans for the future.
Gabor Szots
CCRL testing group