Fruit 1.0 PST

Code, algorithms, languages, construction...
Post Reply
BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Fruit 1.0 PST

Post by BB+ » Sat Aug 13, 2011 9:30 am

Since PST is a popular subject these days, I happened to look at the Fruit 1.0 PST. Rather different than the Fruit 2.1 process and subsequent Rybka 1.0 Beta numerology. Here is the knight code, as an example:

Code: Select all

static const uint8 Centre[64] = {
   0, 1, 2, 3, 3, 2, 1, 0,
   1, 4, 5, 6, 6, 5, 4, 1,
   2, 5, 7, 8, 8, 7, 5, 2,
   3, 6, 8, 9, 9, 8, 6, 3,
   3, 6, 8, 9, 9, 8, 6, 3,
   2, 5, 7, 8, 8, 7, 5, 2,
   1, 4, 5, 6, 6, 5, 4, 1,
   0, 1, 2, 3, 3, 2, 1, 0,};

   // knights
   piece = WhiteKnight12;
   // centre
   for (sq = 0; sq < 64; sq++) {
      PST(piece,sq,Opening) += Centre[sq] * +3;
      PST(piece,sq,Endgame) += Centre[sq] * +3;   }

   // 1st rank
   for (sq = A1; sq <= H1; sq++) {
      PST(piece,sq,Opening) -= 15;   }

   // outpost
   PST(piece,C5,Opening) += 3;
   PST(piece,D5,Opening) += 5;
   PST(piece,E5,Opening) += 5;
   PST(piece,F5,Opening) += 3;
   PST(piece,D6,Opening) += 3;
   PST(piece,E6,Opening) += 3;

   // "trapped"
   PST(piece,A8,Opening) -= 50;
   PST(piece,H8,Opening) -= 50;
I also happened across a quirk in Pepito 1.59. I can understand asymmetric PST for a queen on the d1/e1 squares and perhaps even c2/f2 therein, but it seems to be that the a8/h8 bishop incongruence is a typo.

Code: Select all

static const int TABLA_ALFIL[] = {
-10, -5, -5, -5, -5, -5, -5, -5, // hmm ?
    -5, 0, 0, 0, 0, 0, 0, -5,
    -5, 0, 2, 2, 2, 2, 0, -5,
    -5, 0, 2, 4, 4, 2, 0, -5,
    -5, 0, 2, 4, 4, 2, 0, -5,
    -5, 0, 2, 5, 5, 2, 0, -5,
    -5, 2, 3, 0, 0, 3, 2, -5,
-10, -5, -5, -5, -5, -5, -5, -10};

Code: Select all

static const int TABLA_DAMA[] = {
-10, -10, -10, -10, -10, -10, -10, -10,
    -10, 0, 0, 0, 0, 0, 0, -10,
    -5, 0, 4, 4, 4, 4, 0, -5,
    -5, 0, 4, 8, 8, 4, 0, -5,
    -5, 0, 4, 8, 8, 4, 0, -5,
    -5, 0, 4, 4, 4, 4, 0, -5,
    -5, 0, 4, 0, 0, 0, 0, -5, // c2/f2 are maybe a bit weird
-10, -10, -5, 0, -2, -5, -10, -10}; // here asymmetry looks more sensible

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Booot 5.1.0 and Fruit 2.1 PST

Post by BB+ » Sat Aug 13, 2011 11:01 am

Here's an example of an "explicitly copied" PST tables from Fruit 2.1, in Booot 5.1.0. One might note that they differ in previous Booot versions. They are as below at least in Booot 4.15.0 (Nov 30 2008).

Code: Select all

    WBESQ : TBytesArray  =
     (
        -18,-12, -9, -6, -6, -9,-12,-18,
        -12, -6, -3,  0,  0, -3, -6,-12,
         -9, -3,  0,  3,  3,  0, -3, -9,
         -6,  0,  3,  6,  6,  3,  0, -6,
         -6,  0,  3,  6,  6,  3,  0, -6,
         -9, -3,  0,  3,  3,  0, -3, -9,
        -12, -6, -3,  0,  0, -3, -6,-12,
        -18,-12, -9, -6, -6, -9,-12,-18
     );

