Sunday, November 25, 2007

Jonne

A few days ago, a stranger filed an issue report. A few minutes later, he uploaded a patch that fixed the bug. I immediately added him as a team member.

The next day, he flooded my inbox with all kinds of commits: fixed this, improved that. He seems to enjoy fixing code even more than I enjoy breaking it. ;-)

And he’s no longer a stranger; he’s a friend. Let’s all welcome Jonne to The Gray Matter Team. :-)

Wednesday, October 24, 2007

Nil's Party Mix

I’m making a mix CD for my sister. Here’s what I have so far:

  1. The F***ing Champs — V — Air on a G-String
  2. Yoshihiro Kusano, Tetsuya Ohuchi — Guilty Gear Isuka OST — The Irony of Chaste
  3. Self — Gizmodgery — What a Fool Believes
  4. Royksopp — Remind Me — Remind Me
  5. Judy and Mary — Rurouni Kenshin OST — Sobakasu
  6. Stereolab — Lo Boob Oscillator — Lo Boob Oscillator
  7. Regina Spektor — Begin to Hope — Better
  8. Portal — Portal OST — Still Alive

Do you get the general feel of the mix CD? Should I add, reorder, or remove any songs? I’d appreciate any feedback, thanks!

Sunday, September 23, 2007

Java?

After spending some time writing Ruby and Java code, I had a hard time crossing my eyes again to make heads or tails of GRAY MATTER’s C++ code. That got me thinking — is it time to migrate to a more modern programming language?

Ruby’s syntax is beautiful, but it can’t deliver the performance that a chess engine needs. But what about Java? I did some research, and a couple of things scare me:

  • Java doesn’t have an unsigned 64-bit integer type. We’d have to use signed 64-bit integers as BitBoards. Also, the farther we move up from the bare metal, the less we can rely on our low-level bit-twiddling hacks. Who knows what kind of bizarre problems may result.
  • The Java crowd seems a little bit too enthusiastic about Java’s performance, especially when compared to C++. I don’t trust the Java echo chamber.

I guess we’re sticking with C++. I’m discussing this with Doug, and he agrees that we should stay as close to the bare metal as possible.

Sunday, August 19, 2007

Opening Book

GRAY MATTER now uses an opening book. This improvement accounts for the greatest increase in strength since we moved from naive MiniMax to AlphaBeta.

Saturday, August 4, 2007

With a Little Help from My Friends

It must be chess programming season again. We’ve been progressing by leaps and bounds.

Doug schooled me, yet again, in object oriented programming. He split the search class into a base class and an MTD(f) sub-class. This makes for a much cleaner design (by separating the search framework from the actual search engine) and also gives us a nice way to add more implementations of different search engines (and even switch between them at runtime!). Following Doug’s lead, I split the board class into a base class (which includes board representation and move generation) and a heuristic sub-class (which includes current state evaluation).

A couple of days later, Dillon schooled me, yet again, in chess strategy. He explained the concept of tempo. That, combined with Sam’s dirty trick of hard-coding values into arrays, allowed me to quickly implement tempo evaluation as a method of the heuristic sub-class. And GRAY MATTER no longer does the Happy King Shuffle Dance™.

In other news, we’ve just committed our 1000th revision. Thanks for everything, guys. A celebration is in order. You’ve earned it.

Wednesday, August 1, 2007

Stiff Asks, Raj Answers

While reading Wikipedia’s Vim vs. EMACS flamewar page, I came across a link to a questionnaire for great programmers. I shot the link over to my buddy Doug. He told me that he’s interested in my answers, and I’m interested in his. Here you go, Doug. :-)


How did you learn programming? Were any schools of any use? Or maybe you didn’t even bother with ending any schools :) ?

“I have never let my schooling interfere with my education.” — Mark Twain


What do you think is the most important skill every programmer should posses?

A good sense of humor. Because if you can’t laugh at yourself, programming will make you cry.


Do you think mathematics and/or physics are an important skill for a programmer? Why?


What do you think will be the next big thing in computer programming? X-oriented programming, y language, quantum computers, what?


If you had three months to learn one relativly new technology, which one would You choose?


What do you think makes some programmers 10 or 100 times more productive than others?

I don’t know, and maybe that’s why some programmers are 10 or 100 times more productive than me. But I hope it has something to do with Red Bull energy drink. *taking another swig*


What are your favourite tools (operating system, programming/scripting language, text editor, version control system, shell, database engine, other tools you can’t live without) and why do you like them more than others?

Operating SystemOS X because it’s pretty.
Programming LanguageC/C++ (GCC) because I know it. Oh, and interpreted and scripting languages are for weenies.
Text EditorVim because it saves me from RSI.
Revision Control SystemSubversion.
ShellBASH.
DatabaseI hate all databases equally.
LaptopApple MacBook because it’s pretty.
GuitarGibson SG because it rocks my face off.
PianoKawai baby grand because it’s beautiful.
Writing ImplementLeadholder.

What is your favourite book related to computer programming?

“The best book on programming for the layman is Alice in Wonderland; but that’s because it’s the best book on anything for the layman.” — Alan Jay Perlis

My current library of programming books consists only of The C Programming Language and Operating Systems: Design and Implementation. I’d like a copy of Artificial Intelligence: A Modern Approach and The Art of Computer Programming, but these days, just about everything that I need to know is available online.


What is Your favourite book NOT related to computer programming?

The Bhagavad Gita. This book calms me when I’m too angry and rouses me when I’m too apathetic. I also love The Cartoon History of the Universe and The Complete Calvin and Hobbes.


What are your favourite music bands/performers/compositors?

Bach, Mozart, Beethoven, Radiohead, John Williams (the classical guitarist, not the composer), Asian Dub Foundation, Blur, The Clash, Dr. Dre, Fountains of Wayne, The F***ing Champs, Judy and Mary, Led Zeppelin, Neutral Milk Hotel, The Slackers, Stereolab, Weird Al, and too many others to name.


And here are Doug’s, Alex’s, and Sam’s answers.

Thursday, June 28, 2007

Downtime

My buddy Sam had kindly given me an account on his Linux box to test GRAY MATTER. Sadly, yesterday, someone started pounding away at his bandwidth; he had to take his box offline. He’s still trying to diagnose and solve the problem.

In the meantime, I have no way to test GRAY MATTER (without scorching my testicles). If someone has a Linux box and wouldn’t mind giving me an account to test GRAY MATTER, I’d be most grateful.

Update 1: No one was pounding away at Sam’s bandwidth. Runaway GRAY MATTER processes were pounding away at his CPU and RAM. It was my own dumb fault. He discovered the problem and got his server back online. I’m sorry for the trouble, and thanks, Sam!

Update 2: Song has given me an account on his FreeBSD box as well. Thanks, Song!

Tuesday, June 19, 2007

Next Steps

GRAY MATTER finally plays a decent game, but she’s not quite ready to enter a tournament. To be tournament-worthy, she must:

  • avoid stalemate and pursue checkmate,
  • more intelligently allocate thinking time, and
  • use an opening book.

Friday, June 15, 2007

Mailing List

I’ve created a GRAY MATTER NewsGroup. It allows you to follow changes to the code online or through email. It also allows you to post questions, comments, flames, and pornography.

Tuesday, June 5, 2007

History Heuristic

I’ve re-implemented the history heuristic. It shouldn’t interfere with MTD(f).

Saturday, June 2, 2007

Automata

I haven’t had much time to work on GRAY MATTER. I’ve been working on this instead:

Union Concatenation Star

I’ve also codified what I humbly call Raj’s Law. For two sets, A and B:

A – B = A ∧ A ∧ B

I’ll get back to GRAY MATTER soon.

Dwandy

“It continues to amaze me. The same people who accept that their computers crash for no reason also accept that anything that their computers print is pure truth.”

Thursday, May 31, 2007

Illegal Moves

When GRAY MATTER knew she’d lost, she used to sometimes make illegal moves and leave herself in check. No longer! Now, in search::minimax(), at the move tree’s root node, she generates only legal moves.

Sunday, May 27, 2007

Remote Testing

