Perft statistics - chessprogrammingwiki

Discussion of chess software programming and technical issues.

Moderator: Ras

chessbit
Posts: 24
Joined: Fri Dec 29, 2023 4:47 pm
Location: Belgium
Full name: thomas albert

Re: Perft statistics - chessprogrammingwiki

Post by chessbit »

It looks like on the wiki, the check calculation is as follows:

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 don't understand why not count everything independently, but at least now we are speaking the same language. I have the same results as on the wiki.

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
And without stats:

Code: Select all

Depth:          7
Nodes:          374190009323
Time:           92256 ms
Average:        4055.98 Mn/s
User avatar
Ajedrecista
Posts: 2122
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: Perft statistics - chessprogrammingwiki

Post by Ajedrecista »

Hello Thomas:

It is great that your numbers match with other computation:

https://grandchesstree.com/perft/1/results

The Grand Chess Tree

Total checks in Kiwipete position at depth 6: The Grand Chess Tree → 91.878.047 (total checks) + 360.003 (total mates) = 92.238.050 (your result of checks).

Congratulations on your achievement! Please keep up your good work.

Regards from Spain.

Ajedrecista.