Code: Select all
if (board.checks) {
stats.chk++;
if (nodes == 0) stats.chkm++;
else {
U64 to = (1ULL << board.to);
if (board.checks & to) {
U64 checks = board.checks ^ to;
if (checks) stats.dblchk++;
}
else stats.dischck++;
}
}
I have implemented this in my engine in a way that the checks are calculated from the previous depth. That way, I can still count moves efficiently at depth 1 (with a perf hit of ~30% from the fast perft, due to counting).
For fun, here is the depth 7 of the Kiwi position which is not listed on the wiki:
Code: Select all
Captures: 69479646226
En passant: 117075132
Castles: 7831249352
Promotions: 49612944
Checks at depth 6:
Checks: 92238050
Disc. checks: 568417
Double checks: 54948
Checkmates: 360003
Depth: 7
Nodes: 374190009323
Time: 125603 ms
Average: 2979.14 Mn/s
Code: Select all
Depth: 7
Nodes: 374190009323
Time: 92256 ms
Average: 4055.98 Mn/s