Version 5.2 fixes a few bugs in the 128 bit version. Some intermediate variable were 64 bits wide in stead of 128-bit, which could lead to spurious overflow. Note that 128-bit number is poorly supported by the main C/C++ compilers. For example, under Linux you cannot write a 128 bit literal nor print out a 128-bit number (MPerft uses workarounds for both of them). There is also a lack of 128 bit results to compare with. What I know is that version 5.2/5.3 give consistent results, probably exact.
Code: Select all
mperft-5.3-x86-64-v3-128bits -f "k7/8/8/8/8/8/8/2B1K1N1 w - - 0 1" 20 --fast --div
Magic Perft version 5.3 (c) Richard Delorme 2020 - 2026
Bitboard move generation based on magic (pext) bitboards.
Using 128 bits counter & Zobrist's key.
Perft setting: hashtable size: 32768 Mbytes (1073741828 entries); with 32 threads; with nullmove counting.
a b c d e f g h
8 k . . . . . . . 8
7 . . . . . . . . 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 . . . . . . . . 2
1 . . B . K . N . 1
a b c d e f g h
w,
depth: 20
c1a3 3,789,314,683,705,030,887 positions in 0:00.771 4.913 Epos/s
c1b2 7,381,849,532,908,251,042 positions in 0:00.128 57.618 Epos/s
c1d2 4,308,176,281,282,487,428 positions in 0:00.123 34.772 Epos/s
c1e3 2,998,731,023,870,432,062 positions in 0:00.078 38.056 Epos/s
c1f4 3,123,318,871,803,074,928 positions in 0:00.091 34.065 Epos/s
c1g5 5,178,532,290,991,801,515 positions in 0:00.054 95.537 Epos/s
c1h6 4,542,810,120,280,543,237 positions in 0:00.022 203.186 Epos/s
e1d1 4,009,569,653,362,539,651 positions in 0:00.021 184.209 Epos/s
e1d2 4,047,788,944,120,303,364 positions in 0:00.024 162.760 Epos/s
e1e2 6,100,661,826,137,759,280 positions in 0:00.007 849.395 Epos/s
e1f1 4,299,702,185,286,081,370 positions in 0:00.004 1.026 Zpos/s
e1f2 6,755,901,517,373,669,527 positions in 0:00.002 2.945 Zpos/s
g1e2 5,413,637,977,425,633,758 positions in 0:00.005 1.070 Zpos/s
g1f3 7,943,137,449,825,604,502 positions in 0:00.000 16.228 Zpos/s
g1h3 5,179,627,520,227,528,635 positions in 0:00.000 120.027 Zpos/s
total : 75,072,759,878,600,741,186 positions in 0:01.336 56.185 Epos/s
full time: 0:15.425 s
So it confirms your result.
Note that using simple endgame positions it is quite easy to overflow 128-bit numbers.
Code: Select all
$ mperft-5.3-x86-64-v3-128bits -f "3qk3/8/8/8/8/8/8/4K3 w - - 0 1" 40 --fast -l
Magic Perft version 5.3 (c) Richard Delorme 2020 - 2026
Bitboard move generation based on magic (pext) bitboards.
Using 128 bits counter & Zobrist's key.
Perft setting: hashtable size: 32768 Mbytes (1073741828 entries); with 32 threads; with nullmove counting.
a b c d e f g h
8 . . . q k . . . 8
7 . . . . . . . . 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 . . . . . . . . 2
1 . . . . K . . . 1
a b c d e f g h
w,
perft 1: 3 positions in 0:00.000 1.144 Mpos/s
perft 2: 63 positions in 0:00.000 4.332 Mpos/s
perft 3: 329 positions in 0:00.000 33.657 Mpos/s
perft 4: 8,548 positions in 0:00.000 195.918 Mpos/s
perft 5: 40,679 positions in 0:00.000 157.544 Mpos/s
perft 6: 1,089,960 positions in 0:00.000 3.104 Gpos/s
perft 7: 5,114,254 positions in 0:00.005 879.489 Mpos/s
perft 8: 138,446,205 positions in 0:00.009 14.705 Gpos/s
perft 9: 643,479,181 positions in 0:00.002 216.262 Gpos/s
perft 10: 17,516,410,462 positions in 0:00.007 2.292 Tpos/s
perft 11: 81,232,421,029 positions in 0:00.010 8.065 Tpos/s
perft 12: 2,218,131,608,219 positions in 0:00.024 88.763 Tpos/s
perft 13: 10,262,215,985,523 positions in 0:00.029 345.340 Tpos/s
perft 14: 280,829,349,563,385 positions in 0:00.057 4.911 Ppos/s
perft 15: 1,297,998,818,932,585 positions in 0:00.063 20.395 Ppos/s
perft 16: 35,576,609,082,824,949 positions in 0:00.104 339.010 Ppos/s
perft 17: 164,247,550,974,734,442 positions in 0:00.117 1.399 Epos/s
perft 18: 4,507,326,418,311,453,626 positions in 0:00.175 25.738 Epos/s
perft 19: 20,793,374,300,613,418,561 positions in 0:00.234 88.737 Epos/s
perft 20: 571,166,912,404,442,796,749 positions in 0:00.283 2.014 Zpos/s
perft 21: 2,632,953,960,379,504,344,150 positions in 0:00.338 7.777 Zpos/s
perft 22: 72,379,192,429,587,502,526,718 positions in 0:00.387 186.795 Zpos/s
perft 23: 333,452,076,802,942,292,304,794 positions in 0:00.538 619.437 Zpos/s
perft 24: 9,172,137,475,372,452,097,338,908 positions in 0:00.578 15.846 Ypos/s
perft 25: 42,233,162,321,751,010,925,985,535 positions in 0:00.615 68.591 Ypos/s
perft 26: 1,162,263,592,652,410,085,819,279,036 positions in 0:00.720 1.612 Rpos/s
perft 27: 5,349,185,013,275,714,786,934,684,836 positions in 0:00.814 6.565 Rpos/s
perft 28: 147,268,705,138,733,701,686,330,652,207 positions in 0:00.866 169.975 Rpos/s
perft 29: 677,513,878,027,131,424,006,971,650,216 positions in 0:01.014 668.106 Rpos/s
perft 30: 18,658,587,063,416,864,255,387,511,935,553 positions in 0:01.143 16.321 Qpos/s
perft 31: 85,809,762,525,500,954,233,243,488,589,996 positions in 0:01.323 64.825 Qpos/s
perft 32: 2,363,782,025,397,195,327,917,872,446,390,159 positions in 0:01.431 1650.808 Qpos/s
perft 33: 10,867,665,630,870,920,541,588,165,318,233,518 positions in 0:01.421 7645.622 Qpos/s
perft 34: 299,429,665,589,366,176,247,021,570,069,696,829 positions in 0:01.645 181938.125 Qpos/s
perft 35: 1,376,300,979,740,609,421,424,212,750,564,342,557 positions in 0:01.602 858976.412 Qpos/s
perft 36: 37,926,410,097,876,340,281,000,619,340,372,744,001 positions in 0:01.837 20638904.569 Qpos/s
perft 37: 174,287,433,517,717,864,381,080,632,595,041,305,625 positions in 0:01.948 89441256.434 Qpos/s
perft 38: 337,202,520,174,289,936,700,713,709,013,056,098,182 positions in 0:01.941 173638694.175 Qpos/s
perft 39: 339,337,238,885,727,500,452,289,895,318,291,273,129 positions in 0:02.089 162369860.575 Qpos/s
perft 40: 144,584,449,479,129,745,543,978,057,051,695,167,225 positions in 0:02.280 63388176.495 Qpos/s
total : 14,180,018,784,607,675,732,780,915,642,408,237,558 positions in 0:25.670 552395.974 Qpos/s
Using 128 bits, I am limited to 2^122 in the hashtable (the other 6 bits are used to store the depth), which 5,316,911,983,139,663,491,615,228,241,121,378,304 so any number bigger than that are suspicious in MPerft
If I remember well, the number of positions is around 10^800 - 10^1000 in chess, taking into account 3-fold repetition & 50-move rules (which perft does not), so 128 bit is obviously a low limit.