]> git.sesse.net Git - stockfish/commit - src/pawns.cpp
Pawn clean up
authorAlain SAVARD <support@multicim.com>
Thu, 25 Jul 2019 07:02:26 +0000 (09:02 +0200)
committerStéphane Nicolet <cassio@free.fr>
Thu, 25 Jul 2019 07:05:08 +0000 (09:05 +0200)
commit33c3a0465358116560174ae7421144be714e43f9
treee371f32d0fb4a21f61de38bfa0e0b3cce7a13063
parentdc243a3c880d0a736fb93848cf56e3221e07f8a3
Pawn clean up

Non functional simplification when we find the passed pawns in pawn.cpp
and some code clean up. It also better follows the pattern "flag the pawn"
and "score the pawn".

-------------------------

The idea behind the third condition for candidate passed pawn is a little
bit difficult to visualize. Just for the record, the idea is the following:

Consider White e5 d4 against black e6. d4 can (in some endgames) push
to d5 and lever e6. Thanks to this sacrifice, or after d5xe6, we consider
e5 as "passed".

However:
- if White e5/d4 against black e6/c6: d4 cannot safely push to d5 since d5 is double attacked;
- if White e5/d4 against black e6/d5: d4 cannot safely push to d5 since it is occupied.

This is exactly what the following expression does:

```
   && (shift<Up>(support) & ~(theirPawns | dblAttackThem)))
```

--------------------------

http://tests.stockfishchess.org/tests/view/5d3325bb0ebc5925cf0e6e91
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 124666 W: 27586 L: 27669 D: 69411

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

No functional change
src/pawns.cpp
src/search.cpp