Sapeli 1.0 - New chess engine

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.
JohnWoe
Posts: 92
Joined: Sat Mar 02, 2013 10:31 pm

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Wed Jun 12, 2019 11:09 pm

I added those binaries in this folder. In case those links die.
https://github.com/SamuraiDangyo/Sapeli ... naries/bin
It contains 1.0 + 1.01 + 1.02 + 1.11 + 1.20.

My latest development version was getting really buggy. So I had to revert back to 1.19 and bolt my improvements in.
Even move generator got faster. atm I'm only sorting tactical moves to save cycles.

Code: Select all

1.20
= nodes 875605409 mnps 21.061 time 41.575

1.23
= nodes 875605409 mnps 27.680 time 31.633
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.23

I feel like the new passed pawn code is working here.

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

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Thu Jun 20, 2019 11:24 am

I added dynamic hash uci options for Sapeli.
You can set good moves hash + eval hash.
The more the better.
Also clear hash uci option.

If Sapeli leaks memory or there's some bugs/crashes I want to know.
It should be stable.
But you never know.
At least -bench didn't get any slower.

Sapeli 1.27:
Release: https://github.com/SamuraiDangyo/Sapeli ... s/tag/1.27
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.27

It is the same as 1.26 w/o dynamic hash. So if there is some bugs. 1.26 is the way to go.
Sapeli 1.26:
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.26

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

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Mon Jul 08, 2019 12:58 pm

Sapeli 1.33
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.33
Release: https://github.com/SamuraiDangyo/Sapeli ... s/tag/1.33

Sapeli now compiles under clang / g++ / gcc without problems. As I removed some crab that wasn't necessary. Although clang builds are 7x slower. g++ builds are as good as gcc builds.

Some tests. Sapeli scores 90%+ against fairy now in 40 moves in 1 second games:

Code: Select all

standard / tc=40/1 /// Score of Sapeli 1.33 vs Fairy-Max 5.0b: 881 - 57 - 62 [0.912] 1000
chess960 / tc=40/.3 /// Score of Sapeli 1.33 vs Stockfish 8 64: 542 - 458 - 0 [0.542] 1000
More information about this release
https://github.com/SamuraiDangyo/Sapeli ... s.txt#L103

Code: Select all

*   - 1.33
*     + Removed jum_buf / simplifications
*     + Cast malloc for g++
*     + Removed bin folder: Binaries are here -> https://github.com/SamuraiDangyo/Sapeli/tree/binaries/bin
*     + gcc / g++ / clang can now all build ok
*     + gcc   -bench : = nodes 118301084 mnps 3.942 time 30.010
*     + g++   -bench : = nodes 111980203 mnps 3.731 time 30.010
*     + clang -bench : = nodes 20952140 mnps 0.698 time 30.018
*

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

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Mon Jul 08, 2019 3:57 pm

Quick update. Not much difference to 1.33
Added go movetime / depth support. As there was a request + were very simple to add. UCI support is pretty minimal in Sapeli. As I don't like some aspects of it.

Here is Sapeli 1.34: https://github.com/SamuraiDangyo/Sapeli/tree/1.34
Release: https://github.com/SamuraiDangyo/Sapeli ... s/tag/1.34

new commands;

Code: Select all

go movetime 2000
info depth 0 nodes 40 time 0 nps 0 score cp 56 pv e2e3
info depth 1 nodes 248 time 2 nps 124000 score cp 0 pv e2e3
info depth 2 nodes 2754 time 9 nps 306000 score cp 40 pv d2d4
info depth 3 nodes 8855 time 23 nps 385000 score cp 0 pv c2c3
info depth 4 nodes 42316 time 80 nps 528950 score cp 18 pv d2d4
info depth 5 nodes 148267 time 206 nps 719742 score cp 8 pv b1c3
info depth 6 nodes 335418 time 377 nps 889702 score cp 20 pv e2e4
info depth 7 nodes 1038700 time 798 nps 1301629 score cp 14 pv e2e4
info depth 8 nodes 3539640 time 2001 nps 1768935 score cp 14 pv e2e4
bestmove e2e4

