Simplify aspiration window code

Here the main difference is that now we center
aspiration window on last returned score. This allows
to simplify handling of mate scores.

We have done a reversed SPRT tests, where we wanted to
verify if master is stronger than this patch.

Long TC: master vs this patch (reverse test)
LLR: -2.95 (-2.94,2.94)
Total: 37992 W: 7012 L: 6920 D: 24060

bench: 4507288
This commit is contained in:
Marco Costalba
2013-07-03 08:54:44 +02:00
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -231,7 +231,7 @@ ifeq ($(COMP),clang)
endif endif
### 3.2 General compiler settings ### 3.2 General compiler settings
CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) CXXFLAGS = -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
ifeq ($(comp),gcc) ifeq ($(comp),gcc)
CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
@@ -275,6 +275,8 @@ endif
### 3.4 Debugging ### 3.4 Debugging
ifeq ($(debug),no) ifeq ($(debug),no)
CXXFLAGS += -DNDEBUG CXXFLAGS += -DNDEBUG
else
CXXFLAGS += -g
endif endif
### 3.5 Optimization ### 3.5 Optimization
@@ -354,6 +356,7 @@ endif
### needs access to the optimization flags. ### needs access to the optimization flags.
ifeq ($(comp),gcc) ifeq ($(comp),gcc)
ifeq ($(optimize),yes) ifeq ($(optimize),yes)
ifeq ($(debug),no)
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.` GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.` GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \))) ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
@@ -361,6 +364,7 @@ ifeq ($(comp),gcc)
LDFLAGS += $(CXXFLAGS) LDFLAGS += $(CXXFLAGS)
endif endif
endif endif
endif
endif endif
### ========================================================================== ### ==========================================================================
+2 -1
View File
@@ -821,7 +821,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
// If there is an enemy rook or queen attacking the pawn from behind, // If there is an enemy rook or queen attacking the pawn from behind,
// add all X-ray attacks by the rook or queen. Otherwise consider only // add all X-ray attacks by the rook or queen. Otherwise consider only
// the squares in the pawn's path attacked or occupied by the enemy. // the squares in the pawn's path attacked or occupied by the enemy.
if (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s)) if ( (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) // Unlikely
&& (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s)))
unsafeSquares = squaresToQueen; unsafeSquares = squaresToQueen;
else else
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them)); unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));