New engine: Stash

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

Moderators: hgm, Rebel, chrisw

mhouppin
Posts: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Roland Chastain wrote: Mon Feb 24, 2020 5:03 pm
Damir wrote: Mon Feb 24, 2020 4: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: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

mvanthoor wrote: Mon Feb 24, 2020 5: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: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

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: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: New engine: Stash

Post by Scally »

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.
Gabor Szots
Posts: 1364
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: New engine: Stash

Post by Gabor Szots »

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: 640
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: New engine: Stash

Post by Roland Chastain »

Gabor Szots wrote: Thu Feb 27, 2020 5: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.
Qui trop embrasse mal étreint.
Gabor Szots
Posts: 1364
Joined: Sat Jul 21, 2018 7:43 am
Location: Szentendre, Hungary
Full name: Gabor Szots

Re: New engine: Stash

Post by Gabor Szots »

Roland Chastain wrote: Thu Feb 27, 2020 6:29 pm
Gabor Szots wrote: Thu Feb 27, 2020 5: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: 115
Joined: Wed Feb 12, 2020 5:00 pm
Full name: Morgan Houppin

Re: New engine: Stash

Post by mhouppin »

Gabor Szots wrote: Thu Feb 27, 2020 5: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: 1364
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: Thu Feb 27, 2020 6:45 pm
Gabor Szots wrote: Thu Feb 27, 2020 5: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: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: New engine: Stash

Post by Scally »

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.