Page 1 of 1

New engine: Rengar

Posted: Sat Aug 12, 2023 4:42 pm
by Thomas Swayze
Hi,

As a project to learn C++, I wrote a chess engine from scratch. I would love for it to have an official rating!

Source code and release binary for mac: https://github.com/teswayze/rengar/

Based on results from lichess bot games agains CCRL rated engines, I'd expect a rating in the ballpark of 2500

Re: New engine: Rengar

Posted: Sat Aug 12, 2023 10:52 pm
by Ray
None of us have Macs. Chess is dominated by Windows and Linux machines, but potentially one of us may be able to compile for Windows (which is what all of us happen to use)

Re: New engine: Rengar

Posted: Sun Aug 13, 2023 4:33 pm
by Thomas Swayze
Gotcha - I’m working on a Windows compatible version now

Re: New engine: Rengar

Posted: Wed Aug 16, 2023 8:38 am
by Guenther
Ray wrote: Sat Aug 12, 2023 10:52 pm None of us have Macs. Chess is dominated by Windows and Linux machines, but potentially one of us may be able to compile for Windows (which is what all of us happen to use)
I had no problems to compile a static default release binary (which is bmi2).
If you, or anyone from CCRL want to try it, I have uploaded it here for a while:

https://rwbc-chess.de/Downloads/Engines ... ar_bmi2.7z

I cannot try it myself as long as I have not updated my hardware (may be this fall).

@Thomas Swayze
It would be nice, if you would add an alternative (slower way) for bitmasking except using 'pext',
which would allow to compile it for older hardware too.

Guenther (RWBC)

Re: New engine: Rengar

Posted: Thu Aug 17, 2023 4:41 am
by Thomas Swayze
Guenther wrote: Wed Aug 16, 2023 8:38 am It would be nice, if you would add an alternative (slower way) for bitmasking except using 'pext',
which would allow to compile it for older hardware too.
Done: https://github.com/teswayze/rengar/pull/4

You can compile with

Code: Select all

make no-BMI2=1
or

Code: Select all

make no-BMI=1
Time to depth was up 50% when I benchmarked it.

Re: New engine: Rengar

Posted: Sat Aug 19, 2023 3:50 am
by Thomas Swayze
I released v1.0.1. Same as the original, but with windows binaries and compilable without BMI2 instructions.

https://github.com/teswayze/rengar/releases/tag/v1.0.1

Re: New engine: Rengar

Posted: Sat Aug 19, 2023 3:51 am
by Graham Banks
Thomas Swayze wrote: Sat Aug 19, 2023 3:50 am I released v1.0.1. Same as the original, but with windows binaries and compilable without BMI2 instructions.

https://github.com/teswayze/rengar/releases/tag/v1.0.1
Roughly how strong do you estimate Rengar 1.0.1 64-bit to be?

Re: New engine: Rengar

Posted: Sat Aug 19, 2023 4:36 am
by Thomas Swayze
Graham Banks wrote: Sat Aug 19, 2023 3:51 am Roughly how strong do you estimate Rengar 1.0.1 64-bit to be?
At blitz time controls, I'd guess around 2500. This is based off of some lichess bot games agains CCRL rated engines. Rengar is 1/6 against Odonata, 0/5 against Cheng, 4/4 against Eubos, 2.5/4 against Fatalii, 1.5/2 against Fornax, 0/2 against Phalanx. Of course the hardware comparison is probably apples-to-oranges so there's a pretty wide margin for error here - I wouldn't be surprised if this was off by 300 points in either direction.

I haven't tested Rengar at slower time controls. I'd expect it to be worse there as the simple eval with fast search shouldn't scale as well.

Re: New engine: Rengar

Posted: Sat Aug 19, 2023 5:34 pm
by Gabor Szots
Thomas Swayze wrote: Sat Aug 19, 2023 3:50 am I released v1.0.1. Same as the original, but with windows binaries and compilable without BMI2 instructions.

https://github.com/teswayze/rengar/releases/tag/v1.0.1
The BMI2 exe you provide does not run on my PC, it complains of several missing DLL's.

I tried the makefile but it issued uncountable error messages (1 MB file!). This is how it starts:
lto-wrapper.exe: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\szots\AppData\Local\Temp\ccJwMTP5.ltrans0.ltrans.o:<artificial>:(.text+0x38eb): undefined reference to `doctest::String::String(char const*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\szots\AppData\Local\Temp\ccJwMTP5.ltrans0.ltrans.o:<artificial>:(.text+0x3914): undefined reference to `doctest::detail::ResultBuilder::ResultBuilder(doctest::assertType::Enum, char const*, int, char const*, char const*, doctest::String const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\szots\AppData\Local\Temp\ccJwMTP5.ltrans0.ltrans.o:<artificial>:(.text+0x3921): undefined reference to `doctest::String::~String()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\szots\AppData\Local\Temp\ccJwMTP5.ltrans0.ltrans.o:<artificial>:(.text+0x394e): undefined reference to `doctest::detail::ExpressionDecomposer::ExpressionDecomposer(doctest::assertType::Enum)'
So at the moment I am unable to test your engine.

Re: New engine: Rengar

Posted: Sun Aug 20, 2023 2:00 pm
by Thomas Swayze
Thanks for your efforts and patience with this.
Gabor Szots wrote: Sat Aug 19, 2023 5:34 pm The BMI2 exe you provide does not run on my PC, it complains of several missing DLL's.
My mistake - TIL about static linking. This should be fixed now in v1.0.2: https://github.com/teswayze/rengar/releases/tag/v1.0.2
Gabor Szots wrote: Sat Aug 19, 2023 5:34 pm I tried the makefile but it issued uncountable error messages (1 MB file!).
All the errors I see there have to do with doctest, which shouldn't be included with the release build at all. I haven't been able to get the test build to work either in CI on github or on my windows VM. Because I'm not going to iterating on the engine on a windows platform fixing this is a low priority for me right now.

But the release build ("make release" or just "make") should work fine on windows, as confirmed by CI on github as well as on my VM. Just to add an extra layer of protection I factored out the tests into separate files so they won't even be touched by the release build.

Re: New engine: Rengar

Posted: Wed Aug 23, 2023 4:39 am
by Thomas Swayze
Have you had a chance to test this yet? Version 1.0.2 works for me on a fresh install of Windows 10 now

Re: New engine: Rengar

Posted: Wed Aug 23, 2023 5:32 am
by Gabor Szots
Thomas Swayze wrote: Wed Aug 23, 2023 4:39 am Have you had a chance to test this yet? Version 1.0.2 works for me on a fresh install of Windows 10 now
I was about to post that I have just started a gauntlet with it.

Re: New engine: Rengar

Posted: Wed Aug 23, 2023 12:36 pm
by Thomas Swayze
Fantastic! :mrgreen: Thanks so much!

Re: New engine: Rengar

Posted: Mon Aug 28, 2023 5:53 am
by Gabor Szots
On the list now. Further testing in progress to make the error margins narrower.

Re: New engine: Rengar

Posted: Sun Sep 17, 2023 11:48 am
by Graham Banks
Could you please allow Rengar to use 256mb hash, which is what we usually assign to 1CPU engines?

Re: New engine: Rengar

Posted: Sun Sep 17, 2023 12:18 pm
by Gabor Szots
Graham Banks wrote: Sun Sep 17, 2023 11:48 am Could you please allow Rengar to use 256mb hash, which is what we usually assign to 1CPU engines?
The defult hashbits=24 seem to result in a 256 MB hash table but selecting 25 you can double that value.

Re: New engine: Rengar

Posted: Sun Sep 17, 2023 12:32 pm
by Thomas Swayze
Correct. Each hash entry is 16 bytes, so setting hashbits=24 means you use 2^28 bytes or 256MB. I made an issue to have a “hash” option similar to how other engines do it.

Re: New engine: Rengar

Posted: Sun Sep 17, 2023 3:29 pm
by Graham Banks
Thomas Swayze wrote: Sun Sep 17, 2023 12:32 pm Correct. Each hash entry is 16 bytes, so setting hashbits=24 means you use 2^28 bytes or 256MB. I made an issue to have a “hash” option similar to how other engines do it.
:thumbup: