lithander wrote: ↑Wed Apr 28, 2021 4:18 pm
"Lines of the executable code" is a metric built into Visual Studio that does not stupidly count every line in the source code. Instead it looks at the size of your code after it has been compiled to IL and counts that. This makes the metric does not discourage from writing good, maintainable code. If you shorten your the code by replacing constants with magic numbers etc and make your code ugly and condensed and confusing then LOC metric wouldn't change a bit. It would NOT give you the false impression that you improved the code when in reality you didn't.
If I would count lines of source code instead I'm at ~2000 but that includes empty lines, curly braces, comments, copyright notices... it's absolutely meaningless. So in the C# world when someone says Lines of code (or LOC) he means lines of executable code usually.
Don't compare apples with oranges of course, but for example it's fair to compare my 620 LOC with other C# engines such as MadChess' over 4000 lines of code listed on
the MadChess Download page Because Eric does also use the meaningful metric of executable lines of code when he gives these stats. If he would actually count every line of source code I guess his engines would have over 10.000. (Correct me if I'm wrong, Eric)
LoEC is indeed a much better metric than the old LoC. Many engines with "small source code" are also very hard to maintain because they don't use constants, or write entire "if" or even "switch" statements onto a single line.
Still, I feel that Rustic is somewhat gigantic with around 4500 lines of code (which is everything, except comments and blank lines). But, I do have a penchant for making really tiny steps:
Code: Select all
a = 5
b = 10
c = 7
x = a * b
y = b + c
result = x - y
I could also have written:
In that case however, you don't know what "5" or "10" is, and you don't know what "5 * 10" represents, and so on. This way of writing code adds a lot of lines; together with the fact that I _hate_ long files. If a file gets over over 250-300 lines, I'm going to look into splitting it up if at all possible.
mvanthoor wrote: ↑Wed Apr 28, 2021 3:06 pm
You have added functions that Rustic doesn't have yet, so if I'd add ~325 Elo to my engine, it'd be 2140. I could live with that.
You also have functions that I don't have like TT and bitboards etc!

I don't think our engines are so easily comparable anymore... but I'm fairly sure you could gain a lot of ELO by moving to tapered PSTs. I'd feel honored if you chose to borrow mine! MMC used Rustics tables for a while, so it would only be fair!
[/quote]
I may look into MinimalChess's tuner, because I don't have a clue about how to go about writing one. I'll have to research the algorithm first.
With regard to PST's: I still see many engines (BitGenie is the latest I checked, for example, but certainly not the only one) that re-add all the PST values in the evaluation function. That takes a lot of time, because for every move, you are re-adding all the numbers. I add all the values once, at the beginning of the game, and then keep this value incrementally (just like the Zobrist-keys).
With regard to tapering, I think I'm just going to change the current name to "MG_", and add incremental values for "EG_", and another for "game_phase". Then I only need to calculate the final tapered value in the evaluation function. In the beginning, both MG and EG will be the same, leading to the exact same evaluation as if it wasn't tapered. (And thus the engine will become slower because it has to keep more data.) Then I'll tune both MG and EG. That way, I can just start with and tune my own PST's, and then either be amazed (or disappointed) how much strength the tapering and tuning adds.
(I feel it could be less than expected, because my PST's already encode quite a bit of my own positional knowledge. At the moment, Rustic plays a lot like a faster, deeper-thinking version of myself... sometimes that's really eerie to see, if you're watching a game, expect a certain move, and the engine actually plays that move about 75% of the time. Against Alpha 2, my own draw rate is _very_ high

)