BBC 1.4 + Stockfish NNUE + Online GUI + Opening book - FINAL RELEASE!

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: BBC 1.4 + Stockfish NNUE + Online GUI + Opening book - FINAL RELEASE!

Post by mvanthoor »

maksimKorzh wrote: Tue Oct 27, 2020 5:18 pm Hi Marcel, thank you for teaching me linear algebra)
Btw I'm now studying neural networks (from the very very basics) to may be make my own one day (maybe in other life)

And regarding "easy way out" - don't take it too series) BBC is a YouTube coding project. It's not a "real" chess engine from the perspective like if I wanted to make a chess engine for my self. I wanted to show people what kind of opportunities are available nowadays and hopefully I did. If you were doing youtube you would probably realize that the stuff to emphasize is way different compared to say your scientific approach. Let me try to explain this:

In my understanding (obtained from walking through Rustic's code) I can conclude that it's an example of what SOLID PROGRAMMER with YEARS OF PRODUCTION EXPERIENCE can do if applies his skills to chess programming hobby. That it incredibly cool and would be incredibly valuable/influential to the community whey you'll finish it (well at least first official release). But for me as a noob - what I can say - that is something that I can only realize how cool it is but I can't/won't make use of it because in order to understand all the details behind it's architecture I need to have not only greater skills but... I just had to born in different body with different consciousness and live completely different life compared to what I lived until today - I would need to have classical solid education like you have instead of being 100% self-learner (I have never ever graduate from any kind of programming courses, all I know and can do is from YouTube and studying documentation, I didn't even read books... well, almost didn't). More over that people like you in terms skills and approach are THE VAST MAJORITY of programmers and I will be proud to know another guy who would one day stay along with HGM, Bob Hyatt, Tord Romstad etc... But the problem is that in most cases (your case is probably the only fantastic extension!) GURUS can't help NOOBS. It's like I'm asking in tech room something about alpha-beta search and HGM starts explaining some rocket science that I would never probably be able to understand while enough answer would be just to tell the difference between fail-high and fail-low nodes))) And it happens in everything. Quite a fun thinf that when I've started my series - Pedro and Harald started teaching me in the appropriate way (the only acceptable due to my dumbness) !!!
Hi Maksim,

Of course I understand that everyone has a different life and different education, but I still think you are selling yourself short.

You're calling yourself dumb or an idiot all the time, but writing a chess engine from scratch in C is not a small feat. The only thing between BBC as a toy project and BBC as a "real engine" is to remove all the global variables, split it up into separate files, replace numbers by constants and make everything consistent.

Rustic is not exactly designed to be like it is now; it grows to be like this. However, I don't just keep writing and writing. If you'd look through the commits, you see tons of "refactor, consistency, replace implementation", etc, etc. In short, I'm constantly rewriting and restructuring the engine, keeping the code consistent, files small, make sure to not duplicate functions, and so on. What I mean to say is: Rustic's code is not always this clean or well-structured. Sometimes new stuff I write is a mess, but then I either restructure/refactor it, or I throw it away and do it again, but better. Rustic is only 3500 lines of code right now, but I've written close to 20.000 according to my repository. It means I throw away about 80% of what I write over time.

What I hope to gain from that is an a basic engine the size of a dog house (which is almost done), but built on the foundations of a medieval fortress... so I can extend it indefinitely for years to come, without it toppling over because it becomes unmaintainable.

While I do have a lot of experience writing code as a profession, this is my first chess engine... and I also don't always understand all the concepts people like HGM and Bob Hyatt and others explain. These people have 40-50 YEARS of experience in writing chess engines. They have been writing chess programs longer than I've been alive. I don't expect to understand everything right away.

As long as I don't understand it, I won't implement it into my engine. And if I do finally understand, I test it without implementing anything else... and then I refactor and restructure until that code is as good as it can be (with my current knowledge). Then it's done and I move on to something else.

You can do exactly the same. You're smart enough to write a complete chess engine (or web scraping tools), so you''ll also be smart enough to make it strong, and make the code well-structured. The only thing it will take is patience, and time... not genius intellect.
[snip]

There might be LOTS of examples but the gist is like someone said: IF YOU THINK YOU'RE UNDERSTANDING SOMETHING THEN TRY TO EXPLAIN IT TO 5 YEAR OLD KID AND IF HE UNDERSTANDS THAT WOULD MEAN THAT YOU'RE REALLY UNDERSTANDING WHAT ARE YOU TALKING ABOUT. Now I'm trying to go even further - same stuff but imagine that 5 year old kid is not a human but a monkey. That's how I felt when was a kid or even at high school.
I do know this, and I often use my girlfriend for this; I ask if I can explain something to her, and if she understands (for example, by making a correct analogy, or even finishing before my explanation is done), I know I understand it myself.
So you just imagine that yet another code monkey like me would be able to TOUCH nnue technology! This is so exciting! You can always go deeper if it's your goal. It's just not my goal, for my goal is to show the approach, path to walk through. highlight the most important things and tell about pitfalls.
This is not "teaching" like they teach in universities, no, it's like: "hey what's up guys, I'm as noob as you but I've just found a way of how to embedd stockfish nnue to a chess engine, are you with me?"

This is what I'm doing)
Thanks for taking time to read!
If you only wish to create video's on how to accomplish something, that is fine too. Your series is great. Please know that I also did get some useful pointers from it, or sometimes a different perspective on the subject as opposed to BlueFever's software and the things written on the internet.

I'm just a bit disappointing that you decided to stick NNUE into BBC and call it a day on this engine; I hoped that you'd refactor the engine into better and more structured code, and then develop it further as a classical chess engine to one day compete in the 3000+ Elo range.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
No4b
Posts: 105
Joined: Thu Jun 18, 2020 3:21 pm
Location: Moscow
Full name: Alexander Litov

Re: BBC 1.4 + Stockfish NNUE + Online GUI + Opening book - FINAL RELEASE!

Post by No4b »

Congratz! Great Job on making wonderful video series!

On the topic of NNUE.
IMHO merging BBC and Vice with NNUE was very interesting expiriment, and it is a good thing that someone did it.

However personaly for me it would be more interesting if the net itself was trained with engine you are putting NNUE into.
But training a network and implementing all this is hard work, so I can just hope that one day some enthusiast will do it (or maybe i would become too exited and try it myself).

Anyway, would be interresting to see your future projects :D