Sapeli 1.0 - New chess engine

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
JohnWoe
Posts: 77
Joined: Sat Mar 02, 2013 10:31 pm

Sapeli 1.0 - New chess engine

Post by JohnWoe » Sat Apr 20, 2019 9:08 am

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!

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

Re: Sapeli 1.0 - New chess engine

Post by Roland Chastain » Sat Apr 20, 2019 12:22 pm

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.

JohnWoe
Posts: 77
Joined: Sat Mar 02, 2013 10:31 pm

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Sat Apr 20, 2019 1:43 pm

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.

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

Re: Sapeli 1.0 - New chess engine

Post by Roland Chastain » Sat Apr 20, 2019 2:13 pm

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;

tmokonen
Posts: 1020
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

Re: Sapeli 1.0 - New chess engine

Post by tmokonen » Sat Apr 20, 2019 4:52 pm

It compiles cleanly under Cygwin. I have uploaded 32 and 64 bit compiles here:

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

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

Re: Sapeli 1.0 - New chess engine

Post by Gabor Szots » Sat Apr 20, 2019 5:33 pm

tmokonen wrote:
Sat Apr 20, 2019 4: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.
Gabor Szots
CCRL testing group

tmokonen
Posts: 1020
Joined: Sun Mar 12, 2006 5:46 pm
Location: Vancouver

Re: Sapeli 1.0 - New chess engine

Post by tmokonen » Sat Apr 20, 2019 5:40 pm

Gabor Szots wrote:
Sat Apr 20, 2019 5:33 pm
tmokonen wrote:
Sat Apr 20, 2019 4: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.

JohnWoe
Posts: 77
Joined: Sat Mar 02, 2013 10:31 pm

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Sat Apr 20, 2019 11:48 pm

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.

Spill_The_Tea
Posts: 22
Joined: Mon Dec 17, 2018 2:33 am
Full name: Jase de Lace

Re: Sapeli 1.0 - New chess engine

Post by Spill_The_Tea » Sun Apr 21, 2019 3:30 am

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!

JohnWoe
Posts: 77
Joined: Sat Mar 02, 2013 10:31 pm

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Sun Apr 21, 2019 8:52 am

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.

Post Reply