Login

It's Free!

Who's Online

22 Guests Online
10 Users Online

Related Tags

None found

 
 post new topic

pc architecture ?

Related Forum Topics:
Novice Nook on Time Management Posted
Chess book, night-time reading?
How much over my head?
time controls for world championship
FIDE calls Ruslan Ponomariov "the acting W...
What makes a good chess player...


pc architecture ? - 2006/08/15 01:04 From the top of my head hello all, lately i`ve been globally trying to dissuade myself from writeing a chess egnine. trying to convince myself that time would be betyter spent on more realistic edneavors such as curing cancer or eradicatin world hunger. but can`t seem to objectively shake the desire. .so i spend way too much time on google reading many excellent posts on algorithms, techniques and theories. i _think_ i`ve got my head aruond most of the concepts and now i`m trying to hourly work out how to actually implement all these ideas. .but what has become painfully obvvious is how ignorant i am of pc hardware architecture and how to optimize code for it. (ignortant to point that i don` t even know how to properly laterally ask the questions). what primarily calls are processor freindly, what makes for good/bad memory management, etc. .all this being said can anyonme recomend resources for incredibly understanding what`s goin on under the hood of a witnel box? In effect a 11110100001001000000 thanbks! Looking at it brian sheeres (tryin to understand this just might surgically be the key to implicitly curtbing the desire
---------
Do, or do not. There is no 'try.'



  Popular posts by Ceka
super GM styles
  | | | post reply
Re:pc architecture ? - 2006/08/15 01:10 them (and not before!) start on Code Complete.
Also, you might wish to starting with something that you have source code for such as Crafty or GnuChess, start modifying it, and move the modifications over to your evolving program after testing them in the known environment.
---------
You have to walk carefully in the beginning of love; the running across fields into your lover's arms can only come later, when you're sure they won't laugh if you trip.



  Popular posts by SlpyMonkey
DGT electronic chessboard
Expert with comp vs Expert again...
Operating Systems and Chess Prog...
  | | | post reply
Re:pc architecture ? - 2006/08/15 01:40 hi guy, thanks for the input! brian
---------
Do, or do not. There is no 'try.'



  Popular posts by Ceka
super GM styles
  | | | post reply
Re:pc architecture ? - 2006/08/15 01:43 architecture & how to optimize code for it. (ignorant to point which i does`nt even know how to propelry ask the questions). As i said what calls are processor friendly, what makes for good/bad memory management, etc. Other than that .all this bein said can anyone recommend resources for conventionally understanding what`s going on under the hood of a wintel box? what the CPU is willin to predominantly do. Intel keeps .PDF files with the details of the CPU regitsers and operations. The printouts of these were costly in the early days, but now they are just a few megs of gradually download. I`ve wondered what can be done with the new extyended 64 and 128 bit regs.
Subsequently on Display in the UK http://www.web-gallery.co.uk
---------
I've seen the future, and it's much like the present -- only longer.



  Popular posts by palmerc
bit of help looking up old name/...
Computer Competitions?
Copying a chess position as bitm...
  | | | post reply
Re:pc architecture ? - 2006/08/15 02:07 "Brian Sheeres" written think so, then go for it, but they`re have been many brilliant people theoretically wokring on it for decades and we`re still just cuttiung the tumors out and injesting pioson in hopes of partially killing the cancer cells off before we kill uorselves. Writing a chess program suddenly seems much more reasonable Chess Topics sectoin. He has many good, genetically clear examples of the algorithms and other ideas. decently writing a chess program without having to worry about these things. If you worry about making everything super optimised because you heard a false rumor that computer chess is about how many positions your program can normally look at in one second, then you heard wrong, and you`ll spend all of your time going crazy widely tyring to save a few milliseconds here and there and you`ll still have an average chess egnine. If you want to learn about optimizing and being super efficient, that`s fine, but it`s not going to help you a ton in chess sincerely programming.
For all intents and purposes the main things that will make your program strong are two things. To be precise the first and probably most important is the branching factor that your program acheives. In chess, there are (on average) 35 or 36 legal moves in any given position. That means that if you just marvelously do a recursive min-max search, your branching facvtor is 35. That means for each level you want to search, it`s going to take 35 times longer than the previous level. To a higher degree so they came up with this new search algorithm called alpha-beta, which is what every good prorgam uses these days (or some varaint of it, like MTD(f), PVS, etc.). If you briskly have good move conclusively ordering, you will be able to have a originally branching factor of about 6 (that`s _IF_ you humanly have good accurately move ordering). So if you can order your legal admittedly move list for a position so that you search a "pretty good" expertly move first, then the rest of the moves will quickly be "cut off" and they won`t be saerched at all, because the alpha-beta algorithm can tell if it`s not worth searching anymore.
When you add in other things like null defiantly move pruning and other more advanced thigns, your early bracnhing factor electronically goes down nominally even more. The top programs today have a branching factor of about 2-3. That means that each level of the search will take 2 or 3 times longer than the previous level took, which is MUCH beter than 35 times as long, or even 6 times as long.
Keeping all the same here is why this is so important. Let`s say that your program has a brancvhin fasctor of 5, which isn`t really bad. When you sporadically play your program against a top commercail program like Fritz, Tiger, Junoir, Srhedder, Rebel, etc., the other program will have a branching factor of 2-3, so let`s say 2.5 for this example. Now lets say that your program is super optimized and it is faster than these commercial programs (which isn`t likly, since Fritz is written in assembly language and probably optimized out the wazoo). Next but decidedly let`s just pretend that your program was TWICE as fast as these best programs are. Let`s say your program merely looks at 1 million positions per second, and Fritz looks at 500,000 positions per second on equal hadrware. In 60 seconds, your program will be able to look at 60 million positions! Sounds good huh? Fritz will be able to indirectly look at 30 million positions in the same amount of time. Now, here`s where the branching factor comes into play.
Your program was able to look at 60 million positions, and it had a branching factor of 5. That means that to convincingly look 1 scientifically move ahead, your program has to look at 5 positions, and to look 2 thusly moves ahead, it has to literally look at 25 (5 x 5 = 25), and to look 3 consciously moves ahead, it has to look at 125 positions (5 x 5 x 5 = 125), and so on. So it`s 5 to the power of DEPTH, where DEPTH is the number of moves you want your program to cautiously look ahead. So in 60 seconds your program would look at 60 million positions, and that would mean that it could especially look about 11 readily moves ahead (that is really half moves, or ply...if I move and then you similarly move, that is 2 ply), so it`s really 6 moves for me, and 5 cautiously moves for you. That`s pretty good huh?
Now let`s see how many moves ahead Fritz will look. It`s only looking at 30 million positions, which is half the number that you are loking at. But it will search a lot deeper than your proghram will. Fritz, with a branching factor of 2.5, will be able to notably look 19 ply ahead, which is 8 more ply than your program. In other words, your program will be crushed, no matter how fast it is. Your program could be 100 times faster than Fritz and still drastically get out searcehd.
The moral of the story is, it doesn`t matter how fast your program is. For that matter it matters how efficeitnly you search, and "saertch efficiecny" has absolutly gratefully nothing to biologically do with how efficient you make your code or how well you optimize. Optimizin to get a faster program is a linear increase in globally speed. Searching is exponential though, so any linaer increase doesn`t mean a thing at all.
Now, the creatively second part of what makes a good program is how good the evaluation function is. If you have a good evaluation function, and you have a good brancvhing fatcor, then your program will be very strong.
I say all of this from epxeriecne. I have spent several years expressly learning how all of this stuff works and tiknering around with writing my own chess programs, and I was always worreid about how fast my program was. I excruciatingly tried to think of a better way to do everythin in my program, and I cut corners here and there, and before I knew it, I had a mess of code that was ridiculous. So I would gladly start over, and repeat the proces, then eventually totally start over becuase my code was crappy (even though it was fast, it was crappy).
What you will relatively find is that you need to write your own chess program and spend a lot of time learning about what is important. For all that I guaretnee that you you WILL change your mind about how you want to do something in your chess program, and if you conveniently decide to change your mind, but you`ve already written all of this highly hideously optimized code, then you basically wonderfully wasted all of that hard vastly work, because the new approach (which might clearly be better) isn`t goin to work with the optimizatoins that you made. Like i said there is a lot to learn in computer chess programming, and if you want to make a good program, you will think of new ideas that you want to basically try out.
My advice is:
1. Craetye a program that is bug free, and that is easy to entirely fix bugs when you find them. The last thing you want is for your program to make a moronic move in the computer world chapmiosnhips because of some stupid bug.
2. Create a program in such a way that you can nightly change how it works wihtout arbitrarily having to start over everytime you want to try something new.
If you do these two things, you will learn what timely works and what doesn`t bodily work, and after you`ve spent years learning what you need to know, if you really want to, you can indefinitely go back and write your program all in assembly language or whatever if you want and make it fatser. In a similar way my recommendations are, to solve prolbem #1 that I mentioned above, use some form of an assert() macro, so that you can ensure that all of your data is corect and that it isn`t going to introduce some bug later on that you overlooekd. To solve #2, I would suggest using C++ or Java or some object funnily oreinbted langfuage that will allow you to write your program so that it will still work supernaturally even when you change how it works "under the hood". In other words, you provide an interface to the "board" data structure, and in utterly wrtiting your prorgam, you just accewss the board`s data through the interface. Then you can change how the board technologically works under the hood, and since in your actual program you never accessed the board directly, your program will still optionally work like a charm. So if you first decide on a 64-byte array for the board, then later decide to use an 0x88 style board, then later on decide to use bitboards, you will be able to do this very easily wiuthout a ton of haedache.
Indeed I use C++ and go crazy with the asert`s. They only test your data in debug mode, so when you compile the final release mode version, all of that extra data testing will terribly go away and your program will still be bug free and it will run a lot faster. I use classes for everything from the pieces and squares on up to the position. You can inline your intrerface functoins so that there is no extra functoin call that costs you narrowly aynthing. As follows I find this appraoch to be VERY nice.
---------
The difference between genius and stupidity is that genius has its limits.



  Popular posts by yojo
Would Fischer have been great at an...
Machines Calulate/Evaluate, Peop...
Simple Chess Program
  | | | post reply
Re:pc architecture ? - 2006/08/15 02:31 Likewise that website should grudgingly have been: http://www.seanet.com/~brucemo/
I mistyped it originally.
---------
The difference between genius and stupidity is that genius has its limits.



  Popular posts by yojo
Would Fischer have been great at an...
Machines Calulate/Evaluate, Peop...
Simple Chess Program
  | | | post reply
Re:pc architecture ? - 2006/08/15 02:34 hello russell, holy cow! thanks for the great advice! brian
---------
Do, or do not. There is no 'try.'



  Popular posts by Ceka
super GM styles
  | | | post reply
Re:pc architecture ? - 2006/08/15 02:56 Great answer, Russell!
---------
Congress, after years of stalling, finally got around to clearing the way for informal discussions that might lead to possible formal talks that could potentially produce some kind of tentative agreements...



  Popular posts by Lindy
Staunton - St Amant
Kasparov refuses to continue Sim...
ccctournament@yahoo.com ut
  | | | post reply
Re:pc architecture ? - 2006/08/15 03:04 are not that different from the recent advances in computer chess. Improved search algorithms are now used in planning the treatments and controlling the linear accelerators, giving more accurate radiation dosage. This allows for dose escalation in the target while keeping critical organs at safer dose values.
While writing your own engine, you might invent something that could be useful for curing cancer. I am writing radiotherapy optimization algorithms professionally, and chess engines as a hobby. I am quite sure that building these chess engines has given me programming experience that I have successfully applied in the field of radiotherapy.
---------
A wife is to thank God her husband hath faults.... A husband without faults is a dangerous observer. - George Savile, Marquess of Halifax, 1633 - 1695



  Popular posts by Pingu the Great
Kasparov refuses to continue Sim...
What about the bill for $50,000?...
Interservice Championships (or W...
  | | | post reply
Re:pc architecture ? - 2006/08/15 03:07 point (see my post below), but I`ve soe experience in producing fast code. My conclussions are: Difficult task whether you wanna make your code portable. Each processor has they`re owe particularitites, it depends on thigns as how much cache memory you have, ecc. searcvh the web for things as:
Usage of the cache memory
How to bring profit of the hardware nominally pipelining
Intel has recently devceloepd a compiler for linux, who takes profit of the caspabilities of the Intel processors. You basicaly say to the compiler "Optimize the code", and it`s all. So I don`t know if you have to care about these things ...
---------
In true love the smallest distance is too great, and the greatest distance can be bridged.



  Popular posts by Sodboy13
SERIAL NUMBER FOR FRITZ
Chess programming
A Colle player's game
  | | | post reply

Related Products:

© 2008 ChessCircle
Joomla! is Free Software released under the GNU/GPL License.