ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

First steps with SMP

 
Post new topic       TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Threaded
View previous topic :: View next topic  
Author Message
Robert Purves



Joined: 15 Feb 2010
Posts: 155
Location: New Zealand

PostPosted: Wed Nov 30, 2011 3:02 am    Post subject: First steps with SMP Reply to topic Reply with quote

I have just implemented the first step of multi-threading my engine. It can search on the main thread and a parallel one simultaneously, each returning the same score and PV without crashing. Node count at any depth is exactly doubled by the extra thread. (All this is of course with the shared TT off).

Now I want to implement some form of YBW. Knowing little of the theory, I head for CPW and quickly find some fascinating pseudocode for the Jamboree algorithm:
http://chessprogramming.wikispaces.com/Jamboree

I understand the pseudocode in part, but am puzzled by the return values in two places (these are inside the parallel section):
Code:
      s = -jamboree(c[i], -α - 1, -α);
      if (s >= β) abort_and_return b;
...
          s = -jamboree(c[i], -β, -α);
          if (s >= β) abort_and_return b;

I expected to see s returned, the same as in single-threaded search.
Is there a subtle issue with multithreading that makes b the correct return value, or is there a bug in the pseudocode?

Robert P.
Back to top
View user's profile Send private message
Kevin Hearn



Joined: 30 Dec 2010
Posts: 103

PostPosted: Wed Nov 30, 2011 3:48 am    Post subject: Re: First steps with SMP Reply to topic Reply with quote

Just looks like the difference between fail soft and fail hard. Because you may have made different pruning decisions with a different search window when you fail you return the hard bound because you're not sure if you would've found something in the range (beta, score) in a future search when you look at branches that were subject to pruning with a lower window.

Shouldn't be anything special about multithreading that changes which way you decide to do things, both have their points.
Back to top
View user's profile Send private message
Robert Purves



Joined: 15 Feb 2010
Posts: 155
Location: New Zealand

PostPosted: Wed Nov 30, 2011 5:45 am    Post subject: Re: First steps with SMP Reply to topic Reply with quote

Fail hard would be returning beta (β). But in the Jamboree pseudocode what is returned is a different variable b. It represents in some sense the best score so far, but is updated and used in a way that I cannot yet follow.
Back to top
View user's profile Send private message
Kevin Hearn



Joined: 30 Dec 2010
Posts: 103

PostPosted: Wed Nov 30, 2011 6:24 am    Post subject: Re: First steps with SMP Reply to topic Reply with quote

my apologies. having now read the pseudocode, i'd agree it seems to be wrong. as written, it checks for fail high twice, and returns the best value found before the fail high which makes no sense at all. Overall the pseudocode appears to be a poorly written PVS missing any details pertaining to the actual parallelisation.
Back to top
View user's profile Send private message
Robert Purves



Joined: 15 Feb 2010
Posts: 155
Location: New Zealand

PostPosted: Wed Nov 30, 2011 12:28 pm    Post subject: Re: First steps with SMP Reply to topic Reply with quote

The CPW pseudocode is a corrupted version of the algorithm. The original:
http://supertech.csail.mit.edu/papers/startech.pdf
has abort_and_return s, which is much easier to believe and understand than abort_and_return b.

Also, one line is missing from the CPW code.
Back to top
View user's profile Send private message
Gerd Isenberg



Joined: 08 Mar 2006
Posts: 1786
Location: Hattingen, Germany

PostPosted: Wed Nov 30, 2011 12:46 pm    Post subject: Re: First steps with SMP Reply to topic Reply with quote

micron wrote:
The CPW pseudocode is a corrupted version of the algorithm. The original:
http://supertech.csail.mit.edu/papers/startech.pdf
has abort_and_return s, which is much easier to believe and understand than abort_and_return b.

Also, one line is missing from the CPW code.

Thanks, corrected. How could that happen Wink
_________________
https://chessprogramming.wikispaces.com/
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic       TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions All times are GMT
Threaded
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads