IvanHoe55

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
Post Reply
User avatar
xshat
Posts: 98
Joined: Sat Jun 19, 2010 10:44 am

IvanHoe55

Post by xshat » Fri Jul 02, 2010 9:47 am

The new source has been released:
http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

I will begin attempting to make a compile.

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: IvanHoe55

Post by Jeremy Bernstein » Fri Jul 02, 2010 10:51 am

xshat wrote:The new source has been released:
http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

I will begin attempting to make a compile.
If your OS doesn't support pthread_spinlocks (OSX, for instance), you will need to reimplement them using pthread_mutexes or something. Arg...

Jeremy

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: IvanHoe55

Post by Jeremy Bernstein » Fri Jul 02, 2010 11:02 am

Jeremy Bernstein wrote:
xshat wrote:The new source has been released:
http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

I will begin attempting to make a compile.
If your OS doesn't support pthread_spinlocks (OSX, for instance), you will need to reimplement them using pthread_mutexes or something. Arg...

Jeremy
In RobboTotalBase.h:

Code: Select all

#if 0 /* replace with a decent condition if you care */
#define ROBBO_LOCK_TYPE pthread_spinlock_t
#define ROBBO_LOCK_IT(x) pthread_spin_lock (x)
#define ROBBO_UNLOCK_IT(x) pthread_spin_unlock (x)
#define ROBBO_LOCK(tb, ind) pthread_spin_lock (&(tb->locks)[ind]);
#define ROBBO_UNLOCK(tb, ind) pthread_spin_unlock (&(tb->locks)[ind]);
#define ROBBO_LOCK_INIT(x) pthread_spin_init (x, 1) /* HACK */
#define ROBBO_LOCK_DESTROY(x) pthread_spin_destroy (x)
#else
#define ROBBO_LOCK_TYPE pthread_mutex_t
#define ROBBO_LOCK_IT(x) pthread_mutex_lock (x)
#define ROBBO_UNLOCK_IT(x) pthread_mutex_unlock (x)
#define ROBBO_LOCK(tb, ind) pthread_mutex_lock (&(tb->locks)[ind]);
#define ROBBO_UNLOCK(tb, ind) pthread_mutex_unlock (&(tb->locks)[ind]);
#define ROBBO_LOCK_INIT(x) pthread_mutex_init (x, NULL)
#define ROBBO_LOCK_DESTROY(x) pthread_mutex_destroy (x)
#endif
This crashes for me with a bus error, though, when I run the benchmark:

Code: Select all

...
Position 7: Nodes: 1308791 Time: 1005ms

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x0000000104931f50
0x0000000100029635 in Search (POSITION=0x1003ef2e0) at search.c:272
272		  (p + 1)->move = 0;
Clearly a bad pointer access, but I don't know this code at all, so I'm not sure what's up here.

Code: Select all

    {
      boolean REPETITION;
      for (p = POSITION->DYN - POSITION->DYN->reversible; p < POSITION->DYN; p++)
	{
	  REPETITION = FALSE;
	  for (q = p + 2; q < POSITION->DYN; q += 2)
	    if (p->HASH == q->HASH)
	      {
		REPETITION = TRUE;
		break;
	      }
	  if (!REPETITION)
	    POSITION->STACK[p - POSITION->DYN + POSITION->DYN->reversible] = 0;
	  (p + 1)->move = 0;
	}
    }

Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany
Contact:

Re: IvanHoe55

Post by Jeremy Bernstein » Fri Jul 02, 2010 3:13 pm

I replaced the repetition check code in 55 with the same code from 63 and the bad access goes away:

Code: Select all

  if (ANALYSING)
    {
      boolean REPETITION;
      for (p = POSITION->DYN_ROOT; p < POSITION->DYN; p++)
	{
	  REPETITION = FALSE;
	  for (q = p + 2; q < POSITION->DYN; q += 2)
	    if (p->HASH == q->HASH)
	      {
		REPETITION = TRUE;
		break;
	      }
	  if (!REPETITION)
	    POSITION->STACK[p - POSITION->DYN_ROOT] = 0;
	  (p + 1)->move = 0;
	}
    }
Not sure what is really happening there, though -- what reversible is being used for -- so it's possible that my "fix" is no good. Compared to 63:
63:
Total Nodes: 21935784 Time: 16062ms
Total NPS: 1365000

55:
Total Nodes: 21277934 Time: 16056ms
Total NPS: 1325000

Post Reply