152k rook and bishop attacks using PEXT and PDEP

Discussion of chess software programming and technical issues.

Moderator: Ras

syzygy
Posts: 5672
Joined: Tue Feb 28, 2012 11:56 pm

Re: 152k rook and bishop attacks using PEXT and PDEP

Post by syzygy »

Lasse Hansen wrote:To get an attack table of around 209k instead of 841k, one need to do an additional PDEP and shift (or??).
I have no shift:
https://github.com/syzygy1/tb/blob/master/src/bmi2.h

My table is 210.5k, but I didn't bother (yet) to remove some redundancies.

By now there should be lots of people with Haswell machines. Maybe the Stockfish team (for example) could add pext/pdep generation as a compilation option, so that we finally get some numbers?
Gerd Isenberg
Posts: 2251
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: 152k rook and bishop attacks using PEXT and PDEP

Post by Gerd Isenberg »

Hi Lasse,

interesting idea to omit adjacent attack bits in pdep/pext which are independent from occupancy, and to calculate them separately. Considering the huge L3, my wild guess is that a 800+K plain pext approach will be fastest in a real engine ;-)

Cheers,
Gerd
syzygy
Posts: 5672
Joined: Tue Feb 28, 2012 11:56 pm

Re: 152k rook and bishop attacks using PEXT and PDEP

Post by syzygy »

Gerd Isenberg wrote:Considering the huge L3, my wild guess is that a 800+K plain pext approach will be fastest in a real engine ;-)
For my table generator, my wild guess is that the 200+K pdep/pext approach is fastest. In my chess engine, shiftless magic bitboards with compact tables by Volker Annuss easily beats the "Hyperbola Quintessence" approach, but for my generator they are about equal (possibly Hyperbola is faster on AMD). So memory usage seems more of an issue for my generator.

Maybe pext for bishops, pdep/pext for rooks.

My plan is to wait for Haswell-E...