IvanHoe-Beta-999958m-Beta!

Discussion about chess-playing software (engines, hosts, opening books, platforms, etc...)
Vael Jean-Paul
Posts: 78
Joined: Thu Jun 10, 2010 7:59 am

IvanHoe-Beta-999958m-Beta!

Post by Vael Jean-Paul » Fri Jun 18, 2010 9:35 am

The new Ivanhoe-Beta 999958m is out!!

Can somebody make compiles from it...

http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

JP.

Damir Desevac
Posts: 57
Joined: Thu Jun 10, 2010 2:58 pm
Real Name: Damir Desevac

Re: IvanHoe-Beta-999958m-Beta!

Post by Damir Desevac » Fri Jun 18, 2010 11:51 am

Hi Vael Jean Paul.

I think this link is even better, don't you think ?

http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

PS: looks like the Decembrists left the house. Hmmm, are they true or fake ?

http://ippolit.wikispaces.com/message/v ... a/25279499

Vael Jean-Paul
Posts: 78
Joined: Thu Jun 10, 2010 7:59 am

Re: IvanHoe-Beta-999958m-Beta!

Post by Vael Jean-Paul » Fri Jun 18, 2010 1:20 pm

Looks like same link to me!

And true or fake...have to wait when we see a compile..or is it not possible to make one?

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: IvanHoe-Beta-999958m-Beta!

Post by kingliveson » Fri Jun 18, 2010 8:15 pm

Broken thread initialization leads to infinite loop for Titanic Mode. Code gets stuck here:

Code: Select all

  while (!IO_AWAKE)
    {
      SIGNAL_CON_LOCK (*WAKEUP_IO, *WAKEUP_LOCK_IO);
      NANO_SLEEP (1000000);
    }
Single CPU mode works though. ZOG-MP obviously is incomplete as well.
PAWN : Knight >> Bishop >> Rook >>Queen

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: IvanHoe-Beta-999958m-Beta!

Post by kingliveson » Fri Jun 18, 2010 8:20 pm

Code: Select all

