New engine: Lunarr

Questions and comments related to CCRL testing study
Post Reply
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

New engine: Lunarr

Post by Eliagiac »

Hi everyone,

For the past couple of years, I've been working on a UCI chess engine written in C#, and I believe it's now stable enough to compete with other engines.
It is free and open-source. The code and releases can be found here: https://github.com/Eliagiac/lunarr-chess-engine.

It's a personal project I developed independently, taking inspiration from various sources, like the Chess Programming wiki and other engines (full sources list in the GitHub readme).
There are still tons of features I'd like to add, and I will be releasing updates on GitHub occasionally. When I do, should I post about it here?

From the limited testing I've done against other engines, it has an estimated ELO rating of about 2000.
It would be amazing to see it listed on the CCRL! If there's anything else I need to do please let me know.

Here are more details on the engine:
- Name: Lunarr 2.0.0
- Protocol: UCI
- Author: Elia Giaccardi
- Country: Italy
- Source Code: https://github.com/Eliagiac/lunarr-chess-engine
- Download link: https://github.com/Eliagiac/lunarr-ches ... ses/latest
- Estimated strength: ~2000 ELO
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

Oh, I have just noticed your post.

What you have provided here is enough. You may announce future versions here. An alternative is TalkChess. Also, I'm going to visit your site and follow you there.

Although my schedule is crowded I'm going to try to test your engine before long.

EDIT: It does not move under Arena. In fact it does not seem to load at all. From the command line it does not start. What do you think I do wrong?
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

Thank you, I updated the release to include various dependencies in the .exe file. I think it should work fine now: https://github.com/Eliagiac/lunarr-ches ... tag/v2.0.0
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

Eliagiac wrote: Sun Jan 28, 2024 6:47 pm Thank you, I updated the release to include various dependencies in the .exe file. I think it should work fine now: https://github.com/Eliagiac/lunarr-ches ... tag/v2.0.0
Uhh, it's huge! But it moves.

Only, it displays its name as White Widow. To be honest, I like that name much more. But you must have your reasons.
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

I fixed that issue, it now correctly identifies itself as "Lunarr": https://github.com/Eliagiac/lunarr-ches ... tag/v2.0.1

White Widow was what I originally called the project, but it was pretty random and didn't really have any meaning. Recently I decided to dedicate it to my cat Luna who's been my companion throughout the project's development.

About the size issue, the new executable includes .NET dependencies that are required to run the program. Before, it only took up about 140 kB, but in order to run it .NET needed to already be present on the machine.

If the runtime memory usage is the problem, I could look into trying to reduce that. On my system, it uses around 300-500 MB when thinking. One thing that affects this is the hash table size: by default, it's set to 64 MB, but it can be changed using "setoption name Hash value size_in_megabytes".
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

Eliagiac wrote: Sun Jan 28, 2024 9:32 pm I fixed that issue, it now correctly identifies itself as "Lunarr": https://github.com/Eliagiac/lunarr-ches ... tag/v2.0.1

White Widow was what I originally called the project, but it was pretty random and didn't really have any meaning. Recently I decided to dedicate it to my cat Luna who's been my companion throughout the project's development.

About the size issue, the new executable includes .NET dependencies that are required to run the program. Before, it only took up about 140 kB, but in order to run it .NET needed to already be present on the machine.

If the runtime memory usage is the problem, I could look into trying to reduce that. On my system, it uses around 300-500 MB when thinking. One thing that affects this is the hash table size: by default, it's set to 64 MB, but it can be changed using "setoption name Hash value size_in_megabytes".
Thanks. Memory usage is not a problem. BTW, I have .NET 3 and .NET 7 installed.

What I suggest for future versions is that version number be indicated in id name. If all versions will display only Lunarr, confusion might set in.
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

I have started a tournament with version 2.0.1. I'm just watching the first game and I'm a bit worried because memory usage is constantly growing, now it's at 1210 MB at move 40. At move 60 it is 1520. Maximum value, when the game ended at move 80, was 1566 if my eyes did not deceive me.

I can tolerate that if it does not go higher because I have 32 GB RAM but somehow I feel that it is not how it ought to be. Can you explain why that is?

EDIT: Sometimes the memory usage goes down somewhat and then up again.
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

Gabor Szots wrote: Mon Jan 29, 2024 9:08 am What I suggest for future versions is that version number be indicated in id name. If all versions will display only Lunarr, confusion might set in.
Thanks, I see you already did that.
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

