Author: Dann Corbit
Date: 10:47:50 03/04/06
Go up one level in this thread
On March 04, 2006 at 02:46:22, Gerd Isenberg wrote: >>OK. So you make an array of 128 function pointers then, and do this: >> >>status = method[hashval(BB)](); > >Yes, if you like, you can do either switch with a contiguous range as well. >But to get pure attacksets, there are no function pointers at all, but pointers >to bitboards. > >> >>PGO seems to take a lot of the sting out of missed branch predictions, but of >>course there will always be some. > >It would be interesting to see some pseudocode what your /* Do Stuff */ in the >cases does, to implement a kind of "ray-base" e.g. with the position you >mentioned recently. If you are interested in a1-h8 related properties of let say >square g7. > >[D]7k/3n2q1/5p2/8/6N1/2Q5/1B6/Q1K5 w - - There is probably a lot less magic in my stuff than you might imagine. First of all, I have direct attack bitmaps, shadow bitmaps, and half-pin bitmaps (I tried quarter-pin, but so far they seem to be too expensive for the payback, but half pin are clearly worthwhile). For this position, half pin is enough. Quarter pin positions are very rare. Anyway, the interesting guy is the pawn at f6. When I go to my switch, I will have precalcuated stuff against the full bitmap and also white and black, as well as piece. The upshot is that I have for every square on the board a list of attackers by type and by type of attack (direct, x-ray, half-pin). So let's consider the pawn. He has: white attackers black attackers(defenders) pawn direct(0) pawn direct(0) {no such thing as indirect for P} knight direct(1) knight direct(1) {no such thing as indirect for N} bishop direct(0) bishop direct(0) bishop x-ray(1) bishop x-ray(0) bishop half(0) bishop half(0) rook direct(0) rook direct(0) rook x-ray(0) rook x-ray(0) rook half(0) rook half(0) queen direct(1) queen direct(1) queen x-ray(0) queen x-ray(0) queen half(1) queen half(0) In addition, we know that black is upside down on the pin, that the pinned piece is a queen and that the shadow pinned piece is a king (type of piece that is BEHIND the pinned piece is crucial and actually changes my pin type). My makemove actually updates these counts* (so movegen suffers a bit and will never compete with the fastest). As a side point, it makes a legal only move generator a snap. [*] The function pointers I was referring to are the things that: 1. Remove the influence of the piece from the board (imagine picking it up) 2. Add the new influence of the piece to the board (imagine putting it down) Besides helping out the evaluation a great deal, it is also stupendously helpful for move ordering. You can tell at a glance from the information presented that the queen's pawn capture is winning (makemove alone does not know it, but evaluation does without search).
This page took 0.01 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.