Author: Tord Romstad
Date: 04:05:31 08/31/03
Go up one level in this thread
On August 30, 2003 at 15:32:21, Steven Edwards wrote: >On August 30, 2003 at 14:37:44, Tord Romstad wrote: > >>My program has reached the stage where it is so complicated and ugly that I >>no longer understand clearly how it works (it's rather miraculous that it >>works at all), and there are many parts of the code which I am afraid of >>touching because I am sure I will break something. Besides, the program >>is horribly slow, searching only about 120 kN/s on a PIV 2.4 GHz. > >Comparisons of node frequency are only valid between programs that process >essentially the same information at each node. So 120 KHz cauld be sluggishly >slow or blindingly fast; it all depends. Within certain limits, yes. But is there *any* reasonably strong program which is as slow as 120 kN/s on a PIV 2.4 GHz? >In the Old Days, the first Tech program was, by design, the fastest program in >terms of node frequency. But it was not a top scorer because relatively slower >programs apparently processed more information per node and used it more >effectively. > >>1. One of the things I dislike about bitboards (at least the modern >>approach with rotated bitboards) is that even very simple operations >>like generating moves seem to require either using huge lookup tables >>(like in Crafty without -DCOMPACT_ATTACKS) or writing some extremely >>complicated and unreadable code (like Crafty _with_ -DCOMPACT_ATTACKS). >>Is there a way to use rotated bitboards without having big tables, >>and still keeping the code short, clean and readable? > >I have some mixed feelings about rotated bitboards, so they are not currently >used in the CT toolkit. However, the use of rotated bitboards is a low level >design feature and a decision on using them is one you can defer until you can >get the rest of the bitboard operations working. I agree that the decision of whether or not to use rotated bitboards does not have to be made immediately, but before I start implementing bitboards at all I want to make sure that there is a way to implement them efficiently. >Indeed, the higher level tasks of a chess program should be blissfully ignorant >of the low level details of data representation. In C++, the use of either >standard or custom templates for container and iterator classes can completely >isolate the detials of storage and access of moves, boards, etc. Personally I detest C++ more than any other programming language I have touched (and I have used a lot of them; I'm a programming language junkie). Perhaps this is because I learned to program using Simula and Common Lisp, I don't know. I hope I will never have to write a single line of C++ in the rest of my life. I will not accept a C++ programming job, even if it is paid twice as much as a similar Lisp job. Please note that this is of course just a very subjective opinion. I am not claiming that C++ is inherently bad or anything like that. Many people do amazing things with C++, and it is clearly an excellent tool in the hands of the right persons. I am simply not one of these persons. >>3. I also dislike the fact that bitboards are much too big to be used >>as indexes to lookup tables, and that extracting information from them >>is often difficult to do without looping through all the 1 bits. It is >>easy to compute a bitboard of all pieces which attack a given square, >>but in my evaluation I want to extract information about the number and >>types of attackers in a small and compact bitfield (which can be used >>as an index to a lookup table), while throwing away information about >>the locations of all the attackers. How do I achieve this with bitboards? > >Well, how would you do this *without* bitboards? Write up some code for that, >and then see where parallelization via bitboards can speed up things. I loop through all squares every single piece on the board attacks, and set the corresponding bits in the attack table. It's a rather expensive operation, of course. Obviously, I could do something similar with bitboards, by looping through all the 1s in the bitboard of squares attacked by every piece. But one of the main points of bitboards is to avoid all those loops, isn't it? Tord
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.