Thoth, what's different

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Thoth, what's different

Post by Dann Corbit »

Code: Select all

King eval modifies the score this way:
return score * pos.this_thread()->kgA;

Threats eval modifies the score this way:
return score * pos.this_thread()->thB;

This (standard SF):
    // Initialize score by reading the incrementally updated scores included in
    // the position object (material + piece square tables) and the material
    // imbalance. Score is computed internally from the white point of view.
    Score score = pos.psq_score() + me->imbalance() + pos.this_thread()->contempt;
Is changed to this (Thoth):
    // Initialize score by reading the incrementally updated scores included in
    // the position object (material + piece square tables) and the material
    // imbalance. Score is computed internally from the white point of view.
    Score score = pos.psq_score() * pos.this_thread()->MagicTacticSolver + me->imbalance() + pos.this_thread()->contempt;

There is a calculation for total piece counts by single type:

After this line (found in both Evaluation<T>::value() templates):
    score += initiative(eg_value(score));

We find this:
//exchange tune

    int Pus = 16 - pos.count<PAWN>();
    int Kus = 4 - pos.count<KNIGHT>();
    int Bus = 4 - pos.count<BISHOP>();
    int Rus = 4 - pos.count<ROOK>();
    int Qus = 2 - pos.count<QUEEN>();

    score += pos.this_thread()->Pex * Pus;
    score += pos.this_thread()->Kex * Kus;
    score += pos.this_thread()->Bex * Bus;
    score += pos.this_thread()->Rex * Rus;
    score += pos.this_thread()->Qex * Qus;

In search, right below the contempt calculation (identical in both):
    // In evaluate.cpp the evaluation is from the white point of view
    contempt = (us == WHITE ?  make_score(ct, ct / 2)
                : -make_score(ct, ct / 2));

We find this:
    if(!Options["MagicTacticSolver"]) {
        MagicTacticSolver = 1;
    }
    else if(Options["MagicTacticSolver"]) {
        MagicTacticSolver = 1/1000;
    }

    if(MagicTacticSolver == 1/1000) {
        kgA = 1/100;
        thB = 100;
    }
    else if(MagicTacticSolver == 1) {
        kgA = 1;
        thB = 1;
    }

    int pehh = int(Options["Pawn Exchange"])/16;
    int kehh = int(Options["Knight Exchange"])/4;
    int behh = int(Options["Bishop Exchange"])/4;
    int rehh = int(Options["Rook Exchange"])/4;
    int qehh = int(Options["Queen Exchange"])/2;

    Pex = (us == WHITE ?  make_score(pehh, pehh / 2)
           : -make_score(pehh, pehh / 2));
    Kex = (us == WHITE ?  make_score(kehh, kehh / 2)
           : -make_score(kehh, kehh / 2));
    Bex = (us == WHITE ?  make_score(behh, behh / 2)
           : -make_score(behh, behh / 2));
    Rex = (us == WHITE ?  make_score(rehh, rehh / 2)
           : -make_score(rehh, rehh / 2));
    Qex = (us == WHITE ?  make_score(qehh, qehh / 2)
           : -make_score(qehh, qehh / 2));

These are added to the end of the thread class:
    uint16_t MagicTacticSolver;
    uint16_t kgA;
    uint16_t thB;
    Score Pex;
    Score Kex;
    Score Bex;
    Score Rex;
    Score Qex;

These UCI options are added:
    o["MagicTacticSolver"]     << Option(false);
    o["Pawn Exchange"]         << Option(0, -1000, 1000);
    o["Knight Exchange"]       << Option(0, -1000, 1000);
    o["Bishop Exchange"]       << Option(0, -1000, 1000);
    o["Rook Exchange"]         << Option(0, -1000, 1000);
    o["Queen Exchange"]        << Option(0, -1000, 1000);
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Paul Bedrey
Posts: 1146
Joined: Thu Mar 09, 2006 11:46 am
Location: Saratoga Springs New York

Re: Thoth, what's different

Post by Paul Bedrey »

Hopefully they'll incorporate this change in Brainfish. I've read Laskos explanation of how it can be used against LC and it makes sense. I've been playing Stockfish 10 against Houdini and Komodo with a couple of testsets that reduce the draw rate and Stockfish is really impressive when pieces remain on the board. It's hard to fathom LC being much better but there's ample proof.
Wish I knew how to compile but I'm computer illiterate.