Profiling Comparisons

Discussion of chess software programming and technical issues.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Profiling Comparisons

Post by bob »

D Sceviour wrote:Bob Hyatt wrote,
No. If you want bishop/rook/queen attacks, you directly generate them with a magic multiply lookup. Right at the point where the attacks are needed. No incrementally updated stuff, nothing kept around for later use.
Looking at Crafty's method of attack, it radiates outward from the attacked square rather than radiating inward from the attacking piece. The result (as I see it it) is a single dirty bitboard which gives the minimum required information to test the legality of a position. It cannot be used for anything else. Although I have not specifically tested that method, it may be that is what is necessary to maximize the speed of attack board functions.

However, I use a general attack board for a multiple of uses (futility, checking, legality, sorting, etc.) and that requires an exact attack board of all the pieces and pawns - for both sides on the same move. If this method is correct, then twice the amount of calculation time would be required for the Attacks().

The ultimate question is of course does it work? Arnaud lohéac posted these results for Schooner:

http://talkchess.com/forum/viewtopic.php?t=57496
That's the purpose of magic attacks. Attacks OUTWARD from a source. I do have an AttacksTo(square) which gives 1 bits for all squares that have pieces that attack this target square. I don't use it a lot, however. Useful in generating check evasions (legal moves only) as you need to know where the king is attacked from, and by how many pieces (1 or more than 1).

I understand the use for checking moves since I do that. But "futility" is not normally defined by attacks. You have to weigh the gain by using such expensive information compared to the cost of producing the info. Quite often the gain is more than offset by the cost, making it worthless.