r/ComputerChess • • Jul 01 '26

Duca Chess Engine

In the past 2 weeks I have put my mind to developing a Chess Engine from scratch in C++, i have published 7 distinct versions of it but unfortunately im not able to further optimize it, if you'd like to know why and maybe help me out feel free to check its github repo, here's the link:
https://github.com/just-Lucky/DucaChessEngine
Im no C++ expert, so the code is most likely full of bugs, feel free to contact me if you find any

9 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/Fabulous_Bite_4832 Jul 03 '26

Hi, first of all thank you for the advice. To address the stockfish NNUE, generating my own isn't really an option as I have read online that with modern hardware it can take up to 2 weeks, and my pc is like 12 years old, which is also the reason I cannot further optimize Duca like I said in the README. I went for one of stockfish's old NNUE because I read online that it's open source and a lot of amateur chess engines do the same.
I know 2 weeks is a very short time, even though in those 2 weeks I coded for like 13-14 hours a day, and that's the main reason why I think the code is full of bugs. I have not been using SPRT, in reality I haven't even really tested my engine against itself or against other engines, someone on reddit did it for me and yeah It didnt go very well, although for some reason when they used the same precompiled binary as me in the same position he played different moves on his pc than on mine. For some reason when I tested it against another engine(I only did 1 game) it was winning the whole time and then just blundered 2 rooks in 1 move xD

About the version management, the fact is, this was the first time I used git, all my projects have always been private so I never posted any on github, and so I was used to storing projects like that on my machine, I just thought I could do the same with git, but appearently not. Would you be so kind to tell me how I should have used git properly?

1

u/AngusMcGurkinshaw Jul 03 '26

SPRT: https://www.chessprogramming.org/Sequential_Probability_Ratio_Test

You need to be doing this if you want a strong chess engine. You want to test that a change is a statistically meaningful improvement. The reason I say 2 weeks is short isn't because its a lot to write, but because SPRT testing takes awhile to complete.

Generating data isn't that painful, its done on fixed nodes so its totally fine to do it on hardware, just turn it on overnight. You also don't really even need that big of a NNUE even a 32 wide hidden layer will crush most HCE. Or just embrace the HCE lifestyle that is also a fun place to be. I think that is much more rewarding then yoinking a stockfish net.

But it is true for these things that having stronger hardware will help, so do with that what you will.

When it comes to git you should be using commits. Then if you want to test an older version of your engine you just checkout a specific previous commit. I would recommend you go do some reading online as it is super useful in version managing, even if you only plan to keep things locally on your machine.

1

u/Fabulous_Bite_4832 Jul 05 '26

well I just have the same stucture locally, a directory called "Duca" with the sevem sub-directories, i just went in the main Duca directory and I did
git add .
git commit -m "blah blah blah"
git push

I dont really know any better than this but I'll look into it.
Thanks again!