Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add penalty for doubled pawns in agile pawn structures #3302

Closed

Conversation

Lolligerhans
Copy link
Contributor

@Lolligerhans Lolligerhans commented Jan 14, 2021

Cleanup

Like always, I did a slight cleanup for PR:

  1. replaced make_score with constexpr paramter for easier tuning. Named it DoubledEarly because, like explained in the commit message, it uses an early-game-indicator. Future tweaks can show which name would really be appropriate.
  2. Replaced the lenghty score += Score * bool construction with a not-as-lengthy if (bool) Score +=.

On my setup, the binary does change from these adjustments. I can also use the exact tested version instead.

Idea

The original idea was to penalize if only the doubled pawn formation is not facing their pawns. Any advancement or pawn break from them against our doubled pawns is discouraged: such breaks would allow us to un-double the pawns by simply taking at the first opportunity. It may be easier to pronounce the weakness of doubled pawns when given more chances to set up a favorable pawn structure against them.

The penalty is not yet tuned and no other tweaks were tried.

Generally, the current pawn scoring has some blind spots imposed by the concrete logic implemented. For example, if the doubled pawn in question is protected by our pawns, all existing doubled penalties are skipped.
This patch may only have been successful because it triggers penalties for doubled pawns in situations which the currently logic simply refuses to categorize as a weakness, and the constructed early-game-indicator may simply be predictive enough to identify these cases.

Funnily, I just forgot to restrict this idea to the current file_bb() for the test. The accidentally emerging notion of all pawns being able to freely take at least one step w/o being blocked/captured (aka early-game-indicator) may be an interesting starting point for other tweaks as well.
Or subject to future simplification removing the blind spot instead.

Give an additional penalty of S(20, 10) for any doubled pawn if none of
the opponent's pawns is facing any of our
 - pawns or
 - pawn attacks;
that means, each of their pawns can push at least one square without
being captured.
This ignores their non-pawns pieces and attacks.

One possible justification: Their pawns' ability to push freely provides
options to react to our threats by changing their pawn structure. Our
doubled pawns however will likely lead to an exploitable weakness, even
if the pawn structure is not yet fixed.

Note that the notion of "their pawns not being fixed" is symmetric for
both players: If all of their pawns can push freely so can ours. All
pawns being freely pushable might just be an early-game-indicator.
However, it can trigger during endgame pawns races, where doubled pawns
are especially hindering, too.

LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 134976 W: 17964 L: 17415 D: 99597
Ptnml(0-2): 998, 12702, 39619, 13091, 1078
https://tests.stockfishchess.org/tests/view/5ffdd5316019e097de3ef281

STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 35640 W: 7219 L: 6904 D: 21517
Ptnml(0-2): 645, 4096, 8084, 4289, 706
https://tests.stockfishchess.org/tests/view/5ffda4a16019e097de3ef265

Bench: 4363873
@Lolligerhans
Copy link
Contributor Author

Who forgot to links tests? I sure did not. ;)

@FauziAkram
Copy link
Contributor

@Lolligerhans congrats! looks very solid!
For inserting the links and the results of the tests, you can easily edit the PR

@FauziAkram
Copy link
Contributor

FauziAkram commented Jan 16, 2021

@Lolligerhans are you sure that vondele will merge this patch without you mentioning the links and the stats of the passed tests in the pr? Can you just add them to save time as most likely he will ask for them to be added?

@Lolligerhans
Copy link
Contributor Author

@FauziAkram The force push above was me replacing with a commit that has them.

@vondele vondele closed this in 77eeea4 Jan 17, 2021
joergoster pushed a commit to joergoster/Stockfish-old that referenced this pull request Jan 17, 2021
Give an additional penalty of S(20, 10) for any doubled pawn if none of
the opponent's pawns is facing any of our
 - pawns or
 - pawn attacks;
that means, each of their pawns can push at least one square without
being captured.
This ignores their non-pawns pieces and attacks.

One possible justification: Their pawns' ability to push freely provides
options to react to our threats by changing their pawn structure. Our
doubled pawns however will likely lead to an exploitable weakness, even
if the pawn structure is not yet fixed.

Note that the notion of "their pawns not being fixed" is symmetric for
both players: If all of their pawns can push freely so can ours. All
pawns being freely pushable might just be an early-game-indicator.
However, it can trigger during endgame pawns races, where doubled pawns
are especially hindering, too.

LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 134976 W: 17964 L: 17415 D: 99597
Ptnml(0-2): 998, 12702, 39619, 13091, 1078
https://tests.stockfishchess.org/tests/view/5ffdd5316019e097de3ef281

STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 35640 W: 7219 L: 6904 D: 21517
Ptnml(0-2): 645, 4096, 8084, 4289, 706
https://tests.stockfishchess.org/tests/view/5ffda4a16019e097de3ef265

closes official-stockfish/Stockfish#3302

Bench: 4363873
BM123499 pushed a commit to BM123499/Stockfish that referenced this pull request Feb 22, 2021
Give an additional penalty of S(20, 10) for any doubled pawn if none of
the opponent's pawns is facing any of our
 - pawns or
 - pawn attacks;
that means, each of their pawns can push at least one square without
being captured.
This ignores their non-pawns pieces and attacks.

One possible justification: Their pawns' ability to push freely provides
options to react to our threats by changing their pawn structure. Our
doubled pawns however will likely lead to an exploitable weakness, even
if the pawn structure is not yet fixed.

Note that the notion of "their pawns not being fixed" is symmetric for
both players: If all of their pawns can push freely so can ours. All
pawns being freely pushable might just be an early-game-indicator.
However, it can trigger during endgame pawns races, where doubled pawns
are especially hindering, too.

LTC
LLR: 2.94 (-2.94,2.94) {0.25,1.25}
Total: 134976 W: 17964 L: 17415 D: 99597
Ptnml(0-2): 998, 12702, 39619, 13091, 1078
https://tests.stockfishchess.org/tests/view/5ffdd5316019e097de3ef281

STC
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 35640 W: 7219 L: 6904 D: 21517
Ptnml(0-2): 645, 4096, 8084, 4289, 706
https://tests.stockfishchess.org/tests/view/5ffda4a16019e097de3ef265

closes official-stockfish#3302

Bench: 4363873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants