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);