It's GrainSize / 100 * (100/198) which works out, when GrainSize is 8 (default), to 0.04. With GrainSize of 2, granularity is 0.01. 198 is the weight of a pawn in the middlegame.Uly wrote:Well, yes, the improvement is self-evident, here's an example of a common scenario.
One is analyzing with a margin of 1 centipawn, which means, new mainlines are considered when they beat the old mainline by 0.01, but mainlines with the same score have to be tie-broken (this is trivial, one goes to the tail and forces moves until the score gets +0.01 or -0.01).
Now, assume some deep move of 1.e4 e5 2.Nf3 Nc6 3.Bb5 is scored as 0.16 and falls over the margin, which means one would like to examine early white alternatives that are >0.16. But there's 1.e4 e5 2.Nf3 Nc6 3.Bc4 with a score of 0.16, so one has to examine it deeper until it goes higher (becomes new mainline) or lower (gets refuted so one searches for another alternative, or goes earlier in the mainline to search for better moves, or goes back to extending Bb5).
With granularity=8 one has to examine 3.Bc4 until it goes to either 0.24 or 0.08, which will take a while longer than with granularity=1 where it's very likely that Bb5 and Bc4 don't tie at all, so Bc4 becomes new mainline automatically or the margin can be higher.
This is just an example of an analysis method, but low granularity is conceptually better, for complex positions that don't transpose where one doesn't want to have to refute futile variations, one would even wish to have millipawns granularity available, or something.
Your implementation is working great, since it was granularity=2 I had expected to see only odd or even evaluations but I'm seeing jumps of one centipawn (such as from -0.96 to -0.95) without problems.
Anyway, glad it's working. When you have a sec, check out some endgame positions and let me know if you see anything grainy...
Jeremy