Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
If you are building something like that you really need to be on a different platform than Apple. Do the user interface on Apple if you like, but run the back-end on server class hardware. Applications like these tend to grow and with Apple if you are already on a MP and you need more, like 8 times more. There is nothing as you are already on the top of the line. But if you were running on 4 or 8 CPU Sun server you are running ona "low-end" server and there is room to grow.

One of the things the higher end server class hardware has is "fault tolerance". The Sun equipment will continue to run even with a failed CPU and failed RAM and with a failed disk controller. It will re-configure itself. Also you have multiple power supplys that can be swaped without bringing the system down. Also the Sun stuff is comparably priced to Apple. Sun as a company is very much like Apple. Solaris and Mac OS X share much in common.

Do you really need this much physical RAM? What is the algorithm you are implementing

I already have implemented this, on a smaller scale, on another platform, I want to switch to OS X and foresake Windows because it is an abomination.

There is no "growth" that needs to be budgetted for, this is a one-shot deal. I need the RAM to solve prohibitively large chess-like endgames, and there is no way to get to the next level without grinding a disk into pulp if using a paging schema, which would take about 10 computer-years to finish. For example:

http://www.gothicchess.com/javascript_endings.html

You can see this checkmate in 268 moves that was already solved:

1. Qe2! Qg8+ 2. Ka7! Qg7+ 3. Ka6! Qa1+ 4. Kb7 Qb2+ 5. Kc6 Qf6+ 6. Kc5 Qf5+ 7. Kd6 Qf8+ 8. Kd7! Qf7+ 9. Qe7 Qd5+ 10. Qd6! Qb7+ 11. Ke6 Qe4+ 12. Kf6 Qf3+ 13. Ke5 Qe2+ 14. Kf5 Qf3+ 15. Qf4 Qd5+ 16. Kf6 Qc6+ 17. Ke5 Qb5+ 18. Ke4 Qb1+ 19. Ke3 Qe1+ 20. Kd3 Qc1 21. Ke2 Qc2 22. Ke3 Qc1 23. Kf2 Qc2 24. Kg3 Qg6+ 25. Kf3 Qd3+ 26. Qe3 Qf5+ 27. Kg3 Qi5+ 28. Kg4 Qi6+ 29. Kf4 Qf6+ 30. Kg3! Qj6+ 31. Kf3! Qi6+ 32. Kf2 Qi5+ 33. Ke2 Qb5+ 34. Ke1 Qb1+ 35. Kf2 Qa2 36. Kg3 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1-0

That was just a 5-piece ending on the 80-square board featuring King + Queen + Pawn vs. King + Queen.

"How big" is this database?

There are 60 legal placements for the white pawn.
There are 79 squares remaining for the white queen.
There are then 78, 77, and 76 squares remaining where you can place the black queen, white king, and black king. Some of these are not allowed due to the rules of who can move when one side is in check, but disregard this for the moment. And, lastly, either side can move from any of these arrangements, so you have to mutiply the count by 2.

For position count, you get: 60 x 79 x 78 x 77 x 76 x 2 = 4,327,202,880

But, since the longest win is 268 moves = 268 + 267 = 535 "plies" if you count moves for both sides, you need 2 bytes per position to store the distance to win.

So 4,327,202,880 x 2 = 8,654,405,760 bytes = more than 8 GB of RAM.

Now, I want to solve the 6-piece database, meaning you can basically multiply this by 75, which would be 600 GB. It is really not that "harsh", with symmetry tricks I can reduce this by a factor of 4 meaning 150 GB of RAM would be needed.

It just so happens, with 32 GB of RAM, I could load about 20% of the DB in RAM at a time, and this would greatly reduce the disk access if I implement a most-recently-seen-position buffer scheme.
 
Why do you want or need to calculate all these permutations and end-games? Just curious.

Because it's cool man :)

Actually, as the program searches, if it encounters any of the 300 billion positions I have already solved, it can return perfect information back down to the root of the tree.

There are billions of King + Queen + Pawn vs. King + Queen positions where the side that is up a pawn CANNOT win -- the weak side can draw.

So, in a "jam", if the program was down a pawn, it could head for such a position since the score "0" would be returned. Other programs would still think they were ahead by 1.0 pawns, but Gothic Vortex would know better.

Also, some endgames are so complex, they CANNOT be won with a search. Gothic Vortex would be able to play the correct move for any position INSTANTLY, just looking it up in the database, and making the best possible play.

Even with 15 pieces on the board, the 5-piece database is probed often enough that it can make aanouncements such as "Mate in 276" since the program can force a series of trades getting it down to the reduced material in the endgame database.

Any other computer program would think it was "just down a pawn" and have no idea its impending doom was inevitable.

In the 2004 World Championship, our program went 14-0 to take all the marbles. You can read about it here:

http://www.chessville.com/GothicChess/ComputerWorldChampionships.htm
 
And I forgot to mention, in that huge move list showing the 268 move checkmate, you see some moves ending in !

Every ! means that is the only move to win.

So, if you play ANY other move, you have just handed the draw to your opponent, or even worse, though less likely, you can still lose such an ending.
 
would one of the new flash hdd's work and use virtual memory?

I'd imagine the hard drive bandwidth is still to low. For example, a MacBook Pro can retrieve information from 2 gb of RAM in 1 second, wheras no matter what speed the hard drive is, you'll be limited to something 'slightly' less than that.
 
If you've got that much money to burn to simulate some chess variant well good on you but I think you need to re-evaluate your programming approach bigtime, more ram is always nice for simulation work but you shouldn't *need* it under any circumstances. If you do, you've got one huge memory leak somewhere. Trust me, fluid dynamics, software x-ray optics and economic modelling are way more taxing than chess simulation and they can be done on far lower-grade hardware.

Killyp - you can ping google in well under a second on a broadband connection, you're off on your latency by a few factors there.
 
If you've got that much money to burn to simulate some chess variant well good on you but I think you need to re-evaluate your programming approach bigtime, more ram is always nice for simulation work but you shouldn't *need* it under any circumstances. If you do, you've got one huge memory leak somewhere. Trust me, fluid dynamics, software x-ray optics and economic modelling are way more taxing than chess simulation and they can be done on far lower-grade hardware.

Killyp - you can ping google in well under a second on a broadband connection, you're off on your latency by a few factors there.

Well, if you were right, I would agree with you :)

There is no memory leak.

There is no other way to solve these endings unless they are in a huge RAM buffer, because trillions of positions are being solved, and, as everyone knows, RAM access is order of magnitudes faster than paging off of the disk.

I have published a few papers for the International Computer Games Association Journal, one of which appeared in an artificial intelligence book.

You can download them here:

http://www.GothicChess.com/7_piece.pdf

http://www.GothicChess.com/80.pdf

The first paper is about the longest win ever solved in the game of checkers: 253 moves if you count the play for both sides. I had to solve roughly 23 billion checkers positions (in RAM) to compute that.

The second paper is about the chess variant played on 80 squares, and how chess ALMOST evolved into this in the 1920's. Also, I figured out how to compute the value of the chess pieces on boards of any size (the "Holy Grail" of chess mathematics) and this is one of the reasons they were eager to publish the paper.

NOTE: The program only needs the large amount of RAM to generate the databases. I can run the Gothic Chess program that reads them with a mere fraction of the RAM.

Regarding "money to burn": Gothic Chess has been around since 1998. Since that time I have sold over 50,000 of these boards to many different countries. If you google "Gothic Chess" you can find stuff in German, French, Russian, Italian, etc. etc.

Maybe it also helps that I have a 6'5" tall former hooters waitress as a Media Spokesperson :)

alexis_10.jpg
 
There is no other way to solve these endings unless they are in a huge RAM buffer, because trillions of positions are being solved, and, as everyone knows, RAM access is order of magnitudes faster than paging off of the disk.