diff 999963/CHANGE_LOG 999958/CHANGE_LOG
67c67,79
< 
---
> 999962 BugFix PONDER_MOVE (LeonardoVinci)
> 999961 Institute ZOG MP (ZOG plus Yusuf)
> 999960 IO thread (pthread) plus SMP.c split
>        removed setjmp in IVAN SMP
> 999959 scruff upon with I/O
>        MakeUndoSpeed
>        strength (elo) plus user (uci) improvings
>        Bug: scale with average owned the ``inversion'' in the UCI_Scale
>            VALUE4 ( (w * sc) / av, (x * sc) / av, (y * sc) / av, (z * sc) / av
>        PVHash user ucioption
>        hashfull "random" sample (UCI), around 10-15 MB per cpu second
> 999958 Aspirate with root_multipv.c
>        Bug: en passant inwith RobboTotalBase scoring
diff 999963/Makefile 999958/Makefile
1a2,3
> # EPONYM = IvanHoe-ZOG-MP
> # VERSION = 999958l-ZOG-MP
3c5
< VERSION = 999963-Beta
---
> VERSION = 999958m-Beta
22a25
> # DEFINITIONS += -DBUILD_ZOG_MP_COMPILE # active ZOG MP
56a60
>                SMP_init.c \
61c65,69
<                benchmark.c
---
>                 benchmark.c \
> #               root_zog_node.c \
> #               ZOG_init.c \
> #               ZOG_MP.c
> 
95a104
>                     ZOG_NODE.h \
diff 999963/RobboLito.h 999958/RobboLito.h
10c10
< #define MAX_CPUS 4 /* vary for increase */
---
> #define MAX_CPUS 8 /* vary for increase, up with 64 */
48c48,49
< #define LOCK_INIT(x) InitializeCriticalSection(x)
---
> #define LOCK_INIT(x) InitializeCriticalSection (x)
> #define LOCK_DESTROY DeleteCriticalSection /* new */
51c52
< DWORD PTHREAD[MAX_CPUS];
---
> DWORD PTHREAD[MAX_CPUS], PTHREAD_IO;
52a54,55
> #define IO_THREAD(A) DWORD WINAPI io_thread (LPVOID A)
> #define VOID_STAR_TYPE DWORD
76a80
> #define LOCK_DESTROY pthread_mutex_destroy /* new */
80c84
< pthread_t PTHREAD[MAX_CPUS];
---
> pthread_t PTHREAD[MAX_CPUS], PTHREAD_IO;
81a86,87
> #define IO_THREAD(A) void* io_thread (void* A)
> #define VOID_STAR_TYPE void*
85,88c91,100
< MUTEX_TYPE PTHREAD_COND_MUTEX[MAX_CPUS];
< MUTEX_TYPE WAKEUP_LOCK[MAX_CPUS];
< COND_TYPE PTHREAD_COND_WAIT[MAX_CPUS];
< COND_TYPE WAKEUP[MAX_CPUS];
---
> MUTEX_TYPE PTHREAD_COND_MUTEX[MAX_CPUS], WAKEUP_LOCK_IO[1];
> COND_TYPE PTHREAD_COND_WAIT[MAX_CPUS], WAKEUP_IO[1];
> #define boolean uint8
> boolean volatile SMP_HAS_AKTIV, IVAN_ALL_HALT, IO_AWAKE, INFINITE_LOOP;
> boolean volatile ZOG_AVAILABLE, ZOG_AVAILABLE_OTHER, ZOG_ROOT_DONE;
> boolean volatile SEARCH_IS_DONE, STALL_MODE, UCI_NEW_GAME;
> int SINCE_NEW_GAME;
> uint64 EASY_FACTOR, EASY_FACTOR_PONDER, BATTLE_FACTOR, ORDINARY_FACTOR,
>   ABSOLUTE_PERCENT, DESIRED_MILLIS, BOOK_EXIT_MOVES;
> boolean EXTEND_IN_CHECK;
92,93d103
< #define boolean uint8
< 
112a123,125
> #define FLAG_MOVE_LESS 32
> #define UPPER_FROM_PV 64
> #define LOWER_FROM_PV 128
125,126c138,141
< #define HashLower(Z, mv, dp, v) HashLowerNew (Z, mv, dp, VAS (v))
< #define HashUpper(Z, dp, v) HashUpperNew (Z, dp, VAS (v))
---
> #define HashLower(Z, mv, dp, v) HashLowerNew (Z, mv, dp, VAS (v), 0)
> #define HashUpper(Z, dp, v) HashUpperNew (Z, dp, VAS (v), 0)
> #define HashLowerPV(Z, mv, dp, v) HashLowerNew (Z, mv, dp, VAS (v), LOWER_FROM_PV)
> #define HashUpperPV(Z, dp, v) HashUpperNew (Z, dp, VAS (v), UPPER_FROM_PV)
253c268
<   /* 0e-0f */ uint8 rev, _2;
---
>   /* 0e-0f */ uint8 rev, moveless;
266,267c281,282
< typePVHash PVHashTable[0x10000]; /* multicore ? */
< #define PVHashMask 0xfffc
---
> typePVHash *PVHashTable; /* multicore ? */
> uint64 PVHashMask;
278a294
>   sint32 value;
323c339
< volatile int SMP_FREE;
---
> volatile uint64 SMP_FREE;
328a345
> #define MAX_STACK 256
339,340c356,358
<   uint64 STACK[1024];
<   uint64 StackHeight, cpu, nodes, tbhits;
---
>   uint64 STACK[MAX_STACK], StackHeight;
>   uint64 nodes, tbhits;
>   uint8 cpu, rp;
354c372,400
< #define MAXIMUM_PLY 1024
---
> /********************************* ZOG *********************************/
> 
> typedef struct {uint16 move; sint16 score;} type_ZOG_ML;
> struct ZN
> {
>   typePOS POS[1]; /* STACK has 2048 bytes */
>   MUTEX_TYPE lock[1];
>   int alpha, beta, depth, orig_alpha, expected_value, best_value;
>   struct ZN *PARENT;
>   int USERS, AKTIV_MOVES_COUNT;
>   int zm, phase;
>   int ZOG_MOVE_COUNT, TOTAL_MOVE_COUNT, extension;
>   boolean cpus_used[MAX_CPUS];
>   struct ZN *children[MAX_CPUS];
>   uint32 MOVE_FROM_PARENT, best_move;
>   boolean is_busy, dead, EXPANDED, join_able, is_registered, is_book_keep;
>   uint64 hash, when;
>   int num, previous_result;
>   type_ZOG_ML MOVE_LIST[256]; /* 1024 bytes */
> }; /* volatile? */
> 
> boolean ZOG_AKTIV;
> uint64 ZOG_SIZE, ZOG_HEFT;
> typedef struct ZN type_zog_node;
> #define MIN_ZOG_DEPTH 10
> 
> /*********************************/ /*********************************/
> 
> #define MAXIMUM_PLY 2048
400c446,447
< char STRING1[64], STRING2[64], STRING3[64], STRING4[64];
---
> char STRING1[MAX_CPUS][64], STRING2[MAX_CPUS][64],
>   STRING3[MAX_CPUS][64], STRING4[MAX_CPUS][64]; /* SMP */
491c538,539
< typedef struct { uint32 move; sint32 Value; } typeMPV;
---
> typedef struct
> { uint32 move; sint32 Value, alpha, beta; uint32 depth, _0; uint64 nodes; } typeMPV;
498c546
< boolean ALWAYS_ANALYZE;
---
> boolean ALWAYS_ANALYZE, TRY_PV_IN_ANALYSIS;
502,507c550,556
< uint64 UCI_BishopPairScale;
< uint64 UCI_PawnScale;
< uint64 UCI_KnightScale;
< uint64 UCI_BishopScale;
< uint64 UCI_RookScale;
< uint64 UCI_QueenScale;
---
> uint64 UCI_White_Bishops_Scale, UCI_White_Pawn_Scale, UCI_White_Knight_Scale;
> uint64 UCI_White_Light_Scale, UCI_White_Dark_Scale;
> uint64 UCI_White_Rook_Scale, UCI_White_Queen_Scale;
> uint64 UCI_Black_Bishops_Scale, UCI_Black_Pawn_Scale, UCI_Black_Knight_Scale;
> uint64 UCI_Black_Light_Scale, UCI_Black_Dark_Scale;
> uint64 UCI_Black_Rook_Scale, UCI_Black_Queen_Scale;
> uint64 UCI_MATERIAL_WEIGHTING, UCI_PAWNS_WEIGHTING, UCI_KING_SAFETY_WEIGHTING;
515c564
< boolean SEND_HASH;
---
> boolean SEND_HASH, DO_HASH_FULL;
546c595
< 	  k + i, POSITION->DYN->HASH, t->flags, t->age, Notate(t->move, STRING1), \
---
> 	  k + i, POSITION->DYN->HASH, t->flags, t->age, Notate(t->move, STRING1[POSITION->cpu]), \
550c599
< 	  k + i, zob, t->flags, t->age, Notate(t->move, STRING1), \
---
> 	  k + i, zob, t->flags, t->age, Notate(t->move, STRING1[POSITION->cpu]), \
554c603
< 	  s, k + i, Z, t->flags, t->age, Notate(t->move, STRING1), \
---
> 	  s, k + i, Z, t->flags, t->age, Notate(t->move, STRING1[POSITION->cpu]), \
558c607
< 	  s, k + w, Z, t->flags, t->age, Notate(t->move, STRING1), \
---
> 	  s, k + w, Z, t->flags, t->age, Notate(t->move, STRING1[POSITION->cpu]), \
diff 999963/Robbo_glue.c 999958/Robbo_glue.c
87c87,88
<   if (POSITION->DYN->oo || POSITION->DYN->ep) return FALSE;
---
>   if (POSITION->DYN->oo || POSITION->DYN->ep)
>     return FALSE;
173,176c174
<       SEND ("info depth 0 score cp 0 pv %s\n", Notate (m, STRING1));
< #if 0
<       SEND ("bestmove %s\n", Notate (m, STRING1));
< #else
---
>       SEND ("info depth 0 score cp 0 pv %s\n", Notate (m, STRING1[POSITION->cpu]));
178d175
< #endif
185,188c182
< 	    v2, Notate (m, STRING1));
< #if 0
<       SEND ("bestmove %s\n", Notate (m, STRING1));
< #else
---
> 	    v2, Notate (m, STRING1[POSITION->cpu]));
190d183
< #endif
197,200c190
< 	    v2, Notate (m, STRING1));
< #if 0
<       SEND ("bestmove %s\n", Notate (m, STRING1));
< #else
---
> 	    v2, Notate (m, STRING1[POSITION->cpu]));
202d191
< #endif
diff 999963/Robbo_utilita.c 999958/Robbo_utilita.c
312c312
<   int ep = POSITION->DYN->ep, move, w, vb = dVITT;
---
>   int ep = POSITION->DYN->ep, move, w, vb = 255;
318a319,320
>   if (*Value == dVITT)
>     return TRUE;
329c331
< 	      if (w > vb)
---
> 	      if (w < vb)
342c344
< 	      if (w > vb)
---
> 	      if (w < vb)
358c360
< 	      if (w > vb)
---
> 	      if (w < vb)
371c373
< 	      if (w > vb)
---
> 	      if (w < vb)
381c383
<   *Value = MAX (*Value, vb);
---
>   *Value = MIN (*Value, vb);
diff 999963/SMP.c 999958/SMP.c
5a6
> #include <signal.h>
7c8
< volatile int SMP_FREE;
---
> volatile uint64 SMP_FREE;
9,11d9
< boolean volatile PTHREAD_EXIT[MAX_CPUS];
< void thread_halt (typePOS*);
< boolean INIT[MAX_CPUS];
13,83c11,12
< typedef struct
< {
<   int cpu;
< }
< t_args;
< 
< t_args ARGS[MAX_CPUS];
< 
< volatile int init_threads;
< volatile boolean IVAN_END_SMP;
< jmp_buf DEC_JMP[MAX_CPUS]; /* Decembrist bugfix */
< volatile int active_threads;
< 
< void thread_stall (typePOS*, int);
< 
< void thread_init (int cpu)
< {
<   int z;
<   DO_LOCKED (init_threads++);
<   while (init_threads < CPUS_SIZE)
<     {
<     }
<   z = setjmp (DEC_JMP[cpu]);
<   if (z > 0)
<     DO_LOCKED (active_threads--);
<   while (IVAN_END_SMP)
<     {
<     }
<   WAIT_CON_LOCK (WAKEUP[cpu], WAKEUP_LOCK[cpu]);
<   DO_LOCKED (active_threads++);
<   PTHREAD_EXIT[cpu] = FALSE;
<   thread_stall (NULL_PARENT, cpu);
< }
< 
< void ivan_end_smp()
< {
<   int cpu;
<   int rp;
<   int sp;
< 
<   IVAN_END_SMP = TRUE;
<   LOCK (SMP_IVAN);
<   for (cpu = 1; cpu < CPUS_SIZE; cpu++)
<     PTHREAD_EXIT[cpu] = TRUE;
<   UNLOCK (SMP_IVAN);
<   for (cpu = 1; cpu < CPUS_SIZE; cpu++)
<     {
<       PTHREAD_EXIT[cpu] = TRUE;
<       SIGNAL_CON_LOCK (PTHREAD_COND_WAIT[cpu], PTHREAD_COND_MUTEX[cpu]);
<     }
<   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
<     for (rp = 0; rp < RP_PER_CPU ; rp++)
<       ROOT_POSITION[cpu][rp].stop = TRUE;
<   while (active_threads > 1)
<     {
<       for (cpu = 0; cpu < CPUS_SIZE; cpu++)
< 	for (rp = 0; rp < RP_PER_CPU ; rp++)
< 	  ROOT_POSITION[cpu][rp].stop = TRUE;
<     }
<   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
<     for (rp = 0; rp < RP_PER_CPU ; rp++)
<       ROOT_POSITION[cpu][rp].used = FALSE;
<   for (sp = 0; sp < MAX_SP; sp++)
<     ROOT_SP[sp].aktiv = FALSE;
<   IVAN_END_SMP = FALSE;
< }
< 
< #ifdef WINDOWS
< #define VOID_STAR_TYPE DWORD
< #else
< #define VOID_STAR_TYPE void*
---
> #ifdef BUILD_ZOG_MP_COMPILE
> #include "ZOG_NODE.h"
86,96c15
< IVAN_THREAD(A)
< {
<   t_args* AttB;
<   AttB = (t_args*) A;
<   INIT[AttB->cpu] = TRUE;
<   thread_init (AttB->cpu);
<   return (VOID_STAR_TYPE) NULL;
< }
< 
< static boolean INIT0 = FALSE;
< void ivan_init_smp()
---
> void STUB_IVAN ()
98,163c17,19
<   int cpu;
<   int rp;
<   int sp;
<   typePOS *RP00;
<   int h;
< 
<   SMP_FREE = 0;
<   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
<     for (rp = 0; rp < RP_PER_CPU ; rp++)
<       {
< 	ROOT_POSITION[cpu][rp].used = FALSE;
< 	ROOT_POSITION[cpu][rp].nodes = 0;
< 	ROOT_POSITION[cpu][rp].tbhits = 0;
<       }
<   for (sp = 0; sp < MAX_SP; sp++)
<     ROOT_SP[sp].aktiv = FALSE;
<   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
<     {
<       WORKING[cpu] = NULL;
<       PTHREAD_EXIT[cpu] = FALSE;
<     }
<   NULL_PARENT->child_count = 123;
<   if (!INIT0)
<     {
<       for (cpu = 1; cpu < MAX_CPUS; cpu++)
< 	{
< 	  ARGS[cpu].cpu = cpu;
< 	  PTHREAD_CREATE (&PTHREAD[cpu], NULL, ivan_thread, &ARGS[cpu]);
< 	}
<       while (init_threads < MAX_CPUS)
< 	{
< 	}
< #ifndef WINDOWS
<       {
< 	volatile int c;
< 	for (c = 0; c < 1000000; c++)
< 	  {
< 	  }
<       }
< #endif
<       for (cpu = 1; cpu < CPUS_SIZE; cpu++) /* CPUS_SIZE */
< 	{
< 	  SIGNAL_CON_LOCK (WAKEUP[cpu], WAKEUP_LOCK[cpu]);
< 	}
<     }
<   else for (cpu = 1; cpu < CPUS_SIZE; cpu++) /* CPUS_SIZE */
<     {
<       SIGNAL_CON_LOCK (WAKEUP[cpu], WAKEUP_LOCK[cpu]);
<     }
<   while (active_threads < CPUS_SIZE)
<     {
< #ifndef WINDOWS
<       if (!INIT0)
< 	{
< 	  for (cpu = 1; cpu < CPUS_SIZE; cpu++) /* CPUS_SIZE */
< 	    {
< 	      SIGNAL_CON_LOCK (WAKEUP[cpu], WAKEUP_LOCK[cpu]);
< 	    }
< 	  volatile int c;
< 	  for (c = 0; c < 1000000; c++)
< 	    {
< 	    }
< 	}
< #endif
<     }
<   INIT0 = TRUE;
---
>   typePOS* RP00;
>   int h, cpu, rp, sp;
>   int volatile x;
176a33,47
>   IVAN_ALL_HALT = FALSE;
>   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>     for (rp = 0; rp < RP_PER_CPU ; rp++)
>       {
>         ROOT_POSITION[cpu][rp].used = FALSE;
>         ROOT_POSITION[cpu][rp].stop = FALSE;
>         ROOT_POSITION[cpu][rp].nodes = 0;
>         ROOT_POSITION[cpu][rp].tbhits = 0;
>       }
>   ROOT_POSITION[0][0].used = TRUE;
>   for (sp = 0; sp < MAX_SP; sp++)
>     ROOT_SP[sp].aktiv = FALSE;
>   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>     WORKING[cpu] = NULL;
>   NULL_PARENT->child_count = 123;
178a50,57
>   SMP_HAS_AKTIV = TRUE;
>   SIGNAL_CON_LOCK (*WAKEUP_IO, *WAKEUP_LOCK_IO);
>   for (x = 0; x < 10000; x++);
>   while (!IO_AWAKE)
>     {
>       SIGNAL_CON_LOCK (*WAKEUP_IO, *WAKEUP_LOCK_IO);
>       NANO_SLEEP (1000000);
>     }
187d65
< #define POSITION POS
240,242c118
<     {
<       HashUpperCUT (POS, sp->depth, sp->value);
<     }
---
>     HashUpperCUT (POS, sp->depth, sp->value);
257,259c133
<     {
<       HashUpper (POS->DYN->HASH, sp->depth, sp->value);
<     }
---
>     HashUpper (POS->DYN->HASH, sp->depth, sp->value);
297d170
< #undef POSITION
312,313c185,186
<       DO_LOCKED (SMP_FREE++);
<       while (!WORKING[cpu] && PARENT->child_count && !PTHREAD_EXIT[cpu])
---
>       DO_LOCKED (SMP_FREE |= (1 << cpu));
>       while (!WORKING[cpu] && PARENT->child_count && !ZOG_AVAILABLE)
319c192
<           if (WORKING[cpu] || !PARENT->child_count || PTHREAD_EXIT[cpu])
---
>           if (WORKING[cpu] || !PARENT->child_count || ZOG_AVAILABLE)
328c201,202
<       if (PTHREAD_EXIT[cpu])
---
> #ifdef BUILD_ZOG_MP_COMPILE
>       if (ZOG_AKTIV && ZOG_ROOT_DONE && cpu == 0)
330,332c204,205
< 	  WORKING[cpu] = NULL;
< 	  PARENT = NULL_PARENT;
< 	  longjmp (DEC_JMP[cpu], 1);
---
> 	  WORKING[0] = NULL;
> 	  longjmp (JMP_BUF[0], (1 << 29));
334,335c207,209
<       LOCK (SMP_IVAN);
<       SMP_FREE--;
---
> #endif
>       LOCK (SMP_IVAN); /* ZOG_REGISTRY ? */
>       SMP_FREE &= ~(1 << cpu);
337c211
<       if (!W)
---
>       if (!W && PARENT != NULL_PARENT && !PARENT->child_count)
340d213
< 	  SIGNAL_CON_LOCK (PTHREAD_COND_WAIT[cpu], PTHREAD_COND_MUTEX[cpu]);
342c215
< 	  return;
---
> 	  return; /* IVAN_THREAD */
343a217,228
> #ifdef BUILD_ZOG_MP_COMPILE
>       if (!W && ZOG_AVAILABLE && !ROOT_POSITION[cpu][0].used)
> 	{
> 	  WORKING[cpu] = NULL_PARENT; /* temporary */
> 	  UNLOCK (SMP_IVAN);
> 	  STUB_Znode (cpu); /* ZOG_AVAILABLE if fails? */
> 	  LOCK (SMP_IVAN);
> 	  WORKING[cpu] = NULL;
> 	  UNLOCK (SMP_IVAN);
> 	  continue;
> 	}
> #endif
344a230,231
>       if (!W)
> 	continue;
378,415d264
< static void sp_init ()
< {
<   int sp;
<   for (sp = 0; sp < MAX_SP; sp++)
<     {
<       ROOT_SP[sp].aktiv = FALSE;
<       LOCK_INIT (ROOT_SP[sp].splock);
<     }
< }
< 
< void rp_init ()
< {
<   int cpu;
<   int rp;
<   LOCK_INIT (SMP_IVAN);
<   for (cpu = 0; cpu < MAX_CPUS; cpu++)
<     for (rp = 0; rp < RP_PER_CPU ; rp++)
<     {
<       memset( (void*) &ROOT_POSITION[cpu][rp], 0, sizeof (typePOS));
<       ROOT_POSITION[cpu][rp].DYN_ROOT =
< 	malloc (MAXIMUM_PLY * sizeof(typeDYNAMIC));
<       ROOT_POSITION[cpu][rp].used =  FALSE;
<       ROOT_POSITION[cpu][rp].parent = NULL;
<       ROOT_POSITION[cpu][rp].DYN = ROOT_POSITION[cpu][rp].DYN_ROOT;
<       ROOT_POSITION[cpu][rp].cpu = cpu;
<       LOCK_INIT (ROOT_POSITION[cpu][rp].padlock);
<     }
<   for (cpu = 0; cpu < MAX_CPUS; cpu++)
<     COND_INIT (PTHREAD_COND_WAIT[cpu], PTHREAD_COND_MUTEX[cpu]);
<   for (cpu = 0; cpu < MAX_CPUS; cpu++)
<     COND_INIT (WAKEUP[cpu], WAKEUP_LOCK[cpu]);
<   for (cpu = 0; cpu < MAX_CPUS; cpu++)
<     INIT[cpu] = FALSE;
<   init_threads = 1;
<   active_threads = 1;
<   sp_init ();
< }
< 
429c278
< static typePOS* COPY_TO_CHILD (int icpu, typePOS* PARENT)
---
> void COPY_POSITION (typePOS* CHILD, typePOS* PARENT)
431,432d279
<   typePOS* CHILD;
<   int cpu;
434,438d280
<   CHILD = GetPosition (icpu);
<   if (!CHILD)
<     return NULL;
<   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
<     CHILD->children[cpu] = NULL;
444a287,298
> }
> 
> typePOS* COPY_TO_CHILD (int icpu, typePOS* PARENT)
> {
>   typePOS* CHILD;
>   int cpu;
>   CHILD = GetPosition (icpu);
>   if (!CHILD)
>     return NULL;
>   for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>     CHILD->children[cpu] = NULL;
>   COPY_POSITION (CHILD, PARENT);
Only in 999958: SMP_init.c
diff 999963/SMP_search.c 999958/SMP_search.c
91c91
< 	  v = -OppPV (POSITION, -beta, -alpha, new_depth, b);
---
> 	  v = -OppPV (POSITION, -beta, -alpha, new_depth, b, NULL);
diff 999963/UCI_OPTIONS 999958/UCI_OPTIONS
2c2
< This has a description with the UCI options for IvanHoe currently (999966-Beta).
---
> This has a description with the UCI options for IvanHoe currently (999958-Beta).
5c5
< This takes values from 1 to 65536 in megabytes, and only works for binary powers. We cannot put this information on the option itself for the various GUI insists we determine it as "Hash". Warning: upon a value who is too large, the access will be slowed.
---
> This takes values from 1 to 65536 in megabytes, and only works for binary powers. We cannot put this information on the option itself for the various GUI insists we determine it as "Hash". Warning: upon a value who is too large, the access will be slowed. Also: a future version may release the binary powers.
9a10,14
> Option: PVHash
> This takes values from 1 to 1024 in megabytes, and only works for binary powers. The name is wrong, as king location is also in pawns. Increase this if TryPVinAnalysis is off and the PVs are too short.
> 
> Personal Advise: 1024 Hash, 64 PawnsHash, 64 PVHash is my usage.
> 
23c28
< This turns on the AlternativeTimeUsage. We have made no thorough tests for the application here. There are too many parameters (see 1m plus 1s, 1m flat, 40 moves for 40 seconds, and more).
---
> This turns on the AlternativeTimeUsage. We have made no thorough tests for the application here.
28c33
< Option: BufferTime
---
> Option: BufferTime (milliseconds)
30a36,38
> Option: OutputDelay (milliseconds)
> This lists in milliseconds how long for waiting until output is emitted.
> 
58,63c66,80
< Option: UCI_BishopPairScale
< Option: UCI_PawnScale
< Option: UCI_KnightScale
< Option: UCI_BishopScale
< Option: UCI_RookScale
< Option: UCI_QueenScale
---
> Option: UCI_White_Bishop_Pair_Scale (cp)
> Option: UCI_White_Pawn_Scale (cp)
> Option: UCI_White_Knight_Scale (cp)
> Option: UCI_White_Light_Bishop_Scale (cp)
> Option: UCI_White_Dark_Bishop_Scale (cp)
> Option: UCI_White_Rook_Scale (cp)
> Option: UCI_White_Queen_Scale (cp)
> Option: UCI_Black_Bishop_Pair_Scale (cp)
> Option: UCI_Black_Pawn_Scale (cp)
> Option: UCI_Black_Knight_Scale (cp)
> Option: UCI_Black_Light_Bishop_Scale (cp)
> Option: UCI_Black_Dark_Bishop_Scale (cp)
> Option: UCI_Black_Rook_Scale (cp)
> Option: UCI_Black_Queen_Scale (cp)
> 
65a83,88
> Option: MaterialWeighting
> Option: KingSafetyWeighting
> Option: PawnsWeighting
> 
> These are more user fun options for rescaling. The units are all in 1024s.
> 
68a92,94
> Option: TryPVInAnalysis
> This option demands an expansion of the PV in analysis mode. If this it not on the PV can be truncated from hash hits.
> 
71a98,100
> Option: DoHashFull
> This option implies to send hashfull at the second updates. There is a little overhead.
> 
74a104,116
> Option: TimeEasyFactor
> Option: TimeEasyFactorPonder
> Option: TimeBattleFactor
> Option: TimeOrdinaryFactor
> Option: TimeAbsolutePercent
> Option: TimeDesiredMillis
> Option: TimeBookExitMoves
> 
> These options control the standard time usage. Our defaults seem decent. The DesiredMillis sets up how much time to use, except in movestogo mode when that is apparent. The default 40 uses 40/1000 or 1/25 of the time back in the desired time. The factors then say how much of the desired time to use in situations. The absolute percent caps the amount that can be used in worst scenarios. The book exit moves demands to use extra time on the first moves when the book was left. We put this as 0 and the matter is not much.
> 
> Option: ExtraExtendInCheck
> This option when on will extend an extra half-ply when in check. The default is off.
> 
87a130,131
> 
> The ZOG MP does not turn on unless you compile it and then it hangs.
Only in 999958: ZOG_NODE.h
diff 999963/Zobrist.c 999958/Zobrist.c
9c9
<   (((AGE - (x)) & (MAX_AGE - 1)) * MAX_DEPTH   + (MAX_DEPTH - ((y) + 1)))
---
>   (((AGE - (x)) & (MAX_AGE - 1)) * MAX_DEPTH + (MAX_DEPTH - ((y) + 1)))
18,19c18,19
< static uint64 HASH_SIZE = 0x400000;
< static boolean FLAG_HASH_INIT = 0;
---
> static uint64 HASH_SIZE = 0x400000 /* ?? */, PV_HASH_SIZE = 0x10000;
> static boolean FLAG_HASH_INIT = FALSE, PV_FLAG_HASH_INIT = FALSE;
25d24
<   memset (PVHashTable, 0, 0x10000 * sizeof (typePVHash));
30a30,51
> void PVHashClear ()
> {
>   memset (PVHashTable, 0, PV_HASH_SIZE * sizeof (typePVHash));
> }
> 
> int InitPVHash(int mb)
> {
>   if (mb > 1024)
>     mb = 1024;
>   if (mb < 1)
>     mb = 1;
>   PV_HASH_SIZE = ((1ULL << BSR (mb)) << 20) / sizeof (typePVHash);
>   mb = (PV_HASH_SIZE * sizeof (typeHash)) >> 20;
>   PVHashMask = PV_HASH_SIZE - 4;
>   if (PV_FLAG_HASH_INIT)
>     ALIGNED_FREE (PVHashTable);
>   PV_FLAG_HASH_INIT = TRUE;
>   MEMALIGN (PVHashTable, 64, PV_HASH_SIZE * sizeof (typePVHash));
>   PVHashClear ();
>   return mb;
> }
> 
47,282c68
< #ifndef NEW_HASH
< void HashLowerALL (typePOS* POSITION, int move, int depth, int Value)
< {
<   uint64 Z = POSITION->DYN->HASH;
<   int DEPTH, i, k = Z & HashMask;
<   typeHash *trans;
<   int max = 0, w = 0;
<   move &= 0x7fff;
<   VALUE_ADJUST_STORE (Value, HEIGHT(POSITION));
<   for (i = 0; i < 4; i++)
<     {
<       trans = HashTable + (k + i);
<       if ((trans->hash ^ (Z >> 32)) == 0
< 	  && (!trans->DepthLower || IsALL (trans))
< 	  && trans->DepthLower <= depth)
< 	{
< 	  trans->DepthLower = depth;
< 	  trans->move = move;
< 	  trans->ValueLower = Value;
< 	  trans->age = AGE;
< 	  trans->flags |= FLAG_LOWER | FLAG_ALL;
< 	  return;
< 	}
<       DEPTH = MAX (trans->DepthLower, trans->DepthUpper);
<       if (AGE_DEPTH_MIX (trans->age, DEPTH) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, DEPTH);
< 	  w = i;
< 	}
<     }
<   trans = HashTable + (k + w);
<   trans->hash = (Z >> 32);
<   trans->DepthUpper = 0;
<   trans->ValueUpper = 0;
<   trans->DepthLower = depth;
<   trans->move = move;
<   trans->ValueLower = Value;
<   trans->age = AGE;
<   trans->flags = FLAG_LOWER | FLAG_ALL;
<   return;
< }
< 
< void HashUpperCUT (typePOS* POSITION, int depth, int Value)
< {
<   uint64 Z = POSITION->DYN->HASH;
<   int DEPTH, i, k = Z & HashMask;
<   typeHash *trans;
<   int max = 0, w = 0;
<   VALUE_ADJUST_STORE (Value, HEIGHT(POSITION));
<   for (i = 0; i < 4; i++)
<     {
<       trans = HashTable + (k + i);
<       if (!(trans->hash ^ (Z >> 32))
< 	  && (!trans->DepthUpper || IsCUT (trans))
< 	  && trans->DepthUpper <= depth)
< 	{
< 	  trans->DepthUpper = depth;
< 	  trans->ValueUpper = Value;
< 	  trans->age = AGE;
< 	  trans->flags |= FLAG_UPPER | FLAG_CUT;
< 	  return;
< 	}
<       DEPTH = MAX (trans->DepthLower, trans->DepthUpper);
<       if (AGE_DEPTH_MIX (trans->age, DEPTH) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, DEPTH);
< 	  w = i;
< 	}
<     }
<   trans = HashTable + (k + w);
<   trans->hash = (Z >> 32);
<   trans->DepthLower = 0;
<   trans->move = 0;
<   trans->ValueLower = 0;
<   trans->DepthUpper = depth;
<   trans->ValueUpper = Value;
<   trans->age = AGE;
<   trans->flags = FLAG_UPPER | FLAG_CUT;
<   return;
< }
< 
< void HashLower (uint64 Z, int move, int depth, int Value)
< {
<   int DEPTH, i, k = Z & HashMask;
<   typeHash* trans;
<   int max = 0, w = 0;
<   move &= 0x7fff;
<   for (i = 0; i < 4; i++)
<     {
<       trans = HashTable + (k + i);
<       if (!(trans->hash ^ (Z >> 32)) && !IsExact (trans)
< 	  && trans->DepthLower <= depth)
< 	{
< 	  trans->DepthLower = depth;
< 	  trans->move = move;
< 	  trans->ValueLower = Value;
< 	  trans->age = AGE;
< 	  trans->flags |= FLAG_LOWER;
< 	  trans->flags &= ~FLAG_ALL;
< 	  return;
< 	}
<       DEPTH = MAX (trans->DepthLower, trans->DepthUpper);
<       if (AGE_DEPTH_MIX (trans->age, DEPTH) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, DEPTH);
< 	  w = i;
< 	}
<     }
<   trans = HashTable + (k + w);
<   trans->hash = (Z >> 32);
<   trans->DepthUpper = 0;
<   trans->ValueUpper = 0;
<   trans->DepthLower = depth;
<   trans->move = move;
<   trans->ValueLower = Value;
<   trans->age = AGE;
<   trans->flags = FLAG_LOWER;
<   return;
< }
< 
< void HashUpper (uint64 Z, int depth, int Value)
< {
<   int DEPTH, i, k = Z & HashMask;
<   typeHash* trans;
<   int max = 0, w = 0;
<   for (i = 0; i < 4; i++)
<     {
<       trans = HashTable + (k + i);
<       if (!(trans->hash ^ (Z >> 32)) && !IsExact (trans)
< 	  && trans->DepthUpper <= depth)
< 	{
< 	  trans->DepthUpper = depth;
< 	  trans->ValueUpper = Value;
< 	  trans->age = AGE;
< 	  trans->flags |= FLAG_UPPER;
< 	  trans->flags &= ~FLAG_CUT;
< 	  return;
< 	}
<       DEPTH = MAX (trans->DepthLower, trans->DepthUpper);
<       if (AGE_DEPTH_MIX (trans->age, DEPTH) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, DEPTH);
< 	  w = i;
< 	}
<     }
<   trans = HashTable + (k + w);
<   trans->hash = (Z >> 32);
<   trans->DepthLower = 0;
<   trans->move = 0;
<   trans->ValueLower = 0;
<   trans->DepthUpper = depth;
<   trans->ValueUpper = Value;
<   trans->age = AGE;
<   trans->flags = FLAG_UPPER;
<   return;
< }
< 
< static void pv_zobrist (typePOS* POSITION, int move, int depth, int Value)
< {
<   int i, k = POSITION->DYN->HASH & PVHashMask;
<   typePVHash* trans;
<   int w = 0, max = 0;
<   for (i = 0; i < 4; i++)
<     {
<       trans = PVHashTable + (k + i);
<       if (trans->hash == POSITION->DYN->HASH)
< 	{
< 	  trans->depth = depth; /* esta seguro que depth es mejor ? */
< 	  trans->Value = Value;
< 	  trans->move = move;
< 	  trans->age = AGE;
< 	  return;
< 	}
<       if (AGE_DEPTH_MIX (trans->age, trans->depth) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, trans->depth);
< 	  w = i;
< 	}
<     }
<   trans = PVHashTable + (k + w);
<   trans->hash = POSITION->DYN->HASH;
<   trans->depth = depth;
<   trans->move = move;
<   trans->Value = Value;
<   trans->age = AGE;
< }
< 
< void HashExact (typePOS* POSITION, int move, int depth, int Value, int FLAGS)
< {
<   uint64 Z = POSITION->DYN->HASH;
<   int DEPTH, i, j, k = Z & HashMask;
<   typeHash* trans;
<   int max = 0, w = 0;
<   move &= 0x7fff;
<   pv_zobrist (POSITION, move, depth, Value);
<   VALUE_ADJUST_STORE (Value, HEIGHT(POSITION));
<   for (i = 0; i < 4; i++)
<     {
<       trans = HashTable + (k + i);
<       if ((trans->hash ^ (Z >> 32)) == 0
< 	  && MAX (trans->DepthUpper, trans->DepthLower) <= depth)
< 	{
< 	  trans->DepthUpper = trans->DepthLower = depth;
< 	  trans->move = move;
< 	  trans->ValueUpper = trans->ValueLower = Value;
< 	  trans->age = AGE;
< 	  trans->flags = FLAGS;
< 	  for (j = i + 1; j < 4; j++)
< 	    {
< 	      trans = HashTable + (k + j);
< 	      if ((trans->hash ^ (Z >> 32)) == 0
< 		  && MAX (trans->DepthUpper, trans->DepthLower) <= depth)
< 		{
< 		  memset (trans, 0, 16);
< 		  trans->age = AGE ^ (MAX_AGE / 2);
< 		}
< 	    }
< 	  return;
< 	}
<       DEPTH = MAX (trans->DepthLower, trans->DepthUpper);
<       if (AGE_DEPTH_MIX (trans->age, DEPTH) > max)
< 	{
< 	  max = AGE_DEPTH_MIX (trans->age, DEPTH);
< 	  w = i;
< 	}
<     }
<   trans = HashTable + (k + w);
<   trans->hash = (Z >> 32);
<   trans->DepthUpper = trans->DepthLower = depth;
<   trans->move = move;
<   trans->ValueUpper = trans->ValueLower = Value;
<   trans->age = AGE;
<   trans->flags = FLAGS;
<   return;
< }
< #else /*******************************************************/
---
> /* NEW_HASH */
371c157
< void HashLowerNew (uint64 Z, int move, int depth, int Value)
---
> void HashLowerNew (uint64 Z, int move, int depth, int Value, int FLAGS)
389,390c175,176
< 	  trans->flags |= FLAG_LOWER;
< 	  trans->flags &= ~FLAG_ALL;
---
> 	  trans->flags &= ~(FLAG_ALL | LOWER_FROM_PV);
> 	  trans->flags |= FLAG_LOWER | FLAGS;
410c196
<   trans->flags = FLAG_LOWER;
---
>   trans->flags = FLAG_LOWER | FLAGS;
416c202
< void HashUpperNew (uint64 Z, int depth, int Value)
---
> void HashUpperNew (uint64 Z, int depth, int Value, int FLAGS)
432,433c218,219
< 	  trans->flags |= FLAG_UPPER;
< 	  trans->flags &= ~FLAG_CUT;
---
> 	  trans->flags &= ~(FLAG_CUT | UPPER_FROM_PV);
> 	  trans->flags |= FLAG_UPPER | FLAGS;
453c239
<   trans->flags = FLAG_UPPER;
---
>   trans->flags = FLAG_UPPER | FLAGS;
548d333
< #endif
diff 999963/all_node.c 999958/all_node.c
55a56,57
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return 0;
263c265
<   int move, k, cnt, EXTEND;
---
>   int move, k, cnt;
291a294,295
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return (HEIGHT (POSITION) - VALUE_MATE);
396,400c400
< 	      if (EARLY_GAME)
< 		EXTEND = 1;
< 	      else
< 		EXTEND = 0;
< 	      new_depth = depth - 2 - MIN (2, cnt) + EXTEND;
---
> 	      new_depth = depth - 2 - MIN (2, cnt) + EXTEND_IN_CHECK;
410,414c410
< 	  if (EARLY_GAME)
< 	    EXTEND = 1;
< 	  else
< 	    EXTEND = 0;
< 	  new_depth = depth - 2 + EXTEND;
---
> 	  new_depth = depth - 2 + EXTEND_IN_CHECK;
diff 999963/benchmark.c 999958/benchmark.c
53a54,75
> 
> void MakeUndoSpeed (typePOS* POSITION)
> {
>   typeMoveList ML[256], *ml, *p;
>   int c, u;
>   uint64 C;
>   double t;
>   ml = CaptureMoves (POSITION, ML, 0xffffffffffffffff);
>   ml = OrdinaryMoves (POSITION, ml);
>   u = (int) (ml - ML);
>   printf ("%d psudo-legal moves\n", u);
>   C = GetClock ();
>   for (c = 0; c < 10000000; c++)
>     for (p = ML; p < ml; p++)
>       {
> 	Make (POSITION, p->move);
> 	Undo (POSITION, p->move);
>       }
>   t = (GetClock() - C) / 1000000.0;
>   printf ("%d0 million MakeUndo in %.3fs\n", u, t);
> }
> 
diff 999963/common.h 999958/common.h
11d10
< #define EARLY_GAME ((POSITION->DYN->material & 0xff) >= 18)
36,37c35,36
< #define LOW_DEPTH_CONDITION (new_depth <= 7)
< #define LOW_DEPTH_CONDITION_PV (new_depth <= 7)
---
> #define LOW_DEPTH_CONDITION (new_depth <= 9)
> #define LOW_DEPTH_CONDITION_PV (new_depth <= 9)
diff 999963/control.c 999958/control.c
32c32
< void HaltSearch (int tr)
---
> void HaltSearch (int d, int tr)
38c38,44
<   if (JUMP_IS_SET)
---
>   if (TITANIC_MODE)
>     {
>       IVAN_ALL_HALT = TRUE;
>       if (d == 0)
> 	ivan_end_smp ();
>     }
>   else if (JUMP_IS_SET)
41a48,60
> int DoHashFull (uint64 x)
> {
>   int c = 0, d;
>   uint64 modulus = HashMask + 3;
>   for (d = 0; d < 1000; d++)
>     {
>       x= (0xeca97530f2468bd1)*x + 0x43218765edcb09af; /* sample 1000 */
>       if (HashTable[x & modulus].hash && HashTable[x & modulus].age == AGE)
> 	c++;
>     }
>   return c;
> }
> 
45c64
<   int cpu, rp;
---
>   int cpu, rp, hash_full = 0;
51a71,75
>   if (!TITANIC_MODE && ZOG_AKTIV) /* fix 1 only cpu con ZOG */
>     {
>       ROOT_POSIZIONE0->nodes = ROOT_POSITION[0][0].nodes;
>       ROOT_POSIZIONE0->tbhits = ROOT_POSITION[0][0].tbhits;
>     }
64a89,90
>   if (DO_HASH_FULL)
>     hash_full = DoHashFull (((sint64) u) + x + NODES);
73a100,101
>   if (hash_full)
>     SEND (" hashfull %d", hash_full);
87a116,120
>   if (IVAN_ALL_HALT)
>     {
>       HaltSearch (d, 1);
>       return;
>     }
97,98c130,134
<   if (d == DEPTH)
<     HaltSearch (1);
---
>   if (d && d == DEPTH)
>     {
>       HaltSearch (d, 1);
>       return;
>     }
108c144,147
<     HaltSearch (1);
---
>     {
>       HaltSearch (d, 1);
>       return;
>     }
128c167
<     HaltSearch (2); }
---
>     HaltSearch (d, 2); return; }
135a175,176
>   if (d && TITANIC_MODE)
>     return;
142a184,188
>   if (IVAN_ALL_HALT)
>     {
>       HaltSearch (d, 1);
>       return;
>     }
153c199
< #if defined(UTILITIES)
---
> #if 1
161,162c207,211
<   if (d == DEPTH)
<     HaltSearch (1);
---
>   if (d && d == DEPTH)
>     {
>       HaltSearch (d, 1);
>       return;
>     }
172c221,224
<     HaltSearch (1);
---
>     {
>       HaltSearch (d, 1);
>       return;
>     }
190c242,245
<     HaltSearch (2);
---
>     {
>       HaltSearch (d, 2);
>       return;
>     }
192c247,250
<     HaltSearch (3);
---
>     {
>       HaltSearch (d, 3);
>       return;
>     }
194c252,255
<     HaltSearch (4);
---
>     {
>       HaltSearch (d, 4);
>       return;
>     }
195a257,258
>   if (d && TITANIC_MODE)
>     return;
197,211d259
<     Input (POSITION);
< }
< 
< /********************************/ /********************************/
< 
< #define INFINITY 0x7ffffffffffffff /* sint64 */
< #define STRTOK(p) p = strtok (NULL, " ")
< 
< static uint32 FullMove (typePOS* POSITION, uint32 x)
< {
<   int pi, to = TO (x), fr = FROM (x);
<   if (!x)
<     return x;
<   pi = POSITION->sq[fr];
<   if (pi == wEnumK || pi == bEnumK)
213,214c261,263
<       if (to - fr == 2 || fr - to == 2)
<         x |= FlagOO;
---
>       Input (POSITION);
>       if (d == 0 && TITANIC_MODE && !SMP_HAS_AKTIV)
> 	return;
216,235d264
<   if (TO (x) != 0 && TO (x) == POSITION->DYN->ep
<       && (pi == wEnumP || pi == bEnumP))
<     x |= FlagEP;
<   return x;
< }
< 
< static uint32 numeric_move (typePOS* POSITION, char* str)
< {
<   int x;
<   x = FullMove (POSITION, (str[2] - 'a') + ((str[3] - '1') << 3) +
< 		      ((str[0] - 'a') << 6) + ((str[1] - '1') << 9));
<   if (str[4] == 'b')
<     x |= FlagPromB;
<   if (str[4] == 'n')
<     x |= FlagPromN;
<   if (str[4] == 'r')
<     x |= FlagPromR;
<   if (str[4] == 'q')
<     x |= FlagPromQ;
<   return x;
319c348
<       ABSOLUTE_TIME = TIME / 4 - 10000;
---
>       ABSOLUTE_TIME = (TIME * ABSOLUTE_PERCENT) / 100 - 10000;
322c351
<       DESIRED_TIME = ABSOLUTE_TIME / 11 + INCREMENT;
---
>       DESIRED_TIME = (TIME * DESIRED_MILLIS) / 1000 + INCREMENT;
323a353,355
>   if (SINCE_NEW_GAME < BOOK_EXIT_MOVES)
>     DESIRED_TIME +=
>       (DESIRED_TIME * (BOOK_EXIT_MOVES - SINCE_NEW_GAME)) / BOOK_EXIT_MOVES;
328,329c360
<   EASY_TIME = DESIRED_TIME / 4;
< #if 1
---
>   EASY_TIME = (DESIRED_TIME * EASY_FACTOR) / 100;
331,334c362,402
<     EASY_TIME = DESIRED_TIME / 3;
< #endif
<   BATTLE_TIME = DESIRED_TIME;
<   ORDINARY_TIME = (3 * DESIRED_TIME) / 4;
---
>     EASY_TIME = (DESIRED_TIME * EASY_FACTOR_PONDER) / 100;
>   BATTLE_TIME = (DESIRED_TIME * BATTLE_FACTOR) / 100;
>   ORDINARY_TIME = (DESIRED_TIME * ORDINARY_FACTOR) / 100;
> }
> 
> /************************************************************/
> 
> #define INFINITY 0x7ffffffffffffff /* sint64 */
> #define STRTOK(p) p = strtok (NULL, " ")
> 
> static uint32 FullMove (typePOS* POSITION, uint32 x)
> {
>   int pi, to = TO (x), fr = FROM (x);
>   if (!x)
>     return x;
>   pi = POSITION->sq[fr];
>   if (pi == wEnumK || pi == bEnumK)
>     {
>       if (to - fr == 2 || fr - to == 2)
>         x |= FlagOO;
>     }
>   if (TO (x) != 0 && TO (x) == POSITION->DYN->ep
>       && (pi == wEnumP || pi == bEnumP))
>     x |= FlagEP;
>   return x;
> }
> 
> static uint32 numeric_move (typePOS* POSITION, char* str)
> {
>   int x;
>   x = FullMove (POSITION, (str[2] - 'a') + ((str[3] - '1') << 3) +
> 		      ((str[0] - 'a') << 6) + ((str[1] - '1') << 9));
>   if (str[4] == 'b')
>     x |= FlagPromB;
>   if (str[4] == 'n')
>     x |= FlagPromN;
>   if (str[4] == 'r')
>     x |= FlagPromR;
>   if (str[4] == 'q')
>     x |= FlagPromQ;
>   return x;
diff 999963/cut_node.c 999958/cut_node.c
55a56,57
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return 0;
139a142,144
> #define VALUE_RED1 (depth)
> #define VALUE_RED2 (2 * depth)
> #define DEPTH_RED (MIN (12, depth / 2))
143c148
<       v = MyExclude (POSITION, VALUE - depth, depth - MIN (12, depth / 2),
---
>       v = MyExclude (POSITION, VALUE - VALUE_RED1, depth - DEPTH_RED,
146c151
<       if (v < VALUE - depth)
---
>       if (v < VALUE - VALUE_RED1)
152,153c157,158
< 	  v = MyExclude (POSITION, VALUE - 2 * depth,
< 			 depth - MIN (12, depth / 2), trans_move & 0x7fff);
---
> 	  v = MyExclude (POSITION, VALUE - VALUE_RED2,
> 			 depth - DEPTH_RED, trans_move & 0x7fff);
155c160
< 	  if (v < VALUE - 2 * depth)
---
> 	  if (v < VALUE - VALUE_RED2)
335a341,342
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return (HEIGHT (POSITION) - VALUE_MATE);
475,479c482
< 	      if (EARLY_GAME)
< 		EXTEND = 1;
< 	      else
< 		EXTEND = 0;
< 	      new_depth = depth + EXTEND - REDUCTION - 2;
---
> 	      new_depth = depth + EXTEND_IN_CHECK - REDUCTION - 2;
489,492c492
< 	  if (!SINGULAR && EARLY_GAME)
< 	    EXTEND = 1;
< 	  else
< 	    EXTEND = 0;
---
> 	  EXTEND = !SINGULAR && EXTEND_IN_CHECK;
diff 999963/evaluation.c 999958/evaluation.c
39,53c39
< static void AdjustPositionalGainB (typePOS* POSITION, int move)
< {
<   int v, p, m;
<   if (POSITION->DYN->cp)
<     return;
<   p = POSITION->sq[TO (move)];
<   m = move & 07777;
<   v = POSITION->DYN->PositionalValue - ((POSITION->DYN - 1)->PositionalValue);
<   if (MAX_POS_GAIN (p ,m) <= v)
<     MAX_POS_GAIN (p, m) = v;
<   else
<     MAX_POS_GAIN (p, m)--;
< }
< 
< static void AdjustPositionalGainW (typePOS* POSITION, int move)
---
> static void AdjustPositionalGain (typePOS* POSITION, int move)
60a47
>   v = POSITION->wtm ? v : -v;
68c55
< #define HASH_MASK ( (HashSize) - 1 )
---
> #define EVAL_HASH_MASK ( (HashSize) - 1 )
95a83,84
>   Value *= UCI_MATERIAL_WEIGHTING;
>   Value >>= 10;
309,310c298
< 	  && (AttK[POSITION->bKsq] | bBitboardK) &
< 	  SqSet[H8])
---
> 	  && (AttK[POSITION->bKsq] | bBitboardK) & SqSet[H8])
313,314c301
< 	  && (AttK[POSITION->bKsq] | bBitboardK) &
< 	  SqSet[A8])
---
> 	  && (AttK[POSITION->bKsq] | bBitboardK) & SqSet[A8])
401c388
<   if (((POSITION->DYN->HASH ^ EvalHash[POSITION->DYN->HASH & HASH_MASK]) &
---
>   if (((POSITION->DYN->HASH ^ EvalHash[POSITION->DYN->HASH & EVAL_HASH_MASK]) &
405c392
< 	(int) ((sint16) (EvalHash[POSITION->DYN->HASH & HASH_MASK] & 0xffff));
---
> 	(int) ((sint16) (EvalHash[POSITION->DYN->HASH & EVAL_HASH_MASK] & 0xffff));
412,416c399
< 	{
< 	  POSITION->wtm ?
< 	    AdjustPositionalGainW (POSITION, move) :
< 	    AdjustPositionalGainB (POSITION, move);
< 	}
---
>       AdjustPositionalGain (POSITION, move);
442c425
< 	    EvalHash[POSITION->DYN->HASH & HASH_MASK] =
---
> 	    EvalHash[POSITION->DYN->HASH & EVAL_HASH_MASK] =
446,448d428
< #if 0
< 	    POSITION->tbhits++;	
< #endif
469c449
<       EvalHash[POSITION->DYN->HASH & HASH_MASK] =
---
>       EvalHash[POSITION->DYN->HASH & EVAL_HASH_MASK] =
484,487c464,467
<        && PAWN_INFO->wPfile_count <= 1) ||
<       (POSITION->DYN->flags & BLACK_MINOR_ONLY
<        && PAWN_INFO->bPfile_count <= 1) ||
<       (POSITION->DYN->flags & 128));
---
>        && PAWN_INFO->wPfile_count <= 1)
>       || (POSITION->DYN->flags & BLACK_MINOR_ONLY
> 	  && PAWN_INFO->bPfile_count <= 1)
>       || (POSITION->DYN->flags & 128));
627,629c607
< 	{
< 	  Value += QguardK;
< 	}
---
> 	Value += QguardK;
632,634c610
< 	{
< 	  Value += Qatt;
< 	}
---
> 	Value += Qatt;
646,648c622
< 		{
< 		  Value += DoubQueen7th;
< 		}
---
> 		Value += DoubQueen7th;
675,677c649
< 	{
< 	  Value += RguardK;
< 	}
---
> 	Value += RguardK;
681,688c653,655
< 	{
< 	  Value += RattP;
< 	}
<       if (A &
< 	  ((bBitboardN | bBitboardB) & ~bPatt))
< 	{
< 	  Value += RattBN;
< 	}
---
> 	Value += RattP;
>       if (A & ((bBitboardN | bBitboardB) & ~bPatt))
> 	Value += RattBN;
707,709c674
< 		{
< 		  Value += RookOpenFile;
< 		}
---
> 		Value += RookOpenFile;
715,717c680
< 		    {
< 		      Value += RookOpenFixedMinor;
< 		    }
---
> 		    Value += RookOpenFixedMinor;
719,721c682
< 		    {
< 		      Value += RookOpenMinor;
< 		    }
---
> 		    Value += RookOpenMinor;
732,734c693
< 		    {
< 		      Value += RookHalfOpenPawn;
< 		    }
---
> 		    Value += RookHalfOpenPawn;
738,740c697
< 	    {
< 	      Value += RookHalfOpenKing;
< 	    }
---
> 	    Value += RookHalfOpenKing;
757,759c714
< 	    {
< 	      Value += RookKing8th;
< 	    }
---
> 	    Value += RookKing8th;
767,769c722
< 		{
< 		  Value += DoubRook7thKingPawn;
< 		}
---
> 		Value += DoubRook7thKingPawn;
772,776c725,726
<       if (RANK (b) == R6
< 	  && (bBitboardP | bBitboardK) & Ranks678)
< 	{
< 	  Value += Rook6thKingPawn;
< 	}
---
>       if (RANK (b) == R6 && (bBitboardP | bBitboardK) & Ranks678)
> 	Value += Rook6thKingPawn;
803,805c753
< 	{
< 	  Value += BguardK;
< 	}
---
> 	Value += BguardK;
809,811c757
< 	{
< 	  Value += bAttP;
< 	}
---
> 	Value += bAttP;
813,815c759
< 	{
< 	  Value += bAttN;
< 	}
---
> 	Value += bAttN;
855,857c799
< 	    {
< 	      Value -= BishopTrapGuardValue;
< 	    }
---
> 	    Value -= BishopTrapGuardValue;
873,875c815
< 	{
< 	  Value += NguardK;
< 	}
---
> 	Value += NguardK;
879,881c819
< 	{
< 	  Value += NattP;
< 	}
---
> 	Value += NattP;
883,885c821
< 	{
< 	  Value += NattB;
< 	}
---
> 	Value += NattB;
965,967c901
< 	{
< 	  Value -= QguardK;
< 	}
---
> 	Value -= QguardK;
971,973c905
< 	{
< 	  Value -= Qatt;
< 	}
---
> 	Value -= Qatt;
986,988c918
< 		{
< 		  Value -= DoubQueen7th;
< 		}
---
> 		Value -= DoubQueen7th;
1015,1017c945
< 	{
< 	  Value -= RguardK;
< 	}
---
> 	Value -= RguardK;
1021,1023c949
< 	{
< 	  Value -= RattP;
< 	}
---
> 	Value -= RattP;
1025,1027c951
< 	{
< 	  Value -= RattBN;
< 	}
---
> 	Value -= RattBN;
1046,1048c970
< 		{
< 		  Value -= RookOpenFile;
< 		}
---
> 		Value -= RookOpenFile;
1054,1056c976
< 		    {
< 		      Value -= RookOpenFixedMinor;
< 		    }
---
> 		    Value -= RookOpenFixedMinor;
1058,1060c978
< 		    {
< 		      Value -= RookOpenMinor;
< 		    }
---
> 		    Value -= RookOpenMinor;
1071,1073c989
< 		    {
< 		      Value -= RookHalfOpenPawn;
< 		    }
---
> 		    Value -= RookHalfOpenPawn;
1077,1079c993
< 	    {
< 	      Value -= RookHalfOpenKing;
< 	    }
---
> 	    Value -= RookHalfOpenKing;
1096,1098c1010
< 	    {
< 	      Value -= RookKing8th;
< 	    }
---
> 	    Value -= RookKing8th;
1106,1108c1018
< 		{
< 		  Value -= DoubRook7thKingPawn;
< 		}
---
> 		Value -= DoubRook7thKingPawn;
1112,1114c1022
< 	{
< 	  Value -= Rook6thKingPawn;
< 	}
---
> 	Value -= Rook6thKingPawn;
1141,1143c1049
< 	{
< 	  Value -= BguardK;
< 	}
---
> 	Value -= BguardK;
1147,1149c1053
< 	{
< 	  Value -= bAttP;
< 	}
---
> 	Value -= bAttP;
1151,1153c1055
< 	{
< 	  Value -= bAttN;
< 	}
---
> 	Value -= bAttN;
1211,1213c1113
< 	{
< 	  Value -= NguardK;
< 	}
---
> 	Value -= NguardK;
1217,1219c1117
< 	{
< 	  Value -= NattP;
< 	}
---
> 	Value -= NattP;
1221,1223c1119
< 	{
< 	  Value -= NattB;
< 	}
---
> 	Value -= NattB;
1263,1265c1159
<     {
<       Value += KingAttUnguardedPawn;
<     }
---
>     Value += KingAttUnguardedPawn;
1282,1283c1176,1183
<   ch = (((KingSafetyMult[wKhit >> 16] *
< 	  (wKhit & 0xffff)) / KingSafetyDivider) << 16) + PAWN_INFO->wKdanger;
---
>   ch = (((KingSafetyMult[wKhit >> 16] * (wKhit & 0xffff)) / KingSafetyDivider)
> 	<< 16) + PAWN_INFO->wKdanger;
> #if 1
>   ch >>= 16;
>   ch *= UCI_KING_SAFETY_WEIGHTING;
>   ch >>= 10;
>   ch <<= 16;
> #endif
1313,1314c1213,1220
<   ch = (((KingSafetyMult[bKhit >> 16] *
< 	  (bKhit & 0xffff)) / KingSafetyDivider) << 16) + PAWN_INFO->bKdanger;
---
>   ch = (((KingSafetyMult[bKhit >> 16] * (bKhit & 0xffff)) / KingSafetyDivider)
> 	<< 16) + PAWN_INFO->bKdanger;
> #if 1
>   ch >>= 16;
>   ch *= UCI_KING_SAFETY_WEIGHTING;
>   ch >>= 10;
>   ch <<= 16;
> #endif
1325,1327c1231
<     {
<       Value += MultipleAtt;
<     }
---
>     Value += MultipleAtt;
1329,1331c1233
<     {
<       Value -= MultipleAtt;
<     }
---
>     Value -= MultipleAtt;
1362,1364c1264
< 		{
< 		  Value -= Rook7thEnd;
< 		}
---
> 		Value -= Rook7thEnd;
1366,1368c1266
< 		{
< 		  Value -= Rook6thEnd;
< 		}
---
> 		Value -= Rook6thEnd;
1374,1376c1272
< 	{
< 	  Value += PassedPawnCanMove[tr];
< 	}
---
> 	Value += PassedPawnCanMove[tr];
1378,1380c1274
< 	{
< 	  Value += PassedPawnMeClear[tr];
< 	}
---
> 	Value += PassedPawnMeClear[tr];
1382,1384c1276
< 	{
< 	  Value += PassedPawnOppClear[tr];
< 	}
---
> 	Value += PassedPawnOppClear[tr];
1386,1388c1278
< 	{
< 	  Value += PassedPawnIsFree[tr];
< 	}
---
> 	Value += PassedPawnIsFree[tr];
1392,1394c1282
< 	    {
< 	      Value -= Queen7thEnd;
< 	    }
---
> 	    Value -= Queen7thEnd;
1412,1414c1300
< 		{
< 		  Value += Rook7thEnd;
< 		}
---
> 		Value += Rook7thEnd;
1416,1418c1302
< 		{
< 		  Value += Rook6thEnd;
< 		}
---
> 		Value += Rook6thEnd;
1424,1426c1308
< 	{
< 	  Value -= PassedPawnCanMove[7 - tr];
< 	}
---
> 	Value -= PassedPawnCanMove[7 - tr];
1428,1430c1310
< 	{
< 	  Value -= PassedPawnMeClear[7 - tr];
< 	}
---
> 	Value -= PassedPawnMeClear[7 - tr];
1432,1434c1312
< 	{
< 	  Value -= PassedPawnOppClear[7 - tr];
< 	}
---
> 	Value -= PassedPawnOppClear[7 - tr];
1437,1439c1315
< 	{
< 	  Value -= PassedPawnIsFree[7 - tr];
< 	}
---
> 	Value -= PassedPawnIsFree[7 - tr];
1443,1445c1319
< 	    {
< 	      Value += Queen7thEnd;
< 	    }
---
> 	    Value += Queen7thEnd;
1609c1483
<   EvalHash[POSITION->DYN->HASH & HASH_MASK] =
---
>   EvalHash[POSITION->DYN->HASH & EVAL_HASH_MASK] =
1612,1614c1486
<     POSITION->wtm ?
<       AdjustPositionalGainW (POSITION, move) : AdjustPositionalGainB (POSITION, move);
< 
---
>     AdjustPositionalGain (POSITION, move);
diff 999963/exclude_node.c 999958/exclude_node.c
40c40
<                  VALUE, depth, POSITION->DYN->Value, Notate (MOVE, STRING1)));
---
>                  VALUE, depth, POSITION->DYN->Value, Notate (MOVE, STRING1[POSITION->cpu])));
263c263
<   int move, k, cnt, EXTEND;
---
>   int move, k, cnt;
274c274
<                  VALUE, depth, POSITION->DYN->Value, Notate (MOVE, STRING1)));
---
>                  VALUE, depth, POSITION->DYN->Value, Notate (MOVE, STRING1[POSITION->cpu])));
402,406c402
< 	      if (EARLY_GAME)
< 		EXTEND = 1;
< 	      else
< 		EXTEND = 0;
< 	      new_depth = depth - 2 - MIN (2, cnt) + EXTEND;
---
> 	      new_depth = depth - 2 - MIN (2, cnt) + EXTEND_IN_CHECK;
416,420c412
< 	  if (EARLY_GAME)
< 	    EXTEND = 1;
< 	  else
< 	    EXTEND = 0;
< 	  new_depth = depth - 2 + EXTEND;
---
> 	  new_depth = depth - 2 + EXTEND_IN_CHECK;
diff 999963/functions.h 999958/functions.h
1a2
> void NANO_SLEEP (int);
6c7
< void HaltSearch (int);
---
> void HaltSearch (int, int);
39d39
< #ifdef NEW_HASH
42,43c42,43
< void HashLowerNew (uint64, int, int, int);
< void HashUpperNew (uint64, int, int);
---
> void HashLowerNew (uint64, int, int, int, int);
> void HashUpperNew (uint64, int, int, int);
45,51c45,46
< #else
< void HashLowerALL (typePOS*, int, int, int);
< void HashUpperCUT (typePOS*, int, int);
< void HashLower (uint64, int, int, int);
< void HashUpper (uint64, int, int);
< void HashExact (typePOS*, int, int, int, int);
< #endif
---
> int InitPVHash (int);
> void PVHashClear ();
86,87c81,82
< int PVNodeWhite (typePOS*, int, int, int, int);
< int PVNodeBlack (typePOS*, int, int, int, int);
---
> int PVNodeWhite (typePOS*, int, int, int, int, type_zog_node*);
> int PVNodeBlack (typePOS*, int, int, int, int, type_zog_node*);
149c144,147
< void ivan_fail_high(SPLITPUNKT*, typePOS*, uint32);
---
> void ivan_fail_high (SPLITPUNKT*, typePOS*, uint32);
> void STUB_IVAN ();
> void thread_halt (typePOS*);
> void thread_stall (typePOS*, int);
176a175
> void MakeUndoSpeed (typePOS*);
188a188,195
> #ifdef BUILD_ZOG_MP_COMPILE
> void ZOG_ON ();
> void ZOG_OFF ();
> void ZOG_init ();
> void ZOG_TRAP (int);
> void ENTER_ZOG_NODE (type_zog_node*, int, boolean);
> int zog_root_node (typePOS*, int, int, int);
> #endif
PAWN : Knight >> Bishop >> Rook >>Queen

