- int compute_index(Square wksq, Square bksq, Square psq, Color stm) {
+ // A KPK bitbase index is an integer in [0, IndexMax] range
+ //
+ // Information is mapped in this way
+ //
+ // bit 0: side to move (WHITE or BLACK)
+ // bit 1- 6: black king square (from SQ_A1 to SQ_H8)
+ // bit 7-12: white king square (from SQ_A1 to SQ_H8)
+ // bit 13-14: white pawn file (from FILE_A to FILE_D)
+ // bit 15-17: white pawn rank - 1 (from RANK_2 - 1 to RANK_7 - 1)