Speculative prefetch

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

petero2
Posts: 690
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: Speculative prefetch

Post by petero2 »

Joerg Oster wrote:
lucasart wrote:
Joerg Oster wrote:I have just pushed a test in fishtest to see how it does. I hope you don't mind. :)
SHouldn't you remove the existing prefetch then? You're comulating the prefetch before and after legal move checking basically. I wonder if there's any cost in redoing a prefetch.
I thought this to be a speculative prefetch additional to the existing one in pos.do_move ...
Peter may correct me if I'm wrong.
Theoretically it ought to help a little to have both prefetch instructions since the speculative prefetch is wrong for special moves such as castling and promotion, so in those cases the second prefetch will help. In case the first prefetch was correct, the second prefetch typically has no extra cost.

However, in texel I removed the second prefetch because I could not measure any speed difference when doing so.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Speculative prefetch

Post by lucasart »

Many thanks Peter. Your patch was found to be a clear gain, even in SMP. It will be comitted, then we'll try removing the second prefetch.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.