go depth 8
info depth 0 nodes 40 time 0 nps 0 score cp 56 pv e2e3
info depth 1 nodes 144 time 1 nps 144000 score cp 0 pv e2e3
info depth 2 nodes 1591 time 1 nps 1591000 score cp 40 pv d2d4
info depth 3 nodes 3800 time 2 nps 1900000 score cp 0 pv d2d4
info depth 4 nodes 15827 time 9 nps 1758555 score cp 18 pv d2d4
info depth 5 nodes 63498 time 24 nps 2645750 score cp 14 pv b1c3
info depth 6 nodes 136499 time 49 nps 2785693 score cp 15 pv b1c3
info depth 7 nodes 778239 time 309 nps 2518572 score cp 10 pv e2e4
info depth 8 nodes 2112449 time 810 nps 2607961 score cp 10 pv e2e4
info depth 9 nodes 2112449 time 810 nps 2607961 score cp 10 pv e2e4
bestmove e2e4

go movetime 500
info depth 0 nodes 40 time 0 nps 0 score cp 56 pv e2e3
info depth 1 nodes 140 time 0 nps 0 score cp 0 pv e2e3
info depth 2 nodes 1411 time 1 nps 1411000 score cp 40 pv d2d4
info depth 3 nodes 3586 time 2 nps 1793000 score cp 0 pv d2d4
info depth 4 nodes 21130 time 10 nps 2113000 score cp 22 pv b1c3
info depth 5 nodes 57460 time 20 nps 2873000 score cp 20 pv b1c3
info depth 6 nodes 223196 time 84 nps 2657095 score cp 18 pv e2e4
info depth 7 nodes 622038 time 225 nps 2764613 score cp 14 pv b1c3
info depth 8 nodes 1254007 time 501 nps 2503007 score cp 14 pv b1c3
bestmove b1c3

go depth 5
info depth 0 nodes 40 time 0 nps 0 score cp 56 pv e2e3
info depth 1 nodes 140 time 1 nps 140000 score cp 0 pv e2e3
info depth 2 nodes 1402 time 1 nps 1402000 score cp 40 pv d2d4
info depth 3 nodes 3452 time 2 nps 1726000 score cp 0 pv d2d4
info depth 4 nodes 15537 time 8 nps 1942125 score cp 23 pv b1c3
info depth 5 nodes 50883 time 18 nps 2826833 score cp 14 pv b1c3
info depth 6 nodes 50883 time 18 nps 2826833 score cp 14 pv b1c3
bestmove b1c3

Norbert Raimund Leisner
Posts: 1601
Joined: Tue May 20, 2008 2:57 pm
Location: Augsburg - Germany

Re: Sapeli 1.0 - New chess engine

Post by Norbert Raimund Leisner » Wed Jul 17, 2019 1:50 pm

Are anywhere Windows binaries 64-bit of Sapeli 1.34 - 1.35 available for download?

User avatar
Roland Chastain
Posts: 210
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 » Wed Jul 17, 2019 5:39 pm

Norbert Raimund Leisner wrote:
Wed Jul 17, 2019 1:50 pm
Are anywhere Windows binaries 64-bit of Sapeli 1.34 - 1.35 available for download?
Hello Norbert! Here you are.

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

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Wed Jul 24, 2019 8:51 am

Thanks to Ronald Chastain for builds! I added them to the list: https://github.com/SamuraiDangyo/Sapeli ... naries/bin

I download my source from github so I want Sapeli source code to be 60KB not MBs to quickly download.

Vey minor update:
+ Max moves 256 -> 218. Very very tiny speed boost.
+ Added -analyze. Not sure if this is useful to anyone. Might remove it in 1.37.
- Code: https://github.com/SamuraiDangyo/Sapeli ... li.c#L3728
+ Small fixes.
+ Checked for memory leaks with valgrind. No issues anymore.

Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.36
Release: https://github.com/SamuraiDangyo/Sapeli ... s/tag/1.36

As Sapeli has fast movegen it actually generates even games really fast. So -analyze just plays random moves and shows score of those games. Mostly draws because 3rep + 50move rule.

Code: Select all

./sapeli -analyze

Code: Select all

