Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Don't double check for move legality
In case of a RootNode or a SpNode move has been already checked for legality so we can skip a redundant check. Spotted by Frank Genot. No functional change.
- Loading branch information
4502917There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Marco,
I was curious to see what the FutilityMargins[][] of SF looked like, so I fired up a spreadsheet and replicated your formula:
// Init futility margins array
for (d = 1; d < 16; d++) for (mc = 0; mc < 64; mc++)
FutilityMargins[d][mc] = Value(112 * int(log(double(d * d) / 2) / log(2.0) + 1.001) - 8 * mc + 45);
It gives negative numbers when
I suspect fixing this bug won't have a big impact, but it's still worth doing for the sake of cleanlyness. Perhaps you apply a floor like:
And possibly floor by some epsilon > 0, rather than by zero.
4502917There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Come to think of it, I find your formula quite strange. You are basically using an additive form like
(i) f(d,mc) = g(d) + h(mc)
(ii) h() is linear
I think it would make more sense to consider something like
(i) f(d,mc) = g(d)h(mc)
(ii) h() is a move count rescaling basically:
How about, for example:
f(d,mc) = g(d).sqrt[(128-d)/d]
where g(d) is your unmodified
112 * int(log(double(d * d) / 2) / log(2.0) + 1.001)
Anyway, it's probably best to experiment in a simple spreadsheet with the formula and see how it looks, before spending time testing it.
4502917There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a bug. Negative futility pruning values at depth = 1 are okay. Move count based pruning is going to hit us hard anyway razoring everything where moveCount > 4. Negative futility pruning values only mean that side to move needs to have very good position to avoid prunings.
Of course I don't claim that current formula is optimal, but there is no bug
4502917There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, understood.
I'm surprised at how aggressive the futility pruning + move count pruning of SF is. And given the way it's been developped (systematic testing), it must be right, or at least better than not doing it.
Out of curiosity, how much elo do you reckon futility pruning (including move count pruning) is worth in Stockfish ?
4502917There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.