Computer Chess Club Archives


Search

Terms

Messages

Subject: What to store in the 3x64 squares for 16x16? + some of Fruit's codes

Author: Chan Rasjid

Date: 14:32:18 09/09/05


I just read the "Chess Board Represention" by Dr. Hyatt but it has no mention of
16x representation.

From an old post of Christophe Theron :-
"There are also many smart tricks you can use that are derived from the
properties of a 16x16 (or 16x12) board, and they have never been published".
- I believe some have now been published.

Fruit uses a double 16x16 board:-
struct {
int sq[16x16];
int pos[16x16];

.....

};

Besides the extra 3x64 squares, I now have to figure what to stuff to the extra
256 squares!

I have just read(and compiled) the codes of Fruit 2.1. I think there is a lot
to learn from the codes (for non-expert at least) Besides the chess programming
part, a good case study for students of C.

1)It is not easy to weaken fruit, eg:-

int eval(){
....
   eval_piece(board,mat_info,pawn_info,&opening,&endgame);
   eval_king(board,mat_info,&opening,&endgame);
   eval_passer(board,pawn_info,&opening,&endgame);
   eval_pattern(board,&opening,&endgame);
  if the above is changed to (or something similar) :-
  if (board->ply_nb <=	16){// these eval() only if below ply == 16
   eval_piece(board,mat_info,pawn_info,&opening,&endgame);
   eval_king(board,mat_info,&opening,&endgame);
   eval_passer(board,pawn_info,&opening,&endgame);
   eval_pattern(board,&opening,&endgame);
  }
  it still wins all the other top programs in my list - ruffian,delphi,
aristarch...
}

2)Someone mentioned Fruit uses double bounds in hashing, I can't yet confirm.

The codes for probing hash should be this :-

BOOL trans_retrieve(trans_t * trans, uint64 key, int * move, int * min_depth,
int * max_depth, int * min_value, int * max_value) {
   entry_t * entry;
   int i;

   ASSERT(trans_is_ok(trans));
   ASSERT(move!=NULL);
   ASSERT(min_depth!=NULL);
   ASSERT(max_depth!=NULL);
   ASSERT(min_value!=NULL);
   ASSERT(max_value!=NULL);

   // init

   trans->read_nb++;

   // probe

   entry = trans_entry(trans,key);

   for (i = 0; i < ClusterSize; i++, entry++) {//cluster size = 4
// rasjid. Does this mean hashing triple bounds?

      if (entry->lock == KEY_LOCK(key)) {

         // found

         trans->read_hit++;
         if (entry->date != trans->date) entry->date = trans->date;

         *move = entry->move;

         *min_depth = entry->min_depth;
         *max_depth = entry->max_depth;
         *min_value = entry->min_value;
         *max_value = entry->max_value;

         return true;
      }
   }

   // not found

   return false;
}

4) "don't mix char/short with int", ie for 32/64 bits machine?
   even PST is int.
4) don't use global variables, ie at least within search, ie 99% of the time.
5) don't be afraid of switch(), it has switch(type) for moves gen():-
   case  Knight:
   if (...)
   ....
   else .... 8 x
   break;
   case  Queen:
   if (...)
   ....
   else .... 16 x
   break;
   }
   Maybe allowed as it does incremental gen().

I don't understand the difficult part yet.

Best Regards
Rasjid




























This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.