Differential move generation
Posted: 26 Aug 2006, 10:28
I am back on the topic of differential move generation, because I realized that in the end leaf of a tree (by far the most abundant node type...) the side that is to move only sees its move list of the underlying node changed by a move of the opponent. This means that changes in the list only can come about through loss of a piece in the last ply (requires no change of the list, just skip the listed moves for that piece, as you would also do when it is pinned on the King), or to blocking / unblocking of my Sliders. The latter are moderately uncommon events. (e.g. On a capture there are no blockings.) When differentially updating, by far the most costly part is usually to delete and add the moves of the piece that you moved yourself.
So typically, the amount of work in a node where we don't actually do any moves would be very little. Only if we decide that one of the moves already in the list or an unblocked one is interesting enough to try (e.g. it is a good capture or a check), we need to update the lists before actually searching that move. (And alas, undo the changes later.)
In particular when we only do this for our capture generator, the number of new moves due to unblocking will be very small: each unblocked ray gives at most one new capture, while it might give many new non-captures. So I am leaning to a mixed approach, where the captures are generated differentially, (and are organized in an attack table), while the non-captures are generated by oldfashioned ray-scanning over the board.
Has anyone played with such ideas?
So typically, the amount of work in a node where we don't actually do any moves would be very little. Only if we decide that one of the moves already in the list or an unblocked one is interesting enough to try (e.g. it is a good capture or a check), we need to update the lists before actually searching that move. (And alas, undo the changes later.)
In particular when we only do this for our capture generator, the number of new moves due to unblocking will be very small: each unblocked ray gives at most one new capture, while it might give many new non-captures. So I am leaning to a mixed approach, where the captures are generated differentially, (and are organized in an attack table), while the non-captures are generated by oldfashioned ray-scanning over the board.
Has anyone played with such ideas?