IvanHoe 999953 beta
Posted: Sat Jul 17, 2010 1:06 pm
999953 Changes seem good -- fixed a couple minor bugs. Significant change is introduction of magic bit-boards; unfortunately, it's a 2% speed hit. Will upload when ready.
I like your optimism. Magic bit board: http://chessprogramming.wikispaces.com/Magic+Bitboards and http://en.wikipedia.org/wiki/Bitboard#Chess_bitboards.Vael Jean-Paul wrote:Great..again a new compile..but what does these magic bit-boards do?
Code: Select all
diff 999954/CHANGE_LOG 999953/CHANGE_LOG
85c85
< Bug: Qrrf fails compress
---
> RobboBuild Bug: Qrrf fails compress. Later: NNrb
86a87,90
> 999953 Fix 100 move (jarkkop)
> RobboTriple for 6 pieces rewrite.....
> preliminary ZUGZWANG_DETECT
> MAGIC_BITBOARDS possible (no gainings?)
diff 999954/Makefile 999953/Makefile
5c5
< VERSION = 999954-Beta
---
> VERSION = 999953
59c59,60
< signals.c
---
> signals.c \
> magic_mult.c
157c158
< RobboBuild_OBJECTS = $(RobboBuild_SOURCES:.c=.o) arrays.o
---
> RobboBuild_OBJECTS = $(RobboBuild_SOURCES:.c=.o) arrays.o magic_mult.o
diff 999954/RobboLito.h 999953/RobboLito.h
13a14,18
> #if 1
> #define MAGIC_BITBOARDS TRUE
> #define ZUGZWANG_DETECT TRUE
> #endif
>
371,373c376,379
< #define CheckRepetition \
< CHECK_HALT(); \
< if (POSITION->DYN->reversible >= 100) RETURN(0); \
---
> #define CheckRepetition(in_check) \
> CHECK_HALT (); \
> if (in_check && POSITION->DYN->reversible > 100) RETURN (0); \
> if (!in_check && POSITION->DYN->reversible >= 100) RETURN (0); \
389c395
< typedef struct { uint32 move; } typeMoveList;
---
> typedef struct { uint32 move; } typeMoveList;
444a451
> #ifndef MAGIC_BITBOARDS
445a453,455
> #else
> uint64 OccupiedBW, _0, _1, _2;
> #endif
556a567,568
> /******************************/ /******************************/
>
565a578,591
> #ifdef MAGIC_BITBOARDS
> typedef struct { uint64 mask, mult, shift; uint64* index; } type_MM;
> type_MM ROOK_MM[64], BISHOP_MM[64];
> uint64 MM_ORTHO[102400], MM_DIAG[5248];
> #define AttRocc(sq, OCC) ROOK_MM[sq].index\
> [((OCC & ROOK_MM[sq].mask) * ROOK_MM[sq].mult) >> ROOK_MM[sq].shift]
> #define AttBocc(sq, OCC) BISHOP_MM[sq].index\
> [((OCC & BISHOP_MM[sq].mask) * BISHOP_MM[sq].mult) >> BISHOP_MM[sq].shift]
> #define AttB(sq) AttBocc (sq, POSITION->OccupiedBW)
> #define AttR(sq) AttRocc (sq, POSITION->OccupiedBW)
> #define AttFile(sq) (AttR (sq) & FileArray[FILE (sq)])
>
> #else
>
574a601,608
> #define AttB(fr) (Att_a1h8(fr) | Att_h1a8(fr))
> #define AttR(fr) (AttRank(fr) | AttFile(fr))
> #endif
>
> #define AttQ(fr) (AttR(fr) | AttB(fr))
>
> /******************************/ /******************************/
>
580,583d613
<
< #define AttB(fr) (Att_a1h8(fr) | Att_h1a8(fr))
< #define AttR(fr) (AttRank(fr) | AttFile(fr))
< #define AttQ(fr) (AttR(fr) | AttB(fr))
diff 999954/RobboTotalBase.h 999953/RobboTotalBase.h
75c75
< void TripleBaseMake (typePOS*, int, int, int, char*);
---
> void TripleBaseMake (typePOS*, char*, char*);
diff 999954/RobboTriple.c 999953/RobboTriple.c
7d6
< #define V TRUE
9c8
< RobboTripleBase *TABLE_TRIPLE_BASES;
---
> RobboTripleBase* TABLE_TRIPLE_BASES;
82a82
> #define SAFER_FREE(x) if ((x)) free ((x))
89,90c89,90
< free ((TABLE_TRIPLE_BASES + i)->ind);
< free ((TABLE_TRIPLE_BASES + i)->data);
---
> SAFER_FREE ((TABLE_TRIPLE_BASES + i)->ind);
> SAFER_FREE ((TABLE_TRIPLE_BASES + i)->data);
diff 999954/RobboTripleBase.h 999953/RobboTripleBase.h
13c13
< RobboTripleBase *TABLE_TRIPLE_BASES;
---
> RobboTripleBase* TABLE_TRIPLE_BASES;
diff 999954/RobboTripleBuild.c 999953/RobboTripleBuild.c
34a35,36
> /**************************************************/
>
45c47
< r -= ( r % 32); r >>= 5; \
---
> r -= (r % 32); r >>= 5; \
52c54
< { int sq = w >> 2, king = w & 3; TH[sq] |= (MODO << ( 2 * king ) ); w++; }
---
> { int sq = w >> 2, king = w & 3; TH[sq] |= (MODO << ( 2 * king ) ); w++; }
56d57
< static int C[4], p;
245c246,602
< static void simmetria (char *C, char *SIM)
---
> /**************************************************/
>
> #define wEnumB wEnumBL
> #define bEnumB bEnumBL
>
> void TripleBaseMake (typePOS* POSITION, char* PEZZO, char* inome_file)
> {
> int check = 0, u, MODO = vNON, mal = 0, TotalBase = 0, vc, v[4], w = 0;
> int b, s, cattvi = 0, cattpa = 0, L[4];
> int bK, wK, move, to, fr, pb = 0, c2 = 0, pr, pi, cp;
> const short int *PILA;
> char *TH, *E[4];
> uint64 O, SIZE;
> int rip = 0, p, C[4];
> typeMoveList LIST[256], *list;
> int i, j, k, rf, RF;
> char nome_file[256];
>
> #ifdef NOME_WINDOWS
> nome_file[0] = 'K';
> j = 0;
> while (inome_file[j])
> {
> if (inome_file[j] <= 'Z')
> {
> nome_file[2 * j + 1] = 'w';
> nome_file[2 * j + 2] = inome_file[j] + 32;
> }
> else
> {
> nome_file[2 * j + 1] = 'b';
> nome_file[2 * j + 2] = inome_file[j];
> }
> j++;
> }
> nome_file[2 * j + 1] = 0;
> #else
> strcpy(nome_file, inome_file);
> #endif
>
> printf ("TripleBaseMake %s\n", nome_file);
> POSITION->wtm = TRUE;
> p = 0;
> PILA = RE_normale;
> for (i = 0; i < 4; i++)
> if (PEZZO[i] == wEnumP || PEZZO[i] == bEnumP || PEZZO[i] == BlockedPawn)
> PILA = RE_pedone;
> C[0] = C[1] = C[2] = C[3] = 0;
> POSITION->DYN->reversible = 0;
> POSITION->DYN->ep = POSITION->DYN->oo = 0;
> for (i = 0; i < 4; i++)
> {
> E[i] = ENUMn;
> if (!PEZZO[i])
> E[i] = ENUM0;
> if (PEZZO[i] == wEnumP)
> E[i] = ENUM_BI_PED;
> if (PEZZO[i] == bEnumP)
> E[i] = ENUM_NE_PED;
> if (PEZZO[i] == BlockedPawn)
> E[i] = ENUM_BLOCKED;
> if (PEZZO[i] == wEnumB || PEZZO[i] == bEnumB)
> E[i] = ENUM_ALF;
> }
> SIZE = 355100000 / 4;
> TH = malloc (SIZE);
> for (i = 0; i < SIZE; i++)
> TH[i] = 0;
> for (u = A1; u <= H8; u++)
> POSITION->sq[u] = 0;
> RF = (PILA == RE_pedone) ? 1806 : 462;
> for (rf = 0; rf < RF; rf++)
> {
> if (PILA == RE_normale)
> {
> wK = inverso_normale_re[rf] >> 6;
> bK = inverso_normale_re[rf] & 63;
> }
> if (PILA == RE_pedone)
> {
> wK = inverso_pedone_re[rf] >> 6;
> bK = inverso_pedone_re[rf] & 63;
> }
> if (PEZZO[2] && (PILA[64 * wK + bK] & 15) == 0)
> printf ("%c%c %c%c %d %d\n", (wK & 7) + 'a', (wK / 8) + '1',
> (bK & 7) + 'a', (bK / 8) + '1', w, PILA[64 * wK + bK]);
> for (L[0] = 0; (v[0] = E[0][L[0]]) != -1; L[0]++)
> for (L[1] = 0; (v[1] = E[1][L[1]]) != -1; L[1]++)
> for (L[2] = 0; (v[2] = E[2][L[2]]) != -1; L[2]++)
> for (L[3] = 0; (v[3] = E[3][L[3]]) != -1; L[3]++)
> {
> if (PEZZO[1] && PEZZO[0] == PEZZO[1] && L[1] >= L[0])
> continue;
> if (PEZZO[2] && PEZZO[1] == PEZZO[2] && L[2] >= L[1])
> continue;
> if (PEZZO[3] && PEZZO[2] == PEZZO[3] && L[3] >= L[2])
> continue;
> POSITION->wKsq = wK;
> POSITION->bKsq = bK;
> wBitboardK = SqSet[wK];
> bBitboardK = SqSet[bK];
> wBitboardQ = wBitboardR = wBitboardN = wBitboardBD =
> wBitboardBL = wBitboardP = 0;
> bBitboardQ = bBitboardR = bBitboardN = bBitboardBD =
> bBitboardBL = bBitboardP = 0;
> for (i = 0; i < 4; i++)
> {
> if (PEZZO[i] != BlockedPawn)
> POSITION->bitboard[PEZZO[i]] |= SqSet[v[i]];
> else
> {
> POSITION->bitboard[wEnumP] |= SqSet[v[i]];
> POSITION->bitboard[bEnumP] |= SqSet[v[i] + 8];
> }
> }
> wBitboardOcc = wBitboardP | wBitboardN |
> wBitboardB | wBitboardR | wBitboardQ | wBitboardK;
> #ifndef MAGIC_BITBOARDS
> POSITION->OccupiedL90 = POSITION->OccupiedL45 =
> POSITION->OccupiedR45 = 0;
> #endif
> bBitboardOcc = bBitboardP | bBitboardN |
> bBitboardB | bBitboardR | bBitboardQ | bBitboardK;
> O = wBitboardOcc | bBitboardOcc;
> POSITION->OccupiedBW = O;
> for (i = 0; i < 4; i++)
> {
> if (PEZZO[i] && PEZZO[i] != BlockedPawn)
> POSITION->sq[v[i]] = PEZZO[i];
> if (PEZZO[i] == BlockedPawn)
> {
> POSITION->sq[v[i]] = wEnumP;
> POSITION->sq[v[i] + 8] = bEnumP;
> }
> if (PEZZO[i] == wEnumB && SqSet[v[i]] & LIGHT)
> POSITION->sq[v[i]] = wEnumBL;
> if (PEZZO[i] == wEnumB && SqSet[v[i]] & DARK)
> POSITION->sq[v[i]] = wEnumBD;
> if (PEZZO[i] == bEnumB && SqSet[v[i]] & LIGHT)
> POSITION->sq[v[i]] = bEnumBL;
> if (PEZZO[i] == bEnumB && SqSet[v[i]] & DARK)
> POSITION->sq[v[i]] = bEnumBD;
> }
> POSITION->wtm = TRUE;
> POSITION->sq[POSITION->wKsq] = wEnumK;
> POSITION->sq[POSITION->bKsq] = bEnumK;
> #ifndef MAGIC_BITBOARDS
> while (O)
> {
> b = BSF (O);
> POSITION->OccupiedL90 |= SqSet[Left90[b]];
> POSITION->OccupiedL45 |= SqSet[Left45[b]];
> POSITION->OccupiedR45 |= SqSet[Right45[b]];
> BitClear (b, O);
> }
> #endif
> POSITION->wtm = TRUE;
> Mobility (POSITION);
> #define IN_CHECK (wBitboardK & POSITION->DYN->bAtt)
> #ifdef ROBBO_SCACCO
> if (IN_CHECK && PEZZO[2]) /* safe with Z */
> {
> check++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> #endif
>
> #define IS_ILLEGAL \
> (POSITION->wtm ? \
> (bBitboardK & POSITION->DYN->wAtt) : (wBitboardK & POSITION->DYN->bAtt) )
> #define BAD \
> ( (PEZZO[1] && v[0] == v[1]) || (PEZZO[2] && v[0] == v[2]) || \
> (PEZZO[3] && v[0] == v[3]) || (PEZZO[2] && v[1] == v[2]) || \
> (PEZZO[3] && v[1] == v[3]) || (PEZZO[3] && v[2] == v[3]) || \
> (v[0] == POSITION->wKsq) || (v[1] == POSITION->wKsq) || \
> (v[2] == POSITION->wKsq) || (v[3] == POSITION->wKsq) || \
> (v[0] == POSITION->bKsq) || (v[1] == POSITION->bKsq) || \
> (v[2] == POSITION->bKsq) || (v[3] == POSITION->bKsq) || \
> (PEZZO[0] == BlockedPawn && \
> ((v[0] + 8) == v[1] || (v[0] + 8 == v[2]) || (v[0] + 8 == v[3]) \
> || (v[0] + 8) == POSITION->wKsq || (v[0] + 8) == POSITION->bKsq)) || \
> (PEZZO[1] == BlockedPawn && \
> ((v[1] + 8) == v[0] || (v[1] + 8 == v[2]) || (v[1] + 8 == v[3]) \
> || (v[1] + 8) == POSITION->wKsq || (v[1] + 8) == POSITION->bKsq)) || \
> (PEZZO[2] == BlockedPawn && \
> ((v[2] + 8) == v[0] || (v[2] + 8 == v[1]) || (v[2] + 8 == v[3]) \
> || (v[2] + 8) == POSITION->wKsq || (v[2] + 8) == POSITION->bKsq)) || \
> (PEZZO[3] == BlockedPawn && \
> ((v[3] + 8) == v[0] || (v[3] + 8 == v[1]) || (v[3] + 8 == v[2]) \
> || (v[3] + 8) == POSITION->wKsq || (v[3] + 8) == POSITION->bKsq)) \
> || IS_ILLEGAL)
> if (BAD || !RobboTotalBaseScore (POSITION, &s) || s == dROTT)
> {
> mal++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> if (DISCO_PATTA (s) && MODO == ePAT)
> {
> C[2]++;
> rip++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> if (DISCO_VITTORIA (s) && MODO == eVIT)
> {
> C[1]++;
> rip++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> if (DISCO_PERDITA (s) && MODO == ePER)
> {
> C[3]++;
> rip++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> list = GenCapturesTotal (POSITION, LIST);
> for (u = 0; u < list - LIST; u++)
> {
> move = LIST[u].move;
> to = TO (move);
> fr = FROM (move);
> cp = POSITION->sq[to];
> pr = MoveIsProm (move);
> pi = POSITION->sq[fr];
> POSITION->bitboard[cp] ^= SqSet[to];
> POSITION->bitboard[pi] ^= SqSet[to] ^ SqSet[fr];
> if (pi == wEnumK)
> POSITION->wKsq = to;
> wBitboardOcc ^= SqSet[to] ^ SqSet[fr];
> if (cp)
> bBitboardOcc ^= SqSet[to];
> POSITION->OccupiedBW = wBitboardOcc | bBitboardOcc;
> #ifndef MAGIC_BITBOARDS
> POSITION->OccupiedL90 ^= SqSet[Left90[fr]];
> POSITION->OccupiedL45 ^= SqSet[Left45[fr]];
> POSITION->OccupiedR45 ^= SqSet[Right45[fr]];
> if (!cp)
> {
> POSITION->OccupiedL90 ^= SqSet[Left90[to]];
> POSITION->OccupiedL45 ^= SqSet[Left45[to]];
> POSITION->OccupiedR45 ^= SqSet[Right45[to]];
> }
> #endif
> if (pr && ((move >> 12) & 7) == 7)
> {
> wBitboardP ^= SqSet[to];
> wBitboardQ ^= SqSet[to];
> }
> POSITION->sq[to] = pi;
> if (pr)
> POSITION->sq[to] = wEnumQ;
> POSITION->wtm = FALSE;
> Mobility (POSITION);
> if (!IS_ILLEGAL && RobboTotalBaseScore (POSITION, &vc))
> pb++;
> else
> vc = 1000;
> c2++;
> POSITION->wtm = TRUE;
> POSITION->bitboard[cp] ^= SqSet[to];
> POSITION->bitboard[pi] ^= SqSet[fr];
> if (pi == wEnumK)
> POSITION->wKsq = fr;
> POSITION->sq[fr] = pi;
> POSITION->sq[to] = cp;
> wBitboardOcc ^= SqSet[to] ^ SqSet[fr];
> if (cp)
> bBitboardOcc ^= SqSet[to];
> POSITION->OccupiedBW = wBitboardOcc | bBitboardOcc;
> #ifndef MAGIC_BITBOARDS
> POSITION->OccupiedL90 ^= SqSet[Left90[fr]];
> POSITION->OccupiedL45 ^= SqSet[Left45[fr]];
> POSITION->OccupiedR45 ^= SqSet[Right45[fr]];
> if (!cp)
> {
> POSITION->OccupiedL90 ^= SqSet[Left90[to]];
> POSITION->OccupiedL45 ^= SqSet[Left45[to]];
> POSITION->OccupiedR45 ^= SqSet[Right45[to]];
> }
> #endif
> if (pr && ((move >> 12) & 7) == 7)
> {
> wBitboardP ^= SqSet[to];
> wBitboardQ ^= SqSet[to];
> }
> if (pr && ((move >> 12) & 7) == 4)
> {
> wBitboardP ^= SqSet[to];
> wBitboardN ^= SqSet[to];
> }
> if (vc != 1000 && DISCO_PERDITA (vc))
> {
> cattvi++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> if (vc != 1000 && DISCO_PATTA (vc) && DISCO_PATTA (s)
> && ott (TH, w - 1) != eVIT && ott (TH, w - 1) != vNON)
> {
> cattpa++;
> fis2 (TH, w, MODO);
> goto LOOP;
> }
> }
> POSITION->wtm = TRUE;
> if (DISCO_PATTA (s))
> {
> C[2]++;
> MODO = ePAT;
> }
> if (DISCO_VITTORIA (s))
> {
> C[1]++;
> MODO = eVIT;
> }
> if (DISCO_PERDITA (s))
> {
> C[3]++;
> MODO = ePER;
> }
> fis2 (TH, w, MODO);
> TotalBase++;
> LOOP:
> for (i = 0; i < 4; i++)
> {
> if (PEZZO[i])
> POSITION->sq[v[i]] = 0;
> if (PEZZO[i] == BlockedPawn)
> POSITION->sq[v[i] + 8] = 0;
> }
> POSITION->sq[POSITION->wKsq] = 0;
> POSITION->sq[POSITION->bKsq] = 0;
> }
> }
> printf ("s%d 210:%d/%d/%d\nmal:%d sc:%d cat:%d/%d"
> " rip:%d RTB:%d\ntot:%d/%d pb:%d/%d\n",
> C[0], C[1], C[2], C[3], mal,
> check, cattvi, cattpa, rip, TotalBase,
> mal + check + cattvi + cattpa + rip + TotalBase, w, pb, c2);
> i = 0;
> while (ott (TH, i) == vNON)
> i++;
> s = ott (TH, i);
> j = 0;
> while (j <= i)
> fis2 (TH, j, s);
> rle (TH, w, nome_file, C);
> free (TH);
> }
>
> /**************************************************/
>
> static void simmetria (char *C, char *SIM) /* Z base? */
263c620
< char C[16], SIM[16], PEZb[4] = "QRBN", PEZn[4] = "qrbn", A[16];
---
> char C[16], SIM[16], PEZb[8] = "QRBN", PEZn[8] = "qrbn", A[16];
358,360c715,717
< POSITION->DYN_ROOT = malloc(MAXIMUM_PLY * sizeof(typeDYNAMIC));
< POSITION->DYN = POSITION->DYN_ROOT;
< TripleBaseMake (POSITION, PI[0], PI[1], PI[2], I);
---
> POSITION->DYN_ROOT = malloc (MAXIMUM_PLY * sizeof(typeDYNAMIC));
> POSITION->DYN = POSITION->DYN_ROOT + 1;
> TripleBaseMake (POSITION, PI, I);
362,955d718
< }
<
< #define wEnumB wEnumBL
< #define bEnumB bEnumBL
<
< void
< TripleBaseMake
< (typePOS *POSITION, int PEZZO1, int PEZZO2, int PEZZO3, char *inome_file)
< {
< int check = 0, u, MODO = vNON, mal = 0, TotalBase = 0, vc, va1, va2, va3, w = 0;
< int b, s, cattvi = 0, cattpa = 0;
< int bK, wK, move, to, fr, pb = 0, c2 = 0, pr, pi, cp;
< const short int *PILA;
< char *TH, *E1, *E2, *E3;
< uint64 O;
< int rip = 0;
< typeMoveList LIST[256], *list;
< int i, j, k;
< char nome_file[256];
<
< #ifdef NOME_WINDOWS
< nome_file[0] = 'K';
< j = 0;
< while (inome_file[j])
< {
< if (inome_file[j] <= 'Z')
< {
< nome_file[2 * j + 1] = 'w';
< nome_file[2 * j + 2] = inome_file[j] + 32;
< }
< else
< {
< nome_file[2 * j + 1] = 'b';
< nome_file[2 * j + 2] = inome_file[j];
< }
< j++;
< }
< nome_file[2 * j + 1] = 0;
< #else
< strcpy(nome_file, inome_file);
< #endif
<
< printf ("RobboTriple_fare %s\n", nome_file);
< POSITION->wtm = TRUE;
< p = 0;
< E1 = ENUMn;
< E2 = ENUMn;
< E3 = ENUMn;
< PILA = RE_normale;
< if (PEZZO1 == wEnumP || PEZZO1 == bEnumP || PEZZO1 == BlockedPawn)
< PILA = RE_pedone;
< if (PEZZO2 == wEnumP || PEZZO2 == bEnumP || PEZZO2 == BlockedPawn)
< PILA = RE_pedone;
< if (PEZZO3 == wEnumP || PEZZO3 == bEnumP || PEZZO3 == BlockedPawn)
< PILA = RE_pedone;
< C[0] = C[1] = C[2] = C[3] = 0;
< POSITION->DYN->reversible = 0;
< POSITION->DYN->ep = POSITION->DYN->oo = 0;
< if (!PEZZO1)
< E1 = ENUM0;
< if (PEZZO1 == wEnumP)
< E1 = ENUM_BI_PED;
< if (PEZZO1 == bEnumP)
< E1 = ENUM_NE_PED;
< if (PEZZO1 == BlockedPawn)
< E1 = ENUM_BLOCKED;
< if (!PEZZO2)
< E2 = ENUM0;
< if (PEZZO2 == wEnumP)
< E2 = ENUM_BI_PED;
< if (PEZZO2 == bEnumP)
< E2 = ENUM_NE_PED;
< if (PEZZO2 == BlockedPawn)
< E2 = ENUM_BLOCKED;
< if (!PEZZO3)
< E3 = ENUM0;
< if (PEZZO3 == wEnumP)
< E3 = ENUM_BI_PED;
< if (PEZZO3 == bEnumP)
< E3 = ENUM_NE_PED;
< if (PEZZO3 == BlockedPawn)
< E3 = ENUM_BLOCKED;
< if (PEZZO1 == wEnumB || PEZZO1 == bEnumB)
< E1 = ENUM_ALF;
< if (PEZZO2 == wEnumB || PEZZO2 == bEnumB)
< E2 = ENUM_ALF;
< if (PEZZO3 == wEnumB || PEZZO3 == bEnumB)
< E3 = ENUM_ALF;
< TH = malloc (355100000 / 4);
< for (i = 0; i < 355100000 / 4; i++)
< TH[i] = 0;
< for (u = A1; u <= H8; u++)
< POSITION->sq[u] = 0;
< int rf, RF = (PILA == RE_pedone) ? 1806 : 462;
< for (rf = 0; rf < RF; rf++)
< {
< if (PILA == RE_normale)
< {
< wK = inverso_normale_re[rf] >> 6;
< bK = inverso_normale_re[rf] & 63;
< }
< if (PILA == RE_pedone)
< {
< wK = inverso_pedone_re[rf] >> 6;
< bK = inverso_pedone_re[rf] & 63;
< }
< if (PEZZO3 && (PILA[64 * wK + bK] & 15) == 0)
< printf ("%c%c %c%c %d %d\n", (wK & 7) + 'a', (wK / 8) + '1',
< (bK & 7) + 'a', (bK / 8) + '1', w, PILA[64 * wK + bK]);
< for (i = 0; (va1 = E1[i]) != -1; i++)
< for (j = 0; (va2 = E2[j]) != -1; j++)
< for (k = 0; (va3 = E3[k]) != -1; k++)
< {
< if (PEZZO1 == PEZZO2 && PEZZO1 && j >= i)
< continue;
< if (PEZZO2 == PEZZO3 && PEZZO2 && k >= j)
< continue;
< POSITION->wKsq = wK;
< POSITION->bKsq = bK;
< wBitboardK = SqSet[wK];
< bBitboardK = SqSet[bK];
< wBitboardQ = wBitboardR = wBitboardN = wBitboardBD =
< wBitboardBL = wBitboardP = 0;
< bBitboardQ = bBitboardR = bBitboardN = bBitboardBD =
< bBitboardBL = bBitboardP = 0;
< switch (PEZZO1)
< {
< case wEnumQ:
< wBitboardQ |= SqSet[va1];
< break;
< case wEnumR:
< wBitboardR |= SqSet[va1];
< break;
< case wEnumN:
< wBitboardN |= SqSet[va1];
< break;
< case wEnumP:
< wBitboardP |= SqSet[va1];
< break;
< case bEnumQ:
< bBitboardQ |= SqSet[va1];
< break;
< case bEnumP:
< bBitboardP |= SqSet[va1];
< break;
< case bEnumN:
< bBitboardN |= SqSet[va1];
< break;
< case bEnumR:
< bBitboardR |= SqSet[va1];
< break;
< case wEnumB:
< if (SqSet[va1] & LIGHT)
< wBitboardBL |= SqSet[va1];
< else
< wBitboardBD |= SqSet[va1];
< break;
< case bEnumB:
< if (SqSet[va1] & LIGHT)
< bBitboardBL |= SqSet[va1];
< else
< bBitboardBD |= SqSet[va1];
< break;
< case BlockedPawn:
< wBitboardP |= SqSet[va1];
< bBitboardP |= SqSet[va1 + 8];
< break;
< }
< switch (PEZZO2)
< {
< case wEnumQ:
< wBitboardQ |= SqSet[va2];
< break;
< case wEnumR:
< wBitboardR |= SqSet[va2];
< break;
< case wEnumN:
< wBitboardN |= SqSet[va2];
< break;
< case wEnumP:
< wBitboardP |= SqSet[va2];
< break;
< case bEnumQ:
< bBitboardQ |= SqSet[va2];
< break;
< case bEnumP:
< bBitboardP |= SqSet[va2];
< break;
< case bEnumN:
< bBitboardN |= SqSet[va2];
< break;
< case bEnumR:
< bBitboardR |= SqSet[va2];
< break;
< case wEnumB:
< if (SqSet[va2] & LIGHT)
< wBitboardBL |= SqSet[va2];
< else
< wBitboardBD |= SqSet[va2];
< break;
< case bEnumB:
< if (SqSet[va2] & LIGHT)
< bBitboardBL |= SqSet[va2];
< else
< bBitboardBD |= SqSet[va2];
< break;
< case BlockedPawn:
< wBitboardP |= SqSet[va2];
< bBitboardP |= SqSet[va2 + 8];
< break;
< }
< switch (PEZZO3)
< {
< case wEnumQ:
< wBitboardQ |= SqSet[va3];
< break;
< case wEnumR:
< wBitboardR |= SqSet[va3];
< break;
< case wEnumN:
< wBitboardN |= SqSet[va3];
< break;
< case wEnumP:
< wBitboardP |= SqSet[va3];
< break;
< case bEnumQ:
< bBitboardQ |= SqSet[va3];
< break;
< case bEnumP:
< bBitboardP |= SqSet[va3];
< break;
< case bEnumN:
< bBitboardN |= SqSet[va3];
< break;
< case bEnumR:
< bBitboardR |= SqSet[va3];
< break;
< case wEnumB:
< if (SqSet[va3] & LIGHT)
< wBitboardBL |= SqSet[va3];
< else
< wBitboardBD |= SqSet[va3];
< break;
< case bEnumB:
< if (SqSet[va3] & LIGHT)
< bBitboardBL |= SqSet[va3];
< else
< bBitboardBD |= SqSet[va3];
< break;
< case BlockedPawn:
< wBitboardP |= SqSet[va3];
< bBitboardP |= SqSet[va3 + 8];
< break;
< }
<
< wBitboardOcc = wBitboardP | wBitboardN |
< wBitboardB | wBitboardR | wBitboardQ | wBitboardK;
< POSITION->OccupiedL90 = POSITION->OccupiedL45 =
< POSITION->OccupiedR45 = 0;
< bBitboardOcc = bBitboardP | bBitboardN |
< bBitboardB | bBitboardR | bBitboardQ | bBitboardK;
< O = wBitboardOcc | bBitboardOcc;
< POSITION->OccupiedBW = O;
< if (PEZZO1)
< POSITION->sq[va1] = PEZZO1;
< if (PEZZO2)
< POSITION->sq[va2] = PEZZO2;
< if (PEZZO3)
< POSITION->sq[va3] = PEZZO3;
< if (PEZZO1 == BlockedPawn)
< {
< POSITION->sq[va1] = wEnumP;
< POSITION->sq[va1 + 8] = bEnumP;
< }
< if (PEZZO2 == BlockedPawn)
< {
< POSITION->sq[va2] = wEnumP;
< POSITION->sq[va2 + 8] = bEnumP;
< }
< if (PEZZO3 == BlockedPawn)
< {
< POSITION->sq[va3] = wEnumP;
< POSITION->sq[va3 + 8] = bEnumP;
< }
< if (PEZZO1 == wEnumB && SqSet[va1] & LIGHT)
< POSITION->sq[va1] = wEnumBL;
< if (PEZZO1 == wEnumB && SqSet[va1] & DARK)
< POSITION->sq[va1] = wEnumBD;
< if (PEZZO2 == wEnumB && SqSet[va2] & LIGHT)
< POSITION->sq[va2] = wEnumBL;
< if (PEZZO2 == wEnumB && SqSet[va2] & DARK)
< POSITION->sq[va2] = wEnumBD;
< if (PEZZO3 == wEnumB && SqSet[va3] & LIGHT)
< POSITION->sq[va3] = wEnumBL;
< if (PEZZO3 == wEnumB && SqSet[va3] & DARK)
< POSITION->sq[va3] = wEnumBD;
< if (PEZZO1 == bEnumB && SqSet[va1] & LIGHT)
< POSITION->sq[va1] = bEnumBL;
< if (PEZZO1 == bEnumB && SqSet[va1] & DARK)
< POSITION->sq[va1] = bEnumBD;
< if (PEZZO2 == bEnumB && SqSet[va2] & LIGHT)
< POSITION->sq[va2] = bEnumBL;
< if (PEZZO2 == bEnumB && SqSet[va2] & DARK)
< POSITION->sq[va2] = bEnumBD;
< if (PEZZO3 == bEnumB && SqSet[va3] & LIGHT)
< POSITION->sq[va3] = bEnumBL;
< if (PEZZO3 == bEnumB && SqSet[va3] & DARK)
< POSITION->sq[va3] = bEnumBD;
< POSITION->wtm = TRUE;
< POSITION->sq[POSITION->wKsq] = wEnumK;
< POSITION->sq[POSITION->bKsq] = bEnumK;
< while (O)
< {
< b = BSF (O);
< POSITION->OccupiedL90 |= SqSet[Left90[b]];
< POSITION->OccupiedL45 |= SqSet[Left45[b]];
< POSITION->OccupiedR45 |= SqSet[Right45[b]];
< BitClear (b, O);
< }
< POSITION->wtm = TRUE;
< Mobility (POSITION);
< #define IN_CHECK (wBitboardK & POSITION->DYN->bAtt)
< #ifdef ROBBO_SCACCO
< if (IN_CHECK && PEZZO3) /* safe with Z */
< {
< check++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< #endif
<
< #define IS_ILLEGAL \
< (POSITION->wtm ? \
< (bBitboardK & POSITION->DYN->wAtt) : (wBitboardK & POSITION->DYN->bAtt) )
< #define BAD \
< ( (va1 == va2 && PEZZO1 != 0) || (va1 == va3 && PEZZO1 != 0) || \
< (va2 == va3 && PEZZO2 != 0) || \
< (PEZZO1 == BlockedPawn && \
< (((va1 + 8) == va2 || (va1 + 8) == va3) || \
< ((va1 + 8) == POSITION->wKsq || (va1 + 8) == POSITION->bKsq))) || \
< (PEZZO2 == BlockedPawn && \
< (((va2 + 8) == va1 || (va2 + 8) == va3) || \
< ((va2 + 8) == POSITION->wKsq || (va2 + 8) == POSITION->bKsq))) || \
< (PEZZO3 == BlockedPawn && \
< (((va3 + 8) == va1 || (va3 + 8) == va2) || \
< ((va3 + 8) == POSITION->wKsq || (va3 + 8) == POSITION->bKsq))) || \
< (va1 == POSITION->wKsq) || (va2 == POSITION->wKsq) || \
< (va3 == POSITION->wKsq) || (va1 == POSITION->bKsq) || \
< (va2 == POSITION->bKsq) || (va3 == POSITION->bKsq) || IS_ILLEGAL)
< if (BAD || !RobboTotalBaseScore (POSITION, &s) || s == dROTT)
< {
< mal++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< if (DISCO_PATTA (s) && MODO == ePAT)
< {
< C[2]++;
< rip++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< if (DISCO_VITTORIA (s) && MODO == eVIT)
< {
< C[1]++;
< rip++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< if (DISCO_PERDITA (s) && MODO == ePER)
< {
< C[3]++;
< rip++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< list = GenCapturesTotal (POSITION, LIST);
< for (u = 0; u < list - LIST; u++)
< {
< move = LIST[u].move;
< to = TO (move);
< fr = FROM (move);
< cp = POSITION->sq[to];
< pr = MoveIsProm (move);
< pi = POSITION->sq[fr];
< switch (cp)
< {
< case bEnumN:
< bBitboardN ^= SqSet[to];
< break;
< case bEnumR:
< bBitboardR ^= SqSet[to];
< break;
< case bEnumBL:
< bBitboardBL ^= SqSet[to];
< break;
< case bEnumBD:
< bBitboardBD ^= SqSet[to];
< break;
< case bEnumP:
< bBitboardP ^= SqSet[to];
< break;
< case bEnumQ:
< bBitboardQ ^= SqSet[to];
< break;
< }
< switch (pi)
< {
< case wEnumK:
< POSITION->wKsq = to;
< wBitboardK = SqSet[to];
< break;
< case wEnumR:
< wBitboardR ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumQ:
< wBitboardQ ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumBL:
< wBitboardBL ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumBD:
< wBitboardBD ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumN:
< wBitboardN ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumP:
< wBitboardP ^= SqSet[to] ^ SqSet[fr];
< break;
< }
< wBitboardOcc ^= SqSet[to] ^ SqSet[fr];
< if (cp)
< bBitboardOcc ^= SqSet[to];
< POSITION->OccupiedBW = wBitboardOcc | bBitboardOcc;
< POSITION->OccupiedL90 ^= SqSet[Left90[fr]];
< POSITION->OccupiedL45 ^= SqSet[Left45[fr]];
< POSITION->OccupiedR45 ^= SqSet[Right45[fr]];
< if (!cp)
< {
< POSITION->OccupiedL90 ^= SqSet[Left90[to]];
< POSITION->OccupiedL45 ^= SqSet[Left45[to]];
< POSITION->OccupiedR45 ^= SqSet[Right45[to]];
< }
< if (pr && ((move >> 12) & 7) == 7)
< {
< wBitboardP ^= SqSet[to];
< wBitboardQ ^= SqSet[to];
< }
< POSITION->sq[to] = pi;
< if (pr)
< POSITION->sq[to] = wEnumQ;
< POSITION->wtm = FALSE;
< Mobility (POSITION);
< if (!IS_ILLEGAL && RobboTotalBaseScore (POSITION, &vc))
< pb++;
< else
< vc = 1000;
< c2++;
< POSITION->wtm = TRUE;
< switch (cp)
< {
< case bEnumN:
< bBitboardN ^= SqSet[to];
< break;
< case bEnumR:
< bBitboardR ^= SqSet[to];
< break;
< case bEnumBL:
< bBitboardBL ^= SqSet[to];
< break;
< case bEnumBD:
< bBitboardBD ^= SqSet[to];
< break;
< case bEnumP:
< bBitboardP ^= SqSet[to];
< break;
< case bEnumQ:
< bBitboardQ ^= SqSet[to];
< break;
< }
< switch (pi)
< {
< case wEnumK:
< POSITION->wKsq = fr;
< wBitboardK = SqSet[fr];
< break;
< case wEnumR:
< wBitboardR ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumQ:
< wBitboardQ ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumBL:
< wBitboardBL ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumBD:
< wBitboardBD ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumN:
< wBitboardN ^= SqSet[to] ^ SqSet[fr];
< break;
< case wEnumP:
< wBitboardP ^= SqSet[to] ^ SqSet[fr];
< break;
< }
< POSITION->sq[fr] = pi;
< POSITION->sq[to] = cp;
< wBitboardOcc ^= SqSet[to] ^ SqSet[fr];
< if (cp)
< bBitboardOcc ^= SqSet[to];
< POSITION->OccupiedBW = wBitboardOcc | bBitboardOcc;
< POSITION->OccupiedL90 ^= SqSet[Left90[fr]];
< POSITION->OccupiedL45 ^= SqSet[Left45[fr]];
< POSITION->OccupiedR45 ^= SqSet[Right45[fr]];
< if (!cp)
< {
< POSITION->OccupiedL90 ^= SqSet[Left90[to]];
< POSITION->OccupiedL45 ^= SqSet[Left45[to]];
< POSITION->OccupiedR45 ^= SqSet[Right45[to]];
< }
< if (pr && ((move >> 12) & 7) == 7)
< {
< wBitboardP ^= SqSet[to];
< wBitboardQ ^= SqSet[to];
< }
< if (pr && ((move >> 12) & 7) == 4)
< {
< wBitboardP ^= SqSet[to];
< wBitboardN ^= SqSet[to];
< }
< if (vc != 1000 && DISCO_PERDITA (vc))
< {
< cattvi++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< if (vc != 1000 && DISCO_PATTA (vc) && DISCO_PATTA (s)
< && ott (TH, w - 1) != eVIT && ott (TH, w - 1) != vNON)
< {
< cattpa++;
< fis2 (TH, w, MODO);
< goto LOOP;
< }
< }
< POSITION->wtm = TRUE;
< if (DISCO_PATTA (s))
< {
< C[2]++;
< MODO = ePAT;
< }
< if (DISCO_VITTORIA (s))
< {
< C[1]++;
< MODO = eVIT;
< }
< if (DISCO_PERDITA (s))
< {
< C[3]++;
< MODO = ePER;
< }
< fis2 (TH, w, MODO);
< TotalBase++;
< LOOP:
< if (PEZZO1)
< POSITION->sq[va1] = 0;
< if (PEZZO1 == BlockedPawn)
< POSITION->sq[va1 + 8] = 0;
< if (PEZZO2)
< POSITION->sq[va2] = 0;
< if (PEZZO2 == BlockedPawn)
< POSITION->sq[va2 + 8] = 0;
< if (PEZZO3)
< POSITION->sq[va3] = 0;
< if (PEZZO3 == BlockedPawn)
< POSITION->sq[va3 + 8] = 0;
< POSITION->sq[POSITION->wKsq] = 0;
< POSITION->sq[POSITION->bKsq] = 0;
< }
< }
< printf ("s%d 210:%d/%d/%d\nmal:%d sc:%d cat:%d/%d"
< " rip:%d RTB:%d\ntot:%d/%d pb:%d/%d\n",
< C[0], C[1], C[2], C[3], mal,
< check, cattvi, cattpa, rip, TotalBase,
< mal + check + cattvi + cattpa + rip + TotalBase, w, pb, c2);
< i = 0;
< while (ott (TH, i) == vNON)
< i++;
< s = ott (TH, i);
< j = 0;
< while (j <= i)
< fis2 (TH, j, s);
< rle (TH, w, nome_file, C);
< free (TH);
diff 999954/RobboTripleValue.c 999953/RobboTripleValue.c
221d220
< #if 1
223d221
< #endif
238,240c236
< #if 1
< POSITION->tbhits++;
< #endif
---
> POSITION->tbhits++;
256c252
< (wBitboardK & POSITION->DYN->bAtt) : (bBitboardK & POSITION->DYN->wAtt))
---
> (wBitboardK & POSITION->DYN->bAtt) : (bBitboardK & POSITION->DYN->wAtt) )
diff 999954/RobboTriple_iniz.c 999953/RobboTriple_iniz.c
33a34
> triple->data = triple->ind = NULL;
diff 999954/Robbo_build.c 999953/Robbo_build.c
940a941,946
> sprintf (OTT, "%s/51", TOTAL_BASE_DIRECTORY);
> GetTotalBase (OTT);
> sprintf (OTT, "%s/42", TOTAL_BASE_DIRECTORY);
> GetTotalBase (OTT);
> sprintf (OTT, "%s/33", TOTAL_BASE_DIRECTORY);
> GetTotalBase (OTT);
968a975,980
> sprintf (OTT, "%s/51", TRIPLE_DIR);
> GetTripleBase (OTT);
> sprintf (OTT, "%s/42", TRIPLE_DIR);
> GetTripleBase (OTT);
> sprintf (OTT, "%s/33", TRIPLE_DIR);
> GetTripleBase (OTT);
982c994
< if (b == 1)
---
> if (b <= 1)
diff 999954/Robbo_comp.c 999953/Robbo_comp.c
320,321c320,321
< int min = 1024;
< if (nb > 1024)
---
> int min = 4096;
> if (nb > 4096)
400c400
< B = malloc (TOCCO + 1024);
---
> B = malloc (TOCCO + 4096);
diff 999954/Robbo_glue.c 999953/Robbo_glue.c
47a48,53
> sprintf (DIR, "%s/51", TOTAL_BASE_DIRECTORY);
> GetTotalBase (DIR);
> sprintf (DIR, "%s/42", TOTAL_BASE_DIRECTORY);
> GetTotalBase (DIR);
> sprintf (DIR, "%s/33", TOTAL_BASE_DIRECTORY);
> GetTotalBase (DIR);
101a108,115
> GetTripleBase (DIR);
> sprintf (DIR, "%s/6", TRIPLE_DIR);
> GetTripleBase (DIR);
> sprintf (DIR, "%s/51", TRIPLE_DIR);
> GetTripleBase (DIR);
> sprintf (DIR, "%s/42", TRIPLE_DIR);
> GetTripleBase (DIR);
> sprintf (DIR, "%s/33", TRIPLE_DIR);
diff 999954/Robbo_mfa.c 999953/Robbo_mfa.c
18a19,22
> #ifdef MAGIC_BITBOARDS
> #define ClearOccupied(M, x) { POSITION->OccupiedBW &= M; }
> #define SetOccupied(M, x) { POSITION->OccupiedBW |= M; }
> #else
28a33
> #endif
diff 999954/Robbo_popolare.c 999953/Robbo_popolare.c
312,313c312,313
< if (wK == s[0] || wK == s[1] || bK == s[0] || bK == s[1] ||
< wK == s[2] || bK == s[2] || wK == s[3] || bK == s[3]
---
> if (wK == s[0] || wK == s[1] || bK == s[0] || bK == s[1]
> || wK == s[2] || bK == s[2] || wK == s[3] || bK == s[3]
372a373
> #ifndef MAGIC_BITBOARDS
388a390
> #endif
diff 999954/SEE.c 999953/SEE.c
44,47d43
< SlideIndex[Direction_h1a8] =
< (POSITION->OccupiedL45 >> LineShift[Direction_h1a8][to]) & 077;
< SlideIndex[Direction_a1h8] =
< (POSITION->OccupiedR45 >> LineShift[Direction_a1h8][to]) & 077;
48a45
> mask &= DIAG[to];
50,51c47
< bit |= (LineMask[Direction_h1a8][to][SlideIndex[Direction_h1a8]] |
< LineMask[Direction_a1h8][to][SlideIndex[Direction_a1h8]]) & mask;
---
> bit |= AttB (to) & mask;
54,57d49
< SlideIndex[Direction_horz] =
< (POSITION->OccupiedBW >> LineShift[Direction_horz][to]) & 077;
< SlideIndex[Direction_vert] =
< (POSITION->OccupiedL90 >> LineShift[Direction_vert][to]) & 077;
58a51
> mask &= ORTHO[to];
60,61c53
< bit |= (LineMask[Direction_horz][to][SlideIndex[Direction_horz]] |
< LineMask[Direction_vert][to][SlideIndex[Direction_vert]]) & mask;
---
> bit |= AttR (to) & mask;
68,69c60,63
< if (dir != BAD_DIRECTION)
< bit |= LineMask[dir][fr][SlideIndex[dir]] & TableIndex[dir] & cbf;
---
> if (dir == Direction_h1a8 || dir == Direction_a1h8)
> bit |= AttB (fr) & TableIndex[dir] & cbf;
> if (dir == Direction_horz || dir == Direction_vert)
> bit |= AttR (fr) & TableIndex[dir] & cbf;
95,97c89
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[Direction_a1h8];
---
> mask = AttB (fr) & cbf & TableIndex[Direction_a1h8];
107,109c99
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[Direction_horz];
---
> mask = AttR (fr) & cbf & TableIndex[Direction_horz];
119,121c109,112
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[dir];
---
> if (RANK (fr) == RANK (to) || FILE (fr) == FILE (to))
> mask = AttR (fr) & cbf & TableIndex[Direction_horz];
> else
> mask = AttB (fr) & cbf & TableIndex[Direction_a1h8];
158,160c149
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[Direction_a1h8];
---
> mask = AttB (fr) & cbf & TableIndex[Direction_a1h8];
170,172c159
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[Direction_horz];
---
> mask = AttR (fr) & cbf & TableIndex[Direction_horz];
182,184c169,172
< dir = LINE[fr][to];
< mask = LineMask[dir][fr][SlideIndex[dir]] & cbf &
< TableIndex[dir];
---
> if (RANK (fr) == RANK (to) || FILE (fr) == FILE (to))
> mask = AttR (fr) & cbf & TableIndex[Direction_horz];
> else
> mask = AttB (fr) & cbf & TableIndex[Direction_a1h8];
diff 999954/Zobrist_init.c 999953/Zobrist_init.c
29d28
< printf ("HI %d\n", *w);
diff 999954/all_node.c 999953/all_node.c
44c44
< CheckRepetition;
---
> CheckRepetition (FALSE);
283c283
< CheckRepetition;
---
> CheckRepetition (TRUE);
386c386,388
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/arrays.c 999953/arrays.c
109a110
> #ifndef MAGIC_BITBOARDS
119a121
> #endif
256a259
> #ifndef MAGIC_BITBOARDS
286a290
> #endif
373a378
> #ifndef MAGIC_BITBOARDS
463a469
> #endif
651a658,660
> #ifdef MAGIC_BITBOARDS
> magic_mult_init ();
> #endif
diff 999954/arrays.h 999953/arrays.h
6c6,8
< uint64 AttN[64], AttK[64], AttPw[64], AttPb[64], LineMask[4][64][64];
---
> uint64 AttN[64], AttK[64], AttPw[64], AttPb[64];
> #ifndef MAGIC_BITBOARDS
> uint64 LineMask[4][64][64];
7a10
> #endif
66,67c69
< uint64
< InFrontW[8], NotInFrontW[8], InFrontB[8], NotInFrontB[8], IsolatedFiles[8];
---
> uint64 InFrontW[8], NotInFrontW[8], InFrontB[8], NotInFrontB[8], IsolatedFiles[8];
79,80c81
< uint64
< LEFT2[64], RIGHT2[64], LEFT1[64], RIGHT1[64], ADJACENT[64], LONG_DIAG[64];
---
> uint64 LEFT2[64], RIGHT2[64], LEFT1[64], RIGHT1[64], ADJACENT[64], LONG_DIAG[64];
diff 999954/cut_node.c 999953/cut_node.c
44c44
< CheckRepetition;
---
> CheckRepetition (FALSE);
330c330
< CheckRepetition;
---
> CheckRepetition (TRUE);
459c459,461
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/evaluation.c 999953/evaluation.c
355a356,358
> #ifdef ZUGZWANG_DETECT
> boolean wzug = TRUE, bzug = TRUE;
> #endif
630a634,637
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
662a670,673
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
766a778,781
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
838a854,857
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
923a943,946
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
958a982,985
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
1062a1090,1093
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
1136a1168,1171
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
1511a1547,1552
> #ifdef ZUGZWANG_DETECT
> if (wzug)
> POSITION->DYN->flags &= ~2;
> if (bzug)
> POSITION->DYN->flags &= ~1;
> #endif
diff 999954/exclude_node.c 999953/exclude_node.c
46c46
< CheckRepetition;
---
> CheckRepetition (FALSE);
282c282
< CheckRepetition;
---
> CheckRepetition (TRUE);
388c388,390
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/low_depth.c 999953/low_depth.c
43c43
< CheckRepetition;
---
> CheckRepetition (FALSE);
233c233
< CheckRepetition;
---
> CheckRepetition (TRUE);
331c331,333
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
Only in 999953: magic_mult.c
diff 999954/make_move.c 999953/make_move.c
40a41
> #ifndef MAGIC_BITBOARDS
43a45
> #endif
54a57
> #ifndef MAGIC_BITBOARDS
57a61
> #endif
72a77
> #ifndef MAGIC_BITBOARDS
75a81
> #endif
86a93
> #ifndef MAGIC_BITBOARDS
89a97
> #endif
diff 999954/make_unmake.h 999953/make_unmake.h
40a41,44
> #ifdef MAGIC_BITBOARDS
> #define ClearOccupied(M, x) { POSITION->OccupiedBW &= M; }
> #define SetOccupied(M, x) { POSITION->OccupiedBW |= M; }
> #else
48a53
> #endif
diff 999954/mobility.c 999953/mobility.c
7a8,10
> #ifdef ZUGZWANG_DETECT
> boolean wzug = TRUE, bzug = TRUE;
> #endif
25a29,32
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
33a41,44
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
48a60,63
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
65a81,84
> #ifdef ZUGZWANG_DETECT
> if (A & ~wBitboardOcc)
> wzug = FALSE;
> #endif
87a107,110
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
95a119,122
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
110a138,141
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
127a159,162
> #ifdef ZUGZWANG_DETECT
> if (A & ~bBitboardOcc)
> bzug = FALSE;
> #endif
161a197,202
> #ifdef ZUGZWANG_DETECT
> if (wzug)
> POSITION->DYN->flags &= ~2;
> if (bzug)
> POSITION->DYN->flags &= ~1;
> #endif
diff 999954/pv_node.c 999953/pv_node.c
60c60
< CheckRepetition;
---
> CheckRepetition (check);
317c317,319
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/qsearch.c 999953/qsearch.c
36c36
< CheckRepetition;
---
> CheckRepetition (FALSE);
199c199
< CheckRepetition;
---
> CheckRepetition (TRUE);
298c298,300
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/qsearch_pv.c 999953/qsearch_pv.c
37c37
< CheckRepetition;
---
> CheckRepetition (FALSE);
284c284
< CheckRepetition;
---
> CheckRepetition (TRUE);
374c374,376
< if (IS_EXACT (POSITION->DYN->exact))
---
> if (POS0->reversible == 100) /* HACK */
> v = 0;
> else if (IS_EXACT (POSITION->DYN->exact))
diff 999954/un_make_move.c 999953/un_make_move.c
12a13
> #ifndef MAGIC_BITBOARDS
15a17
> #endif
23a26
> #ifndef MAGIC_BITBOARDS
26a30
> #endif
38a43
> #ifndef MAGIC_BITBOARDS
41a47
> #endif
49a56
> #ifndef MAGIC_BITBOARDS
52a60
> #endif
diff 999954/utility.c 999953/utility.c
62a63
> #ifndef MAGIC_BITBOARDS
63a65
> #endif
108a111
> #ifndef MAGIC_BITBOARDS
116a120
> #endif
Hi! What do you mean by this?kingliveson wrote:Only thing IvanHoe needs is Pawn Hash set to 1/8th or 1/4th of Hash used -- everything else can remain default. 999954 beta is quite stable as is 999953.
Hello Mr. Doe, yes Pawn Hash needs to be adjusted relative to Hash. The Pawn Hash gets quite a hit during search (eval) so setting it too low causes nps to decrease. You can't go wrong with 1/8th. Just like Hash, must be power of 2.John Doe wrote:Hi! What do you mean by this?kingliveson wrote:Only thing IvanHoe needs is Pawn Hash set to 1/8th or 1/4th of Hash used -- everything else can remain default. 999954 beta is quite stable as is 999953.
If I'm using 1024 mb hash so I need pawn hash setyp as 256 or 128?
Actually, I no longer have IvanHoe 9.53b w32 source code. I was careless, but am definitely keeping the source for the next build though. Inside joke.sirabc wrote:Ivanhoe 9.53b x32 default doesn't run on older pcs because popcnt is turned on---when I run the exe in a dos window, it reports popcnt enable.
Can't you decompile it and make it even stronger?kingliveson wrote: Actually, I no longer have IvanHoe 9.53b w32 source code. I was careless, but am definitely keeping the source for the next build though. Inside joke.