Page 1 of 16

Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 11:08 am
by JohnWoe
I have published my chess960 engine in the wild:

Source code:
https://github.com/SamuraiDangyo/Sapeli

There's 1 binary. But you should be able to build better binaries with make - program.
Possibly testing different flags.
First thing to do is run: sapeli -id

Video Sapeli vs fairymax:
https://www.youtube.com/watch?v=zGUUWj-vJRQ

About Sapeli.
This program was written back in 2016.
Then it reached the point I wanted.
A week ago I thought I lost my old code.
My memory stick died.
Luckily I found my backups.
I cleaned up Sapeli's code and published it.

Sapeli is still rather a perft counter with chess engine.
Than a chess engine with perft counter.
I liked doing this perft stuff.

I used to play myself against fairymax quite a lot.
And thought it would be great to write a program that could play and possibly beat fairymax.

I have no idea of strength. All I know Sapeli beats fairymax.
These are 1 second games:
# Score of Sapeli 1.0 vs Fairy-Max 4.8V: 76 - 14 - 10 [0.81] 100
# Score of Sapeli 1.0 vs Fairy-Max 4.8V: 721 - 193 - 86 [0.76] 1000
In 1 minute games Sapeli beats fairymax also.

About strength.
I have no plans to make a Stockfish clone.
I have wasted too much time with chess programming.
So from now on I'm only improving code quality and fixing bugs.
But if you want to improve Sapeli's strength then go ahead!

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 2:22 pm
by Roland Chastain
Hello!

Congratulations for beating Fairy-Max. :wink:

I tried to build the engine under Windows, with different compilers, but it seems that some parts of the code are not portable.

I wonder if it would be easy to make a Windows compatible version.

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 3:43 pm
by JohnWoe
Thanks!

I forgot to mention I have only tested on Linux.
I don't have any Windows or MacOS machines to test with.
In Sapeli there's not much Linux specific stuff.
Propably:

Code: Select all

static char Input_available() 
?
But somebody with experience porting Linux stuff to Windows knows better.

Sapeli beats Fairy-Max in all time controls. As far as I can tell.
Sometimes Fairy-Max runs out of time. Its qsearch explodes. ( As far as I know Sapeli never runs out time. )
And sometimes Fairy-Max even crashes.
But it's a great opponent for Sapeli.

I forgot to mention since Fairy-Max can't play chess960 I tested against Stockfish -> "make gamestockfish".
In 300ms games Sapeli is able to hang on w/ 50% score.
In longer games of course no change.

But ultimate strength was never the goal.

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 4:13 pm
by Roland Chastain
Here is the error I get with MinGW-GCC.

Code: Select all

Sapeli.c: In function 'Input_available':
Sapeli.c:2251:2: error: unknown type name 'fd_set'
  fd_set a;

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 6:52 pm
by tmokonen
It compiles cleanly under Cygwin. I have uploaded 32 and 64 bit compiles here:

http://tonyschess.x10host.com/Sapeli1.0.rar

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 7:33 pm
by Gabor Szots
tmokonen wrote: Sat Apr 20, 2019 6:52 pm It compiles cleanly under Cygwin. I have uploaded 32 and 64 bit compiles here:

http://tonyschess.x10host.com/Sapeli1.0.rar
Thanks, Tony. 64-bit O3 (which is about twice as fast as O2) seems to run OK here.

Re: Sapeli 1.0 - New chess engine

Posted: Sat Apr 20, 2019 7:40 pm
by tmokonen
Gabor Szots wrote: Sat Apr 20, 2019 7:33 pm
tmokonen wrote: Sat Apr 20, 2019 6:52 pm It compiles cleanly under Cygwin. I have uploaded 32 and 64 bit compiles here:

http://tonyschess.x10host.com/Sapeli1.0.rar
Thanks, Tony. 64-bit O3 (which is about twice as fast as O2) seems to run OK here.
The O2 and O3 are different levels of optimization. The O3 compiles should be faster, but I can't guarantee that on all hardware. The O3 compile is faster on my hardware, but only 20% faster or so.

Re: Sapeli 1.0 - New chess engine

Posted: Sun Apr 21, 2019 1:48 am
by JohnWoe
Nice. Thanks all.

I added some

Code: Select all

_kbhit()
compile with -DWINDOWS_BUILD flag or use "make windowsbuild".
https://github.com/SamuraiDangyo/Sapeli ... li.c#L2261
It probably won't work so I will take it off in future.
But if it works it can stay.

I tested some optimization levels:
make suite5
No optimization: nodes 24037116 mnps 8.668 time 2.773
O1: nodes 24037116 mnps 19.849 time 1.211
O2: nodes 24037116 mnps 20.704 time 1.161
O3: nodes 24037116 mnps 20.686 time 1.162

The big suite: make suite7
# nodes 23772192204 mnps 16.219 time 1465.738

But these vary on different machines.
-bench is propably better benchmark anyway.
-suite is just perft numbers.

Small fixes. Upgraded to 1.01 version.
Sapeli is pretty fast.
It's getting 5 mnps while Fairy-Max 5.0 is getting 1.1 mnps on my machine.

Re: Sapeli 1.0 - New chess engine

Posted: Sun Apr 21, 2019 5:30 am
by Spill_The_Tea
Hi JohnWoe,

I only had to change one line to be able to compile on MacOS.
Sapeli.c, Line 2250: #ifdef _WIN32

Otherwise works great. Nice work!

Re: Sapeli 1.0 - New chess engine

Posted: Sun Apr 21, 2019 10:52 am
by JohnWoe
Thanks for testing!

I updated this. It was very little code for Windows/MacOS machines. Which is great.

Code: Select all

#if defined(WINDOWS_BUILD) || defined(_WIN32) || defined(_WIN64)
https://github.com/SamuraiDangyo/Sapeli ... li.c#L2266

I have been making only fixes no functional changes.