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 rank based bonus for blocked pawns. #2794

Closed

Conversation

locutus2
Copy link
Member

@locutus2 locutus2 commented Jul 5, 2020

This is a rewrite of my original idea which uses only two parameters. Thanks to rocky640 for pointing this out.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 50800 W: 9707 L: 9446 D: 31647
Ptnml(0-2): 831, 5851, 11822, 6018, 878
https://tests.stockfishchess.org/tests/view/5f00b4f359f6f03532894304

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 52064 W: 6477 L: 6167 D: 39420
Ptnml(0-2): 331, 4628, 15834, 4878, 361
https://tests.stockfishchess.org/tests/view/5f0115fe59f6f03532894345

Bench: 4882833

@mstembera
Copy link
Contributor

Congrats! Just curious why it makes sense to stop at rank 3?

@Rocky640
Copy link

Rocky640 commented Jul 6, 2020

example 1; white e4, black e5. Both pawn on relative rank r = RANK_4. So the bonus will cancel out.

example 2: white e3 black e4. White pawn on r=RANK_3, Black pawn on r=RANK_5
let's say you give bonus S(a,b) or white pawn, and bonus S(c, d) for black pawn.
at the end of the day, you can simply give S(a-c, b-d) for white pawn, and S(0,0) for black

example 3: white e2 black e3. White pawn on r=RANK_2, Black pawn on r=RANK_6
let's say you give bonus S(a,b) or white pawn, and bonus S(c, d) for black pawn.
at the end of the day, you can simply give S(a-c, b-d) for white pawn, and S(0,0) for black

Therefore it is useless to score blocked pawn on r>=RANK_4 so we score only for r < RANK_4

@vondele vondele added the to be merged Will be merged shortly label Jul 6, 2020
@locutus2
Copy link
Member Author

locutus2 commented Jul 6, 2020

if it feels more familiar i could do a non-functional rewrite so that rank 5 and 6 are get the bonus.

constexpr Score BlockedPawn[2] = { S(-10, -3), S(-3, 3) };

if (blocked && r > RANK_4)
            score += BlockedPawn[r-4];

@snicolet
Copy link
Member

snicolet commented Jul 6, 2020

if it feels more familiar i could do a non-functional rewrite so that rank 5 and 6 are get the bonus.

Yes, that would be an incentive for developers to work on the subject or tweak the bonuses, as we think of fawn pawns as advanced pawns in the 5th and 6th ranks.

@locutus2
Copy link
Member Author

locutus2 commented Jul 6, 2020

@snicolet
Ok, i have pushed the rewritten version and add a comment at the bonus that its clear that this counts for 5th and 6th rank.

This is a rewrite of my original idea which uses only two parameters. Thanks to rocky640 for pointing this out.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 50800 W: 9707 L: 9446 D: 31647
Ptnml(0-2): 831, 5851, 11822, 6018, 878
https://tests.stockfishchess.org/tests/view/5f00b4f359f6f03532894304

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 52064 W: 6477 L: 6167 D: 39420
Ptnml(0-2): 331, 4628, 15834, 4878, 361
https://tests.stockfishchess.org/tests/view/5f0115fe59f6f03532894345

Bench: 4882833
@locutus2
Copy link
Member Author

locutus2 commented Jul 6, 2020

Correct grammatical error in commit and PR message (insert is)

@xoto10
Copy link
Contributor

xoto10 commented Jul 6, 2020

The only thing that puzzles me is that the bonus is almost always negative, so it's really a penalty for advanced pawns :(

On the upside, it gives us more flexibility/detail in scoring these pawns, which should be a good thing, and perhaps future tuning will refine the various values that affect these pawns :)

@locutus2
Copy link
Member Author

locutus2 commented Jul 6, 2020

@xoto10
This values simply say that we currently overevaluated blocked pawns on the 5th and 6th rank the most time.

@vondele vondele closed this in 7225d25 Jul 6, 2020
@vondele
Copy link
Member

vondele commented Jul 6, 2020

Thanks!

mstembera pushed a commit to mstembera/Stockfish that referenced this pull request Jul 6, 2020
ddugovic pushed a commit to ddugovic/Stockfish that referenced this pull request Jul 7, 2020
Fix for overevaluated blocked pawns on the 5th and 6th rank.
This is a rewrite of the original idea that uses only two parameters.
Thanks to rocky640 for pointing this out.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 50800 W: 9707 L: 9446 D: 31647
Ptnml(0-2): 831, 5851, 11822, 6018, 878
https://tests.stockfishchess.org/tests/view/5f00b4f359f6f03532894304

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 52064 W: 6477 L: 6167 D: 39420
Ptnml(0-2): 331, 4628, 15834, 4878, 361
https://tests.stockfishchess.org/tests/view/5f0115fe59f6f03532894345

closes official-stockfish#2794

Bench: 4882833
noobpwnftw pushed a commit to noobpwnftw/Stockfish that referenced this pull request Aug 15, 2020
Fix for overevaluated blocked pawns on the 5th and 6th rank.
This is a rewrite of the original idea that uses only two parameters.
Thanks to rocky640 for pointing this out.

STC:
LLR: 2.94 (-2.94,2.94) {-0.50,1.50}
Total: 50800 W: 9707 L: 9446 D: 31647
Ptnml(0-2): 831, 5851, 11822, 6018, 878
https://tests.stockfishchess.org/tests/view/5f00b4f359f6f03532894304

LTC:
LLR: 2.93 (-2.94,2.94) {0.25,1.75}
Total: 52064 W: 6477 L: 6167 D: 39420
Ptnml(0-2): 331, 4628, 15834, 4878, 361
https://tests.stockfishchess.org/tests/view/5f0115fe59f6f03532894345

closes official-stockfish#2794

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

Successfully merging this pull request may close these issues.

6 participants