Progress on Rustic

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Progress on Rustic

Post by algerbrex »

mvanthoor wrote: Wed Apr 05, 2023 10:50 am I feel it is the same with move generators: Fancy / Black Magic Bitboards + PEXT are so fast, and current evaluations and NN's take up so much computational power, that any improvement that can be measured outside the margin of error will probably be less than 5 Elo.
That's a bit where I am right now, looking at the recent work that has been done here by several people on new move generator techniques. I mean absolutely no disrespect, but I just don't find the discussions all that interesting, personally. I do have to admit I haven't taken the time to really dig into the new methods developed, but once I figured out how magic bitboards worked, I was pretty satisfied with the move generation and basically haven't touched the code in almost two years.

I might look into implementing some of the new techniques for fun at some point and running my own tests, but right now I just have to admit I'm not very motivated to :)
User avatar
lithander
Posts: 915
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Progress on Rustic

Post by lithander »

algerbrex wrote: Wed Apr 05, 2023 9:41 pm I might look into implementing some of the new techniques for fun at some point and running my own tests, but right now I just have to admit I'm not very motivated to :)
I thought I was feeling the same, then got involved due to a variety of reasons. It did bug me that I didn't understand Mike's sliding generator idea just from reading his code and now that I do understand it I think it's pretty cool. Leorik's movegen was something I came up with on my own and I always planned to compare it to the established methods to see how much performance I'm sacrificing. So when Daniel nudged me into that by compiling a faster version of Leorik without going into much details how I couldn't ignore the challenge ;)
algerbrex wrote: Tue Apr 04, 2023 7:18 pm I plan on writing a simplified explanation with a slightly more math-y flavor, but hopefully still clear. Because once you understand the idea behind gradient descent, really the main challenge is then figuring out how to compute the relevant derivatives.
I think this paper would be a great contribution! Do that first! ;) Especially if it's less math-y than Andrew Grants paper on the topic (https://pdfhost.io/v/Q~Yrnl8kj_Tuningpdf.pdf) which, by all means, was a great read to get me started when I was stuck with Texels method and didn't know how to improve.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Progress on Rustic

Post by mvanthoor »

lithander wrote: Wed Apr 05, 2023 10:16 pm I think this paper would be a great contribution! Do that first! ;) Especially if it's less math-y than Andrew Grants paper on the topic (https://pdfhost.io/v/Q~Yrnl8kj_Tuningpdf.pdf) which, by all means, was a great read to get me started when I was stuck with Texels method and didn't know how to improve.
Everything that is a clear and correct explanation of a difficult subject is a great contribution. The fact that most chess engines where written in C, using tricks and sometimes even undefined behavior, along with the fact that nothing was clearly documented, has been one of the greatest drivers for me to finally start Rustic after Rust hit version 1.0.

===

PS: I'm now posting this from my new computer. I've installed Debian Linux Bookworm (now in Testing phase) and it seems I got everything to work even though the installation is not perfect. My usual installation ended up missing a bunch of packages so the system didn't boot into the desktop. That was an easy fix. The one thing I'm now seeing is that it displays an error (with the annotation (bug) after it) that it can't probe something in the bios. I'll look into that later and if needed report it. It doesn't seem to affect anything though.

I've been running some tests with the 7950X in 105W Eco mode, in which the power draw is basically the same as that of a 5950X. For now I also applied a "negative 10" (where "10" in the BIOS has no unit, but it can go from 0 to 30). In that mode the base clock seems to be 3 GHz. With 16 threads loaded in stress-ng, it boosts to 4.4 GHz. With 24 threads loaded it boosts to 4.7 GHz, and with 32 threads it hovers between 5.0 and 5.1 GHz and then doesn't go any higher. When fully loaded the temperature flatlines at 73.5 degrees, but the fans are louder than I'd like them to be because in the BIOS they go flat-out starting at 70 degrees with the "Silent" profile. I'll have to do something about that. Turning them down to 90% or 85% (around 1800 RPM) should make a massive difference in noise but not in temperature.

When doing normal work or browsing or whatever, the system is completely silent as all fans run at 500 RPM at that point.

Now I just have to install the second SSD and a support strut for the graphics card (damn those things are huge nowadays), and pull all the data from the old system. Then change about 5 million settings in KDE and I'd be done. Maybe tinker with some settings here or there in the first few weeks.

Finally back to some chess programming... almost.

