A few positions to test movegen

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: A few positions to test movegen

Post by Sven »

Evert wrote:
Sven Schüle wrote: I should add: in the first two of your positions there is no reason for short castling not being allowed, other than the FEN stating so. A rook being attacked does not already prevent you from castling.
I was confused about the point of those positions too when I first saw them, more so when I ran them through my perft function and got the quoted count.

The point is not that it's illegal to castle when the rook is attacked. Note that the side to move is not the side that can castle. The point is that after 1... BxR 2. RxB, the rook is no longer the original rook. So although the original rook never moved, the rook that is now in its place did and castling is not allowed. The point of the test is whether the castling rights are properly removed when the rook is captured.
Ok, that makes sense.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

To depth: 8/5bk1/8/2Pp4/8/1K6/8/8 w - d6 0 1

Post by sje »

[d]8/5bk1/8/2Pp4/8/1K6/8/8 w - d6 0 1[/d]

Code: Select all

[] emptran 6
Ka2 76,150
Ka3 82,957
Ka4 80,828
Kb2 119,231
Kb4 97,074
Kc2 129,058
Kc3 118,973
c6 119,793
Depth: 6   Count: 824,064   Elapsed: 13.7137  (60090.4 Hz / 1.66416e-05 s)

[] emptran 7
Ka2 481,775
Ka3 536,432
Ka4 527,476
Kb2 781,134
Kb4 641,198
Kc2 869,728
Kc3 812,202
c6 930,751
Depth: 7   Count: 5,580,696   Elapsed: 13.749  (405900 Hz / 2.46366e-06 s)

[] emptran 8
Ka2 6,617,275
Ka3 7,389,234
Ka4 7,318,109
Kb2 10,706,221
Kb4 8,855,590
Kc2 11,892,456
Kc3 11,069,903
c6 12,323,546
Depth: 8   Count: 76,172,334   Elapsed: 13.7852  (5.52566e+06 Hz / 1.80974e-07 s)

[] emptran 9
Ka2 43,579,399
Ka3 49,437,281
Ka4 49,294,822
Kb2 71,709,512
Kb4 60,619,263
Kc2 80,559,281
Kc3 75,645,329
c6 112,791,951
Depth: 9   Count: 543,636,838   Elapsed: 13.8635  (3.92135e+07 Hz / 2.55014e-08 s)

[] emptran 10
Ka2 608,527,018
Ka3 692,510,853
Ka4 695,845,189
Kb2 999,446,892
Kb4 851,348,994
Kc2 1,122,413,740
Kc3 1,050,714,226
c6 1,482,546,358
Depth: 10   Count: 7,503,353,270   Elapsed: 14.1647  (5.29724e+08 Hz / 1.88778e-09 s)

[] emptran 11
Ka2 4,305,947,693
Ka3 5,009,387,988
Ka4 4,979,314,463
Kb2 7,142,801,668
Kc2 7,932,396,109
Kb4 6,193,476,404
Kc3 7,520,577,320
c6 16,827,221,249
Depth: 11   Count: 59,911,122,894   Elapsed: 15.3973  (3.89102e+09 Hz / 2.57002e-10 s)

[] emptran 12
Ka2 60,212,984,603
Ka3 70,202,506,872
Ka4 70,417,682,599
Kb2 99,780,321,004
Kc2 111,123,158,947
Kc3 104,968,701,088
Kb4 87,026,582,315
c6 216,381,475,992
Depth: 12   Count: 820,113,413,420   Elapsed: 19.0884  (4.29639e+10 Hz / 2.32753e-11 s)

[] emptran 13
Ka2 487,483,760,641
Ka4 573,080,915,596
Ka3 583,694,681,184
Kb2 815,469,581,375
Kb4 729,002,621,509
Kc2 867,240,520,150
Kc3 827,001,396,095
c6 3,044,669,994,162
Depth: 13   Count: 7,927,643,470,712   Elapsed: 35.3548  (2.24231e+11 Hz / 4.45969e-12 s)

[] emptran 14
Ka2 6,706,819,831,294
Ka4 7,984,095,583,388
Ka3 8,039,299,610,870
Kb4 10,073,187,840,290
Kb2 11,217,002,932,514
c6 38,204,565,333,701
Kc2 12,027,852,063,445
Kc3 11,416,530,683,728
Depth: 14   Count: 105,669,353,879,230   Elapsed: 197.487  (5.35071e+11 Hz / 1.86891e-12 s)

[] emptran 15
Ka4 79,781,765,096,673
Ka2 66,989,291,874,365
Ka3 83,346,225,956,755
Kb4 104,402,430,337,326
c6 634,003,172,374,622
Kc2 111,913,218,785,472
Kb2 113,016,456,269,599
Kc3 107,372,258,179,723
Depth: 15   Count: 1,300,824,818,874,535   Elapsed: 1110.18  (1.17173e+12 Hz / 8.5344e-13 s)

[] emptran 16
Ka4 1,079,200,516,960,943
Ka2 892,342,355,298,739
Kb4 1,398,501,300,996,884
Kb2 1,506,601,290,835,939
Ka3 1,111,865,881,445,537
c6 7,807,392,706,298,393
Kc2 1,511,613,782,302,952
Kc3 1,442,224,972,634,667
Depth: 16   Count: 16,749,742,806,774,054   Elapsed: 3738.21  (4.48068e+12 Hz / 2.2318e-13 s)

[] emptran 17
Ka4 13,822,507,592,875,541
Ka2 11,427,785,555,467,958
Kb2 19,484,257,313,292,053
Ka3 14,779,536,764,874,672
Kb4 18,603,434,181,971,053
c6 144,385,747,679,121,599
Kc2 17,814,407,212,305,750
Kc3 17,137,962,073,975,472
Depth: 17   Count: 257,455,638,373,884,098   Elapsed: 43508.4  (5.91738e+12 Hz / 1.68994e-13 s)
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: A few positions to test movegen

Post by gbtami »

PyChess own engine passed all test. Thx Martin!
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: To depth: 8/5bk1/8/2Pp4/8/1K6/8/8 w - d6 0 1

Post by Ajedrecista »

Hello Steve:

I have tested JetChess 1.0.0.0 in that position from ply 8 up to ply 17 (just as you): if I do not count the results of cxd6 e.p. given by JetChess, then all perft values agree with yours. Congratulations!

Regards from Spain.

Ajedrecista.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

To depth: 3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1

Post by sje »

[d]3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1[/d]

Code: Select all

[] emptran 6
Ka4 172,818
Ka6 156,082
Kb4 210,405
Kb5 182,011
Kb6 171,667
c6 127,497
Depth: 6   Count: 1,020,480   Elapsed: 14.0431  (72667.8 Hz / 1.37613e-05 s)

[] emptran 7
Ka4 1,053,199
Kb4 1,300,034
Ka6 868,915
Kb5 1,076,774
Kb6 971,993
c6 813,149
Depth: 7   Count: 6,084,064   Elapsed: 14.0142  (434135 Hz / 2.30343e-06 s)

[] emptran 8
Ka4 18,847,515
Ka6 15,285,404
Kb4 23,265,216
Kb5 19,060,051
Kb6 17,090,279
c6 13,462,794
Depth: 8   Count: 107,011,259   Elapsed: 13.9982  (7.64465e+06 Hz / 1.3081e-07 s)

[] emptran 9
Ka4 114,799,308
Ka6 87,738,992
Kb4 143,581,817
Kb5 113,067,366
Kb6 98,696,639
c6 96,519,583
Depth: 9   Count: 654,403,705   Elapsed: 14.1485  (4.62526e+07 Hz / 2.16204e-08 s)

[] emptran 10
Ka6 1,553,104,440
Ka4 2,053,840,467
Kb4 2,568,985,667
Kb5 2,009,557,285
Kb6 1,747,957,136
c6 1,618,387,456
Depth: 10   Count: 11,551,832,451   Elapsed: 14.5272  (7.95184e+08 Hz / 1.25757e-09 s)

[] emptran 11
Ka6 9,387,217,977
Ka4 12,835,876,918
Kb4 16,184,139,001
Kb5 12,437,781,979
Kb6 10,641,341,547
c6 14,269,338,389
Depth: 11   Count: 75,755,695,811   Elapsed: 16.1906  (4.679e+09 Hz / 2.13721e-10 s)

[] emptran 12
Ka6 166,887,447,674
Kb6 189,184,338,673
Ka4 229,364,060,043
Kb5 221,125,944,407
Kb4 289,214,154,340
c6 239,303,947,094
Depth: 12   Count: 1,335,079,892,231   Elapsed: 21.3992  (6.23894e+10 Hz / 1.60284e-11 s)

[] emptran 13
Ka6 1,119,872,389,618
Kb6 1,277,278,878,192
c6 2,755,115,218,394
Kb4 1,944,788,321,613
Kb5 1,487,534,432,704
Ka4 1,533,937,202,336
Depth: 13   Count: 10,118,526,442,857   Elapsed: 69.1811  (1.46261e+11 Hz / 6.83707e-12 s)

[] emptran 14
Ka6 19,824,853,252,447
Kb6 22,613,834,399,082
c6 45,738,172,275,508
Kb4 34,543,305,291,286
Kb5 26,325,276,908,553
Ka4 27,245,485,708,371
Depth: 14   Count: 176,290,927,835,247   Elapsed: 326.952  (5.39195e+11 Hz / 1.85462e-12 s)

[] emptran 15
Ka6 160,018,485,567,407
Kb6 183,410,599,918,419
c6 662,866,706,386,728
Kb4 265,146,632,375,909
Kb5 208,447,628,762,504
Ka4 209,279,190,800,428
Depth: 15   Count: 1,689,169,243,811,395   Elapsed: 5041.91  (3.35026e+11 Hz / 2.98484e-12 s)

[] emptran 16
Ka6 2,786,662,949,577,909
Kb6 3,193,787,429,941,721
c6 10,845,718,850,029,518
Kb4 4,643,588,151,781,907
Kb5 3,633,206,864,174,363
Ka4 3,663,758,710,005,513
Depth: 16   Count: 28,766,722,955,510,931   Elapsed: 44076.1  (6.5266e+11 Hz / 1.53219e-12 s)
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: A few positions to test movegen

Post by mar »

gbtami wrote:PyChess own engine passed all test. Thx Martin!
Congratulations Bajusz :) You can try the positions posted by Volker too as they are useful to those who manage rook moved flags instead of castling rights.
You're welcome.

Martin
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: A few positions to test movegen

Post by Sven »

mar wrote:as they are useful to those who manage rook moved flags instead of castling rights.
Managing "rook moved flags" should be replaced by managing castling rights and properly updating them anyway.

Sven
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: A few positions to test movegen

Post by gbtami »

mar wrote:
gbtami wrote:PyChess own engine passed all test. Thx Martin!
Congratulations Bajusz :) You can try the positions posted by Volker too as they are useful to those who manage rook moved flags instead of castling rights.
You're welcome.

Martin
PyChess manages castling rights, but run the test with Volker's position and they passed too :)
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: A few positions to test movegen

Post by JVMerlino »

Here are a few more positions I used to test my movegen and perft when converting Myrddin to bitboards (thanks to Ron Murawski for several of them):

r3k2r/8/8/8/3pPp2/8/8/R3K1RR b KQkq e3 0 1
perft 6 = 485,647,607

r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1
perft 6 = 706,045,033

8/7p/p5pb/4k3/P1pPn3/8/P5PP/1rB2RK1 b - d3 0 28
perft 6 = 38,633,283

8/3K4/2p5/p2b2r1/5k2/8/8/1q6 b - - 1 67
perft 7 = 493,407,574

rnbqkb1r/ppppp1pp/7n/4Pp2/8/8/PPPP1PPP/RNBQKBNR w KQkq f6 0 3
perft 6 = 244,063,299

r3k2r/p1ppqpb1/bn2pnp1/3PN3/1p2P3/2N2Q1p/PPPBBPPP/R3K2R w KQkq -
perft 5 = 193,690,690

8/p7/8/1P6/K1k3p1/6P1/7P/8 w - -
perft 8 = 8,103,790

n1n5/PPPk4/8/8/8/8/4Kppp/5N1N b - -
perft 6 = 71,179,139

r3k2r/p6p/8/B7/1pp1p3/3b4/P6P/R3K2R w KQkq -
perft 6 = 77,054,993

8/2p5/3p4/KP5r/1R3p1k/8/4P1P1/8 w - -
perft 7 = 178,633,661

8/5p2/8/2k3P1/p3K3/8/1P6/8 b - -
perft 8 = 64,451,405

r3k2r/pb3p2/5npp/n2p4/1p1PPB2/6P1/P2N1PBP/R3K2R w KQkq -
perft 5 = 29,179,893

jm
User avatar
Ajedrecista
Posts: 1966
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: To depth: 3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1

Post by Ajedrecista »

Hello Steven:

JetChess agrees with Symbolic up to depth 16. I ran Perft(17) and Perft(18) of this position with JetChess 1.0.0.0 in an Intel i5-760 (2.8 GHz) with 1 GB of hash:

[d]3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1

Code: Select all

3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1

  1   c5-c6  182677827348616709
  2  Ka5-b5   36826809919730212
  3  Ka5-a6   29280150877737878
  4  Ka5-b6   33691924636933787
  5  Ka5-a4   35288912419086171
  6  Ka5-b4   44447828588453812

Total:       362213453790558569

362,213,453,790,558,569 (move pathes after 17 half moves).

Time: 424.679 s (0:07:04.679).

Code: Select all

3k4/8/8/K1Pp3r/8/8/8/8 w - d6 0 1

  1   c5-c6  2947282399567995885
  2  Ka5-b5   625618004962388090
  3  Ka5-a6   496123624691807794
  4  Ka5-b6   570837041883814373
  5  Ka5-a4   602633909963891583
  6  Ka5-b4   759796778350457754

Total:       6002291759420355479

6,002,291,759,420,355,479 (move pathes after 18 half moves).

Time: 2729.044 s (0:45:29.044).
Regards from Spain.

Ajedrecista.