Have you considered a huge RAID array? i know it won't be as fast as ram... but could it provide an alternative? With a dedicate raid box, you should be able to get better than 600MB/sec with a quad channel fiber connection... and all the storage space you could ever use.

just a thought... i've got raid on the brain lately as i config my system.
 
Have you considered a huge RAID array? i know it won't be as fast as ram... but could it provide an alternative? With a dedicate raid box, you should be able to get better than 600MB/sec with a quad channel fiber connection... and all the storage space you could ever use.

just a thought... i've got raid on the brain lately as i config my system.

Well, the computation will take 1.5 computer years if it is 100% RAM resident. With my buffering solution, it will take about 2.2 computer years. Since I have a limit to my patience, I may just lease 4 machines (the task is parallelizable) and have everything in about 8 months' time.

Now, scale that by the speed ratio of a RAID disk to RAM, and you see why it becomes impossible. Even with a 10:1 ratio (and it will be over 1000:1, way over) you are talking about 22 computer years with a RAID-only approach.

I just have a boatload of code to crank. The project has over 200,000 lines of source code as is, and I am about 65,000 lines away from completion.
 
You don't need the ram, it'd just be nice, thus my point. Take a look at Amazon's EC2 service, you're better off buying cycles than you are leasing hardware for something like this and it doesn't look like something that's too hard to paralellize. Of course that doesn't generate you threads on major sites with your product splattered all over them. If you do want to lease hardware you're better off with something like a small cluster of Sun Fire X4200s, more cycles for your buck. I'm not sure how you're coming up with those 1.5/2 year figures though.

This thing written in c? perl?
 
You don't need the ram, it'd just be nice, thus my point. Take a look at Amazon's EC2 service, you're better off buying cycles than you are leasing hardware for something like this and it doesn't look like something that's too hard to paralellize. Of course that doesn't generate you threads on major sites with your product splattered all over them. If you do want to lease hardware you're better off with something like a small cluster of Sun Fire X4200s, more cycles for your buck. I'm not sure how you're coming up with those 1.5/2 year figures though.

This thing written in c? perl?

Will all due respect, you don't understand the process :)

If the database is not probed in RAM, it turns a "2-computer-year" solution into one that requires decades. You can have the fastest computer in the world cranking on it, it will do you no good if you have to read the database off of disk.
 
There's a 25-year anniversary sale at Sun:
http://www.sun.com/emrkt/25sale/index.jsp

I would go for an semi entry-level Sun Fire X4600 M2 with 8 dual-core Opterons for now, and swap the CPUs later in the year for quad-cores (it uses CPU modules, so one cannot just get the cheapest version with 4 CPUs).
It takes a maximum of 128GB RAM.

But that only if one would only need to change the CPUs later, not the whole modules, otherwise I imagine the upgrade could be expensive.
You'll have to ask Sun.
 
32GB for the Mac will cost you $8000
64GB (8 CPUs) for the Sun will cost you $10400 (forget about 128GB, it would cost you $40000). But the base 8-CPU configuration already uses 2GB DIMMs and leaves 16 slots free, so you would just have to add 32GB for $5200.

8-core Mac Pro with 32GB and bad memory bandwidth (21.3 GB/s): $12000
16-core Sun Fire with 64GB and excellent memory bandwidth (85.6 GB/s): $25200
(upgradeable to 32-core or 128GB).
 
32GB for the Mac will cost you $8000
64GB (8 CPUs) for the Sun will cost you $10400 (forget about 128GB, it would cost you $40000). But the base 8-CPU configuration already uses 2GB DIMMs and leaves 16 slots free, so you would just have to add 32GB for $5200.

8-core Mac Pro with 32GB and bad memory bandwidth (21.3 GB/s): $12000
16-core Sun Fire with 64GB and excellent memory bandwidth (856 GB/s): $25200
(upgradeable to 32-core or 128GB).

Are Suns and the new Macs both "Big endian"? If so, I can use the sun to crank out the databases then use the Mac to play the game.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.