~~~ Analyze( 10000 ) ~~~
[ Fen: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq ]
[ Analysing ... ]
[ Score: 69 - 55 - 876 [0.51] 1000 ]
[ Score: 130 - 121 - 1749 [0.50] 2000 ]
[ Score: 174 - 185 - 2641 [0.50] 3000 ]
[ Score: 231 - 254 - 3515 [0.50] 4000 ]
[ Score: 299 - 293 - 4408 [0.50] 5000 ]
[ Score: 372 - 354 - 5274 [0.50] 6000 ]
[ Score: 441 - 417 - 6142 [0.50] 7000 ]
[ Score: 507 - 480 - 7013 [0.50] 8000 ]
[ Score: 567 - 540 - 7893 [0.50] 9000 ]
=
[ Time: 77.22s ]
[ Speed: 129.51 games/s ]
[ Score: 629 - 602 - 8769 [0.50] 10000 ]

Code: Select all

./sapeli -fen "6k1/RQPPR3/8/8/8/8/8/2K5 w - - 0 1" -analyze 30000 # white is winning

Code: Select all

...
[ Score: 10708 - 0 - 16292 [0.70] 27000 ]
[ Score: 11129 - 0 - 16871 [0.70] 28000 ]
[ Score: 11506 - 0 - 17494 [0.70] 29000 ]
=
[ Time: 31.80s ]
[ Speed: 943.42 games/s ]
[ Score: 11915 - 0 - 18085 [0.70] 30000 ]

Gabor Szots
Posts: 247
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 » Wed Jul 24, 2019 9:53 am

JohnWoe wrote:
Wed Jul 24, 2019 8:51 am
+ Max moves 256 -> 218. Very very tiny speed boost.
+ Added -analyze. Not sure if this is useful to anyone. Might remove it in 1.37.
Max moves: Does that mean it can't make more than 218 moves?

Analyze: I am sure most people who use Sapeli welcome that feature.
Gabor Szots
CCRL testing group

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

Re: Sapeli 1.0 - New chess engine

Post by JohnWoe » Wed Jul 24, 2019 12:40 pm

Gabor Szots wrote:
Wed Jul 24, 2019 9:53 am
JohnWoe wrote:
Wed Jul 24, 2019 8:51 am
+ Max moves 256 -> 218. Very very tiny speed boost.
+ Added -analyze. Not sure if this is useful to anyone. Might remove it in 1.37.
Max moves: Does that mean it can't make more than 218 moves?

Analyze: I am sure most people who use Sapeli welcome that feature.
Thanks for the feedback!
That max moves means maximum moves per position. Basically just for move generator. Gives a tiny speed boost. I measured ~+0.3 mnps.
Code: https://github.com/SamuraiDangyo/Sapeli ... peli.c#L59
There is this link: https://chess.stackexchange.com/questio ... -in-a-turn
As it seems that 218 is the maximum moves per position.

Analyze can stay for now. It is in 1.36 + 1.37. It prints results every 1000 games. Can stop it anytime you want.

Forgot in 1.36...
Added Draw_material() to Result(). Now Sapeli analyzes 10% faster.
Not much other difference to 1.36.
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.37

Gabor Szots
Posts: 247
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 » Wed Jul 24, 2019 1:27 pm

JohnWoe wrote:
Wed Jul 24, 2019 12:40 pm

Thanks for the feedback!
That max moves means maximum moves per position. Basically just for move generator. Gives a tiny speed boost. I measured ~+0.3 mnps.
Code: https://github.com/SamuraiDangyo/Sapeli ... peli.c#L59
There is this link: https://chess.stackexchange.com/questio ... -in-a-turn
As it seems that 218 is the maximum moves per position.

Analyze can stay for now. It is in 1.36 + 1.37. It prints results every 1000 games. Can stop it anytime you want.

Forgot in 1.36...
Added Draw_material() to Result(). Now Sapeli analyzes 10% faster.
Not much other difference to 1.36.
Source code: https://github.com/SamuraiDangyo/Sapeli/tree/1.37
I guess I misunderstood not only max moves but analyze as well. I thought it was analysis mode.
Gabor Szots
CCRL testing group

Post Reply