mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Remove pawn history from ProbCut constructor
use same style as other history tables Passed STC: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 184672 W: 46953 L: 46896 D: 90823 Ptnml(0-2): 604, 21095, 48887, 21140, 610 https://tests.stockfishchess.org/tests/view/654766b4136acbc573526602 closes https://github.com/official-stockfish/Stockfish/pull/4865 No functional change
This commit is contained in:
parent
442c294a07
commit
d0e87104aa
3 changed files with 12 additions and 16 deletions
|
@ -89,7 +89,7 @@ MovePicker::MovePicker(const Position& p,
|
||||||
const ButterflyHistory* mh,
|
const ButterflyHistory* mh,
|
||||||
const CapturePieceToHistory* cph,
|
const CapturePieceToHistory* cph,
|
||||||
const PieceToHistory** ch,
|
const PieceToHistory** ch,
|
||||||
const PawnHistory& ph,
|
const PawnHistory* ph,
|
||||||
Move cm,
|
Move cm,
|
||||||
const Move* killers) :
|
const Move* killers) :
|
||||||
pos(p),
|
pos(p),
|
||||||
|
@ -112,7 +112,7 @@ MovePicker::MovePicker(const Position& p,
|
||||||
const ButterflyHistory* mh,
|
const ButterflyHistory* mh,
|
||||||
const CapturePieceToHistory* cph,
|
const CapturePieceToHistory* cph,
|
||||||
const PieceToHistory** ch,
|
const PieceToHistory** ch,
|
||||||
const PawnHistory& ph,
|
const PawnHistory* ph,
|
||||||
Square rs) :
|
Square rs) :
|
||||||
pos(p),
|
pos(p),
|
||||||
mainHistory(mh),
|
mainHistory(mh),
|
||||||
|
@ -129,11 +129,9 @@ MovePicker::MovePicker(const Position& p,
|
||||||
|
|
||||||
// Constructor for ProbCut: we generate captures with SEE greater
|
// Constructor for ProbCut: we generate captures with SEE greater
|
||||||
// than or equal to the given threshold.
|
// than or equal to the given threshold.
|
||||||
MovePicker::MovePicker(
|
MovePicker::MovePicker(const Position& p, Move ttm, Value th, const CapturePieceToHistory* cph) :
|
||||||
const Position& p, Move ttm, Value th, const CapturePieceToHistory* cph, const PawnHistory& ph) :
|
|
||||||
pos(p),
|
pos(p),
|
||||||
captureHistory(cph),
|
captureHistory(cph),
|
||||||
pawnHistory(ph),
|
|
||||||
ttMove(ttm),
|
ttMove(ttm),
|
||||||
threshold(th) {
|
threshold(th) {
|
||||||
assert(!pos.checkers());
|
assert(!pos.checkers());
|
||||||
|
@ -188,6 +186,7 @@ void MovePicker::score() {
|
||||||
m.value += (*continuationHistory[2])[pc][to] / 4;
|
m.value += (*continuationHistory[2])[pc][to] / 4;
|
||||||
m.value += (*continuationHistory[3])[pc][to];
|
m.value += (*continuationHistory[3])[pc][to];
|
||||||
m.value += (*continuationHistory[5])[pc][to];
|
m.value += (*continuationHistory[5])[pc][to];
|
||||||
|
m.value += (*pawnHistory)[pawn_structure(pos)][pc][to];
|
||||||
|
|
||||||
// bonus for checks
|
// bonus for checks
|
||||||
m.value += bool(pos.check_squares(pt) & to) * 16384;
|
m.value += bool(pos.check_squares(pt) & to) * 16384;
|
||||||
|
@ -209,8 +208,6 @@ void MovePicker::score() {
|
||||||
: pt != PAWN ? bool(to & threatenedByPawn) * 15000
|
: pt != PAWN ? bool(to & threatenedByPawn) * 15000
|
||||||
: 0)
|
: 0)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
m.value += pawnHistory[pawn_structure(pos)][pc][to];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else // Type == EVASIONS
|
else // Type == EVASIONS
|
||||||
|
@ -221,7 +218,7 @@ void MovePicker::score() {
|
||||||
else
|
else
|
||||||
m.value = (*mainHistory)[pos.side_to_move()][from_to(m)]
|
m.value = (*mainHistory)[pos.side_to_move()][from_to(m)]
|
||||||
+ (*continuationHistory[0])[pos.moved_piece(m)][to_sq(m)]
|
+ (*continuationHistory[0])[pos.moved_piece(m)][to_sq(m)]
|
||||||
+ pawnHistory[pawn_structure(pos)][pos.moved_piece(m)][to_sq(m)];
|
+ (*pawnHistory)[pawn_structure(pos)][pos.moved_piece(m)][to_sq(m)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ class MovePicker {
|
||||||
const ButterflyHistory*,
|
const ButterflyHistory*,
|
||||||
const CapturePieceToHistory*,
|
const CapturePieceToHistory*,
|
||||||
const PieceToHistory**,
|
const PieceToHistory**,
|
||||||
const PawnHistory&,
|
const PawnHistory*,
|
||||||
Move,
|
Move,
|
||||||
const Move*);
|
const Move*);
|
||||||
MovePicker(const Position&,
|
MovePicker(const Position&,
|
||||||
|
@ -153,9 +153,9 @@ class MovePicker {
|
||||||
const ButterflyHistory*,
|
const ButterflyHistory*,
|
||||||
const CapturePieceToHistory*,
|
const CapturePieceToHistory*,
|
||||||
const PieceToHistory**,
|
const PieceToHistory**,
|
||||||
const PawnHistory&,
|
const PawnHistory*,
|
||||||
Square);
|
Square);
|
||||||
MovePicker(const Position&, Move, Value, const CapturePieceToHistory*, const PawnHistory&);
|
MovePicker(const Position&, Move, Value, const CapturePieceToHistory*);
|
||||||
Move next_move(bool skipQuiets = false);
|
Move next_move(bool skipQuiets = false);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -170,7 +170,7 @@ class MovePicker {
|
||||||
const ButterflyHistory* mainHistory;
|
const ButterflyHistory* mainHistory;
|
||||||
const CapturePieceToHistory* captureHistory;
|
const CapturePieceToHistory* captureHistory;
|
||||||
const PieceToHistory** continuationHistory;
|
const PieceToHistory** continuationHistory;
|
||||||
const PawnHistory& pawnHistory;
|
const PawnHistory* pawnHistory;
|
||||||
Move ttMove;
|
Move ttMove;
|
||||||
ExtMove refutations[3], *cur, *endMoves, *endBadCaptures;
|
ExtMove refutations[3], *cur, *endMoves, *endBadCaptures;
|
||||||
int stage;
|
int stage;
|
||||||
|
|
|
@ -855,8 +855,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
|
||||||
{
|
{
|
||||||
assert(probCutBeta < VALUE_INFINITE);
|
assert(probCutBeta < VALUE_INFINITE);
|
||||||
|
|
||||||
MovePicker mp(pos, ttMove, probCutBeta - ss->staticEval, &captureHistory,
|
MovePicker mp(pos, ttMove, probCutBeta - ss->staticEval, &captureHistory);
|
||||||
thisThread->pawnHistory);
|
|
||||||
|
|
||||||
while ((move = mp.next_move()) != MOVE_NONE)
|
while ((move = mp.next_move()) != MOVE_NONE)
|
||||||
if (move != excludedMove && pos.legal(move))
|
if (move != excludedMove && pos.legal(move))
|
||||||
|
@ -915,7 +914,7 @@ moves_loop: // When in check, search starts here
|
||||||
prevSq != SQ_NONE ? thisThread->counterMoves[pos.piece_on(prevSq)][prevSq] : MOVE_NONE;
|
prevSq != SQ_NONE ? thisThread->counterMoves[pos.piece_on(prevSq)][prevSq] : MOVE_NONE;
|
||||||
|
|
||||||
MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &captureHistory, contHist,
|
MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &captureHistory, contHist,
|
||||||
thisThread->pawnHistory, countermove, ss->killers);
|
&thisThread->pawnHistory, countermove, ss->killers);
|
||||||
|
|
||||||
value = bestValue;
|
value = bestValue;
|
||||||
moveCountPruning = singularQuietLMR = false;
|
moveCountPruning = singularQuietLMR = false;
|
||||||
|
@ -1484,7 +1483,7 @@ Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth) {
|
||||||
// will be generated.
|
// will be generated.
|
||||||
Square prevSq = is_ok((ss - 1)->currentMove) ? to_sq((ss - 1)->currentMove) : SQ_NONE;
|
Square prevSq = is_ok((ss - 1)->currentMove) ? to_sq((ss - 1)->currentMove) : SQ_NONE;
|
||||||
MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &thisThread->captureHistory,
|
MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &thisThread->captureHistory,
|
||||||
contHist, thisThread->pawnHistory, prevSq);
|
contHist, &thisThread->pawnHistory, prevSq);
|
||||||
|
|
||||||
int quietCheckEvasions = 0;
|
int quietCheckEvasions = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue