1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Drop the lever condition for backwards

We can view the patch version as adding some "undermining bonus" for
level pawns, when the defending side can not easily avoid the exchange
by advancing her pawn.

• Case 1) White b2,c3, Black a3,b3:
          Black is breaking through, b2 deserves a penalty

• Case 2) White b2,c3, Black a3,c4:
          if b2xa3 then White ends up with a weak pawn on a3
          and probably a weak pawn on c3 too.

In either case, White can still not safely play b2-b3 and make a
phalanx with c3, which is the essence of a backward pawn definition.

Passed STC in SPRT[0, 4]:
LLR: -2.96 (-2.94,2.94) [0.00,4.00]
Total: 131169 W: 26523 L: 26199 D: 78447
http://tests.stockfishchess.org/tests/view/5aefa4d50ebc5902a409a151
ELO 1.19 [-0.38,2.88] (95%)

Passed LTC in SPRT[-3, 1]:
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 24824 W: 3732 L: 3617 D: 17475
http://tests.stockfishchess.org/tests/view/5af04d3f0ebc5902a88b2e55
ELO 1.27 [-1.21,3.70] (95%)

Closes https://github.com/official-stockfish/Stockfish/pull/1584

How to continue from there?

There were some promising tests a couple of months ago about adding
a lever condition for king danger in evaluate.cpp, maybe it would
be time to re-try this after all the recent changes in pawns.cpp

Bench: 4773882
This commit is contained in:
Alain SAVARD 2018-05-08 11:00:51 +02:00 committed by Stéphane Nicolet
parent 8d1625d6df
commit 6634f41ac9
2 changed files with 11 additions and 5 deletions

View file

@ -117,8 +117,14 @@ public:
MovePicker(const MovePicker&) = delete;
MovePicker& operator=(const MovePicker&) = delete;
MovePicker(const Position&, Move, Value, const CapturePieceToHistory*);
MovePicker(const Position&, Move, Depth, const ButterflyHistory*, const CapturePieceToHistory*, Square);
MovePicker(const Position&, Move, Depth, const ButterflyHistory*, const CapturePieceToHistory*, const PieceToHistory**, Move, Move*);
MovePicker(const Position&, Move, Depth, const ButterflyHistory*,
const CapturePieceToHistory*,
Square);
MovePicker(const Position&, Move, Depth, const ButterflyHistory*,
const CapturePieceToHistory*,
const PieceToHistory**,
Move,
Move*);
Move next_move(bool skipQuiets = false);
private:

View file

@ -118,7 +118,7 @@ namespace {
// A pawn is backward when it is behind all pawns of the same color
// on the adjacent files and cannot be safely advanced.
backward = !lever && !(ourPawns & pawn_attack_span(Them, s + Up))
backward = !(ourPawns & pawn_attack_span(Them, s + Up))
&& (stoppers & (leverPush | (s + Up)));
// Passed pawns will be properly scored in evaluation because we need
@ -223,7 +223,7 @@ Value Entry::evaluate_shelter(const Position& pos, Square ksq) {
Value safety = (ourPawns & file_bb(ksq)) ? Value(5) : Value(-5);
if ((shift<Down>(theirPawns) & (FileABB | FileHBB) & BlockRanks) & ksq)
if (shift<Down>(theirPawns) & (FileABB | FileHBB) & BlockRanks & ksq)
safety += 374;
File center = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));