Too bad. You would know I have done my homeworks before posting.AndrewGrant wrote: ↑Wed Sep 30, 2020 7:36 pm I stopped reading after that. Go take a look at Ethereal.
I missed that page however I don't understand why Stockfish is not mentioned in the main Github page of Ethereal.https://github.com/AndyGrant/Ethereal/wiki Look harder.
Anyway, I read in the wiki:
Let me help you complete it then, I have a long list.If you see something in Ethereal that you believe should be listed here, contact me
N.1: Evaluation of pawn shelter/storm. Anyone can see it's pretty much the same as Stockfish's one.
Ethereal:
Code: Select all
// Evaluate King Shelter & King Storm threat by looking at the file of our King,
// as well as the adjacent files. When looking at pawn distances, we will use a
// distance of 7 to denote a missing pawn, since distance 7 is not possible otherwise.
for (int file = MAX(0, fileOf(kingSq) - 1); file <= MIN(FILE_NB - 1, fileOf(kingSq) + 1); file++) {
// Find closest friendly pawn at or above our King on a given file
uint64_t ours = myPawns & Files[file] & forwardRanksMasks(US, rankOf(kingSq));
int ourDist = !ours ? 7 : abs(rankOf(kingSq) - rankOf(backmost(US, ours)));
// Find closest enemy pawn at or above our King on a given file
uint64_t theirs = enemyPawns & Files[file] & forwardRanksMasks(US, rankOf(kingSq));
int theirDist = !theirs ? 7 : abs(rankOf(kingSq) - rankOf(backmost(US, theirs)));
// Evaluate King Shelter using pawn distance. Use separate evaluation
// depending on the file, and if we are looking at the King's file
ei->pkeval[US] += KingShelter[file == fileOf(kingSq)][file][ourDist];
if (TRACE) T.KingShelter[file == fileOf(kingSq)][file][ourDist][US]++;
// Evaluate King Storm using enemy pawn distance. Use a separate evaluation
// depending on the file, and if the opponent's pawn is blocked by our own
blocked = (ourDist != 7 && (ourDist == theirDist - 1));
ei->pkeval[US] += KingStorm[blocked][mirrorFile(file)][theirDist];
if (TRACE) T.KingStorm[blocked][mirrorFile(file)][theirDist][US]++;
}
Code: Select all
/// Entry::evaluate_shelter() calculates the shelter bonus and the storm
/// penalty for a king, looking at the king file and the two closest files.
template<Color Us>
Score Entry::evaluate_shelter(const Position& pos, Square ksq) const {
constexpr Color Them = ~Us;
Bitboard b = pos.pieces(PAWN) & ~forward_ranks_bb(Them, ksq);
Bitboard ourPawns = b & pos.pieces(Us) & ~pawnAttacks[Them];
Bitboard theirPawns = b & pos.pieces(Them);
Score bonus = make_score(5, 5);
File center = std::clamp(file_of(ksq), FILE_B, FILE_G);
for (File f = File(center - 1); f <= File(center + 1); ++f)
{
b = ourPawns & file_bb(f);
int ourRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
b = theirPawns & file_bb(f);
int theirRank = b ? relative_rank(Us, frontmost_sq(Them, b)) : 0;
int d = edge_distance(f);
bonus += make_score(ShelterStrength[d][ourRank], 0);
if (ourRank && (ourRank == theirRank - 1))
bonus -= BlockedStorm[theirRank];
else
bonus -= make_score(UnblockedStorm[d][theirRank], 0);
}
return bonus;
}