Benoit,
My question is, how come using bit operations in Squeak is not **way** faster than creating objects ? Am I missing something ?
Well, that's a good question. It most certainly _should_ be faster. In fact, I put some effort in preventing exhaustive allocations (by pre-allocating and recycling objects) since measuring showed that the overhead of allocating and garbage collecting the move, board, and player objects took roughly 80% of the overall time. And indeed - after taking care of these allocations the entire engine was four times faster.
If you have in fact a generator for legal moves only I'd be truly interested in seeing it. I found that validating moves introduces an overhead which is more than compensated by the extra ply required without validation (since almost all moves are valid). And if your allocation overhead is only remotely close to what I've measured your move generator must be three to four times faster than mine! Given that generating the moves takes roughly 50% of the overall time I'd certainly love to have one of those ;-)
BTW, the engine should run like hell with j3. I tried it once (but Win32/J3 crashed on me) so I don't know what the real outcome is. But it's all just integer arithmetic and recursion so j3 should make a _huge_ difference here (probably another factor of four or so).
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org]On Behalf Of Benoit St-Jean Sent: Thursday, November 29, 2001 6:08 AM To: squeak-dev@lists.squeakfoundation.org Cc: Andreas.Raab@gmx.de Subject: RE: XML Parser choice (was Re: [ENH] ??? MD5 in Squeak.)
4544Morphic-Chess-ar -- Andreas Raab -- 25 November 2001 A long-term project of mine has always been to write
a >nice little chess program for Squeak. But since I
haven't done anything on it in the last few months
I'm > just going to throw it at the community to see if
someone is interested in doing a bit more. It's a playing ... but not well :-( So, go get it from > the objects tool and improve it!" Smalltalk at: #ChessConstants put: Dictionary new.
Nice job Andreas! Quite impressive actually. Just discovered two small bugs : it allows castling when the king is in check and only allows you to promote pawns to queens, i.e. no subpromotion menu...
To make a long story short, I am also playing with such a beast myself.... A chess program named Lamneth which started as a bunch of experiments on alpha-beta vs NegaScout, transposition table replacement schemes, etc...
I'm curious about the speed of your chess engine... You heavily use bit shifts and bit operators and generate all moves. In my case, I tried to implement a fully legal move generator with chess piece objects... I am able to generate around 50000 positions in roughly 2.5 seconds without make/unmake mechanism, Trans. Table lookup and evaluation. From my previous tests, I'll be able to evaluate around 50000 positions in less than 5.5 seconds... Your programs reaches around 55000 positions in about 5 seconds...
My question is, how come using bit operations in Squeak is not **way** faster than creating objects ? Am I missing something ? BTW, I'm on Win 2000 with the very latest Squeak updates on a Pentium 1.7Ghz.
=====
Benoit St-Jean bstjean@yahoo.com ICQ: 130611319 / Yahoo Mssngr: bstjean http://cactus.swiki.net "We're only immortal for a limited time", Neil Peart
Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1