Saturday, January 28, 2006

Parallel search in chess

(This is something I wrote down about 3 weeks back and forgot to post ... so here goes nothing !)

If you know alphabeta , you will know that it is 'essentially' a serial algorithm : there is a pretty high dependency among the nodes in the tree. (I mention only alphabeta here , though all variations of it have same problems).

This has resulted in two directions of research for parallel search , two approaches so as to speak of :
* Trying to come up with alternate algorithms which try to 'eliminate' (or reduce) this dependency between nodes : lower the dependency , the more 'parallel' the algo becomes.
* Variations of alphabeta itself so that you can parallelize it better.

Most of my experiments with anything other than pvs (variant of alphabeta) has not been very fruitful : they suffer from a variety of problems (MTD(f) , ABDADA , etc) ... and yet some people do seem to be using them quite well !
So it is a case of YMMV I guess.

Among the various algorithms in the second category , I have always found nothing much in the literature which is really good - so I hacked up a algo which is reminiscent of DTS.
I have an iterative search , with YBW (for deciding on split points) and no concrete subtree ownerships (so the tree 'owner' can move between processes) - (skipping the gory details here ;-) - bug me if you want to know more :-P )

Note , I usually run on an SMP box - never have worked on an MPI box and very rarely on a NUMA box : so I have not considered the implications of a MPI or NUMA problems in my design too much. (Yes yes , I try to make sure that localization of mem is highest , etc - but there could be other 'issues').

The above should be boring stuff for most I guess ? :-)

Anyway , the reason why I am blogging about parallel chess algorithm is :
* I have a dual core proc box at home - was eating into me that I am not using it efficiently enough.
* I was bored out of my wits and needed a new challenge - fixing bugs after the major release is done can be a bit boring after a while :-D

and so ....
* I just completed testing my new parallel search which exhibits very good average speedup of around 1.88+ for 2 procs , with a scaling of 1.98+ ! :-D
The worst case behavior is still around 1.4 or so , also the scaling ramp up is not as fast I would like it to be (takes a few secs to get to 1.9x).

Ofcourse other than the parallel search , rest of this new engine is 'borrowed' from my previous engine - so the gameplay is not really much better (I was testing some wacky eval and moveordering ideas earlier using incremental attacktables) : but damn it gives me a kick to see it fly like this :-)

The way I have designed the search , I am not sure till how many processors it will scale , how NUMA will affect its performance , etc.
I expect it to impact it atleast a bit : no I am not even thinking of clusters or other MPI boxes - all that is in the realm of testing and tuning (I suck at tuning :-( ) , but I would expect it to do quite well indeed upto quite a high number of processors.

So tonight , I relax and enjoy the numbers flashing through my screen - tomorrow I port it to solaris and then ... let us see if I can get a 'relatively free' box at office ;-)


Anonymous daku said...

"So tonight , I relax and enjoy the numbers flashing through my screen" - Matrix?

2/21/2006 08:54:00 AM  
Blogger Mridul said...

Better than matrix :-)
Matrix codes , I cant understand - these I can :-D

2/22/2006 10:56:00 AM  

Post a Comment

Links to this post:

Create a Link

<< Home

Wednesday, January 18, 2006


Came across this :
Interesting read !

By the way, whole license at :


Post a Comment

Links to this post:

Create a Link

<< Home

Friday, January 13, 2006

Pure Pwnage

Sascha pointed this to be yesterday -
Absolutely hilarious ... I am currently downloading episodes 8 and 9 , but the ones till now have been way too entertaining !!

Enjoy !


Post a Comment

Links to this post:

Create a Link

<< Home

Thursday, January 12, 2006

XML Languages

Tim Bray , one of the inventor's of XML , has written two really nice articles on XML Language design : here and here.
The relevence of most of the arguments and points though are not limited to just XML - really interesting read !


Anonymous Anonymous said...

aaditya said...

Yeah read that, pretty good stuff :)

1/12/2006 01:17:47 PM

(As part of removing some spam , I accidently deleted sood's comment :-( )

1/12/2006 08:59:00 PM  

Post a Comment

Links to this post:

Create a Link

<< Home

Friday, January 06, 2006

Definition of sexy !

Alok just pointed this to me.

Press release here.

Check out the specs people :
41 Giga pixels/sec
96 pixel pipes !
2 Gig graphics RAM !!

What you will need is a quad cpu dual core opteron with this as the grahics card - ah , that will be the life !!
If only I had a house to sell to buy this baby :-(


Blogger AK said...

Why don't you book a Flat in Bangalore, make the downpayment with your current 'Monster', wait till the day this 'Sexy Beast' is launched, then sell the Flat for it?.....Good last line.

1/06/2006 06:39:00 PM  
Blogger  said...


Then I realize it is the same feeling I have towards a yamaha dragstar.

Maybe if I start saving I'll get one someday, but I'll be too old then. And by then this graphics card will be long obsolete!

1/06/2006 08:19:00 PM  
Blogger Mridul said...

@ ak
When have you known me to plan for the future ? :-P
If my bank account was healthy enough , I would have got a quad dual core opteron with two SLI 'nice' (read 7800GTX ;-) ) sli cards.
Kidney anyone ?!

@ Kousik

That bike looks good ! I am not into bikes in general , but this one looks real nice !!
Well , what is hot today will change tommorrow - but as of today , that card is red hot !

1/10/2006 11:53:00 PM  

Post a Comment

Links to this post:

Create a Link

<< Home

Thursday, January 05, 2006

Gajjar ka halwa

First things first : A very happy and prosperous New year to all !

Now ....

I suck at cooking , and yet I like to eat tasty food :-D
(Note : The definition is hacked such that whatever I cook is tasty ;-) )

Me , Aparup and Shireen were at Koshy's for dinner on 1st Janand Shireen had this craving for 'Gajjar ka halwa'.

Unfortunately , they did not have it.
So we dropped desert plans from there and went 'Gajjar ka halwa' hunting in the restaurants nearby.
The pretty heavy dinner that we just had made us (me and Aparup ?) give up the search pretty fast.

In most normal circumstances (read lazy me) , the matter would end there .... and I did promptly forget all about it as soon as I got home.

But ....

Next night , Aparup IM's me to go over to his place ... and when I get there , voila !

Pity that I was full , else I could have had more :-) (Is dessert served at the end of a meal on purpose ? So that we dont have lots of it ?!)

Shireen did try to give me a technical rundown about how easy/hard it was to make it , but /me content to just gorge on the delicious sweatmeat :-D

Moral of the story :
* Never give up your desires.
And more importantly ,
* Stay close to people who dont give up their's and are willing to share :-)

By the way people , Mr. Noufal Ibrahim is back to blogging :-) Yet another destination for me to spam at !!


Post a Comment

Links to this post:

Create a Link

<< Home