And then I hope to put system building and configuration to the side again for another 8-10 years or so.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
JoAnnP38
Posts: 253
Joined: Mon Aug 26, 2019 4:34 pm
Location: Clearwater, Florida USA
Full name: JoAnn Peeler

Re: Progress on Rustic

Post by JoAnnP38 »

lithander wrote: Wed Apr 05, 2023 10:16 pm
algerbrex wrote: Wed Apr 05, 2023 9:41 pm I might look into implementing some of the new techniques for fun at some point and running my own tests, but right now I just have to admit I'm not very motivated to :)
I thought I was feeling the same, then got involved due to a variety of reasons. It did bug me that I didn't understand Mike's sliding generator idea just from reading his code and now that I do understand it I think it's pretty cool. Leorik's movegen was something I came up with on my own and I always planned to compare it to the established methods to see how much performance I'm sacrificing. So when Daniel nudged me into that by compiling a faster version of Leorik without going into much details how I couldn't ignore the challenge ;)
algerbrex wrote: Tue Apr 04, 2023 7:18 pm I plan on writing a simplified explanation with a slightly more math-y flavor, but hopefully still clear. Because once you understand the idea behind gradient descent, really the main challenge is then figuring out how to compute the relevant derivatives.
I think this paper would be a great contribution! Do that first! ;) Especially if it's less math-y than Andrew Grants paper on the topic (https://pdfhost.io/v/Q~Yrnl8kj_Tuningpdf.pdf) which, by all means, was a great read to get me started when I was stuck with Texels method and didn't know how to improve.
I'm still using the Texel method basically, although I've made several improvements that have drastically increased its performance. Right now I can process 8-10 million positions and converge on an optimization to 6 decimal places in about 30 minutes. I call my new algorithm "Stochastic Texel with Mini-Batches" :D 8-) :shock: . I won't need anything faster until release 3 of Pedantic where I plan to have different sets of PST based on the location of the enemy king. I'll need to process a lot more data I think.
User avatar
Ras
Posts: 2694
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Progress on Rustic

Post by Ras »

mvanthoor wrote: Thu Apr 06, 2023 12:01 am and a support strut for the graphics card (damn those things are huge nowadays)
In my case from 2010, I even had to cut out parts of the 5.25" bay because the GPU wouldn't fit with 31cm length, and yes, it did include a support strut. The 6750 XT plus a Ryzen 5700X provide solid 1080p gaming performance with about 120FPS in Witcher 3. The other PC here has a 6650 XT for 1080p/60Hz, and a PS3 controller for Dark Souls III works out of the box. The kicker: both PCs run Linux Mint, even for gaming. Steam has really made things easy.
Rasmus Althoff
https://www.ct800.net
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Progress on Rustic

Post by mvanthoor »

