Monday, May 23, 2011

The Cannonball Express: Now with more Express!

Correction: In writing this post, I used my own article (quoted below) as source material. Re-reading this post a few weeks later, I realized that I'd made a historical error in that article, and perpetuated it in this post. I programmed the Cray in 1989, ten years before writing the article, and not twenty years earlier in 1979. I've corrected the post.

Twelve years ago, in 1999, I wrote an article for TidBITS called Power Macintosh G3: The Cannonball Express. It was a discussion of speed in computers, and how software and hardware factors contributed to the simple-sounding notion of "speed". Part of it was a (highly unscientific!) comparison between the speed of the new-in-1999 Power Macintosh G3, and a Cray Y-MP supercomputer that I'd had a chance to program some ten years earlier, circa 1989.

You can read the article if you like—it's not too long, and it's written for the non-technical reader (and the puzzle is fun, too). Or you can get a quick summary by reading the next couple of paragraphs here:


The highly unscientific comparison was a puzzle-solving problem I'd written, called "Piper". The article discussed the evolution of Piper and the techniques I'd applied to try to make it run faster. There was a particular puzzle called "woodchuck" that I wanted to solve, because for years it had proven to be too big a problem for Piper to handle in any reasonable time period. The Cray, a $15,000,000 room-filling monster that was one of the fastest computers in the world at the time, finally solved it in a 20-hour run.

Ten years later, I tried running Piper again on the latest-and-greatest Macintosh tower, and it blew away the Cray by solving "woodchuck" in under two minutes!

Twelve years after that—that is, a few days ago—I remembered the article. Piper's source code was made available with the article. After a brief search occasioned by a stale download link, I found the source, downloaded it, tweaked it a bit for a modern compiler, and ran it on my 2.8 GHz, dual processor Quad-Core Intel Xeon Macintosh tower. The results: on this hardware, Piper solved "woodchuck" in 14 seconds flat, taking 9 seconds to find the best solution and then running another 5 seconds to ensure that no better solution exists.

Nine seconds. Wow.

A word about Solitaire Till Dawn
I continue to get comments and mail, urging me to work hard on a Lion-compatible version of Solitaire Till Dawn. I assure you all, I am working hard, and making good progress. You can keep an eye on that progress by visiting this blog and checking the SOLITAIRE TILL DAWN update box in the upper-right corner of the page. I post updates there two or three times a week, usually. And as always, thanks for your support, your interest, and your patience while I get this done!

5 comments:

Unknown said...

Hi Rick

well- I am 60 this year (imagine my surprise) and have been playing std (oops) for all 20 years of that time. Much of this, of course was on a mac of antique quality.

And though now, with money and age, I am running mac lion --- I still must say to you ---Take your time. Now, I know about time!

It was time, masquerading as youth, that gave you what was necessary to create std. Time, masquerading again as "you still have it" will let the updates happen when they will.

thanks for ten years of fun!! Longer than many modern marriages.

Marian

crocroft said...

Hahaha -- to the Other Unknown: I've got five more years on you (65 in October), so I don't have as much time as you do. So I'm urging Rick to HURRY!!!!! (please!). I can't find anything else even remotely like it for desktop play. STD is my morning coffee and my goodnight snack -- I'm ready to play (but WILL say thanks so much for all the previous fun!) !!

Unknown said...

Howdy - As long as we're bragging (or complaining) about our age, I thought I'd put in my 2-cents worth. At 74, I've been playing STD since I got my first Mac in Jan 2007. I switched to Lion early this month on my desktop, but I'm still running Snow Leopard on my MacBook.

So, hurry up Rick - I need to update my Book!
Thanks

Kaye said...

Since we're all out there with our ages, I just turned 69 and have been using STD "forever". It's usually the last thing I do on my computer before I close down for the night (or, morning I should say as it's usually 2-3 am before I stop!).

I haven't updated to Lion yet and not really in any hurry to do so. However, looking forward to seeing what you end up with.

Did want to thank you for a wonderful game that has delighted me for many years --- by the way, met the real "Agnes" about a year ago. Told her that game was the hardest of the ones I usually play!
Keep up the great work, but, have a "life" too.

Regards, Kaye

stoney said...

Okay, I'm 67 and the wait is getting on my nerves.
Steve