Gerd Isenberg wrote:Looking for pinned pieces for both sides can be combined with finding discovered checks for both sides if you use fill-stuff. Also, if side not to move has discovered (or even double) check at the tips we may reconsider standing pat with static eval >= beta.
Yes, I was thinking along these lines. I'm still thinking it through in my head, but I'm going to make 4 sets of bitboards for pieces pinned in each direction. I suppose to determine discovered/double checking status I will create these for both sides (i.e. pieces pinned against both kings). I might do this with a fill-based approach. I had considered it, but I'm not sure if there would be much difference. The loop method is likely fast, but IMO ugly. Fill techniques would likely be ugly too, as I have a method that takes direction as an enum. Each direction requires two fills that correspond to both positive and negative directions. This I suppose I would do with a table of function pointers.
So once you have these bitboards, you can determine which pieces can move in that direction by ANDing every other direction's pin set. Discovered checks are determined by whether a piece is pinned against the opponent king, and regular checks are determined by a regular attack set union.
I'm still not sure how I'd like to integrate this into my current setup. If I determine checking status of moves, it makes little sense to make in_check() calls elsewhere. I suppose in your case you get it for free though. Perhaps I will start keeping direction-based attack sets around, so that I get it for free.
