maksimKorzh wrote: ↑Wed Aug 26, 2020 10:43 am
Thanks for such a detailed explanation to the point - now I see the reason WHY you love it so much. I guess memory management in rust is unique - I was intrigued so that started researching about it even more. I've also enjoyed walking through your engine code. Even though it's written in rust and uses magic bitboards still I had a feeling of a strong influence by VICE - just like in all of my sources))) But don't get insulted by this statement please - I'm saying this to show that I really really like your code. It's like when you catch the very gist of what needs to be done from someone else and then simply trying to implement it on your own. GOOD JOB. I'm tempted to see rustic in action one day!
Thanks for the compliment
Why would I be insulted by you noticing that Rustic shows VICE influences? In the beginning, it actually started out as a port of VICE (at least, the general structure and some programming concepts), but written in Rust. Then I did some things different here and there, and then I (partly) switched to bitboards; then I completely switched to magic bitboards. Rustic is at this stage (move generation+perft) for 5 months already. In April, I noticed that Rustic was slower than some other engines when running perft. I started optimizing, and it turned into a friendly "optimization contest" between myself and Terje (author of Weiss):
http://talkchess.com/forum3/viewtopic.php?f=7&t=73577
I took some idea's from Weiss, and I'm quite sure Weiss might have had a few changes inspired by my code. In the end, both Rustic and Weiss ended up running at the same speed; less than 1 second apart on my system, for the same perft run. Both engines got faster in the process.
Fun Facts:
Weiss started out as a fork of VICE, and Terje then turned it into a a magic bitboard engine.
Rustic started out using VICE as a template, with code written in Rust, and I then turned the engine into a bitboard engine.
In the thread above, Weiss and Rustic swapped some optimization idea's.
So it's not surprising you're going to find VICE/Weiss influences in my engine; it's also no surprise to me that Rustic and Weiss have comparable speed.
Obviously, Weiss already plays strong chess for a long time. I hope that, in about a month, I can pick up development for Rustic again, and at some point, you'll see it in action. As soon as I get the chance, I'll also download and compile your engine Wukong as one of the sparring partners for the first few versions of Rustic
===
There's a lot in Rustic that doesn't need to be in the final engine, such as most of the "extra" folder. (It's there for debugging purposes; printing the board in different ways for example). The interfaces (console, uci, xboard) are going to be on a feature-basis; nobody but people who want to develop on the engine will use the console interface. That stuff will improve when I set up compilation using features. (That will also get rid of many of the "allow_dead_code" attributes.)
There are many comments that need to be updated.
Rustic already has quite a lot of error handling and checking; if the program is running and it gets into an unknown state from which it can't recover, I don't want it to crash; I want it to print (or later, maybe, log) a message and quit. Error handling in Rust has improved/made easier since some of the code was written. A lot of error handling can now be shortened by using the "?" operator.