suggest 2 changes in syzygy1/stockfish

Discussion of chess software programming and technical issues.

Moderator: Ras

acconcio
Posts: 22
Joined: Tue Feb 04, 2014 9:52 pm
Location: Italy Milan

suggest 2 changes in syzygy1/stockfish

Post by acconcio »

At the beginning of qsearch() in search.cpp

Code: Select all

    StateInfo st;
    const TTEntry* tte;
    Key posKey;
    Move ttMove, move, bestMove;
    Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
    bool givesCheck, evasionPrunable;
    Depth ttDepth;

+++++++++++++++++++++++ from here
    if (   depth >= TBProbeDepth
        && popcount<Full>(pos.pieces()) <= TBCardinality
        && pos.rule50_count() == 0
       )
    {
        int found, v = Tablebases::probe_wdl(pos, &found);

        if (found)
        {
            TBHits++;

            if (TB50MoveRule) {
                value = v < -1 ? -VALUE_MATE + MAX_PLY + ss->ply
                      : v >  1 ?  VALUE_MATE - MAX_PLY - ss->ply
                      : VALUE_DRAW + 2 * v;
            }
            else
            {
                value = v < 0 ? -VALUE_MATE + MAX_PLY + ss->ply
                      : v > 0 ?  VALUE_MATE - MAX_PLY - ss->ply
                      : VALUE_DRAW;
            }

            // Transposition table lookup
            posKey = pos.key(); 
            TT.store(posKey, value_to_tt(value, ss->ply), BOUND_EXACT,
                     depth + 6 * ONE_PLY, MOVE_NONE, VALUE_NONE);

            return value;
        }
    }
   +++++++++++++++++++++++++++++++++ to here
    // To flag BOUND_EXACT a node with eval above alpha and no available moves
    if (PvNode)
        oldAlpha = alpha;
in evaluate.cpp
just clean this bonus (syzygy will take care of that) from
namespace {
....
}

Code: Select all

/*
  // If booth have rook or rook vs Night/bishop looks for unstoppables
  if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) == RookValueEg *  2)
      score +=  evaluate_unstoppable_pawns(pos, WHITE, ei)
              - evaluate_unstoppable_pawns(pos, BLACK, ei);
*/
And when you make tests using cutechess or fishtest or whatever put in ram 5men table base and
give 1.5 G hash or more (5 is too much) if you can to single engine.
I made some thousand games test and looks like score is better, to be honest i tried stripping endgame from material.cpp, but the best result comes from this configuration.

thanks you and please be patient :)
If you find a better place to put this block in qsearch please let me know, i m going blind in a one-eyed country :)

P.S. do you know how to suggest this as a poll in github? it's beyond me :)
syzygy
Posts: 5874
Joined: Tue Feb 28, 2012 11:56 pm

Re: suggest 2 changes in syzygy1/stockfish

Post by syzygy »

I'm not going to add TB probing to the qsearch, but feel free to do this in your version of SF.
acconcio
Posts: 22
Joined: Tue Feb 04, 2014 9:52 pm
Location: Italy Milan

Re: suggest 2 changes in syzygy1/stockfish

Post by acconcio »

syzygy wrote:I'm not going to add TB probing to the qsearch, but feel free to do this in your version of SF.
for example while deepsjeng in fics is far ahead in win:

while in precedent games deepsjeng has:
Record for stoccafisso vs. DeepSjeng:
wins losses draws
rated 17 93 265

today i notice that for a while stoccafisso rating is up deepsjeng:

57: = 2796 W 2777 DeepSjeng [ br 3 0] D46 Rep Sun Mar 16, 15:43 CET 2014

And this was not an option before, so, for the moment i believe that this change works.

ciao e grazie!