New engine: Stash

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
mhouppin
Posts: 26
Joined: Wed Feb 12, 2020 4:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin » Mon Feb 24, 2020 4:47 pm

Roland Chastain wrote:
Mon Feb 24, 2020 4:03 pm
Damir wrote:
Mon Feb 24, 2020 3:19 pm
Any Windows compiles available ? :)
I have just tried to compile under Windows. I have a problem with the random function.

Code: Select all

In file included from sources\bitboard\bitboard_init.c:16:0:
include/random.h: In function 'qrandom':
include/random.h:22:21: warning: implicit declaration of function 'random'; did you mean 'qrandom'? [-Wimplicit-function-declaration]
  return (((uint64_t)random() << 43)
                     ^~~~~~
                     qrandom
sources\bitboard\bitboard_init.c: In function 'magic_init':
sources\bitboard\bitboard_init.c:91:3: warning: implicit declaration of function 'srandom'; did you mean 'qrandom'? [-Wimplicit-function-declaration]
   srandom(17);
   ^~~~~~~
   qrandom

Code: Select all

bitboard_init.o:bitboard_init.c:(.text+0x8): undefined reference to `random'
bitboard_init.o:bitboard_init.c:(.text+0xf): undefined reference to `random'
bitboard_init.o:bitboard_init.c:(.text+0x23): undefined reference to `random'
bitboard_init.o:bitboard_init.c:(.text+0x53d): undefined reference to `srandom'
Patched, it seems Windows has no random() function, only rand()

mhouppin
Posts: 26
Joined: Wed Feb 12, 2020 4:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin » Mon Feb 24, 2020 4:51 pm

mvanthoor wrote:
Mon Feb 24, 2020 4:02 pm
You switched the engine from square/piece iteration to magic bitobards in less than 10 days? :shock:

Only 50 ELO for implementing bitboards seems wrong. If I remember correctly, Minic by xr_a_y gained something like 200 ELO because of the speed boost of bitboards over square/piece-iteration.

You must have been writing a lot of code, or did you port the code directly from Stockfish and adapted it to fit the existing engine?

Do you have a base ELO established somewhere (your own tournament, for example), or is the engine in any rating list?
No Elo base (I should really do that though), for now I'm using the STS engine testing to get a base rating.

For the magic bitboards thing, I already worked 2 months ago on recoding a C version of Stockfish for entertainment purpose, so I was already aware of how to implement it. I don't know for the +200 Elo though, no testing done yet ^^

mhouppin
Posts: 26
Joined: Wed Feb 12, 2020 4:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin » Thu Feb 27, 2020 1:45 pm

Hi there, version 9.0.1 out !

I fixed the Piece-Square scoring, as middlegame and endgame scores were swapped, leading to way too early king moves towards the center and weird piece positions. I also corrected the 'searchmoves parameter' handling in the go command, I forgot to set the end pointer in the move list. I moved the git tag 'v9' to this version.

I'm currently testing all versions from 3.0 to 9.0, and I'm simultaneously working on the quiescence search function. Good afternoon to everyone !

User avatar
Scally
Posts: 111
Joined: Thu Sep 28, 2017 7:34 pm
Location: Bermondsey, London
Full name: Alan Cooper
Contact:

Re: New engine: Stash

Post by Scally » Thu Feb 27, 2020 4:18 pm

Hi,

This was a nice weaker engine on the 32 bit Raspberry Pi, it now seems to be for 64 bit systems only as it no longer compiles:

include/bitboard.h:17:24: fatal error: immintrin.h: No such file or directory
# include <immintrin.h>
^
compilation terminated.

Thanks,

Al.
Alan Cooper
My Chess Computers

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

Re: New engine: Stash

Post by Gabor Szots » Thu Feb 27, 2020 4:49 pm

I am a novice in compiling. I tried gcc but it misses the .h files and gives a lot of errors. Also, is it necessary to unpack all *.c files in a common folder or is there a switch to collect the files from all subfolders?
Gabor Szots
CCRL testing group

User avatar
Roland Chastain
Posts: 333
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: New engine: Stash

Post by Roland Chastain » Thu Feb 27, 2020 5:29 pm

Gabor Szots wrote:
Thu Feb 27, 2020 4:49 pm
I am a novice in compiling. I tried gcc but it misses the .h files and gives a lot of errors. Also, is it necessary to unpack all *.c files in a common folder or is there a switch to collect the files from all subfolders?
Hello! I am not an expert either, but here is the batch file that I made to compile the program:

Code: Select all

set path=C:\Qt\Tools\mingw730_64\bin

gcc.exe -c sources\bitboard\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\board\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\hashkey\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\info\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\movelist\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\psq_score\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\misc\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\main\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\engine\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\uci\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread

gcc.exe *.o -o stash.exe -lpthread -lm -pthread
I am not sure of all the options, but it works.

P.-S. After that I had to copy libwinpthread-1.dll in the engine directory.

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

Re: New engine: Stash

Post by Gabor Szots » Thu Feb 27, 2020 5:43 pm

Roland Chastain wrote:
Thu Feb 27, 2020 5:29 pm
Gabor Szots wrote:
Thu Feb 27, 2020 4:49 pm
I am a novice in compiling. I tried gcc but it misses the .h files and gives a lot of errors. Also, is it necessary to unpack all *.c files in a common folder or is there a switch to collect the files from all subfolders?
Hello! I am not an expert either, but here is the batch file that I made to compile the program:

Code: Select all

set path=C:\Qt\Tools\mingw730_64\bin

gcc.exe -c sources\bitboard\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\board\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\hashkey\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\info\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\movelist\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\psq_score\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\misc\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\main\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\engine\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread
gcc.exe -c sources\uci\*.c -Wall -Wextra -O2 -Iinclude -lpthread -lm -pthread

gcc.exe *.o -o stash.exe -lpthread -lm -pthread
I am not sure of all the options, but it works.

P.-S. After that I had to copy libwinpthread-1.dll in the engine directory.
Thanks but it still complains about the missing header files. They are not in the downloaded source package.
Gabor Szots
CCRL testing group

mhouppin
Posts: 26
Joined: Wed Feb 12, 2020 4:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin » Thu Feb 27, 2020 5:45 pm

Gabor Szots wrote:
Thu Feb 27, 2020 4:49 pm
I am a novice in compiling. I tried gcc but it misses the .h files and gives a lot of errors. Also, is it necessary to unpack all *.c files in a common folder or is there a switch to collect the files from all subfolders?
Simply using 'make' command in subfolder should do the job, no need to unpack source files

Also, Stash 9.0 is not supported on 32-bit systems for now, I'm working on adapting the code on another branch, I will post it when it's done ^^

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

Re: New engine: Stash

Post by Gabor Szots » Thu Feb 27, 2020 5:56 pm

mhouppin wrote:
Thu Feb 27, 2020 5:45 pm
Gabor Szots wrote:
Thu Feb 27, 2020 4:49 pm
I am a novice in compiling. I tried gcc but it misses the .h files and gives a lot of errors. Also, is it necessary to unpack all *.c files in a common folder or is there a switch to collect the files from all subfolders?
Simply using 'make' command in subfolder should do the job, no need to unpack source files

Also, Stash 9.0 is not supported on 32-bit systems for now, I'm working on adapting the code on another branch, I will post it when it's done ^^
I unpacked everything in a separate folder and now gcc *.c -O3 -march=native -o Stash-SzG.exe worked just fine. :)

I guess 'make' is a file you put somewhere.
Gabor Szots
CCRL testing group

User avatar
Scally
Posts: 111
Joined: Thu Sep 28, 2017 7:34 pm
Location: Bermondsey, London
Full name: Alan Cooper
Contact:

Re: New engine: Stash

Post by Scally » Thu Feb 27, 2020 6:18 pm

Also, Stash 9.0 is not supported on 32-bit systems for now, I'm working on adapting the code on another branch, I will post it when it's done ^^
It did work on my Raspberry Pi upto and including v8.1.4 but hasn’t since your recent multitudes of changes.

Thanks,

Al.
Alan Cooper
My Chess Computers

Post Reply