Code: Select all

     WNESQ : TBytesArray  =
     (
      -40,-30,-20,-15,-15,-20,-30,-40,
      -30,-20,-10, -5, -5,-10,-20,-30,
      -20,-10,  0,  5,  5,  0,-10,-20,
      -15, -5,  5, 10, 10,  5, -5,-15,
      -15, -5,  5, 10, 10,  5, -5,-15,
      -20,-10,  0,  5,  5,  0,-10,-20,
      -30,-20,-10, -5, -5,-10,-20,-30,
      -40,-30,-20,-15,-15,-20,-30,-40
     );

Code: Select all

     WQESQ : TBytesArray  =
     (
        -24,-16,-12, -8, -8,-12,-16,-24,
        -16, -8, -4,  0,  0, -4, -8,-16,
        -12, -4,  0,  4,  4,  0, -4,-12,
         -8,  0,  4,  8,  8,  4,  0, -8,
         -8,  0,  4,  8,  8,  4,  0, -8,
        -12, -4,  0,  4,  4,  0, -4,-12,
        -16, -8, -4,  0,  0, -4, -8,-16,
        -24,-16,-12, -8, -8,-12,-16,-24
     );
The rooks array is also -6 -3 0 3 for files.

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Chesley PST and Berliner

Post by BB+ » Sat Aug 13, 2011 11:32 am

Another interesting one I ran across was Chesley, claiming to have pawn values based on Hans Berliner(!).

Code: Select all

      // Pawn values based on Hans Berliner.
      {
         0,   0,   0,   0,   0,   0,   0,   0,
         6,  12,  25,  50,  50,  25,  12,   6,
         6,  12,  25,  50,  50,  25,  12,   6,
        -3,   3,  17,  28,  28,  17,   3,  -3,
       -10,  -5,  10,  20,  20,  10,  -5, -10,
       -10,  -5,   5,  15,  15,   5,  -5, -10,
       -10,  -5,   5, -10, -10,   5,  -5, -10,
         0,   0,   0,   0,   0,   0,   0,   0
      },

Code: Select all

    // Values used in the end game.
    {
      // Pawn values based on Hans Berliner.
      {
#define eg(x) (x)
        eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0),
        eg( 45), eg( 29), eg( 16), eg(  5), eg(  5), eg( 16), eg( 29), eg( 45),
        eg( 45), eg( 29), eg( 16), eg(  5), eg(  5), eg( 16), eg( 29), eg( 45),
        eg( 33), eg( 17), eg(  7), eg(  1), eg(  1), eg(  7), eg( 17), eg( 33),
        eg( 25), eg( 10), eg(  0), eg( -5), eg( -5), eg(  0), eg( 10), eg( 25),
        eg( 20), eg(  5), eg( -5), eg(-10), eg(-10), eg( -5), eg(  5), eg( 20),
        eg( 20), eg(  5), eg( -5), eg(-10), eg(-10), eg( -5), eg(  5), eg( 20),
        eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0), eg(  0)
#undef eg
      },

BB+
Posts: 1484
Joined: Thu Jun 10, 2010 4:26 am

Re: Fruit 1.0 PST

Post by BB+ » Sat Aug 27, 2011 3:02 am

Here are the Fruit 1.0 PST arrays [it actually has a DispPST switch to print them, for debugging purposes].

Some other differences between Fruit 1.0 and Fruit 2.1 are that the phase is 3-5-9 rather than 1-2-4, and that the piece ordering is pPnN..., rather than PpNn...

White Pawns Opening

Code: Select all

  +0   +5  +10  +15  +15  +10   +5   +0
  +0   +5  +10  +15  +15  +10   +5   +0
  +0   +5  +10  +15  +15  +10   +5   +0
  +0   +5  +10  +25  +25  +10   +5   +0
  +0   +5  +10  +35  +35  +10   +5   +0
  +0   +5  +10  +15  +15  +10   +5   +0
  +2   +7  +12   -5   -5  +12   +7   +2
  +0   +5  +10  +15  +15  +10   +5   +0
White Knights Opening

Code: Select all

  -50   +3   +6   +9   +9   +6   +3  -50
   +3  +12  +15  +18  +18  +15  +12   +3
   +6  +15  +21  +27  +27  +21  +15   +6
   +9  +18  +27  +32  +32  +27  +18   +9
   +9  +18  +24  +27  +27  +24  +18   +9
   +6  +15  +21  +24  +24  +21  +15   +6
   +3  +12  +15  +18  +18  +15  +12   +3
  -15  -12   -9   -6   -6   -9  -12  -15
White Bishops Opening

