Perft(13) [3.4 GHz Core i7-2600, 16 GB RAM]

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Re: Another restart

Post by sje »

The perft(13) calculation has been restarted using its last valid checkpoint data. This data includes some 260,000+ draft eight records, abut one third of the total needed.

The most recent output:

Code: Select all

rnbqkbnr/ppp2ppp/4p3/3P4/8/1P6/P1PP1PPP/RNBQKBNR b KQkq - 0 3 8 1618149104768
rnbqkbnr/ppp2ppp/4p3/3p4/4P3/1P6/P1PP1PPP/RNBQKBNR w KQkq - 0 3 9 51424595261274
rnbqkbnr/ppp1p1pp/5p2/3p4/6P1/2N5/PPPPPP1P/R1BQKBNR b KQkq - 0 3 8 252321457279
rnbqkbnr/ppp1p1pp/5p2/3p4/8/2N3P1/PPPPPP1P/R1BQKBNR w KQkq - 0 3 9 8194193228180
rnb1kbnr/ppp1pppp/B2q4/3p4/4P3/P7/1PPP1PPP/RNBQK1NR b KQkq - 2 3 8 2227150134084
rn1qkbnr/ppp1pppp/8/3p4/1P4b1/4P2P/P1PP1PP1/RNBQKBNR b KQkq - 0 3 8 810492701241
rnbqkbnr/ppp1pp1p/8/3p2p1/2N4P/8/PPPPPPP1/R1BQKBNR b KQkq - 1 3 8 547833732250
rn1qkbnr/ppp1pppp/8/3p1b2/P7/4PQ2/1PPP1PPP/RNB1KBNR b KQkq - 2 3 8 1710681670432
rnbqkbnr/ppp1p1pp/8/3p1p2/8/2N3P1/PPPPPPBP/R1BQK1NR b KQkq - 1 3 8 363144025359
rnbqkbnr/ppp1pppp/8/8/4p1P1/5N2/PPPP1P1P/RNBQKB1R b KQkq - 0 3 8 801987390986
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 57

Post by sje »

Draft 11 record number 57:
[d]
The perft(11) for the above is: 6,454,545,219,171,971

57 (14.25%) down, 343 (85.75%) to go.
diep
Posts: 1822
Joined: Thu Mar 09, 2006 11:54 pm
Location: The Netherlands

Re: Perft(13) [3.4 GHz Core i7-2600, 16 GB RAM]

Post by diep »

sje wrote:The run uses a 12 GB transposition table with 2^29 entries split evenly between WTM and BTM. Each half of the table is partitioned into 256 regions each guarded by a spinlock. There are eight counting threads running, one for each of the eight hyperthreads supported by the four core Intel i7-2600. Each thread is assigned one of the twenty ply zero moves; the moves are dealt in SAN order from a supervisory thread. When a counting thread completes its draft twelve calculation, it's given another ply zero move to handle (if any remain).

When a store is made into the transposition table, if the record is draft eight or higher then it's also written to the checkpoint file. Upon a restart, the contents of the checkpoint file are read into a fresh transposition table before counting resumes.

The transposition table is four-way associative; up to four entries may be tried with overwrite preference given to the entry having the lowest subtotal count. Unused entries have a subtotal count of zero. Only subtotals of draft two or greater are stored in the table.
I took a short look at PERFT myself recently as i rewrote a move generator mine so used perft to test the move generator, as perft is supposed to work.

Then i stumbled upon some record attempts with perft. I noticed that you can reorganize your hashtables much easier based upon a depthleft hierarchy, as a depthleft of 4 is going to need a cutoff at depthleft 4.

Furthermore i noticed it's possible to speedup the generating proces bigtime last few plies by not using a hashtable there and just use some clever counting tricks. Clever counting tricks aren't catching 100% of all transpositoins, yet they speedup the search bigtime.

Another alternative to that, which you could try first, is using the last few plies a very tiny hashtable that more or less fits in the L2 or L3 cache, as that will have the biggest impact. In the end you just save out a number of cycles there, with the last plies fitting easily in L1 and only being a core local proces.

Spinlocking is never needed and never clever of course.

The key to doing perft faster is a clever hashtable implementation that uses the properties of the perft counting proces.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Perft(13) [3.4 GHz Core i7-2600, 16 GB RAM]

Post by sje »

diep wrote:Spinlocking is never needed and never clever of course.
Experiments with segmented transposition tables say otherwise. Spinlocks are ideal for controlling access of low contention resources without making any system calls. In Symbolic, each transposition entry storage vector is divided in 256 disjoint segments each with its own spinlock. With perft calculations, there are eight threads accessing the table with full safety and without measurable overhead.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 58

Post by sje »

Draft 11 record number 58:
[d]
The perft(11) for the above is: 5,397,085,831,258,784

58 (14.5%) down, 342 (85.5%) to go.

After 95 days of elapsed time, the average calculation time for a draft 11 result is about 39 hours and 19 minutes.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 59

Post by sje »

Draft 11 record number 59:
[d]
The perft(11) for the above is: 8,650,897,280,195,776

This is the largest draft 11 result seen so far.

