algerbrex wrote: ↑Wed Sep 22, 2021 5:41 am
I think while I continue to debug this issue, I'll post updates here, and hopefully, they'll be useful to future newcomers like me.
...
I'll have a look at it myself as well. I've seen a lot of things in Blunder that are coded similar to how I did it in Rustic, (including the ASCII art at the console
), and as this is something that is already implemented in my own engine, I think I can look at the code without being influenced.
Because PVS gets enhanced by the TT (which is beneficial for the researches), I looked through that code first. I noticed a small difference with my code: the mate handling is different. For example, when storing:
Yours:
Code: Select all
if score > Checkmate {
score += int16(ply)
}
if score < -Checkmate {
score -= int16(ply)
}
Mine:
Code: Select all
if score > Checkmate {
score += int16(ply)
}
if score < Checkmate {
score -= int16(ply)
}
(Notice the missing minus sign in my code.)
After thinking about it, I decided that this was a bug in my engine: because of the missing minus sign, it may play into a variation, not seeing that it will be mated (because minus Checkmate is you being mated, and forgetting the minus sign results in the TT returning the wrong value).
This can happen in a small number of games, where the engine can play into a variation in which it will lose. So I changed this in my development version and started a test. At the moment, it's still running:
Code: Select all
Score of Rustic Alpha 3.13.100 vs Rustic Alpha 3.12.100: 574 - 489 - 416 [0.529]
... Rustic Alpha 3.13.100 playing White: 331 - 189 - 220 [0.596] 740
... Rustic Alpha 3.13.100 playing Black: 243 - 300 - 196 [0.461] 739
... White vs Black: 631 - 432 - 416 [0.567] 1479
Elo difference: 20.0 +/- 15.0, LOS: 99.5 %, DrawRatio: 28.1 %
1479 of 2000 games finished.
A +20 Elo difference, already outside the margin of error. So I'm gaining 5-35 Elo, as it stands now. (I would need to run 5000 games or so to be completely sure.)
So... by looking into _your_ problem, I discovered a bug in my own engine, which could potentially gain +35 Elo when fixed. So the mate handling seems to NOT be the problem in your engine... and I think I should put you in my engine's credits even though you didn't actually "do" anything
I'll clone the Git repo and take a look at the rest of the code shortly.