I have a MacBook, and I don’t enjoy burning my CPU at 100% and scorching my testicles every time I test GRAY MATTER. I’ve discovered a cool (pun intended) way to run GRAY MATTER on my desktop remotely and XBoard on my laptop locally:

For this to work, you need GRAY MATTER and an SSH server installed on your desktop, and an SSH client and XBoard installed on your laptop. On your laptop, launch a terminal emulator and issue the following command:

xboard -rsh ssh -fh domain.com -ruser username -fcp gray-matter/bin/gray

But replace domain.com with your desktop’s domain name or IP address, username with your username, and gray-matter/bin/gray with the path (either absolute or relative to your home directory) to your GRAY MATTER executable.

Saturday, May 26, 2007

Etymology of Checkmate

Just when you thought that it wasn’t possible, I became even more interesting. You see, the word checkmate is etymologically related to my last name, Shah. The word checkmate is derived from the phrase shah mat which translates to, “The king is defeated.” Read more.

Pondering, Terminology

I’ve added two new technical documents about pondering and terminology. These are works in progress. Hit me with your questions, comments, and flames.

Wednesday, May 23, 2007

Library Quotes

The public library is the most dangerous place in town. — John Ciardi

A truly great library contains something in it to offend everyone. — Jo Godwin

I pray that no child of mine would ever descend into such a place as a library. They are indeed most dangerous places and unfortunate is she or he who is lured into such a hellhole of enjoyment, stimulus, facts, passion and fun. — Willy Russell

Forget about the Senior Prom and go to the library and educate yourself if you’ve got any guts. Some of you like pep rallies and plastic robots who tell you what to read. Forget I mentioned it… Rise for the flag, salute. — Frank Zappa

Existing libraries, in their very being, seem to question the authority of those in power. — Alberto Manguel

Friday, May 18, 2007

Technical Documents

I’d started writing a series of technical documents as posts on this blog. I’d written about perft() and alpha-beta pruning when I realized that the posts were growing too large and unwieldy. I think that these documents have a better home in the wiki. If you’d like access to change anything about the wiki (or source code), comment on this blog, email me, or IM me.

Friday, May 11, 2007

One Negative Sign

I’d forgotten one negative sign, which caused GRAY MATTER to pursue draws instead of checkmates! One negative sign! I hate myself.

Thursday, May 10, 2007

Simpler Code

In the move search, I’ve abandoned NegaScout for MTD(f). This has forced several other changes in the code. I’ve discarded the null-move and history heuristics in favor of straight FailSoft AlphaBeta.

The increase in search depth is spectacular, but even better is how much simpler the code has become. Sadly, I don’t think that everything works properly just yet. I’ll keep hacking at it.

Saturday, May 5, 2007

Friends Needed

One of the reasons that we’ve embarked on this project is to meet interesting people. We're looking to extend our circle of friends. These are the roles that we still need filled:

  • Release Coordinator: Upon every major change to the GRAY MATTER source code (that affects its playing strength), this person will compile and upload a Windows executable. Here are the simple instructions to do this manually, but this entire process could be automated. Ideally, this person will have a box running Linux with Subversion, the GNU toolchain, and MinGW.

  • Chess Player: This person will play chess against GRAY MATTER (or perhaps test GRAY MATTER on an Internet Chess Server) and provide feedback regarding its performance to its developers.

We also need developers who will contribute ideas or source code. If you’re interested in playing any of these parts, comment on this blog, email me, or IM me.

Friday, May 4, 2007

Hello, World

My name is Raj, and I’m the lead (pronounced l33t) hacker of a team that’s interested in chess. Our mission is to develop a competitive, pedagogical chess engine. And, most importantly, to have fun while doing it. On this blog, we’ll chronicle the development of our chess engine, GRAY MATTER, from girlhood, through adolescence, and into womanhood.

From the GRAY MATTER project page:

GRAY MATTER is a chess engine; it can play a game of chess. It isn’t very strong but is a good learning and teaching tool. Its authors aim to write readable, understandable, and hackable code. It’s written in C++ and employs good object-oriented practices. It uses some state-of-the-art techniques such as an MTD(f) move search and rotated BitBoards.

If you’d like to know more, comment on this blog, email me, or IM me.

P.S. First post!