User avatar
kingliveson
Posts: 1388
Joined: Thu Jun 10, 2010 1:22 am
Real Name: Franklin Titus
Location: 28°32'1"N 81°22'33"W

Re: IvanHoe-Beta-999958m-Beta!

Post by kingliveson » Fri Jun 18, 2010 8:23 pm

Code: Select all

diff 999963/init_gen.i 999958/init_gen.i
47,52c47,52
<   CAPTURE_VALUE[wEnumK][bEnumQ] = (0xcb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[wEnumK][bEnumR] = (0xc3 << 24) + (0x00 << 20);
<   CAPTURE_VALUE[wEnumK][bEnumBL] = (0xbb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[wEnumK][bEnumBD] = (0xbb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[wEnumK][bEnumN] = (0xb3 << 24) + (0x00 << 20);
<   CAPTURE_VALUE[wEnumK][bEnumP] = (0xab << 24) + (0x00 << 20);
---
>   CAPTURE_VALUE[wEnumK][bEnumQ] = (0xcb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[wEnumK][bEnumR] = (0xc3 << 24) + (0x03 << 20);
>   CAPTURE_VALUE[wEnumK][bEnumBL] = (0xbb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[wEnumK][bEnumBD] = (0xbb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[wEnumK][bEnumN] = (0xb3 << 24) + (0x03 << 20);
>   CAPTURE_VALUE[wEnumK][bEnumP] = (0xab << 24) + (0x03 << 20);
104,109c104,109
<   CAPTURE_VALUE[bEnumK][wEnumQ] = (0xcb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[bEnumK][wEnumR] = (0xc3 << 24) + (0x00 << 20);
<   CAPTURE_VALUE[bEnumK][wEnumBL] = (0xbb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[bEnumK][wEnumBD] = (0xbb << 24) + (0x00 << 20);
<   CAPTURE_VALUE[bEnumK][wEnumN] = (0xb3 << 24) + (0x00 << 20);
<   CAPTURE_VALUE[bEnumK][wEnumP] = (0xab << 24) + (0x00 << 20);
---
>   CAPTURE_VALUE[bEnumK][wEnumQ] = (0xcb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[bEnumK][wEnumR] = (0xc3 << 24) + (0x03 << 20);
>   CAPTURE_VALUE[bEnumK][wEnumBL] = (0xbb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[bEnumK][wEnumBD] = (0xbb << 24) + (0x03 << 20);
>   CAPTURE_VALUE[bEnumK][wEnumN] = (0xb3 << 24) + (0x03 << 20);
>   CAPTURE_VALUE[bEnumK][wEnumP] = (0xab << 24) + (0x03 << 20);
diff 999963/input.c 999958/input.c
105a106,116
>   if (!memcmp (string, "PVHash", 6))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  Value = InitPVHash (Value);
> 	  SEND ("Optional PVHash %d\n", Value);
> 	  READYOK ();
> 	}
>     }
118a130,131
> 	  if (TITANIC_MODE)
> 	    ivan_init_smp ();
131c144,147
< 	    TITANIC_MODE = TRUE;
---
> 	    {
> 	      TITANIC_MODE = TRUE;
> 	      ivan_init_smp ();
> 	    }
206c222,223
<   if (!memcmp (string, "UCI_BishopPairScale", 19))
---
>   /********************************/  /********************************/
>   if (!memcmp (string, "UCI_White_Bishop_Pair_Scale", 27))
216,217c233,234
< 	  UCI_BishopPairScale = Value;
< 	  SEND ("Optional UCI_BishopPairScale %d\n", UCI_BishopPairScale);
---
> 	  UCI_White_Bishops_Scale = Value;
> 	  SEND ("Optional UCI_White_Bishop_Pair_Scale %d\n", UCI_White_Bishops_Scale);
223c240
<   if (!memcmp (string, "UCI_PawnScale", 13))
---
>   if (!memcmp (string, "UCI_White_Pawn_Scale", 20))
233,234c250,251
< 	  UCI_PawnScale = Value;
< 	  SEND ("Optional UCI_PawnScale %d\n", UCI_PawnScale);
---
> 	  UCI_White_Pawn_Scale = Value;
> 	  SEND ("Optional UCI_White_Pawn_Scale %d\n", UCI_White_Pawn_Scale);
240,241c257
< 
<   if (!memcmp (string, "UCI_KnightScale", 15))
---
>   if (!memcmp (string, "UCI_White_Knight_Scale", 22))
251,252c267,268
< 	  UCI_KnightScale = Value;
< 	  SEND ("Optional UCI_KnightScale %d\n", UCI_KnightScale);
---
> 	  UCI_White_Knight_Scale = Value;
> 	  SEND ("Optional UCI_White_Knight_Scale %d\n", UCI_White_Knight_Scale);
258c274
<   if (!memcmp (string, "UCI_BishopScale", 15))
---
>   if (!memcmp (string, "UCI_White_Light_Bishop_Scale", 28))
268,269c284,285
< 	  UCI_BishopScale = Value;
< 	  SEND ("Optional UCI_BishopScale %d\n", UCI_BishopScale);
---
> 	  UCI_White_Light_Scale = Value;
> 	  SEND ("Optional UCI_White_Light_Bishop_Scale %d\n", UCI_White_Light_Scale);
275,276c291,308
< 
<   if (!memcmp (string, "UCI_RookScale", 13))
---
>   if (!memcmp (string, "UCI_White_Dark_Bishop_Scale", 27))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 150)
> 	    Value = 150;
> 	  if (Value > 500)
> 	    Value = 500;
> 	  UCI_White_Dark_Scale = Value;
> 	  SEND ("Optional UCI_White_Dark_Bishop_Scale %d\n", UCI_White_Dark_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_White_Rook_Scale", 20))
286,287c318,319
< 	  UCI_RookScale = Value;
< 	  SEND ("Optional UCI_RookScale %d\n", UCI_RookScale);
---
> 	  UCI_White_Rook_Scale = Value;
> 	  SEND ("Optional UCI_White_Rook_Scale %d\n", UCI_White_Rook_Scale);
293c325
<   if (!memcmp (string, "UCI_QueenScale", 14))
---
>   if (!memcmp (string, "UCI_White_Queen_Scale", 21))
303,304c335,336
< 	  UCI_QueenScale = Value;
< 	  SEND ("Optional UCI_QueenScale %d\n", UCI_QueenScale);
---
> 	  UCI_White_Queen_Scale = Value;
> 	  SEND ("Optional UCI_White_Queen_Scale %d\n", UCI_White_Queen_Scale);
310c342,510
< 
---
>   /********************************/  /********************************/
>   if (!memcmp (string, "UCI_Black_Bishop_Pair_Scale", 27))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 0)
> 	    Value = 0;
> 	  if (Value > 150)
> 	    Value = 150;
> 	  UCI_Black_Bishops_Scale = Value;
> 	  SEND ("Optional UCI_Black_Bishop_Pair_Scale %d\n", UCI_Black_Bishops_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Pawn_Scale", 20))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 50)
> 	    Value = 50;
> 	  if (Value > 200)
> 	    Value = 200;
> 	  UCI_Black_Pawn_Scale = Value;
> 	  SEND ("Optional UCI_Black_Pawn_Scale %d\n", UCI_Black_Pawn_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Knight_Scale", 22))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 150)
> 	    Value = 150;
> 	  if (Value > 500)
> 	    Value = 500;
> 	  UCI_Black_Knight_Scale = Value;
> 	  SEND ("Optional UCI_Black_Knight_Scale %d\n", UCI_Black_Knight_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Light_Bishop_Scale", 28))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 150)
> 	    Value = 150;
> 	  if (Value > 500)
> 	    Value = 500;
> 	  UCI_Black_Light_Scale = Value;
> 	  SEND ("Optional UCI_Black_Light_Bishop_Scale %d\n", UCI_Black_Light_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Dark_Bishop_Scale", 27))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 150)
> 	    Value = 150;
> 	  if (Value > 500)
> 	    Value = 500;
> 	  UCI_Black_Dark_Scale = Value;
> 	  SEND ("Optional UCI_Black_Dark_Bishop_Scale %d\n", UCI_Black_Dark_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Rook_Scale", 20))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 300)
> 	    Value = 300;
> 	  if (Value > 700)
> 	    Value = 700;
> 	  UCI_Black_Rook_Scale = Value;
> 	  SEND ("Optional UCI_Black_Rook_Scale %d\n", UCI_Black_Rook_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "UCI_Black_Queen_Scale", 21))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 500)
> 	    Value = 500;
> 	  if (Value > 1500)
> 	    Value = 1500;
> 	  UCI_Black_Queen_Scale = Value;
> 	  SEND ("Optional UCI_Black_Queen_Scale %d\n", UCI_Black_Queen_Scale);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "MaterialWeighting", 17))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 512)
> 	    Value = 512;
> 	  if (Value > 2048)
> 	    Value = 2048;
> 	  UCI_MATERIAL_WEIGHTING = Value;
> 	  SEND ("Optional MaterialWeighting %d\n", UCI_MATERIAL_WEIGHTING);
> 	  InitMaterialValue ();
> 	  EvalHashClear ();
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "KingSafetyWeighting", 19))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 512)
> 	    Value = 512;
> 	  if (Value > 2048)
> 	    Value = 2048;
> 	  UCI_KING_SAFETY_WEIGHTING = Value;
> 	  SEND ("Optional KingSafetyWeighting %d\n", UCI_KING_SAFETY_WEIGHTING);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "PawnsWeighting", 14))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value < 512)
> 	    Value = 512;
> 	  if (Value > 2048)
> 	    Value = 2048;
> 	  UCI_PAWNS_WEIGHTING = Value;
> 	  SEND ("Optional PawnsWeighting %d\n", UCI_PAWNS_WEIGHTING);
> 	  PawnHashReset ();
> 	  READYOK ();
> 	}
>     }
>   /********************************/  /********************************/
324c524
< 
---
>   /********************************/  /********************************/
383a584,597
>   if (!memcmp (string, "TryPVinAnalysis", 15))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  if (!strcmp (v + 6, "false"))
> 	    TRY_PV_IN_ANALYSIS = FALSE;
> 	  if (!strcmp (v + 6, "true"))
> 	    TRY_PV_IN_ANALYSIS = TRUE;
> 	  SEND ("Optional TryPVinAnalysis %s\n",
> 		TRY_PV_IN_ANALYSIS ? "true" : "false");
> 	  READYOK ();
> 	}
>     }
397a612,625
>   if (!memcmp (string, "DoHashFull", 10))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  if (!strcmp (v + 6, "false"))
> 	    DO_HASH_FULL = FALSE;
> 	  if (!strcmp (v + 6, "true"))
> 	    DO_HASH_FULL = TRUE;
> 	  SEND ("Optional DoHashFull %s\n",
> 		DO_HASH_FULL ? "true" : "false");
> 	  READYOK ();
> 	}
>     }
416,417c644,645
<       EmitFen (POSITION, STRING1);
<       SEND ("info string %s\n", STRING1);
---
>       EmitFen (POSITION, STRING1[POSITION->cpu]);
>       SEND ("info string %s\n", STRING1[POSITION->cpu]);
541a770,930
> 
>   if (!memcmp (string, "TimeEasyFactor", 14))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  EASY_FACTOR = Value;
> 	  if (EASY_FACTOR <= 10)
> 	    EASY_FACTOR = 10;
> 	  if (EASY_FACTOR >= 500)
> 	    EASY_FACTOR = 500;
> 	  SEND ("Optional TimeEasyFactor %d\n", EASY_FACTOR);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeEasyFactorPonder", 20))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  EASY_FACTOR_PONDER = Value;
> 	  if (EASY_FACTOR_PONDER <= 10)
> 	    EASY_FACTOR_PONDER = 10;
> 	  if (EASY_FACTOR_PONDER >= 500)
> 	    EASY_FACTOR_PONDER = 500;
> 	  SEND ("Optional TimeEasyFactorPonder %d\n", EASY_FACTOR_PONDER);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeBattleFactor", 16))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  BATTLE_FACTOR = Value;
> 	  if (BATTLE_FACTOR <= 10)
> 	    BATTLE_FACTOR = 10;
> 	  if (BATTLE_FACTOR >= 500)
> 	    BATTLE_FACTOR = 500;
> 	  SEND ("Optional TimeBattleFactor %d\n", BATTLE_FACTOR);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeOrdinaryFactor", 18))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  ORDINARY_FACTOR = Value;
> 	  if (ORDINARY_FACTOR <= 10)
> 	    ORDINARY_FACTOR = 10;
> 	  if (ORDINARY_FACTOR >= 500)
> 	    ORDINARY_FACTOR = 500;
> 	  SEND ("Optional TimeOrdinaryFactor %d\n", ORDINARY_FACTOR);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeAbsolutePercent", 19))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  ABSOLUTE_PERCENT = Value;
> 	  if (ABSOLUTE_PERCENT <= 10)
> 	    ABSOLUTE_PERCENT = 10;
> 	  if (ABSOLUTE_PERCENT >= 100)
> 	    ABSOLUTE_PERCENT = 100;
> 	  SEND ("Optional TimeAbsolutePercent %d\n", ABSOLUTE_PERCENT);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeDesiredMillis", 17))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  DESIRED_MILLIS = Value;
> 	  if (DESIRED_MILLIS <= 10)
> 	    DESIRED_MILLIS = 10;
> 	  if (DESIRED_MILLIS >= 100)
> 	    DESIRED_MILLIS = 100;
> 	  SEND ("Optional TimeDesiredMillis %d\n", DESIRED_MILLIS);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "TimeBookExitMoves", 17))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  BOOK_EXIT_MOVES = Value;
> 	  if (BOOK_EXIT_MOVES <= 0)
> 	    BOOK_EXIT_MOVES = 0;
> 	  if (BOOK_EXIT_MOVES >= 20)
> 	    BOOK_EXIT_MOVES = 20;
> 	  SEND ("Optional TimeBookExitMoves %d\n", BOOK_EXIT_MOVES);
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "ExtraExtendInCheck", 18))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  if (!strcmp (v + 6, "false"))
> 	    EXTEND_IN_CHECK = FALSE;
> 	  if (!strcmp (v + 6, "true"))
> 	    EXTEND_IN_CHECK = TRUE;
> 	  SEND ("Optional ExtraExtendInCheck %s\n",
> 		EXTEND_IN_CHECK ? "true" : "false");
> 	  READYOK ();
> 	}
>     }
> 
> #ifdef BUILD_ZOG_MP_COMPILE
>   if (!memcmp (string, "ZOG MP Usage", 12))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  if (!strcmp (v + 6, "false"))
> 	    ZOG_OFF ();
> 	  if (!strcmp (v + 6, "true"))
> 	    {
> 	      if (!ZOG_AKTIV)
> 		ZOG_ON ();
> 	    }
> 	  SEND ("Optional ZOG MP Usage %s\n", ZOG_AKTIV ? "true" : "false");
> 	  READYOK ();
> 	}
>     }
>   if (!memcmp (string, "ZOG MP Records", 14))
>     {
>       v = strstr (string, "value");
>       if (v)
> 	{
> 	  Value = atoi (v + 6);
> 	  if (Value <= 1)
> 	    Value = 1;
> 	  if (Value >= 1024)
> 	    Value = 1024;
> 	  if (ZOG_AKTIV)
> 	    {
> 	      ZOG_OFF ();
> 	      ZOG_SIZE = Value << 10;
> 	      ZOG_ON ();
> 	    }
> 	  else
> 	    ZOG_SIZE = Value << 10;
> 	  SEND ("Optional ZOG MP Records %d\n", ZOG_SIZE >> 10);
> 	  READYOK ();
> 	}
>     }
> #endif
546c935
<   SEND ("id name %s verzione %s\n", EPONYM, VERSION);
---
>   SEND ("id name %s version %s\n", EPONYM, VERSION);
553c942
<   SEND ("id dedication To Vladimir Ilyich\n");
---
>   SEND ("id dedication To Vladimir Ilyich plus Zog 1 with Albania\n");
555c944,945
<   SEND ("option name PawnsHash type spin min 1 max 1024 default 2\n");
---
>   SEND ("option name PawnsHash (binary mb) type spin min 1 max 1024 default 2\n");
>   SEND ("option name PVHash (binary mb) type spin min 1 max 1024 default 1\n");
585,590c975,991
<   SEND ("option name UCI_BishopPairScale (centipawns) type spin min 0 max 150 default 45\n");
<   SEND ("option name UCI_PawnScale (centipawns) type spin min 50 max 200 default 100\n");
<   SEND ("option name UCI_KnightScale (centipawns) type spin min 150 max 500 default 300\n");
<   SEND ("option name UCI_BishopScale (centipawns) type spin min 150 max 500 default 310\n");
<   SEND ("option name UCI_RookScale (centipawns) type spin min 300 max 700 default 500\n");
<   SEND ("option name UCI_QueenScale (centipawns) type spin min 500 max 1500 default 950\n");
---
>   SEND ("option name UCI_White_Bishop_Pair_Scale (cp) type spin min 0 max 150 default 45\n");
>   SEND ("option name UCI_White_Pawn_Scale (cp) type spin min 50 max 200 default 100\n");
>   SEND ("option name UCI_White_Knight_Scale (cp) type spin min 150 max 500 default 300\n");
>   SEND ("option name UCI_White_Light_Bishop_Scale (cp) type spin min 150 max 500 default 310\n");
>   SEND ("option name UCI_White_Dark_Bishop_Scale (cp) type spin min 150 max 500 default 310\n");
>   SEND ("option name UCI_White_Rook_Scale (cp) type spin min 300 max 700 default 500\n");
>   SEND ("option name UCI_White_Queen_Scale (cp) type spin min 500 max 1500 default 950\n");
>   SEND ("option name UCI_Black_Bishop_Pair_Scale (cp) type spin min 0 max 150 default 45\n");
>   SEND ("option name UCI_Black_Pawn_Scale (cp) type spin min 50 max 200 default 100\n");
>   SEND ("option name UCI_Black_Knight_Scale (cp) type spin min 150 max 500 default 300\n");
>   SEND ("option name UCI_Black_Light_Bishop_Scale (cp) type spin min 150 max 500 default 310\n");
>   SEND ("option name UCI_Black_Dark_Bishop_Scale (cp) type spin min 150 max 500 default 310\n");
>   SEND ("option name UCI_Black_Rook_Scale (cp) type spin min 300 max 700 default 500\n");
>   SEND ("option name UCI_Black_Queen_Scale (cp) type spin min 500 max 1500 default 950\n");
>   SEND ("option name MaterialWeighting type spin min 512 max 2048 default 1024\n");
>   SEND ("option name KingSafetyWeighting type spin min 512 max 2048 default 1024\n");
>   SEND ("option name PawnsWeighting type spin min 512 max 2048 default 1024\n");
591a993
>   SEND ("option name TryPVinAnalysis type check default true\n");
592a995
>   SEND ("option name DoHashFull type check default true\n");
594a998,1010
>   SEND ("option name TimeEasyFactor type spin min 10 max 500 default 15\n");
>   SEND ("option name TimeEasyFactorPonder type spin min 10 max 500 default 33\n");
>   SEND ("option name TimeBattleFactor type spin min 10 max 500 default 100\n");
>   SEND ("option name TimeOrdinaryFactor type spin min 10 max 500 default 75\n");
>   SEND ("option name TimeAbsolutePercent type spin min 10 max 100 default 25\n");
>   SEND ("option name TimeDesiredMillis type spin min 10 max 100 default 40\n");
>   SEND ("option name TimeBookExitMoves type spin min 0 max 20 default 0\n");
>   SEND ("option name ExtraExtendInCheck type check default false \n");
>   
> #ifdef BUILD_ZOG_MP_COMPILE
>   SEND ("option name ZOG MP Usage type check default false\n");
>   SEND ("option name ZOG MP Records (binary kilos) type spin min 1 max 1024 default 4\n");
> #endif
609a1026
>   UCI_NEW_GAME = FALSE;
613c1030,1042
<     HaltSearch (0);
---
>     {
>       if (SEARCH_IS_DONE)
> 	return;
>       HaltSearch (0, 0); /* no return when JUMP_IS_SET */
>       if (INFINITE_LOOP)
> 	return;
>       STALL_MODE = TRUE;
>       while (!SEARCH_IS_DONE)
> 	NANO_SLEEP (1000000);
>       STALL_MODE = FALSE;
>       SUPPRESS_INPUT = FALSE;
>       return;
>     }
615,617c1044,1052
<     readyok ();
<   if (!strcmp (I, "ponderhit"))
<     ponderhit ();
---
>     {
>       readyok ();
>       return;
>     }
>   if (!strcmp (I, "ponderhit")) /* cuidado con ZOG? Personal Opinion: for the OK! */
>     {
>       ponderhit ();
>       return;
>     }
620,621c1055,1069
<       HaltSearch (0);
<       NewGame (POSITION, TRUE);
---
>       if (SEARCH_IS_DONE)
> 	{
> 	  NewGame (POSITION, TRUE);
> 	  return;
> 	}
>       UCI_NEW_GAME = TRUE;
>       HaltSearch (0, 0); /* no return when JUMP_IS_SET */
>       if (INFINITE_LOOP)
> 	return;
>       STALL_MODE = TRUE;
>       while (!SEARCH_IS_DONE)
> 	NANO_SLEEP (1000000);
>       STALL_MODE = FALSE;
>       SUPPRESS_INPUT = FALSE;
>       return;
629a1078,1079
>   if (!strcmp (I, "makeundo"))
>     MakeUndoSpeed (POSITION);
679c1129
<   SUPPRESS_INPUT = FALSE;
---
>   SUPPRESS_INPUT = FALSE; /* ??? */
706c1156
< #include <unistd.h> /* LINUX */  /* tested multiple hours with instant stop */
---
> #include <unistd.h> /* LINUX */
713c1163
<   while (INPUT_BUFFER[r++] != '\n') /* newline, is always? MAC OS X? who cares!*/
---
>   while (INPUT_BUFFER[r++] != '\n') /* newline, is always? MAC OS X? */
diff 999963/low_depth.c 999958/low_depth.c
55a56,57
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return 0;
151c153
< 	  && (move & 0xe000) == 0 && SqSet[fr] & ~MyXRAY
---
> 	  && (move & 0xe000) == 0 && (SqSet[fr] & ~MyXRAY)
162,163c164,165
< 	  && SqSet[fr] & ~MyXRAY && POSITION->sq[fr] != EnumMyK
< 	  && !MoveIsEP (move) && move != trans_move && !MySEE (POSITION, move))
---
> 	  && (SqSet[fr] & ~MyXRAY) && !MoveIsEP (move)
> 	  && move != trans_move && !MySEE (POSITION, move))
168d169
< 
243a245,246
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return (HEIGHT (POSITION) - VALUE_MATE);
332c335
< 	v = -OppLowDepthCheck (POSITION, 1 - VALUE, depth - 1 + (EARLY_GAME));
---
> 	v = -OppLowDepthCheck (POSITION, 1 - VALUE, depth - 1 + EXTEND_IN_CHECK);
335c338
< 	  new_depth = depth - 2 + EARLY_GAME;
---
> 	  new_depth = depth - 2 + EXTEND_IN_CHECK;
diff 999963/main.c 999958/main.c
56c56
<   printf ("%s verzione %s\n", EPONYM, VERSION);
---
>   printf ("%s VERSION %s\n", EPONYM, VERSION);
74a75,78
> #ifdef BUILD_ZOG_MP_COMPILE
>   printf ("compiled with ZOG MP, sizeof %d+%d\n",
> 	  (int) (sizeof (type_zog_node)), (int) (2 * sizeof (typeDYNAMIC)));
> #endif
84c88
<     malloc (MAXIMUM_PLY * sizeof(typeDYNAMIC));
---
>     malloc (MAXIMUM_PLY * sizeof (typeDYNAMIC));
90a95
>   SMP_HAS_AKTIV = FALSE;
92a98
>   InitPVHash (1);
97,102c103,119
<   UCI_BishopPairScale = 45;
<   UCI_PawnScale = 100;
<   UCI_KnightScale = 300;
<   UCI_BishopScale = 310;
<   UCI_RookScale = 500;
<   UCI_QueenScale = 950;
---
>   UCI_White_Bishops_Scale = 45;
>   UCI_White_Pawn_Scale = 100;
>   UCI_White_Knight_Scale = 300;
>   UCI_White_Light_Scale = 310;
>   UCI_White_Dark_Scale = 310;
>   UCI_White_Rook_Scale = 500;
>   UCI_White_Queen_Scale = 950;
>   UCI_Black_Bishops_Scale = 45;
>   UCI_Black_Pawn_Scale = 100;
>   UCI_Black_Knight_Scale = 300;
>   UCI_Black_Light_Scale = 310;
>   UCI_Black_Dark_Scale = 310;
>   UCI_Black_Rook_Scale = 500;
>   UCI_Black_Queen_Scale = 950;
>   UCI_MATERIAL_WEIGHTING = 1024;
>   UCI_PAWNS_WEIGHTING = 1024;
>   UCI_KING_SAFETY_WEIGHTING = 1024;
122c139,140
<   SEND_HASH = FALSE;
---
>   SEND_HASH = TRUE;
>   DO_HASH_FULL = TRUE;
123a142
>   ZOG_AKTIV = FALSE;
126c145,146
< 
---
>   SEARCH_IS_DONE = TRUE;
>   INFINITE_LOOP = FALSE;
131a152
>   TRY_PV_IN_ANALYSIS = TRUE;
148a170,172
> #ifdef BUILD_ZOG_MP_COMPILE
>   ZOG_init ();
> #endif
151a176,185
>   STALL_MODE = FALSE;
>   SINCE_NEW_GAME = 0;
>   EASY_FACTOR = 15;
>   EASY_FACTOR_PONDER = 33;
>   BATTLE_FACTOR = 100;
>   ORDINARY_FACTOR = 75;
>   ABSOLUTE_PERCENT = 25;
>   DESIRED_MILLIS =  40;
>   BOOK_EXIT_MOVES = 0;
>   EXTEND_IN_CHECK = FALSE;
diff 999963/make_move.c 999958/make_move.c
106c106
< 	 printf ("Mw %d %s\n", HEIGHT(POSITION), Notate(move, STRING1)));
---
> 	 printf ("Mw %d %s\n", HEIGHT(POSITION), Notate(move, STRING1[POSITION->cpu])));
108c108
<   if (POSITION->cpu == 0)
---
>   if (!TITANIC_MODE) /* new */
231c231
< 	 printf ("Mb %d %s\n", HEIGHT(POSITION), Notate(move, STRING1)));
---
> 	 printf ("Mb %d %s\n", HEIGHT(POSITION), Notate(move, STRING1[POSITION->cpu])));
diff 999963/material_value.c 999958/material_value.c
15,16c15,16
< static int InitFlags (int wP, int wN, int wB, int wBL,  int wBD, int wR, int wQ,
< 		      int bP, int bN, int bB, int bB1, int bB2, int bR, int bQ)
---
> static int InitFlags (int wP, int wN, int wB, int wBL, int wBD, int wR, int wQ,
> 		      int bP, int bN, int bB, int bBL, int bBD, int bR, int bQ)
33c33
<       if ((wBL == 1 && bB2 == 1) || (wBD == 1 && bB1 == 1))
---
>       if ((wBL == 1 && bBD == 1) || (wBD == 1 && bBL == 1))
63c63
< 		       int bP, int bN, int bB, int bB1, int bB2, int bR, int bQ)
---
> 		       int bP, int bN, int bB, int bBL, int bBD, int bR, int bQ)
75,76c75,76
<       if ((wBL == 1 && wBD == 0 && bB1 == 0 && bB2 == 1) ||
< 	  (wBL == 0 && wBD == 1 && bB1 == 1 && bB2 == 0))
---
>       if ((wBL == 1 && wBD == 0 && bBL == 0 && bBD == 1) ||
> 	  (wBL == 0 && wBD == 1 && bBL == 1 && bBD == 0))
90,91c90,91
<       if ((wBL == 1 && wBD == 0 && bB1 == 0 && bB2 == 1) ||
< 	  (wBL == 0 && wBD == 1 && bB1 == 1 && bB2 == 0))
---
>       if ((wBL == 1 && wBD == 0 && bBL == 0 && bBD == 1) ||
> 	  (wBL == 0 && wBD == 1 && bBL == 1 && bBD == 0))
98c98
< 			int bP, int bN, int bB, int bB1, int bB2, int bR, int bQ)
---
> 			int bP, int bN, int bB, int bBL, int bBD, int bR, int bQ)
150c150
< 		  && ((wBL == 1 && bB1 == 1) || (wBD == 1 && bB2 == 1)))
---
> 		  && ((wBL == 1 && bBL == 1) || (wBD == 1 && bBD == 1)))
153c153
< 		  && ((wBD == 1 && bB1 == 1) || (wBL == 1 && bB2 == 1)))
---
> 		  && ((wBD == 1 && bBL == 1) || (wBL == 1 && bBD == 1)))
363c363
< 			int bP, int bN, int bB, int bB1, int bB2, int bR, int bQ)
---
> 			int bP, int bN, int bB, int bBL, int bBD, int bR, int bQ)
415c415
< 		  && ((bB1 == 1 && wBL == 1) || (bB2 == 1 && wBD == 1)))
---
> 		  && ((bBL == 1 && wBL == 1) || (bBD == 1 && wBD == 1)))
418c418
< 		  && ((bB2 == 1 && wBL == 1) || (bB1 == 1 && wBD == 1)))
---
> 		  && ((bBD == 1 && wBL == 1) || (bBL == 1 && wBD == 1)))
631,637c631,647
<   VALUE4 ( (w * av) / sc, (x * av) / sc, (y * av) / sc, (z * av) / sc)
< #define BishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_BishopPairScale)
< #define ValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_PawnScale)
< #define ValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_KnightScale)
< #define ValueB VALUE4_SCALED (280, 295, 325, 360, 310, UCI_BishopScale)
< #define ValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_RookScale)
< #define ValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_QueenScale)
---
>   VALUE4 ( (w * sc) / av, (x * sc) / av, (y * sc) / av, (z * sc) / av)
> 
> #define wBishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_White_Bishops_Scale)
> #define wValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_White_Pawn_Scale)
> #define wValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_White_Knight_Scale)
> #define wValueBL VALUE4_SCALED (280, 295, 325, 360, 310, UCI_White_Light_Scale)
> #define wValueBD VALUE4_SCALED (280, 295, 325, 360, 310, UCI_White_Dark_Scale)
> #define wValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_White_Rook_Scale)
> #define wValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_White_Queen_Scale)
> #define bBishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_Black_Bishops_Scale)
> #define bValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_Black_Pawn_Scale)
> #define bValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_Black_Knight_Scale)
> #define bValueBL VALUE4_SCALED (280, 295, 325, 360, 310, UCI_Black_Light_Scale)
> #define bValueBD VALUE4_SCALED (280, 295, 325, 360, 310, UCI_Black_Dark_Scale)
> #define bValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_Black_Rook_Scale)
> #define bValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_Black_Queen_Scale)
> 
641,642c651,653
< static uint64 ComputeValue (int wP, int wN, int wB, int wBL, int wBD, int wR, int wQ,
< 			    int bP, int bN, int bB, int bB1, int bB2, int bR, int bQ)
---
> static uint64 ComputeValue
> (int wP, int wN, int wB, int wBL, int wBD, int wR, int wQ,
>  int bP, int bN, int bB, int bBL, int bBD, int bR, int bQ)
647,652c658,664
<   va += (wB / 2 - bB / 2) * BishopPair;
<   va += (wP - bP) * ValueP;
<   va += (wN - bN) * ValueN;
<   va += (wB - bB) * ValueB;
<   va += (wR - bR) * ValueR;
<   va += (wQ - bQ) * ValueQ;
---
>   va += (wB / 2) * wBishopPair - (bB / 2) * bBishopPair;
>   va += wP * wValueP - bP * bValueP;
>   va += wN * wValueN - bN * bValueN;
>   va += wBL * wValueBL - bBL * bValueBL;
>   va += wBD * wValueBD - bBD * bValueBD;
>   va += wR * wValueR - bR * bValueR;
>   va += wQ * wValueQ - bQ * bValueQ;
678c690
<   int wQ, bQ, wR, bR, wBL, bB1, wBD, bB2, wN, bN, wP, bP, n, Value, wB, bB;
---
>   int wQ, bQ, wR, bR, wBL, bBL, wBD, bBD, wN, bN, wP, bP, n, Value, wB, bB;
694c706
<   bB1 = n % 2;
---
>   bBL = n % 2;
696c708
<   bB2 = n % 2;
---
>   bBD = n % 2;
706,707c718,719
<   bB = bB1 + bB2;
<   va = ComputeValue (wP, wN, wB, wBL, wBD, wR, wQ, bP, bN, bB, bB1, bB2, bR, bQ);
---
>   bB = bBL + bBD;
>   va = ComputeValue (wP, wN, wB, wBL, wBD, wR, wQ, bP, bN, bB, bBL, bBD, bR, bQ);
740c752
< 			 bP, bN, bB, bB1, bB2, bR, bQ);
---
> 			 bP, bN, bB, bBL, bBD, bR, bQ);
742c754
< 			 bP, bN, bB, bB1, bB2, bR, bQ);
---
> 			 bP, bN, bB, bBL, bBD, bR, bQ);
748a761,762
>   Value *= UCI_MATERIAL_WEIGHTING;
>   Value >>= 10;
751c765
< 				  bP, bN, bB, bB1, bB2, bR, bQ);
---
> 				  bP, bN, bB, bBL, bBD, bR, bQ);
753c767
< 				 bP, bN, bB, bB1, bB2, bR, bQ);
---
> 				 bP, bN, bB, bBL, bBD, bR, bQ);
diff 999963/matval_explain.c 999958/matval_explain.c
634,640c634,648
<   VALUE4 ( (w * av) / sc, (x * av) / sc, (y * av) / sc, (z * av) / sc)
< #define BishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_BishopPairScale)
< #define ValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_PawnScale)
< #define ValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_KnightScale)
< #define ValueB VALUE4_SCALED (280, 295, 325, 360, 310, UCI_BishopScale)
< #define ValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_RookScale)
< #define ValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_QueenScale)
---
>   VALUE4 ( (w * sc) / av, (x * sc) / av, (y * sc) / av, (z * sc) / av)
> #define wBishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_White_Bishops_Scale)
> #define wValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_White_Pawn_Scale)
> #define wValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_White_Knight_Scale)
> #define wValueBL VALUE4_SCALED (280, 295, 325, 360, 310, UCI_White_Light_Scale)
> #define wValueBD VALUE4_SCALED (280, 295, 325, 360, 310, UCI_White_Dark_Scale)
> #define wValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_White_Rook_Scale)
> #define wValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_White_Queen_Scale)
> #define bBishopPair VALUE4_SCALED (35, 40, 50, 55, 45, UCI_Black_Bishops_Scale)
> #define bValueP VALUE4_SCALED (80, 90, 110, 125, 100, UCI_Black_Pawn_Scale)
> #define bValueN VALUE4_SCALED (265, 280, 320, 355, 300, UCI_Black_Knight_Scale)
> #define bValueBL VALUE4_SCALED (280, 295, 325, 360, 310, UCI_Black_Light_Scale)
> #define bValueBD VALUE4_SCALED (280, 295, 325, 360, 310, UCI_Black_Dark_Scale)
> #define bValueR VALUE4_SCALED (405, 450, 550, 610, 500, UCI_Black_Rook_Scale)
> #define bValueQ VALUE4_SCALED (800, 875, 1025, 1150, 950, UCI_Black_Queen_Scale)
651,656c659,666
<   va += (wB / 2 - bB / 2) * BishopPair;
<   va += (wP - bP) * ValueP;
<   va += (wN - bN) * ValueN;
<   va += (wB - bB) * ValueB;
<   va += (wR - bR) * ValueR;
<   va += (wQ - bQ) * ValueQ;
---
>   va += (wB / 2) * wBishopPair - (bB / 2) * bBishopPair;
>   va += wP * wValueP - bP * bValueP;
>   va += wN * wValueN - bN * bValueN;
>   va += wBL * wValueBL - bBL * bValueBL;
>   va += wBD * wValueBD - bBD * bValueBD;
>   va += wR * wValueR - bR * bValueR;
>   va += wQ * wValueQ - bQ * bValueQ;
> 
diff 999963/move_gen.c 999958/move_gen.c
184,185c184
< 	Add (LIST, FROM_LEFT (to) | to,
< 		CAPTURE_VALUE[EnumMyP][c]);
---
> 	Add (LIST, FROM_LEFT (to) | to, CAPTURE_VALUE[EnumMyP][c]);
195c194
< 		  (0x20 << 24) + CAPTURE_VALUE[EnumMyP][c]);
---
> 	       (0x20 << 24) + CAPTURE_VALUE[EnumMyP][c]);
273,275c272,273
<   for (U =
<        FORWARD_SHIFT (BitboardMyP & SECOND_SIXTH_RANKS) & empty;
<        U; BitClear (sq, U))
---
>   for (U = FORWARD_SHIFT (BitboardMyP & SECOND_SIXTH_RANKS) & empty; U;
>        BitClear (sq, U))
385c383
<   T = AttK[sq] & mask;
---
>   T = AttK[sq] & mask & (~OppAttacked);
422c420
<   int to, sq, requ = OppKingSq;
---
>   int to, sq, opks = OppKingSq;
430c428
<   PAWN = MyAttackedPawns[requ];
---
>   PAWN = MyAttackedPawns[opks];
432c430
<     ROOK = AttR (requ);
---
>     ROOK = AttR (opks);
434c432
<     BISHOP = AttB (requ);
---
>     BISHOP = AttB (opks);
470c468
<       MovesTo (T, EnumMyN, AttN[requ]);
---
>       MovesTo (T, EnumMyN, AttN[opks]);
491c489
<   int requ, king, sq, to, fr, pi;
---
>   int opks, king, sq, to, fr, pi;
565c563
<   requ = OppKingSq;
---
>   opks = OppKingSq;
567c565
<       MyAttackedPawns[requ];
---
>       MyAttackedPawns[opks];
575c573
<       MyAttackedPawns[requ];
---
>       MyAttackedPawns[opks];
651c649
<       && POSITION->sq[BACK_RIGHT (requ)] == 0)
---
>       && POSITION->sq[BACK_RIGHT (opks)] == 0)
653c651
<       if (POSITION->sq[BACK_RIGHT2 (requ)] == EnumMyP)
---
>       if (POSITION->sq[BACK_RIGHT2 (opks)] == EnumMyP)
655,656c653,654
< 	  fr = BACK_RIGHT2 (requ);
< 	  to = BACK_RIGHT (requ);
---
> 	  fr = BACK_RIGHT2 (opks);
> 	  to = BACK_RIGHT (opks);
661,663c659,661
<       if (RANK (requ) == NUMBER_RANK5
< 	  && POSITION->sq[BACK_RIGHT2 (requ)] == 0
< 	  && POSITION->sq[BACK_RIGHT3 (requ)] == EnumMyP)
---
>       if (RANK (opks) == NUMBER_RANK5
> 	  && POSITION->sq[BACK_RIGHT2 (opks)] == 0
> 	  && POSITION->sq[BACK_RIGHT3 (opks)] == EnumMyP)
665,666c663,664
< 	  to = BACK_RIGHT (requ);
< 	  fr = BACK_RIGHT3 (requ);
---
> 	  to = BACK_RIGHT (opks);
> 	  fr = BACK_RIGHT3 (opks);
673c671
<       && POSITION->sq[BACK_LEFT (requ)] == 0)
---
>       && POSITION->sq[BACK_LEFT (opks)] == 0)
675c673
<       if (POSITION->sq[BACK_LEFT2 (requ)] == EnumMyP)
---
>       if (POSITION->sq[BACK_LEFT2 (opks)] == EnumMyP)
677,678c675,676
< 	  fr = BACK_LEFT2 (requ);
< 	  to = BACK_LEFT (requ);
---
> 	  fr = BACK_LEFT2 (opks);
> 	  to = BACK_LEFT (opks);
683,685c681,683
<       if (RANK (requ) == NUMBER_RANK5
< 	  && POSITION->sq[BACK_LEFT2 (requ)] == 0
< 	  && POSITION->sq[BACK_LEFT3 (requ)] == EnumMyP)
---
>       if (RANK (opks) == NUMBER_RANK5
> 	  && POSITION->sq[BACK_LEFT2 (opks)] == 0
> 	  && POSITION->sq[BACK_LEFT3 (opks)] == EnumMyP)
687,688c685,686
< 	  to = BACK_LEFT (requ);
< 	  fr = BACK_LEFT3 (requ);
---
> 	  to = BACK_LEFT (opks);
> 	  fr = BACK_LEFT3 (opks);
diff 999963/ok_move.c 999958/ok_move.c
14c14
<   uint64 mask;
---
>   uint64 toSet;
16c16
<   mask = SqSet[to];
---
>   toSet = SqSet[to];
37c37
< 	  if (SqSet[to] & OppOccupied)
---
> 	  if (toSet & OppOccupied)
43c43
< 	  if ((SqSet[to] & POSITION->OccupiedBW) == 0)
---
> 	  if ((toSet & POSITION->OccupiedBW) == 0)
55c55
<       if (AttN[fr] & mask)
---
>       if (AttN[fr] & toSet)
61c61
<       if (AttB (fr) & mask)
---
>       if (AttB (fr) & toSet)
84c84
<       if (AttR (fr) & mask)
---
>       if (AttR (fr) & toSet)
90c90
<       if (AttQ (fr) & mask)
---
>       if (AttQ (fr) & toSet)
96c96
<       if (AttK[fr] & mask && (SqSet[to] & OppAttacked) == 0)
---
>       if (AttK[fr] & toSet && (toSet & OppAttacked) == 0)
diff 999963/pawn_eval.c 999958/pawn_eval.c
14a15
> #if 1
41a43,71
> #else
> const uint8 SHELTERaa[8] = { 45, 0, 10, 30, 40, 40, 40, 40 };
> const uint8 SHELTERab[8] = { 55, 0, 15, 40, 50, 55, 55, 55 };
> const uint8 SHELTERac[8] = { 20, 0, 5, 10, 15, 15, 20, 20 };
> const uint8 STORMaa[8] = { 10, 0, 35, 15, 5, 0, 0, 0 };
> const uint8 STORMab[8] = { 15, 0, 60, 25, 10, 0, 0, 0 };
> const uint8 STORMac[8] = { 5, 0, 25, 10, 5, 0, 0, 0 };
> 
> const uint8 SHELTERba[8] = { 30, 0, 5, 15, 20, 25, 25, 25 };
> const uint8 SHELTERbb[8] = { 55, 0, 15, 40, 50, 55, 55, 55 };
> const uint8 SHELTERbc[8] = { 30, 0, 10, 20, 25, 30, 30, 30 };
> const uint8 STORMba[8] = { 5, 0, 35, 15, 5, 0, 0, 0 };
> const uint8 STORMbb[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> const uint8 STORMbc[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> 
> const uint8 SHELTERcb[8] = { 30, 0, 5, 15, 20, 25, 25, 25 };
> const uint8 SHELTERcc[8] = { 55, 0, 15, 40, 50, 55, 55, 55 };
> const uint8 SHELTERcd[8] = { 30, 0, 10, 20, 25, 30, 30, 30 };
> const uint8 STORMcb[8] = { 5, 0, 35, 15, 5, 0, 0, 0 };
> const uint8 STORMcc[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> const uint8 STORMcd[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> 
> const uint8 SHELTERdc[8] = { 30, 0, 5, 15, 20, 25, 25, 25 };
> const uint8 SHELTERdd[8] = { 55, 0, 15, 40, 50, 55, 55, 55 };
> const uint8 SHELTERde[8] = { 30, 0, 10, 20, 25, 30, 30, 30 };
> const uint8 STORMdc[8] = { 5, 0, 35, 15, 5, 0, 0, 0 };
> const uint8 STORMdd[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> const uint8 STORMde[8] = { 10, 0, 50, 20, 10, 0, 0, 0 };
> #endif
286,288c316
< 	    {
< 	      Value -= Islands;
< 	    }
---
> 	    Value -= Islands;
323,325c351
< 	{
< 	  Value -= Hole;
< 	}
---
> 	Value -= Hole;
352,354c378
< 		{
< 		  Value -= BackwardClosed;
< 		}
---
> 		Value -= BackwardClosed;
363,365c387
< 	    {
< 	      Value -= DoubledOpenIsolated;
< 	    }
---
> 	    Value -= DoubledOpenIsolated;
368,370c390
< 	{
< 	  Value -= IsolatedOpen;
< 	}
---
> 	Value -= IsolatedOpen;
383,385c403
< 		{
< 		  Value -= BackwardOpen;
< 		}
---
> 		Value -= BackwardOpen;
439,441c457
< 	    {
< 	      Value += Islands;
< 	    }
---
> 	    Value += Islands;
487,489c503
< 		{
< 		  Value += DoubledClosedIsolated;
< 		}
---
> 		Value += DoubledClosedIsolated;
502,503c516
< 		  if ((bBitboardP & AttPw[b - 8]) ==
< 		      0)
---
> 		  if ((bBitboardP & AttPw[b - 8]) == 0)
507,509c520
< 		{
< 		  Value += BackwardClosed;
< 		}
---
> 		Value += BackwardClosed;
523,525c534
< 	{
< 	  Value += IsolatedOpen;
< 	}
---
> 	Value += IsolatedOpen;
538,540c547
< 		{
< 		  Value += BackwardOpen;
< 		}
---
> 		Value += BackwardOpen;
579,581c586
< 	{
< 	  continue;
< 	}
---
> 	continue;
604,606c609
<     {
<       Value += BestBlackKingDistance - BestWhiteKingDistance;
<     }
---
>     Value += BestBlackKingDistance - BestWhiteKingDistance;
610,612c613
<     {
<       Value += KingAttPawn;
<     }
---
>     Value += KingAttPawn;
614,616c615
<     {
<       Value += KingOO;
<     }
---
>     Value += KingOO;
618,620c617
<     {
<       Value += KingOOO;
<     }
---
>     Value += KingOOO;
623,625c620
<     {
<       Value -= KingAttPawn;
<     }
---
>     Value -= KingAttPawn;
627,629c622
<     {
<       Value -= KingOO;
<     }
---
>     Value -= KingOO;
631,633c624,635
<     {
<       Value -= KingOOO;
<     }
---
>     Value -= KingOOO;
>   if (1)
>   {
>     int v1,v2;
>     v1 = (sint16) (Value & 0xffff);
>     v2 = (v1 < 0) + (sint16) ((Value >> 16) & 0xffff);
>     v1 *= UCI_PAWNS_WEIGHTING;
>     v1 >>= 10;
>     v2 *= UCI_PAWNS_WEIGHTING;
>     v2 >>= 10;
>     Value = SCORE (v2, v1);
>   }
diff 999963/perft.c 999958/perft.c
98c98
< 	  printf ("%s ",Notate (LM[i].move, STRING1));
---
> 	  printf ("%s ",Notate (LM[i].move, STRING1[POSITION->cpu]));
diff 999963/pv_node.c 999958/pv_node.c
5a6,12
> #ifdef BUILD_ZOG_MP_COMPILE
> void NEW_ZOG_NODE (typePOS*, int, int, int, type_zog_node*, uint32);
> int TRY_ZOG_NODE (typePOS*, int, int, int, type_zog_node*, uint32);
> typedef enum
>   { NO_ZOG, ZOG_IS_BUSY, ZOG_MOVE_LESS, ZOG_MOVE_FORCED} zogs;
> #define MIN_ZOG_DEPTH 10
> #endif
23c30,31
< int MyPV (typePOS* POSITION, int ALPHA, int BETA, int depth, int check)
---
> int MyPV (typePOS* POSITION, int ALPHA, int BETA,
> 	  int depth, int check, type_zog_node *parent)
32c40
<   int SINGULAR;
---
>   int SINGULAR, LMR, cnt, MEDIAN, MARGIN;
42a51,52
>   MEDIAN = (BETA + ALPHA) / 2;
>   MARGIN = (BETA - ALPHA);
57a68
>   /* usa PVHash ? */
65c76,78
< 	  trans_depth = trans->DepthLower;
---
> 	  if (trans->flags & FLAG_MOVE_LESS)
> 	    return (check) ? (HEIGHT (POSITION) - VALUE_MATE) : 0;
> 	  trans_depth = trans->DepthLower; /* move_depth */
71a85,94
> 	  trans_depth = MAX (trans->DepthLower, trans->DepthUpper);
> 	  if (IsExact (trans) && trans_depth >= depth)
> 	    {
> 	      Value = HashLowerBound (trans); /* the either */
> 	      UPDATE_AGE();
> 	      if (!ANALYSING || !TRY_PV_IN_ANALYSIS)
> 		RETURN (Value);
> 	    }
> 	  if (trans_depth > hash_depth)
> 	    hash_depth = trans_depth;
74d96
< 	      trans_depth = trans->DepthLower;
75a98,100
> 	      if (trans->flags & LOWER_FROM_PV &&
> 		  trans_depth >= depth && Value >= BETA)
> 		RETURN (BETA);
79d103
< 	      trans_depth = trans->DepthUpper;
80a105,107
> 	      if (trans->flags & UPPER_FROM_PV &&
> 		  trans_depth >= depth && Value <= ALPHA)
> 		RETURN (ALPHA);
82,89d108
< 	  if (trans_depth > hash_depth)
< 	    hash_depth = trans_depth;
< 	  if (IsExact (trans) && trans_depth >= depth)
< 	    {
< 	      UPDATE_AGE();
< 	      if (!ANALYSING)
< 		RETURN (Value);
< 	    }
93c112,126
<   if (!trans_move && depth >= 6)
---
> #ifdef BUILD_ZOG_MP_COMPILE
>   if (ZOG_AKTIV && trans_move && parent && POSITION->rp == 0)
>     {
>       int zog = TRY_ZOG_NODE (POSITION, ALPHA, BETA, depth, parent, trans_move);
>       if (zog == NO_ZOG && parent->EXPANDED && depth >= MIN_ZOG_DEPTH)
>         NEW_ZOG_NODE (POSITION, ALPHA, BETA, depth, parent, trans_move);
>       if (zog == ZOG_MOVE_LESS)
> 	{
> 	  best_value = - VALUE_INFINITY;
> 	  goto MOVE_LESS;
> 	}
>     }
> #endif
> 
>   if (!trans_move && depth >= 6) /* bad in if POSITION demurs legaled moves */
98c131,132
< 	  v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 8, check);
---
> 	  v = MyPV (POSITION, ALPHA - depth, BETA + depth,
> 		    depth - 8, check, NULL);
104c138,139
< 	v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 4, check);
---
> 	v = MyPV (POSITION, ALPHA - depth, BETA + depth,
> 		  depth - 4, check, NULL);
111c146
<       v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 8, check);
---
>       v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 8, check, NULL);
117c152
< 	  v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 4, check);
---
> 	  v = MyPV (POSITION, ALPHA - depth, BETA + depth, depth - 4, check, NULL);
167a203,205
> #define DEPTH_RED (MIN (12, depth / 2))
> #define VALUE_RED1 (depth / 2)
> #define VALUE_RED2 (depth)
172,186d209
<       to = TO (move);
<       fr = FROM (move);
<       MAKE (POSITION, move);
<       EVAL (move);
<       if (ILLEGAL_MOVE)
< 	{
< 	  UNDO (POSITION, move);
< 	  goto SKIP;
< 	}
<       Value = -OppPV (POSITION, -BETA, -ALPHA, depth - 10, (MOVE_IS_CHECK) != 0);
<       UNDO (POSITION, move);
<       CHECK_HALT ();
< #define DEPTH_RED (MIN (12, depth / 2))
< #define VALUE_RED1 (depth / 2)
< #define VALUE_RED2 (depth)
188c211
< 	v = MyExcludeCheck (POSITION, Value - VALUE_RED1,
---
> 	v = MyExcludeCheck (POSITION, ALPHA - VALUE_RED1,
191c214
< 	v = MyExclude (POSITION, Value - VALUE_RED1,
---
> 	v = MyExclude (POSITION, ALPHA - VALUE_RED1,
194c217
<       if (v < Value - VALUE_RED1)
---
>       if (v < ALPHA - VALUE_RED1)
198c221
< 	    v = MyExcludeCheck (POSITION, Value - VALUE_RED2,
---
> 	    v = MyExcludeCheck (POSITION, ALPHA - VALUE_RED2,
201c224
< 	    v = MyExclude (POSITION, Value - VALUE_RED2,
---
> 	    v = MyExclude (POSITION, ALPHA - VALUE_RED2,
204c227
< 	  if (v < Value - VALUE_RED2)
---
> 	  if (v < ALPHA - VALUE_RED2)
208d230
<  SKIP:
214a237
>   cnt = 0;
249a273
> 	  cnt++;
261c285
<       /* LMR ? */
---
> 
270,271c294
< 	  if (POS1->cp != 0 || move_is_check
< 	      || (check && EARLY_GAME))
---
> 	  if (POS1->cp != 0 || move_is_check || (check && EXTEND_IN_CHECK))
278,279c301,306
<       new_depth = depth - 2 + MAX (EXTEND, SINGULAR);
< 
---
>       if (!EXTEND && cnt >= 3 && NextMove->phase == ORDINARY_MOVES
> 	  && MARGIN < 100 && depth >= 10)
> 	LMR = BSR (1 + cnt) - 1;
>       else
> 	LMR = 0;
>       new_depth = depth - 2 + MAX (EXTEND, SINGULAR) - LMR;
297a325
> 	  new_depth += LMR;
299c327
< 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check, NULL);
302c330
< 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check, NULL);
303a332
>       cnt++;
315c344
<       HashLower (POSITION->DYN->HASH, move, depth, v);
---
>       HashLowerPV (POSITION->DYN->HASH, move, depth, v);
325a355
>  MOVE_LESS:
328,330c358,360
<       if (!check)
< 	RETURN (0);
<       RETURN (HEIGHT (POSITION) - VALUE_MATE);
---
>       best_value = (check) ? (HEIGHT (POSITION) - VALUE_MATE) : 0;
>       HashExact (POSITION, MOVE_NONE, depth, best_value, FLAG_EXACT | FLAG_MOVE_LESS);
>       RETURN (best_value);
340c370
<   HashUpper (POSITION->DYN->HASH, depth, best_value);
---
>   HashUpperPV (POSITION->DYN->HASH, depth, best_value);
diff 999963/qsearch.c 999958/qsearch.c
44a45,46
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return 0;
200a203,204
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return (HEIGHT (POSITION) - VALUE_MATE);
diff 999963/qsearch_pv.c 999958/qsearch_pv.c
49a50,51
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return 0;
294a297,298
> 	  if (trans->flags & FLAG_MOVE_LESS)
>             return (HEIGHT (POSITION) - VALUE_MATE);
diff 999963/root_analysis.c 999958/root_analysis.c
16c16
<   int CNT, origALPHA, best_value, cnt, move_is_check, new_depth, v, TEMPvalu;
---
>   int CNT, origALPHA, best_value, cnt, move_is_check, new_depth, v;
20,21c20,22
<   int EXTEND;
<   int to;
---
>   int EXTEND, LMR;
>   int to, value;
>   uint64 NODES, NODES_STORE, nodes;
32a34,37
> #ifdef BUILD_ZOG_MP_COMPILE
>   if (ZOG_AKTIV) /* && depth >= 15 */
>     return zog_root_node (POSITION, ALPHA, BETA, depth);
> #endif
41a47,56
>   if (TITANIC_MODE)
>     {
>       int cpu, rp;
>       NODES = 0;
>       for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>         for (rp = 0; rp < RP_PER_CPU ; rp++)
>           NODES += ROOT_POSITION[cpu][rp].nodes;
>     }
>   else NODES = ROOT_POSIZIONE0->nodes;
>   NODES_STORE = NODES;
48c63
<       EXTEND =0;
---
>       EXTEND = 0;
49a65,72
>       LMR = 0;
> #if 1
>       if (!EXTEND && cnt >= 3 && depth >= 10)
>         LMR = 1;
>       if (!EXTEND && cnt >= 6 && depth >= 10)
>         LMR = 2;
> #endif
>       new_depth = depth - 2 + EXTEND - LMR;
55c78
< 	      Notate (move, STRING1), (p - ROOT_MOVE_LIST) + 1);
---
> 	      Notate (move, STRING1[POSITION->cpu]), (p - ROOT_MOVE_LIST) + 1);
57c80
< 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check, NULL);
75c98,99
< 		      v = -OppPV (POSITION, -ALPHA - 1, -ALPHA, an, move_is_check);
---
> 		      v = -OppPV (POSITION, -ALPHA - 1, -ALPHA,
> 				  an, move_is_check, NULL);
78a103
> 		    {
79a105,106
> 		      new_depth += LMR;
> 		    }
85a113
> 	  new_depth += LMR;
87c115,116
< 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA, new_depth, move_is_check);
---
> 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA,
> 			new_depth, move_is_check, NULL);
90c119
< 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check, NULL);
95a125
>       cnt++;
97c127
< 	TEMPvalu = origALPHA;
---
>         p->value = origALPHA;
99,100c129,140
< 	TEMPvalu = v;
<       p->move |= (TEMPvalu + 0x8000) << 16;
---
>         p->value = v;
>       if (TITANIC_MODE)
>         {
>           int cpu, rp;
>           NODES = 0;
>           for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>             for (rp = 0; rp < RP_PER_CPU ; rp++)
>               NODES += ROOT_POSITION[cpu][rp].nodes;
>         }
>       else NODES = ROOT_POSIZIONE0->nodes;
>       p->nodes = NODES - NODES_STORE;
>       NODES_STORE = NODES;
106c146
< 	      HashLower (POSITION->DYN->HASH, move, depth, v);
---
> 	      HashLowerPV (POSITION->DYN->HASH, move, depth, v);
116d155
<       cnt++;
126a166,167
>       value = p->value;
>       nodes = p->nodes;
129,130c170,175
< 	  if ((move & 0xffff0000) < (q->move & 0xffff0000))
< 	    (q - 1)->move = q->move;
---
> 	  if (value < q->value)
> 	    {
> 	      (q - 1)->move = q->move;
> 	      (q - 1)->value = q->value;
> 	      (q - 1)->nodes = q->nodes;
> 	    }
135a181,182
>       q->value = value;
>       q->nodes = nodes;
136a184,205
> #if 1
>   for (p = ROOT_MOVE_LIST + CNT; p > ROOT_MOVE_LIST; p--)
>     {
>       move = p->move;
>       value = p->value;
>       nodes = p->nodes;
>       for (q = p + 1; q < ROOT_MOVE_LIST + CNT; q++)
>         {
>           if (nodes < q->nodes)
>             {
>               (q - 1)->move = q->move;
>               (q - 1)->value = q->value;
>               (q - 1)->nodes = q->nodes;
>             }
>           else
>             break;
>         }      
>       (q - 1)->move = move;
>       (q - 1)->value = value;
>       (q - 1)->nodes = nodes;
>     }
> #endif
138c207
<   if (!DO_SEARCH_MOVES)
---
>   if (!DO_SEARCH_MOVES) /* analysis specificated */
141c210
< 	HashUpper (POSITION->DYN->HASH, depth, origALPHA);
---
> 	HashUpperPV (POSITION->DYN->HASH, depth, origALPHA);
diff 999963/root_multipv.c 999958/root_multipv.c
9c9
< void APPLY_SORT (int AGE_DEPTH_MIX, typeMPV* mpv)
---
> void APPLY_SORT (int n, typeMPV* mpv)
13c13,14
<   for (s = 0; s < AGE_DEPTH_MIX && mpv[s].move; s++)
---
>   uint64 y;
>   for (s = 0; s < n && mpv[s].move; s++)
25a27,38
> 	  x = p->depth;
> 	  p->depth = (p - 1)->depth;
> 	  (p - 1)->depth = x;
> 	  x = p->alpha;
> 	  p->alpha = (p - 1)->alpha;
> 	  (p - 1)->alpha = x;
> 	  x = p->beta;
> 	  p->beta = (p - 1)->beta;
> 	  (p - 1)->beta = x;
> 	  y = p->nodes;
> 	  p->nodes = (p - 1)->nodes;
> 	  (p - 1)->nodes = y;
40c53
<   typeRootMoveList* p;
---
>   typeRootMoveList *p, *q;
43c56
<   int EXTEND;
---
>   int EXTEND, LMR, value;
45,47c58,59
<   int i, j, x;
<   int BETA = VALUE_MATE;
<   int ALPHA = -VALUE_MATE;
---
>   int i, j, x, moveno;
>   int ALPHA = -VALUE_MATE, TARGET, DELTA, ALPHA2, LOWER;
48a61
>   uint64 NODES, NODES_STORE, nodes, y;
50,51c63,65
<   for (i = 0; i < 256; i++)
<     MPV[i].move = MPV[i].Value = 0;
---
>   if (depth < 14) /* 7 plies */
>     for (i = 0; i < 0x100; i++)
>       MPV[i].move = MPV[i].Value = 0;
61a76,85
>   if (TITANIC_MODE)
>     {
>       int cpu, rp;
>       NODES = 0;
>       for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>         for (rp = 0; rp < RP_PER_CPU ; rp++)
>           NODES += ROOT_POSITION[cpu][rp].nodes;
>     }
>   else NODES = ROOT_POSIZIONE0->nodes;
>   NODES_STORE = NODES;
64a89,104
>       TARGET = -VALUE_INFINITY;
>       DELTA = VALUE_MATE;
>       for (moveno = 0; MPV[moveno].move; moveno++)
> 	if (MPV[moveno].move == move)
> 	  {
> 	    TARGET = MPV[moveno].Value;
> 	    break;
> 	  }
>       if (TARGET == -VALUE_INFINITY)
> 	TARGET = 0;
>       else
> 	DELTA = 8;
>       if (GOOD_MOVES > 0)
> 	ALPHA2 = MPV[0].Value - MULTI_CENTI_PAWN_PV;
>       else
> 	ALPHA2 = -VALUE_INFINITY;
68c108
<       EXTEND =0;
---
>       EXTEND = 0;
73c113,118
<       new_depth = depth - 2 + EXTEND;
---
>       LMR = 0;
>       if (!EXTEND && cnt >= 2 * GOOD_MOVES + 3 && depth >= 10)
> 	LMR = 1;
>       if (!EXTEND && cnt >= 2 * GOOD_MOVES + 6 && depth >= 10)
> 	LMR = 2;
>       new_depth = depth - 2 + EXTEND - LMR;
76c121
< 	      Notate (move, STRING1), (p - ROOT_MOVE_LIST) + 1);
---
> 	      Notate (move, STRING1[POSITION->cpu]), (p - ROOT_MOVE_LIST) + 1);
78c123,158
< 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	{
> 	  while (TRUE)
> 	    {
> 	      LOWER = MAX (TARGET - DELTA, ALPHA2);
> 	      v = -OppPV (POSITION, -TARGET - DELTA, -LOWER,
> 			  new_depth, move_is_check, NULL);
> 	      if (v < TARGET + DELTA && v > LOWER)
> 		break;
> 	      if (GOOD_MOVES && v <= ALPHA2)
> 		break;
> 	      new_depth += LMR;
> 	      LMR = 0;
> 	      /* UCI bounds */
> 	      MPV[moveno].move = move;
> 	      MPV[moveno].depth = depth;
> 	      MPV[moveno].alpha = LOWER;
> 	      MPV[moveno].beta = TARGET + DELTA;
> 	      MPV[moveno].Value = v;
> 	      UNDO (POSITION, move);
> 	      Information (POSITION, GetClock () - START_CLOCK,
> 			   MPV[moveno].alpha, MPV[moveno].Value, MPV[moveno].beta);
> 	      MAKE (POSITION, move);
> 	      EVAL (move);
> 	      if (v >= TARGET + DELTA)
> 		TARGET = TARGET + DELTA / 2;
> 	      else
> 		TARGET = TARGET - DELTA / 2;
> 	      if (TARGET + DELTA >= 25000 || TARGET - DELTA <= -25000)
> 		{
> 		  TARGET = 0;
> 		  DELTA = VALUE_MATE;
> 		}
> 	      else
> 		DELTA += DELTA / 2;	      
> 	    }
> 	}
96c176,177
< 		      v = -OppPV (POSITION, -ALPHA - 1, -ALPHA, an, move_is_check);
---
> 		      v = -OppPV (POSITION, -ALPHA - 1, -ALPHA,
> 				  an, move_is_check, NULL);
100c181,184
< 		      goto DEC;
---
> 		    {
> 		      new_depth += LMR;
> 		      goto EN_CIRCLE;
> 		    }
106a191
> 	  new_depth += LMR;
108,113c193,206
< 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA, new_depth, move_is_check);
< 	DEC:
< 	  if (v > ALPHA)
< 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
< 	  if (v <= ALPHA)
< 	    v = ALPHA;
---
> 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA,
> 			new_depth, move_is_check, NULL);
> 	EN_CIRCLE:
> 	  DELTA = 8;
> 	  while (v > ALPHA)
> 	    {
> 	      v = -OppPV (POSITION, -ALPHA - DELTA, -ALPHA,
> 			  new_depth, move_is_check, NULL);
> 	      if (v < ALPHA + DELTA)
> 		break;
> 	      DELTA += DELTA / 2;
> 	      if (ALPHA + DELTA >= 25000)
> 		DELTA = VALUE_MATE - ALPHA;
> 	    }
116a210,220
>       if (TITANIC_MODE)
>         {
>           int cpu, rp;
>           NODES = 0;
>           for (cpu = 0; cpu < CPUS_SIZE; cpu++)
>             for (rp = 0; rp < RP_PER_CPU ; rp++)
>               NODES += ROOT_POSITION[cpu][rp].nodes;
>         }
>       else NODES = ROOT_POSIZIONE0->nodes;
>       p->nodes = NODES - NODES_STORE;
>       NODES_STORE = NODES;
118a223
> 	  p->value = v;
120c225
< 	    HashLower (POSITION->DYN->HASH, move, depth, v);
---
> 	    HashLowerPV (POSITION->DYN->HASH, move, depth, v);
121a227,229
> 	  MPV[GOOD_MOVES].depth = depth;
> 	  MPV[GOOD_MOVES].alpha = -VALUE_MATE;
> 	  MPV[GOOD_MOVES].beta = VALUE_MATE;
132a241,242
>       else
> 	p->value = ALPHA;
134a245
>   MPV[GOOD_MOVES].move = MOVE_NONE;
143a255,260
> 	      x = ROOT_MOVE_LIST[i].value;
> 	      ROOT_MOVE_LIST[i].value = ROOT_MOVE_LIST[j].value;
> 	      ROOT_MOVE_LIST[j].value = x;
> 	      y = ROOT_MOVE_LIST[i].nodes;
> 	      ROOT_MOVE_LIST[i].nodes = ROOT_MOVE_LIST[j].nodes;
> 	      ROOT_MOVE_LIST[j].nodes = y;
148,149c265,266
<   ROOT_DEPTH = depth;
<   if (!DO_SEARCH_MOVES)
---
> #if 1
>   for (p = ROOT_MOVE_LIST + CNT; p >= ROOT_MOVE_LIST + GOOD_MOVES; p--)
151c268,284
<       HashExact (POSITION, MPV[0].move, depth, MPV[0].Value, FLAG_EXACT);
---
>       move = p->move;
>       value = p->value;
>       nodes = p->nodes;
>       for (q = p + 1; q < ROOT_MOVE_LIST + CNT; q++)
>         {
>           if (nodes < q->nodes)
>             {
>               (q - 1)->move = q->move;
>               (q - 1)->value = q->value;
>               (q - 1)->nodes = q->nodes;
>             }
>           else
>             break;
>         }      
>       (q - 1)->move = move;
>       (q - 1)->value = value;
>       (q - 1)->nodes = nodes;
152a286,289
> #endif
>   ROOT_DEPTH = depth;
>   if (!DO_SEARCH_MOVES)
>     HashExact (POSITION, MPV[0].move, depth, MPV[0].Value, FLAG_EXACT);
diff 999963/root_node.c 999958/root_node.c
16c16
<   int CNT, origALPHA, best_value, cnt, move_is_check, new_depth, v, TEMPvalu;
---
>   int CNT, origALPHA, best_value, cnt, move_is_check, new_depth, v;
20,21c20,22
<   int EXTEND;
<   int to;
---
>   int EXTEND, LMR;
>   int to, value;
>   uint64 NODES, NODES_STORE, nodes;
28a30,33
> #ifdef BUILD_ZOG_MP_COMPILE
>   if (ZOG_AKTIV) /* && depth >= 15 */
>     return zog_root_node (POSITION, ALPHA, BETA, depth);
> #endif
38a44,54
>   if (TITANIC_MODE)
>     {
>       int cpu, rp;
>       NODES = 0;
>       for (cpu = 0; cpu < CPUS_SIZE; cpu++)
> 	for (rp = 0; rp < RP_PER_CPU ; rp++)
> 	  NODES += ROOT_POSITION[cpu][rp].nodes;
>     }
>   else NODES = ROOT_POSIZIONE0->nodes;
>   NODES_STORE = NODES;
>   cnt = 0;
46,47c62
<       if (POS1->cp || move_is_check ||
< 	  PassedPawnPush (to, FOURTH_RANK (to)))
---
>       if (POS1->cp || move_is_check || PassedPawnPush (to, FOURTH_RANK (to)))
49c64,69
<       new_depth = depth - 2 + EXTEND;
---
>       LMR = 0;
>       if (!EXTEND && cnt >= 3 && depth >= 10)
> 	LMR = 1;
>       if (!EXTEND && cnt >= 6 && depth >= 10)
> 	LMR = 2;
>       new_depth = depth - 2 + EXTEND - LMR;
52c72
< 	      Notate (move, STRING1), (p - ROOT_MOVE_LIST) + 1);
---
> 	      Notate (move, STRING1[POSITION->cpu]), (p - ROOT_MOVE_LIST) + 1);
54c74
< 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check, NULL);
75a96,97
> 	  new_depth += LMR;
> #if 1
77c99,101
< 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA, new_depth, move_is_check);
---
> 	    v = -OppPV (POSITION, -ALPHA - 1, -ALPHA,
> 			new_depth, move_is_check, NULL);
> #endif
79c103,104
< 	    v = -OppPV (POSITION, -BETA, -ALPHA, new_depth, move_is_check);
---
> 	    v = -OppPV (POSITION, -BETA, -ALPHA,
> 			new_depth, move_is_check, NULL);
83a109
>       cnt++;
86c112
< 	TEMPvalu = origALPHA;
---
> 	p->value = origALPHA;
88,89c114,125
< 	TEMPvalu = v;
<       p->move |= (TEMPvalu + 0x8000) << 16;
---
> 	p->value = v;
>       if (TITANIC_MODE)
> 	{
> 	  int cpu, rp;
> 	  NODES = 0;
> 	  for (cpu = 0; cpu < CPUS_SIZE; cpu++)
> 	    for (rp = 0; rp < RP_PER_CPU ; rp++)
> 	      NODES += ROOT_POSITION[cpu][rp].nodes;
> 	}
>       else NODES = ROOT_POSIZIONE0->nodes;
>       p->nodes = NODES - NODES_STORE;
>       NODES_STORE = NODES;
95c131
< 	      HashLower (POSITION->DYN->HASH, move, depth, v);
---
> 	      HashLowerPV (POSITION->DYN->HASH, move, depth, v);
120d155
<       cnt++;
130a166,167
>       value = p->value;
>       nodes = p->nodes;
133,134c170,175
< 	  if ((move & 0xffff0000) < (q->move & 0xffff0000))
< 	    (q - 1)->move = q->move;
---
> 	  if (value < q->value)
> 	    {
> 	      (q - 1)->move = q->move;
> 	      (q - 1)->value = q->value;
> 	      (q - 1)->nodes = q->nodes;
> 	    }
139a181,203
>       q->value = value;
>       q->nodes = nodes;
>     }
> #if 1
>   for (p = ROOT_MOVE_LIST + CNT; p > ROOT_MOVE_LIST; p--)
>     {
>       move = p->move;
>       value = p->value;
>       nodes = p->nodes;
>       for (q = p + 1; q < ROOT_MOVE_LIST + CNT; q++)
> 	{
> 	  if (nodes < q->nodes)
> 	    {
> 	      (q - 1)->move = q->move;
> 	      (q - 1)->value = q->value;
> 	      (q - 1)->nodes = q->nodes;
> 	    }
> 	  else
> 	    break;
> 	}      
>       (q - 1)->move = move;
>       (q - 1)->value = value;
>       (q - 1)->nodes = nodes;
140a205
> #endif
143c208
<     HashUpper (POSITION->DYN->HASH, depth, origALPHA);
---
>     HashUpperPV (POSITION->DYN->HASH, depth, origALPHA);
diff 999963/search.c 999958/search.c
11a12
>   boolean b;
42c43
< 		       depth, POSITION->DYN->bAtt & wBitboardK) :
---
> 		       depth, POSITION->DYN->bAtt & wBitboardK, NULL) :
44c45
< 		       depth, POSITION->DYN->wAtt & bBitboardK);
---
> 		       depth, POSITION->DYN->wAtt & bBitboardK, NULL);
55,57c56
<       if (!POSITION->wtm ?
< 	  (wBitboardK & POSITION->DYN->bAtt) : (bBitboardK & POSITION->DYN->wAtt))
< 	PONDER_MOVE = MOVE_NONE;
---
>       b = (LEGAL);
58a58,59
>       if (!b)
> 	PONDER_MOVE = MOVE_NONE;
62c63,64
< 		Notate (ROOT_BEST_MOVE, STRING1), Notate (PONDER_MOVE, STRING2));
---
> 	Notate (ROOT_BEST_MOVE, STRING1[POSITION->cpu]),
> 	Notate (PONDER_MOVE, STRING2[POSITION->cpu]));
76a79
> #define MAX_MATE_PLY 2048
79c82
<   if (Value > VALUE_MATE - MAXIMUM_PLY)
---
>   if (Value > VALUE_MATE - MAX_MATE_PLY)
81c84
<   else if (Value < -VALUE_MATE + MAXIMUM_PLY)
---
>   else if (Value < -VALUE_MATE + MAX_MATE_PLY)
108a112,116
>   if (!TITANIC_MODE && ZOG_AKTIV)
>     {
>       ROOT_POSIZIONE0->nodes = ROOT_POSITION[0][0].nodes;
>       ROOT_POSIZIONE0->tbhits = ROOT_POSITION[0][0].tbhits;
>     }
122c130
< #if 0
---
> #if 0 /* SELdepth non funzione SMP */
124c132
<   sd = p - (POSITION->DYN_ROOT + 1); /* seldepth */
---
>   sd = p - (POSITION->DYN_ROOT + 1);
135,137c143,149
<     MPV[0].move = ROOT_BEST_MOVE;
<   if (MULTI_PV == 1)
<     MPV[0].Value = Value;
---
>     {
>       MPV[0].move = ROOT_BEST_MOVE;
>       MPV[0].Value = Value;
>       MPV[0].alpha = ALPHA;
>       MPV[0].beta = BETA;
>       MPV[0].depth = ROOT_DEPTH;
>     }
146,148c158,160
<       Notate (move, STRING1);
<       strcpy (q, STRING1);
<       q += strlen (STRING1);
---
>       Notate (move, STRING1[POSITION->cpu]);
>       strcpy (q, STRING1[POSITION->cpu]);
>       q += strlen (STRING1[POSITION->cpu]);
195,197c207,209
< 	  Notate (move, STRING1);
< 	  strcpy (q, STRING1);
< 	  q += strlen (STRING1);
---
> 	  Notate (move, STRING1[POSITION->cpu]);
> 	  strcpy (q, STRING1[POSITION->cpu]);
> 	  q += strlen (STRING1[POSITION->cpu]);
215,217c227,229
< 	     cp_mate (MPV[mpv].Value, STRING2),
< 	     MODIFIER (ALPHA, MPV[mpv].Value, BETA, STRING3),
< 	     ROOT_DEPTH / 2, pv);
---
> 	     cp_mate (MPV[mpv].Value, STRING2[POSITION->cpu]),
> 	     MODIFIER (MPV[mpv].alpha, MPV[mpv].Value, MPV[mpv].beta, STRING3[POSITION->cpu]),
> 	     MPV[mpv].depth / 2, pv);
226a239
>   SEARCH_IS_DONE = FALSE;
227a241,244
>   if (NEW_GAME)
>     SINCE_NEW_GAME = 0;
>   else
>     SINCE_NEW_GAME++;
233,236d249
<   POSITION->StackHeight = -1;
<   ROOT_BEST_MOVE = ROOT_DEPTH = ROOT_SCORE = 0;
<   for (p = POSITION->DYN_ROOT; p <= POSITION->DYN; p++)
<     POSITION->STACK[++(POSITION->StackHeight)] = p->HASH;
238a252,258
>   ROOT_BEST_MOVE = ROOT_DEPTH = ROOT_SCORE = 0;
>   POSITION->StackHeight = 0;
>   if (POSITION->DYN->reversible > 110)
>     goto SKIP_REP_CHECK;
>   POSITION->StackHeight = -1;
>   for (p = POSITION->DYN - POSITION->DYN->reversible; p <= POSITION->DYN; p++)
>     POSITION->STACK[++(POSITION->StackHeight)] = p->HASH;
242c262
<       for (p = POSITION->DYN_ROOT; p < POSITION->DYN; p++)
---
>       for (p = POSITION->DYN - POSITION->DYN->reversible; p < POSITION->DYN; p++)
252c272
< 	    POSITION->STACK[p - POSITION->DYN_ROOT] = 0;
---
> 	    POSITION->STACK[p - POSITION->DYN + POSITION->DYN->reversible] = 0;
255a276
>  SKIP_REP_CHECK:
277c298
<       ivan_init_smp ();
---
>       STUB_IVAN ();
289c310
< #ifdef YUSUF_MULTICORE
---
>   SUPPRESS_INPUT = TRUE;
291,292c312,316
<     ivan_end_smp ();
< #endif
---
>     {
>       LOCK (SMP_IVAN);
>       SMP_HAS_AKTIV = FALSE;
>       UNLOCK (SMP_IVAN);
>     }
305d328
<   SUPPRESS_INPUT = TRUE;
310a334
>       INFINITE_LOOP = TRUE;
316a341
>       INFINITE_LOOP = TRUE;
320a346
>   INFINITE_LOOP = FALSE;
323a350,354
>   SEARCH_IS_DONE = TRUE;
>   if (UCI_NEW_GAME)
>     NewGame (POSITION, TRUE);
>   while (STALL_MODE)
>     NANO_SLEEP (1000000);
diff 999963/set_position.c 999958/set_position.c
329a330
> 	      POSITION->StackHeight = 0; /* kludge */
338c339
<       while (I[0] == ' ')
---
>       while (I[0] == ' ' || I[0] == '\t')
348c349
<   char i[1024];
---
>   char i[1024], II[1024], *J;
350a352,353
>   strcpy (II, I);
>   J = strstr (II, "moves");
360c363
<       I = ReadFEN (POSITION, I);
---
>       I = ReadFEN (POSITION, I); /* conforms 50-move, ShredderGUI broken */
362c365
<   if (I[0])
---
>   if (I[0] == 'm')
368c371
< 	  while (I[0] == ' ')
---
> 	  while (I[0] == ' ' || I[0] == '\t')
371a375,385
>     }
>   else /* UCI mess, with ShredderGUI, noncompliant in FEN */
>     {
>       if (J)
> 	{
> 	  SEND ("info string The GUI with you owns not strict FEN compliantcy. Demand anew!\n");
> 	  J += strlen ("moves");
> 	  while (J[0] == ' ')
> 	    J++;
> 	  ReadMoves (POSITION, J);
> 	}	  
diff 999963/top_analysis.c 999958/top_analysis.c
72c72
<       MAKE (POSITION, move);
---
>       Make (POSITION, move);
154a155,156
> 	  if (IVAN_ALL_HALT)
> 	    goto CHECK_DONE;
175a178,179
>       if (IVAN_ALL_HALT)
> 	return;
176a181,182
>       if (IVAN_ALL_HALT)
> 	return;
diff 999963/top_node.c 999958/top_node.c
111c111
<       MAKE (POSITION, move);
---
>       Make (POSITION, move);
152c152
<       MAKE (POSITION, move);
---
>       Make (POSITION, move);
204,206c204
< 	{
< 	  ROOT_SCORE = L;
< 	}
---
> 	ROOT_SCORE = L;
208,210c206
< 	{
< 	  ROOT_SCORE = 0;
< 	}
---
> 	ROOT_SCORE = 0;
229a226,227
> 	  if (IVAN_ALL_HALT)
> 	    goto CHECK_DONE;
251,255c249
< 	{
< 	  if (!ROOT_MOVE_LIST[1].move
< 	      || (ROOT_MOVE_LIST[0].move - ROOT_MOVE_LIST[1].move >= (200 << 16)))
< 	    EASY_MOVE = TRUE;
< 	}
---
> 	EASY_MOVE = TRUE;
256a251,252
>       if (IVAN_ALL_HALT)
> 	return;
257a254,255
>       if (IVAN_ALL_HALT)
> 	return;
diff 999963/un_make_move.c 999958/un_make_move.c
61c61
<          printf ("Uw %d %s\n", HEIGHT(POSITION), Notate(move, STRING1)));
---
>          printf ("Uw %d %s\n", HEIGHT(POSITION), Notate(move, STRING1[POSITION->cpu])));
115c115
<          printf ("Ub %d %s\n", HEIGHT(POSITION), Notate(move, STRING1)));
---
>          printf ("Ub %d %s\n", HEIGHT(POSITION), Notate(move, STRING1[POSITION->cpu])));
diff 999963/utility.c 999958/utility.c
293a294
>   PVHashClear ();
298a300,306
> #ifdef BUILD_ZOG_MP_COMPILE
>   if (ZOG_AKTIV)
>     {
>       ZOG_OFF ();
>       ZOG_ON ();
>     }
> #endif
diff 999963/validate.c 999958/validate.c
212c212
<       printf ("x: %d mossa: %s\n", x, Notate (x, STRING1));
---
>       printf ("x: %d mossa: %s\n", x, Notate (x, STRING1[POSITION->cpu]));
PAWN : Knight >> Bishop >> Rook >>Queen

benstoker
Posts: 110
Joined: Thu Jun 10, 2010 7:32 pm
Real Name: Ben Stoker

Re: IvanHoe-Beta-999958m-Beta!

Post by benstoker » Fri Jun 18, 2010 10:53 pm

Vael Jean-Paul wrote:The new Ivanhoe-Beta 999958m is out!!

Can somebody make compiles from it...

http://ippolit.wikispaces.com/file/deta ... m-Beta.tar

JP.
Sorry for duping this post in the general - didn't look before posting.

benstoker
Posts: 110
Joined: Thu Jun 10, 2010 7:32 pm
Real Name: Ben Stoker

Re: IvanHoe-Beta-999958m-Beta!

Post by benstoker » Fri Jun 18, 2010 10:56 pm

kingliveson wrote:Broken thread initialization leads to infinite loop for Titanic Mode. Code gets stuck here:

Code: Select all

  while (!IO_AWAKE)
    {
      SIGNAL_CON_LOCK (*WAKEUP_IO, *WAKEUP_LOCK_IO);
      NANO_SLEEP (1000000);
    }
Single CPU mode works though. ZOG-MP obviously is incomplete as well.
MP ("titanic") works fine on my ubuntu box - and the n/s is noticeably faster than version 63. Where's the above code excerpt from?

benstoker
Posts: 110
Joined: Thu Jun 10, 2010 7:32 pm
Real Name: Ben Stoker

Re: IvanHoe-Beta-999958m-Beta!

Post by benstoker » Fri Jun 18, 2010 11:00 pm

Vael Jean-Paul wrote:Looks like same link to me!

And true or fake...have to wait when we see a compile..or is it not possible to make one?
Is there no free and easy way for these windoze people to compile a simple C prog? Must windoze people lay out $$$ for Visual-whatever in order to compile hello.c?

JP, if you have an extra machine, you could always load ubuntu on it, and then you can compile these things yourself by doing nothing more than typing 'make' and hitting the enter-key.

Good luck in any event.

64x
Posts: 301
Joined: Thu Jun 10, 2010 2:47 am

Re: IvanHoe-Beta-999958m-Beta!

Post by 64x » Sat Jun 19, 2010 2:37 am

Would Digital Mars http://www.digitalmars.com work or would the resulting binary is far from being as optimized as the other options?

I am willing to test if someone can point me towards a few instructions on how to test the quality of the compile.

Post Reply