Questions about PEXT move generation

Discussion of chess software programming and technical issues.

Moderator: Ras

Joost Buijs
Posts: 1631
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Questions about PEXT move generation

Post by Joost Buijs »

mathmoi wrote: Tue Jan 16, 2024 5:01 pm
jdart wrote: Sun Jan 14, 2024 10:38 pm PEXT gives only a very minor speed gain in my engine.
Is it even worth it? I was under the impression that PEXT (when a fast implementation is available) was definitely faster. Was it wrong to assume that?

In any case I will have to test it myself, but I'd like to know what kind of speedup other author have found between Magic and PEXT.
For my engine PEXT is even somewhat slower than my Magic implementation.

Perft depth 7 with PEXT:

Total moves: 3195901860
Total time: 22.4786 sec.
Average mps: 142175362

Perft depth 7 with Magic:

Total moves: 3195901860
Total time: 20.7247 sec.
Average mps: 154207043

This is on an Intel i9-10980XE which has fast PEXT, I think it solely depends upon how the compiler optimizes the code, maybe there are cache effects too.