Hi All
If you are using 0x88:
You can use the "can piece on fsq attack tosq" trick.
Then it becomes: Can piece on fsq attack tosq via another square". Do not give a yes/no but give the actual squares on wich it does.
For a knight,rook,bishop you give atmost 2 squares, pawn 1, queen 11 (? iirc)
yes i use 0x88. what i do is loop over the pieces check if it is pinned,if
so generate all moves, otherwise continue checing every tosq if it gives a direct check. What you suggested above must be faster for generating checks only,but i generate captures and checks simultaneously. This may zero the gain? The capture generation requires looping over all the squares unless you know the attacked opponent pieces before hand.
Do you have a suggestion for a good benchmark? According to my profiler, my generate_checks() functions consume 1.2% of the CPU time in tactical positions. Of course this number by itself means nothing (except that cannot hope to improve my program by optimising this function). Perhaps I just call generate_checks() less often than you do, or the rest of my code is very slow?
i used the starting position and it dropped my nps from 1,110,000 to
850,000. Note this is with pcsq only evaluation. It should drop further
on tactical suites. I will post results on a tactical position later.
My NPS further drops to 500,000 by generating attack tables with in the eval. This is equivalent to 2x move generation.
so i am thinking i would gain something by trying to optimize these generation routines??
I do not know exactly what you are targeting. If it is the creation of moves including the information, whether they are no, single or double check threats, there is a special perft routine of mine. An example:
only generation of check moves(+ captures if possible) to be used in qsearch.The perft you posted is for generating all moves.
BTW Reinhard ,do you see any advantage by using an offset method other
than 0x88? This method gives nice square relation ships which helps in fast attack generation.
best
daniel