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
if (ei.pi->semiopen(Us, file_of(s)))
score += ei.pi->semiopen(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile;
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);
continue;
Square ksq = pos.king_square(Us);
Key posKey;
Move ttMove, move, bestMove;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
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
Depth ttDepth;
// To flag BOUND_EXACT a node with eval above alpha and no available moves
{
ss->staticEval = ss->evalMargin = VALUE_NONE;
bestValue = futilityBase = -VALUE_INFINITE;
{
ss->staticEval = ss->evalMargin = VALUE_NONE;
bestValue = futilityBase = -VALUE_INFINITE;
- enoughMaterial = false;
alpha = bestValue;
futilityBase = ss->staticEval + ss->evalMargin + Value(128);
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
}
// Initialize a MovePicker object for the current position, and prepare
&& !InCheck
&& !givesCheck
&& move != ttMove
&& !InCheck
&& !givesCheck
&& move != ttMove
&& type_of(move) != PROMOTION
&& !pos.is_passed_pawn_push(move))
{
&& type_of(move) != PROMOTION
&& !pos.is_passed_pawn_push(move))
{