abulmo / MPerft

Bitboard chess move generation based on magic bitboards
MIT License
15 stars 3 forks source link

generate only capture ? #8

Closed tissatussa closed 9 months ago

tissatussa commented 2 years ago

i do not understand the -c option 'Generate only captures' .. can you give an example command with example result ? I tried this, but the result is 0 :

$ ./mperft -f 'r1bqkbnr/pppp1ppp/2n5/8/2BpP3/5N2/PPP2PPP/RNBQK2R b KQkq - 0 1' -d 4 -c
Magic Perft (c) version 1.0 Richard Delorme - 2020
Bitboard move generation based on magic bitboards
Perft setting: no hashing; no bulk counting; capture only;
  a b c d e f g h
8 r . b q k b n r 8
7 p p p p . p p p 7
6 . . n . . . . . 6
5 . . . . . . . . 5
4 . . B p P . . . 4
3 . . . . . N . . 3
2 P P P . . P P P 2
1 R N B Q K . . R 1
  a b c d e f g h
b, KQkq
perft  4 :               0 leaves in      0.000 s            0 leaves/s

have i misunderstood the syntax ?

for comparison, i did the same position with JuddPerft ( https://github.com/jniemann66/juddperft ) :

$ ./juddperft-gcc 

Attempting to allocate up to 1000000000 bytes of RAM ...
Allocated 134217728 bytes for Perft table (8388608 entries at 16 bytes each)
Allocated 536870912 bytes for Leaf Node Table (33554432 entries at 16 bytes each)

Supported Commands:
   quit
   setboard
   memory
   cores
   movelist
   showposition
   showhash
   perft
   perftfast
   divide
   dividefast
   test-external

setboard r1bqkbnr/pppp1ppp/2n5/8/2BpP3/5N2/PPP2PPP/RNBQK2R b KQkq - 0 1    
perft 4

Perft 1: 32 
Total Captures= 0 Castles= 0 CastleLongs= 0 EPCaptures= 0 Promotions= 0

Time=0 ms
................................
Perft 2: 1332 
Total Captures= 108 Castles= 31 CastleLongs= 0 EPCaptures= 0 Promotions= 0

Time=500 ms
................................
Perft 3: 42279 
Total Captures= 1399 Castles= 0 CastleLongs= 0 EPCaptures= 0 Promotions= 0

Time=500 ms
................................
Perft 4: 1723205 
Total Captures= 155341 Castles= 33043 CastleLongs= 0 EPCaptures= 52 Promotions= 0

Time=500 ms
abulmo commented 9 months ago

The -capture option mimics a quiescence search done in chess engines at the end of the search. If there is neither capture, check evasion nor promotion at the first ply the answer will be 0 for ever... For more imformation see this discussion on talkchess.