Moving to Magic Bitboards... any advice?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

asanjuan
Posts: 214
Joined: Thu Sep 01, 2011 5:38 pm
Location: Seville, Spain

Re: Moving to Magic Bitboards... any advice?

Post by asanjuan »

As a precursor to magic slider attack generation, the classic 4-ray, loop-free, branch-free method has some advantages, including being easy to understand. It has the same interface.


Ok, This is the method that i'm currently using.

After taking a wile, i modified my perft function, counting leaf nodes after generating them, without doing/undoing the move.

After that, my perft "speed" reaches 19 Mnps, but this is really false... this measure has no sense for me.
because I can't predict the speed of my search with this function. Is only a measure of how many moves i can generate per second... not how many positions i can reach per second (wich is what i was looking for)[/quote]
asanjuan
Posts: 214
Joined: Thu Sep 01, 2011 5:38 pm
Location: Seville, Spain

Re: Moving to Magic Bitboards... any advice?

Post by asanjuan »

Ok, i have used a profiler. I didn't know its existance because my VS2005 is in spanish, and here it seems to be known as "instrumentación".
After analyze my code, i realized that my engine spends 36% of the time in eval. This is what i knew by intuition... the only difference is that i have real numbers now.

So thank you all.
I think i have enough information to follow.
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: Moving to Magic Bitboards... any advice?

Post by Kempelen »

asanjuan wrote: So thank you all.
I think i have enough information to follow.
Suerte con tu engine y cuidado que esto es adictivo :lol:
Fermin
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Moving to Magic Bitboards... any advice?

Post by JVMerlino »

tpetzke wrote:
I've never used a profile tool. I have always optimized code by "intuition" with excellent results
Then your intuition is better than mine. Some things are really counter intuitive. For an easy start I would you gprof, the profiler from gcc. It is included in the mingw suite and very easy to use and free. It will tell you in what functions your program spends most of the time, not necessarily why your program spends your time there.

From a first look I would also say the Intel VTune Amplifier is a very powerful tool, it will tell you per statement in your function what it contributes to the run time of the program. Unfortunately it is not free but there is an evaluation version available.

And don't run your profiler in a VMware image, it won't work. I know it is obvious, but stupid me tried even that.

Thomas...
I sometimes use a very "feature-light", but free, tool called "Sleepy" (sometimes called "Very Sleepy"). It gives me basic call graph and CPU% usage information (per function and per line of code) to help me identify some problem areas. You might find it useful.

http://www.codersnotes.com/sleepy

jm
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Moving to Magic Bitboards... any advice?

Post by tpetzke »

Y lo mismo de mí

Thomas...