Code: Select all

  +19  +16  +17  +18  +18  +17  +16  +19
  -14  +23  +20  +21  +21  +20  +23  -14
  +17  +20  +26  +23  +23  +26  +20  +17
  +18  +21  +23  +28  +28  +23  +21  +18
  +18  +21  +23  +28  +28  +23  +21  +18
  +17  +20  +26  +23  +23  +26  +20  +17
  +16  +23  +20  +21  +21  +20  +23  +16
   +9   +6   +7   +8   +8   +7   +6   +9
White Rooks Opening

Code: Select all

   +0   +3   +6   +9   +9   +6   +3   +0
  +25  +28  +31  +34  +34  +31  +28  +25
   +0   +3   +6   +9   +9   +6   +3   +0
   +0   +3   +6   +9   +9   +6   +3   +0
   +0   +3   +6   +9   +9   +6   +3   +0
   +0   +3   +6   +9   +9   +6   +3   +0
   +0   +3   +6   +9   +9   +6   +3   +0
   +1   +4   +7  +10  +10   +7   +4   +1
White Queens Opening

Code: Select all

  +100 +100 +100 +100 +100 +100 +100 +100
  +115 +115 +115 +115 +115 +115 +115 +115
  +100 +100 +100 +100 +100 +100 +100 +100
  +100 +100 +100 +100 +100 +100 +100 +100
  +100 +100 +100 +100 +100 +100 +100 +100
  +100 +100 +100 +100 +100 +100 +100 +100
  +100 +100 +100 +100 +100 +100 +100 +100
   +95  +95  +95  +95  +95  +95  +95  +95
White King Opening

Code: Select all

  -175 -175 -175 -175 -175 -175 -175 -175
  -150 -150 -150 -150 -150 -150 -150 -150
  -125 -125 -125 -125 -125 -125 -125 -125
  -100 -100 -100 -100 -100 -100 -100 -100
   -75  -75  -75  -75  -75  -75  -75  -75
   -50  -50  -50  -50  -50  -50  -50  -50
   +50  +50   +0   +0   +0   +0  +50  +50
   +50  +50   +0   +0  +20   +0  +50  +50
White Pawns Endgame

Code: Select all

  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
  +0   +0   +0   +0   +0   +0   +0   +0
White Knights Endgame

Code: Select all

  +0   +3   +6   +9   +9   +6   +3   +0
  +3  +12  +15  +18  +18  +15  +12   +3
  +6  +15  +21  +24  +24  +21  +15   +6
  +9  +18  +24  +27  +27  +24  +18   +9
  +9  +18  +24  +27  +27  +24  +18   +9
  +6  +15  +21  +24  +24  +21  +15   +6
  +3  +12  +15  +18  +18  +15  +12   +3
  +0   +3   +6   +9   +9   +6   +3   +0
White Bishops Endgame

Code: Select all

 +20  +22  +24  +26  +26  +24  +22  +20
 +22  +28  +30  +32  +32  +30  +28  +22
 +24  +30  +34  +36  +36  +34  +30  +24
 +26  +32  +36  +38  +38  +36  +32  +26
 +26  +32  +36  +38  +38  +36  +32  +26
 +24  +30  +34  +36  +36  +34  +30  +24
 +22  +28  +30  +32  +32  +30  +28  +22
 +20  +22  +24  +26  +26  +24  +22  +20
White Rooks Endgame

Code: Select all

 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
 +25  +25  +25  +25  +25  +25  +25  +25
White Queens Endgame

Code: Select all

 +80  +83  +86  +89  +89  +86  +83  +80
 +83  +92  +95  +98  +98  +95  +92  +83
 +86  +95 +101 +104 +104 +101  +95  +86
 +89  +98 +104 +107 +107 +104  +98  +89
 +89  +98 +104 +107 +107 +104  +98  +89
 +86  +95 +101 +104 +104 +101  +95  +86
 +83  +92  +95  +98  +98  +95  +92  +83
 +80  +83  +86  +89  +89  +86  +83  +80
White King Endgame

Code: Select all

   +0  +10  +20  +30  +30  +20  +10   +0
  +10  +40  +50  +60  +60  +50  +40  +10
  +20  +50  +70  +80  +80  +70  +50  +20
  +30  +60  +80  +90  +90  +80  +60  +30
  +30  +60  +80  +90  +90  +80  +60  +30
  +20  +50  +70  +80  +80  +70  +50  +20
  +10  +40  +50  +60  +60  +50  +40  +10
   +0  +10  +20  +30  +30  +20  +10   +0

Post Reply