Gabor Szots wrote: Mon Jan 29, 2024 9:08 am BTW, I have .NET 3 and .NET 7 installed.
I developed the engine using .NET 8, so it needs the latest libraries to work properly.
Gabor Szots wrote: Mon Jan 29, 2024 5:06 pm I'm just watching the first game and I'm a bit worried because memory usage is constantly growing, now it's at 1210 MB at move 40. At move 60 it is 1520. Maximum value, when the game ended at move 80, was 1566 if my eyes did not deceive me.
That's interesting, when testing it myself I never saw it go above 1 GB. It starts at 300-500 MB, then goes up as the game progresses, occasionally dropping by about 200 MB. I'm not exactly sure what causes the fluctuations and drops, but I'll look into it.
What time control were you using? I'd like to try and replicate the issue.
User avatar
Gabor Szots
Posts: 12849
Joined: Sat Dec 09, 2006 6:30 am
Sign-up code: 10159
Location: Szentendre, Hungary

Re: New engine: Lunarr

Post by Gabor Szots »

Eliagiac wrote: Wed Jan 31, 2024 1:21 pm What time control were you using? I'd like to try and replicate the issue.
1:40+1 (100 sec + 1 secs)
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

I just published a new release addressing the memory issues: https://github.com/Eliagiac/lunarr-ches ... tag/v2.1.0
It now uses about 400-600 MB while playing, much better compared to the 1 GB+ of before.

Previously, the engine was keeping track of all the nodes in the search tree at all times. I originally implemented this to create a visualization of the tree once the search was over.
The new implementation does not store references to the children of a node by default, resulting in those objects being deleted from memory when the search moves on to another node.

These changes also caused an increase in the nodes searched per second of ~40%, resulting in a significant improvement in playing strength.
User avatar
Graham Banks
Posts: 26916
Joined: Sun Dec 18, 2005 5:47 pm
Sign-up code: 0
Location: Auckland, NZ

Re: New engine: Lunarr

Post by Graham Banks »

We use 256mb hash per core, so ideally that is what we should be able to set an engine to use.
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

The hash table size can be configured to any amount of memory, using "setoption name Hash value x". The default value is 64 MB.

I was referring to the overall memory usage of the program, which previously increased indefinitely as the game went on because it was storing recerences to unnecessary objects, sometimes reaching over 1 GB. Now that's down to 400-600 MB.
Ray
Posts: 22606
Joined: Sun Dec 18, 2005 6:33 pm
Sign-up code: 10159
Location: NZ

Re: New engine: Lunarr

Post by Ray »

Graham Banks wrote: Fri Feb 16, 2024 4:12 pm We use 256mb hash per core, so ideally that is what we should be able to set an engine to use.
512MB is an option for 40/15 as well.
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

I found a major bug when detecting draws by repetition. It is now fixed in the latest release: https://github.com/Eliagiac/lunarr-ches ... tag/v2.1.1

All information about positions reached before the root was lost when copying the board with the previous implementation, causing the engine to be blind to immediate draws by repetition. I don't know how I didn't notice this sooner.

These changes resulted in a significant increase in playing strength. I'm still testing to find out the exact Elo difference from the previous version, but I wanted to get this out as soon as possible.

Update: I've been running a tournament in self-play against the previous version. The Elo difference is ~70 points.
User avatar
Graham Banks
Posts: 26916
Joined: Sun Dec 18, 2005 5:47 pm
Sign-up code: 0
Location: Auckland, NZ

Re: New engine: Lunarr

Post by Graham Banks »

Eliagiac wrote: Sat Feb 17, 2024 12:06 pm I found a major bug when detecting draws by repetition. It is now fixed in the latest release: https://github.com/Eliagiac/lunarr-ches ... tag/v2.1.1

All information about positions reached before the root was lost when copying the board with the previous implementation, causing the engine to be blind to immediate draws by repetition. I don't know how I didn't notice this sooner.

These changes resulted in a significant increase in playing strength. I'm still testing to find out the exact Elo difference from the previous version, but I wanted to get this out as soon as possible.

Update: I've been running a tournament in self-play against the previous version. The Elo difference is ~70 points.
Let me know if you think Lunarr would be competitive in my Division 10 field.
Eliagiac
Posts: 8
Joined: Fri Jul 21, 2023 1:55 pm
Sign-up code: 10159

Re: New engine: Lunarr

Post by Eliagiac »

Graham Banks wrote: Sat Feb 17, 2024 4:18 pm Let me know if you think Lunarr would be competitive in my Division 10 field.
It would be amazing to participate in the tournament. However, even with these last few updates, Lunarr has an Elo rating somewhere between 2000 and 2050, whereas the other engines competing seem to be in the 2200-2400 range. I'd still be thrilled to participate if that's not an issue. Thanks again for considering my engine!
Post Reply