Skip to content

Commit 6fbe027

Browse files
committed
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
2 parents db53883 + ddcb572 commit 6fbe027

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ ifeq ($(COMP),clang)
231231
endif
232232

233233
### 3.2 General compiler settings
234-
CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
234+
CXXFLAGS = -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS)
235235

236236
ifeq ($(comp),gcc)
237237
CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
@@ -275,6 +275,8 @@ endif
275275
### 3.4 Debugging
276276
ifeq ($(debug),no)
277277
CXXFLAGS += -DNDEBUG
278+
else
279+
CXXFLAGS += -g
278280
endif
279281

280282
### 3.5 Optimization
@@ -354,13 +356,15 @@ endif
354356
### needs access to the optimization flags.
355357
ifeq ($(comp),gcc)
356358
ifeq ($(optimize),yes)
359+
ifeq ($(debug),no)
357360
GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
358361
GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
359362
ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
360363
CXXFLAGS += -flto
361364
LDFLAGS += $(CXXFLAGS)
362365
endif
363366
endif
367+
endif
364368
endif
365369

366370
### ==========================================================================

src/evaluate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
821821
// If there is an enemy rook or queen attacking the pawn from behind,
822822
// add all X-ray attacks by the rook or queen. Otherwise consider only
823823
// the squares in the pawn's path attacked or occupied by the enemy.
824-
if (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s))
824+
if ( (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN)) // Unlikely
825+
&& (forward_bb(Them, s) & pos.pieces(Them, ROOK, QUEEN) & pos.attacks_from<ROOK>(s)))
825826
unsafeSquares = squaresToQueen;
826827
else
827828
unsafeSquares = squaresToQueen & (ei.attackedBy[Them][ALL_PIECES] | pos.pieces(Them));

0 commit comments

Comments
 (0)