1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Retire enoughMaterial + lower trapped rook threshold

Here speed up is the name of the game.

Speed up is gained:

- Removing the useless enoughMaterial code

- Limiting trapped rook evaluation to where it counts

Tested at long TC:
LLR: 2.97 (-2.94,2.94)
Total: 10061 W: 1948 L: 1790 D: 6323

bench: 4558173
This commit is contained in:
Tom Vijlbrief 2013-07-13 11:46:59 +02:00 committed by Marco Costalba
parent bf90499fc3
commit 6960f41e03
2 changed files with 2 additions and 5 deletions

View file

@ -554,7 +554,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
if (ei.pi->semiopen(Us, file_of(s)))
score += ei.pi->semiopen(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile;
if (mob > 6 || ei.pi->semiopen(Us, file_of(s)))
if (mob > 3 || ei.pi->semiopen(Us, file_of(s)))
continue;
Square ksq = pos.king_square(Us);

View file

@ -1126,7 +1126,7 @@ moves_loop: // When in check and at SpNode search starts from here
Key posKey;
Move ttMove, move, bestMove;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
bool givesCheck, enoughMaterial, evasionPrunable;
bool givesCheck, evasionPrunable;
Depth ttDepth;
// To flag BOUND_EXACT a node with eval above alpha and no available moves
@ -1168,7 +1168,6 @@ moves_loop: // When in check and at SpNode search starts from here
{
ss->staticEval = ss->evalMargin = VALUE_NONE;
bestValue = futilityBase = -VALUE_INFINITE;
enoughMaterial = false;
}
else
{
@ -1196,7 +1195,6 @@ moves_loop: // When in check and at SpNode search starts from here
alpha = bestValue;
futilityBase = ss->staticEval + ss->evalMargin + Value(128);
enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMg;
}
// Initialize a MovePicker object for the current position, and prepare
@ -1218,7 +1216,6 @@ moves_loop: // When in check and at SpNode search starts from here
&& !InCheck
&& !givesCheck
&& move != ttMove
&& enoughMaterial
&& type_of(move) != PROMOTION
&& !pos.is_passed_pawn_push(move))
{