59 (14.75%) down, 341 (85.25%) to go.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 60

Post by sje »

Draft 11 record number 60:
[d]
The perft(11) for the above is: 6,490,924,495,782,649

60 (15%) down, 340 (85%) to go.

After 97 days of elapsed time, the average calculation time for a draft 11 result is about 38 hours and 48 minutes.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 61

Post by sje »

Draft 11 record number 61:
[d]
The perft(11) for the above is: 7,415,740,017,649,556

61 (15.25%) down, 339 (84.75%) to go.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 record number 62

Post by sje »

Draft 11 record number 62:
[d]
The perft(11) for the above is: 8,169,953,022,956,660

62 (15.5%) down, 338 (84.5%) to go.

After 98 days of elapsed time, the average calculation time for a draft 11 result is about 37 hours and 56 minutes.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Draft 11 results summary: records 1-50

Post by sje »

Draft 11 results summary: records 1-50:

Code: Select all

rnbqkbnr/1ppppppp/p7/8/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 1865423942798492
rnbqkbnr/1ppppppp/p7/8/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 2458021022756805
rnbqkbnr/1ppppppp/p7/8/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2110456650953864
rnbqkbnr/1ppppppp/p7/8/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 1562327606120748
rnbqkbnr/1ppppppp/p7/8/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 1882390155585040
rnbqkbnr/1ppppppp/p7/8/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 2373558610955814
rnbqkbnr/1ppppppp/p7/8/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2250225134770081
rnbqkbnr/1ppppppp/p7/8/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2178802463490013
rnbqkbnr/1ppppppp/8/p7/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 2670298917876179
rnbqkbnr/1ppppppp/8/p7/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2373873098604319
rnbqkbnr/1ppppppp/8/p7/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 3411299116725061
rnbqkbnr/1ppppppp/8/p7/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2171307455092881
rnbqkbnr/1ppppppp/8/p7/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 3039243237480582
rnbqkbnr/1ppppppp/8/p7/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 2654960388372645
rnbqkbnr/1ppppppp/8/p7/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 3354897405349959
rnbqkbnr/1ppppppp/8/p7/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 3850353951070799
rnbqkbnr/p1pppppp/1p6/8/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2789110131566204
rnbqkbnr/p1pppppp/1p6/8/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2062282403634935
rnbqkbnr/p1pppppp/1p6/8/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 2486684623836455
rnbqkbnr/p1pppppp/1p6/8/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 2429530164149293
rnbqkbnr/p1pppppp/1p6/8/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 3127051188240924
rnbqkbnr/p1pppppp/1p6/8/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 3098666191905313
rnbqkbnr/p1pppppp/1p6/8/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 3210768736129942
rnbqkbnr/p1pppppp/1p6/8/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2757027375707862
rnbqkbnr/p1pppppp/8/1p6/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2111901966382174
rnbqkbnr/p1pppppp/8/1p6/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2156261402017841
rnbqkbnr/p1pppppp/8/1p6/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 2746571348858965
rnbqkbnr/p1pppppp/8/1p6/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 2487329055338327
rnbqkbnr/p1pppppp/8/1p6/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 2428159154505788
rnbqkbnr/p1pppppp/8/1p6/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 3154612832248278
rnbqkbnr/p1pppppp/8/1p6/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 3161823457665669
rnbqkbnr/p1pppppp/8/1p6/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 3901556100338558
rnbqkbnr/pp1ppppp/2p5/8/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 2768271331293873
rnbqkbnr/pp1ppppp/2p5/8/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 3782980467479785
rnbqkbnr/pp1ppppp/2p5/8/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2342166292286351
rnbqkbnr/pp1ppppp/2p5/8/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 3152460705609456
rnbqkbnr/pp1ppppp/2p5/8/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 2844253997560744
rnbqkbnr/pp1ppppp/2p5/8/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 3602834392535550
rnbqkbnr/pp1ppppp/2p5/8/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 3377958687547657
rnbqkbnr/pp1ppppp/2p5/8/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 3342480370972141
rnbqkbnr/pp1ppppp/8/2p5/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 3105144188541894
rnbqkbnr/pp1ppppp/8/2p5/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 2645575697730606
rnbqkbnr/pp1ppppp/8/2p5/8/2N5/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 4357323324696016
rnbqkbnr/pp1ppppp/8/2p5/8/7N/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 3213899487866532
rnbqkbnr/pp1ppppp/8/2p5/8/1P6/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 3593594503531601
rnbqkbnr/pp1ppppp/8/2p5/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 0 2 11 4110277127488705
rnbqkbnr/pp1ppppp/8/2p5/P7/8/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 3857229623778338
rnbqkbnr/pp1ppppp/8/2p5/1P6/8/P1PPPPPP/RNBQKBNR w KQkq - 0 2 11 4688592240810617
rnbqkbnr/ppp1pppp/3p4/8/8/N7/PPPPPPPP/R1BQKBNR w KQkq - 0 2 11 4662754522416989
rnbqkbnr/ppp1pppp/3p4/8/8/P7/1PPPPPPP/RNBQKBNR w KQkq - 0 2 11 3889547812747990