Hi all
I used attack tables once. I did it because I thought it would be easier and faster in the long run.
Easier because the table could help answer a lot of questions that would otherwise need specially optimized routines.
Faster because computer chess is mainly about tactics like threats, attacks and pressure, a table would incrementally generate this information cheaper.
I now think I was wrong on both accounts, especially the "easier" part.
There is nothing easy about them, they take forever to implement and debug compared to a general attack routine, IMHO.
The real question to the hardcore chessprogrammer is of course if they are faster or not
Initially a table like that produces a big slowdown, probably a factor 2-3 in raw node speed. I think such a large speeddrop is hard to regain, but YMMV.
Some things that might benefit from attack tables is SEE, mobility and king safety eval and move ordering.
InCheck() detection also of course, although note it can be optimized pretty well by just looking at the attacks of the last piece that moved and its possible x-ray check.
Although all of those subroutines do become faster it's still the bottom line that counts, and at least in frenzee it is overall faster to use on-the-fly detection. Particularly in the endgame the attack tables seem like a poor investment.
-S.