Almost done setting up the development environment. (I'm taking the chance of this new install to also clean up lots of unused stuff by either not getting it from the old system or just not installing it.) I tested Rustic's first run. On this CPU it runs at 51 million nodes/second in perft (no hash, no bulk counting etc), up from 32 million on the old system. So the singlethreaded performance of this 7950X is about 60% higher than the 6700K. Clock speeds are insane. The 6700K has a base of 4 GHz and boost to 4.2 for all cores. The 7950X has a base of 4.5 GHz, and boosts to 5.1 - 5.6 GHz depending on how many cores are loaded.

With power drain capped at 105W Eco mode and an undervolt of 15 (setting is 1-30), it runs at 5.1 GHz on all cores when loaded with 32 threads. Temperature sits stable at 75 degrees with my cooling solution: a Noctua NH-U12A that runs at 20% when under 50 degrees, and at 50% when between 50 degrees and 85 degrees. Over 85 degrees it'll ramp up to 80%. It also has three case fans with the same fan curve. (I might still tweak stuff like that in the future.)

During normal use the computer is basically dead silent. When running at full load, the noise level is comparable to that of my old system at full load.

It seems everything's fine, so I can now just finish setting up and get back to chess programming.
Ras wrote: Fri Apr 07, 2023 9:52 pm In my case from 2010, I even had to cut out parts of the 5.25" bay because the GPU wouldn't fit with 31cm length, and yes, it did include a support strut. The 6750 XT plus a Ryzen 5700X provide solid 1080p gaming performance with about 120FPS in Witcher 3. The other PC here has a 6650 XT for 1080p/60Hz, and a PS3 controller for Dark Souls III works out of the box. The kicker: both PCs run Linux Mint, even for gaming. Steam has really made things easy.
That was one massive GPU for 2010. My current one (MSI RX 6750 XT GamingX 12 GB) is just under 31cm. But it's much bigger than the previous MSI GTX 1070 GamingX 8GB it replaces. It's 2.5 slots instead of 2, has 3 fans instead of 1, and it's 5cm longer.

It has an anti-sag bracket delivered with it, but it takes up three more slots. I just use this: Support strut It costs around 8-12 euro. It basically is a little pillar with a magnet at the bottom. You put it under the graphics card (careful to not have it touch the fans). The magnet makes it click to the PSU shroud and it stands up on its own. Then you extend the strut, lift the card and bolt it into place.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Progress on Rustic

Post by mvanthoor »

Unexpected... When running 16 games in parallel, the CPU will hit 86 degrees in Eco mode. None of the stress tests I've tried managed to get it over 76 degrees. It seems chess engines are some special kind if stress test. There's no way to lower temperature further except by hard-capping the clock speed at something like 4.8 GHz or lowering the power drain down to 65W Eco mode. I don't know if I want to sacrifice that much performance. Even though from day to day use, it would not make any difference to cap the clock speed... but also leaving it where it is shouldn't be a problem because AMD designed the CPU to always hit 95C out of the box, except with the biggest water coolers available.

Weird times. Up to the Core 10 series, people would freak out if a CPU ran over 70 degrees at full load and now they're designed to just keep boosting to use up all the allotted power, or if power is set to "whatever you can get", use up all the thermal headroom.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
lithander
Posts: 915
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Progress on Rustic

Post by lithander »

You don't need the Eco modes, you can set the PPT directly and chose something above 65W but below what you currently have. Also try the Curve Optimizer for some undervolting to mitigate the performance drop from limiting power draw.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Progress on Rustic

Post by mvanthoor »

lithander wrote: Sun Apr 09, 2023 5:22 pm You don't need the Eco modes, you can set the PPT directly and chose something above 65W but below what you currently have. Also try the Curve Optimizer for some undervolting to mitigate the performance drop from limiting power draw.
I already have. I set the 105W Eco mode and put the curve optimizer to -15. When running a gauntlet with 16 threads, the CPU hovers around 84 degrees at 5.3 GHz. When running gauntlet with 24 threads, it's actually cooler at around 81 degrees, but the speed dropped to 5.1 GHz.

The cooler is a Noctua NH-U12A which, at temperatures between 55 and 85 degrees is running at 50% fan speed.

I'm quite sure that, even despite the 105W Eco mode, this CPU is going to hit 95C in the summer.

In the end it doesn't matter if the speed is X or Y, as long as the entire gauntlet is run at that speed. Still, I don't like the fact that manufacturers are using power or heat as the target for CPU speed. I want to be able to set a CPU speed, and that's it, even if you're not even close to hitting your power or heat limit. There is such an option, at least with my Asus board ("Per Core Boost Clock Limit"), but the option either doesn't do anything (broken), or it only works on Windows / needs some sort of driver in the operating system.

The thing I like even less is that this BIOS has some options in two different places, and you can set contradictory values, without the manual or the BIOS itself explaining which one will take precedent. That's just idiotic. There is a Precision Boost entry in the Ai-Tweaker menu, but also one in the Advanced menu, and the possible settings are different, and independent. The first allows you to set "Eco mode" and some additional "Asus modes", while the one in Advanced has the manual options you mentioned. And as said, they can be set contradictory.

With regard to BIOS-es, this is one of the worst I've seen. Sometimes two places to change one settings (in case of Q-Fan, even 3), and they can sometimes contradict. Explanation of settings is non-existent. The help and manual are nearly useless.

"Set option TYDKVX" => What's this? Look at the help / manual...

"This sets TYDKVX to Auto, Enabled, or Disabled."

Yes, thanks. Great help. Just like a dictionary where they sometimes use the word you're looking up to describe what the word itself means.

Fortunately everything seems to work and the system is stable.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Carbec
Posts: 161
Joined: Thu Jan 20, 2022 9:42 am
Location: France
Full name: Philippe Chevalier

Re: Progress on Rustic

Post by Carbec »

Hi all,

I plan to buy a new pc in the following months, based on a AMD 7950X.
Could you give me some details about your configuration ? (case, motherboard, graphic card ...)
Is it necessary to have a watercooling system ?
I am also looking for a silent system, how noisy is the 7950X ?
My budget is about 2000-2500 euros, I think it is enough to build something good.

Thanks a lot

Philippe