mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Simplify pieceValue to one phase.
Simplifies the usage of pieceValues to mg values with the exception of pawnValues, After the removal of PSQT. passed STC: https://tests.stockfishchess.org/tests/view/64d147845b17f7c21c0dd86c LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 197248 W: 50168 L: 50125 D: 96955 Ptnml(0-2): 651, 23029, 51222, 23070, 652 passed LTC: https://tests.stockfishchess.org/tests/view/64d212de5b17f7c21c0debbb LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 181170 W: 45949 L: 45893 D: 89328 Ptnml(0-2): 84, 19656, 51052, 19706, 87 closes https://github.com/official-stockfish/Stockfish/pull/4734 Bench: 1494401
This commit is contained in:
committed by
Disservin
parent
495852fecd
commit
3322349c1a
@@ -347,7 +347,7 @@ void Position::set_state() const {
|
||||
st->key ^= Zobrist::psq[pc][s];
|
||||
|
||||
if (type_of(pc) != KING && type_of(pc) != PAWN)
|
||||
st->nonPawnMaterial[color_of(pc)] += PieceValue[MG][pc];
|
||||
st->nonPawnMaterial[color_of(pc)] += PieceValue[pc];
|
||||
}
|
||||
|
||||
if (st->epSquare != SQ_NONE)
|
||||
@@ -742,7 +742,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
|
||||
}
|
||||
}
|
||||
else
|
||||
st->nonPawnMaterial[them] -= PieceValue[MG][captured];
|
||||
st->nonPawnMaterial[them] -= PieceValue[captured];
|
||||
|
||||
dp.dirty_num = 2; // 1 piece moved, 1 piece captured
|
||||
dp.piece[1] = captured;
|
||||
@@ -822,7 +822,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
|
||||
^ Zobrist::psq[pc][pieceCount[pc]];
|
||||
|
||||
// Update material
|
||||
st->nonPawnMaterial[us] += PieceValue[MG][promotion];
|
||||
st->nonPawnMaterial[us] += PieceValue[promotion];
|
||||
}
|
||||
|
||||
// Reset rule 50 draw counter
|
||||
@@ -1048,11 +1048,11 @@ bool Position::see_ge(Move m, Bitboard& occupied, Value threshold) const {
|
||||
|
||||
Square from = from_sq(m), to = to_sq(m);
|
||||
|
||||
int swap = PieceValue[MG][piece_on(to)] - threshold;
|
||||
int swap = PieceValue[piece_on(to)] - threshold;
|
||||
if (swap < 0)
|
||||
return false;
|
||||
|
||||
swap = PieceValue[MG][piece_on(from)] - swap;
|
||||
swap = PieceValue[piece_on(from)] - swap;
|
||||
if (swap <= 0)
|
||||
return true;
|
||||
|
||||
@@ -1089,7 +1089,7 @@ bool Position::see_ge(Move m, Bitboard& occupied, Value threshold) const {
|
||||
if ((bb = stmAttackers & pieces(PAWN)))
|
||||
{
|
||||
occupied ^= least_significant_square_bb(bb);
|
||||
if ((swap = PawnValueMg - swap) < res)
|
||||
if ((swap = PawnValue - swap) < res)
|
||||
break;
|
||||
|
||||
attackers |= attacks_bb<BISHOP>(to, occupied) & pieces(BISHOP, QUEEN);
|
||||
@@ -1098,14 +1098,14 @@ bool Position::see_ge(Move m, Bitboard& occupied, Value threshold) const {
|
||||
else if ((bb = stmAttackers & pieces(KNIGHT)))
|
||||
{
|
||||
occupied ^= least_significant_square_bb(bb);
|
||||
if ((swap = KnightValueMg - swap) < res)
|
||||
if ((swap = KnightValue - swap) < res)
|
||||
break;
|
||||
}
|
||||
|
||||
else if ((bb = stmAttackers & pieces(BISHOP)))
|
||||
{
|
||||
occupied ^= least_significant_square_bb(bb);
|
||||
if ((swap = BishopValueMg - swap) < res)
|
||||
if ((swap = BishopValue - swap) < res)
|
||||
break;
|
||||
|
||||
attackers |= attacks_bb<BISHOP>(to, occupied) & pieces(BISHOP, QUEEN);
|
||||
@@ -1114,7 +1114,7 @@ bool Position::see_ge(Move m, Bitboard& occupied, Value threshold) const {
|
||||
else if ((bb = stmAttackers & pieces(ROOK)))
|
||||
{
|
||||
occupied ^= least_significant_square_bb(bb);
|
||||
if ((swap = RookValueMg - swap) < res)
|
||||
if ((swap = RookValue - swap) < res)
|
||||
break;
|
||||
|
||||
attackers |= attacks_bb<ROOK>(to, occupied) & pieces(ROOK, QUEEN);
|
||||
@@ -1123,7 +1123,7 @@ bool Position::see_ge(Move m, Bitboard& occupied, Value threshold) const {
|
||||
else if ((bb = stmAttackers & pieces(QUEEN)))
|
||||
{
|
||||
occupied ^= least_significant_square_bb(bb);
|
||||
if ((swap = QueenValueMg - swap) < res)
|
||||
if ((swap = QueenValue - swap) < res)
|
||||
break;
|
||||
|
||||
attackers |= (attacks_bb<BISHOP>(to, occupied) & pieces(BISHOP, QUEEN))
|
||||
|
||||
Reference in New Issue
Block a user