Author: Will Singleton
Date: 12:47:09 04/27/99
Go up one level in this thread
On April 27, 1999 at 15:14:31, KarinsDad wrote: >On April 27, 1999 at 14:08:37, Will Singleton wrote: > >> >>On April 27, 1999 at 10:11:32, KarinsDad wrote: >> >>> >>>PS. Last night, it was running at 100 KNPS on a P2 400. However, this is with >>>the old legal move generation code which does not take advantage of the piece >>>attack tables yet and very few sections of code have been optimized for speed. >> >>How do you use attack tables to help generate moves? I assume you're not >>referring to the typical move-gen table that has all possible TO squares for >>each FROM square for each piece. >> >>Will > >No, although we do use that type of table for creating the piece attack tables >for knights. And we have some very large tables to quickly create the piece >attack tables (for queen, rook, bishop, and king moves) in the first place. > >We have two types of attack tables: Piece Attack tables and Xraying Piece Attack >tables. > >Piece Attack tables are used by the legal move. These are similar to bitboards >except that they indicate for a given square, every piece that attacks that >square (i.e. each square requires 32 bits for the 32 pieces). > >The legal move generator then has to determine pinned (and partially pinned) >pieces. All other legal moves are stored in this structure with the exception of >pawns which can only take if there is a piece there or e.p., and can move >forward if no piece is there; and kings which cannot move into check, and which >can castle. So, about 70% of all legal moves are already in this structure for a >given node. > >The xraying version of this structure (which by the way I haven't written the >code for) will then be used in the evaluation code to determine who controls a >given square. They are identical to the piece attack table with the exception >that xraying pieces ALSO attack a given square. So, batteries of rooks and >queens control a square more than just the closest piece, etc. I will probably >copy the Piece Attack structure to the Xraying Piece Attack structure and just >calculate the xraying pieces (queens, rooks, and bishops) on the fly in the >evaluation code (as opposed to having the structure on each node like the Piece >Attack table). > >One of the things that I have currently avoided is the code to calculate delta >information on a given piece piece attack table (this code is partially written, >however, I stopped working on it since the code to create the table from scratch >can temporarily be used instead). Once the delta code is used, then it will >speed up the creation of any node whose parent node you have the table set up >for already. > >KarinsDad :) Thanks for the explanation, sounds like you're making good progress. It always seemed to me that the overhead of incrementally updating the attack-tables at each node would negate the advantage derived at move-gen. But I guess you haven't got far enough to test that trade-off yet. Will
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.