"Stockfish Evaluation Guide" tool

6950 views
Skip to first unread message

hxi...@gmail.com

unread,
Jan 22, 2017, 9:48:16 AM1/22/17
to FishCooking
Hello,
i developed tool where you can investigate each part of Stockfish static evaluation function. It is standalone single HTML page with javascript. Every evaluation term is rewritten in single small javascript function. You can setup any position with FEN or by moving pieces on chessboard and see how evaluation is computed and what is result and if possible to attach score to individal squares it is visualized on chessboard. It is possible to edit or add/remove evaluation terms and save your changes into new file. Check out "Table" tab for same table as provided by Stockfish "eval" command or "Graph" tab for nice graph. Lazy evaluation, specialized evaluation function and specialized scaling function are not included. Other parts should be equivalent to Stockfish evaluation function version from 22.01.2017 but i guess there may still be some bugs. I tested it in desktop Firefox and Google Chrome browser. It may or may not work in other browsers.

Download link here:
https://drive.google.com/file/d/0B9VqaIaDT-tAWWFMN1hxbi1Tb1U/view

Mikael

unread,
Jan 22, 2017, 11:12:21 AM1/22/17
to FishCooking, hxi...@gmail.com
Nicest tool ever. :-) Good work! I'm sure it will give us some new ideas to test.

I think I found an improvement. Currently the "per square values" board is far from the main board. If all boards could be visible side by side, the values would be easier to read.

Mikael

unread,
Jan 22, 2017, 11:17:56 AM1/22/17
to FishCooking, hxi...@gmail.com
Another thing... The Isolated total, and backward total pages, do not show any boards or values.


On Sunday, January 22, 2017 at 3:48:16 PM UTC+1, hxi...@gmail.com wrote:

algot...@gmail.com

unread,
Jan 22, 2017, 11:22:04 AM1/22/17
to FishCooking, hxi...@gmail.com
hxim: this is completely awesome !!!

This will become a premium tool for skilled analysts who wants to understand and refine stockfish evaluations based on specific positions.

Strong chess players who are not programmers will also be able to see what is going on and propose new ideas.

On Chrome, I tried everything I could in the last hour, and was really enjoyed to see that everything is well documented, and working accurately and flawlessly.

On Internet Explorer 11, some links does not work (but who uses that anyway).

Some remarks
a) It would be nice to output shelter_weakness separate from shelter_storm
b) We can move pieces around, as in a game, but cannot scroll back
But we can easily paste a fen in the upper right window, which is fine for now. pgn browsing support might be a future feature too.

c) If I choose "Other checks totals", it will display correctly checks by knight, bishop and rooks (but not queen).

But if I choose "Other checks", it displays also the queen checks at the right (and also in the per square tables at the bottom). It is fine, because you are illustrating "your" helper function, but it can be a bit misleading if someone thinks that it goes into the main evaluation.

Maybe adding some note for "your" helper functions might make this more clear.

Awesome !!!

-Rocky


Rens de Vries

unread,
Jan 22, 2017, 11:41:04 AM1/22/17
to FishCooking, hxi...@gmail.com
Amazing tool! Very well done!

-TueRens

Op zondag 22 januari 2017 15:48:16 UTC+1 schreef hxi...@gmail.com:

joster

unread,
Jan 22, 2017, 12:06:42 PM1/22/17
to FishCooking, hxi...@gmail.com
Breathtaking!

hxi...@gmail.com

unread,
Jan 22, 2017, 1:11:24 PM1/22/17
to FishCooking, hxi...@gmail.com
Thanks for your suggestions.
Also i just noticed one problem with "King danger" it was implemented from the other side and comment is wrong - it detects our attack on enemy king instead of like in Stockfish where it is enemy attack on our king.


> The Isolated total, and backward total pages, do not show any boards or values.

i turn them off because here i had to merge middlegame and endgame logic into one function with parameter because of the graph where i need for each value displayed there one function=eval.term which controls it. you can turn them on in edit tab but you will see only endgame values i think.

> It would be nice to output shelter_weakness separate from shelter_storm

good idea


Other thing i forgot:
- you can add/change pieces on board with doubleclick
- you can reset board to initial position by writing "reset" into search box
- you can flip board and colors by writing "colorflip" into search box
- you can change side to move by writing "sidetomove" into search box
- you can edit name, group, text, code and some visualization options for each eval.term/page in edit tab

VoyagerOne

unread,
Jan 23, 2017, 9:52:38 AM1/23/17
to FishCooking, hxi...@gmail.com
Incredible work!

This deserves more attention.

Gary should link this webpage from fishtest dashboard.


For those who are IT challenged...
Just save the file on your desktop and open it up with chrome/IE/Firefox.
Message has been deleted
Message has been deleted

chess...@gmail.com

unread,
Jan 23, 2017, 12:59:07 PM1/23/17
to FishCooking, hxi...@gmail.com
Outstanding! Thanks so much for this tool! The Graph and Table Views are awesome!

hxi...@gmail.com

unread,
Jan 26, 2017, 3:04:33 PM1/26/17
to FishCooking, hxi...@gmail.com
Hello,
I uploaded NEW VERSION. I fixed some bugs and added some features requested in this thread. You can undo your moves/changes with little arrows or copy/paste PGN of game into searchbox. CTRL + click on arrow to go to beggining or end. Now if you make legal move in position move counters are updated correctly and side to move is changed automatically.

Download link is same:
https://drive.google.com/file/d/0B9VqaIaDT-tAWWFMN1hxbi1Tb1U/view

hxi...@gmail.com

unread,
Jan 26, 2017, 3:23:51 PM1/26/17
to FishCooking, hxi...@gmail.com

VoyagerOne

unread,
Jan 26, 2017, 3:35:36 PM1/26/17
to FishCooking, hxi...@gmail.com
You sir, are a genius!

I have a few suggestions:

The side bar where you have (Attack, Helper...etc.) make them blue links as users may not know to click on them...hiding your awesome work.
The tiny arrows were difficult to find even though I knew they were there...might be a good idea to increase the size and/or highlight them.

Maybe have the Main evaluation under the board also shows the pawn score as well....
Example:
Main evaluation = 645 (3.15)

Again amazing work...you are quite talented.

Rens de Vries

unread,
Jan 26, 2017, 4:01:39 PM1/26/17
to FishCooking, hxi...@gmail.com
Absolutely amazing work indeed.

Thanks for your dedication and keep up the amazing work!

Op donderdag 26 januari 2017 21:23:51 UTC+1 schreef hxi...@gmail.com:

Günther Demetz

unread,
Jan 27, 2017, 3:54:13 AM1/27/17
to FishCooking, hxi...@gmail.com
This tool is great! You're a very gifted developer.

Lyudmil Antonov

unread,
Jan 27, 2017, 4:48:04 AM1/27/17
to FishCooking, hxi...@gmail.com
Comparing the group breakdown at the left and the position table, we can see that the groups "Attack" and "Helpers" are missing from the position table. It's likely, then, that SF evaluation is incomplete. 

hxi...@gmail.com

unread,
Jan 27, 2017, 8:52:40 AM1/27/17
to FishCooking, hxi...@gmail.com
Dne pátek 27. ledna 2017 10:48:04 UTC+1 Lyudmil Antonov napsal(a):
> Comparing the group breakdown at the left and the position table, we can see that the groups "Attack" and "Helpers" are missing from the position table. It's likely, then, that SF evaluation is incomplete. 

No no it is containing functions used in other evaluation parts as subroutines. You can find out for each of them in which ones in Code section after the text "It is used in following parent evaluation terms" there is list.

Lyudmil Antonov

unread,
Jan 27, 2017, 9:02:35 AM1/27/17
to FishCooking, hxi...@gmail.com
Ok, I see now. Excellent work!


Sam Watson

unread,
Jan 27, 2017, 3:18:06 PM1/27/17
to FishCooking, hxi...@gmail.com
Wow, that is a tool of great beauty.

One request, can we pass a FEN via a URL in someway?

hxi...@gmail.com

unread,
Jan 28, 2017, 5:01:37 AM1/28/17
to FishCooking, hxi...@gmail.com
Dne pátek 27. ledna 2017 21:18:06 UTC+1 Sam Watson napsal(a):
Hello,
i just added this feature and suggestions from VoyagerOne.
You can now put same things as you can put in search box into url parameter like this:
FEN:
https://hxim.github.io/Stockfish-Evaluation-Guide/index.html?p=2r5/5RR1/1bPk4/1P5p/6b1/3B4/2K5/8%20b%20-%20-%206%2068
PGN:
https://hxim.github.io/Stockfish-Evaluation-Guide/index.html?p=1.e4%20e5%202.Nf3
Search for page:
https://hxim.github.io/Stockfish-Evaluation-Guide/index.html?p=King%20danger

VoyagerOne

unread,
Jan 28, 2017, 11:29:45 AM1/28/17
to FishCooking, hxi...@gmail.com
I can't give you enough compliments on this tool!

New features are very nice.  Pawn score is very helpful.

Thanks again!!

P.S.

We should link your site from fishtest... pronto.

lilmafya

unread,
Jan 28, 2017, 11:59:57 AM1/28/17
to FishCooking, hxi...@gmail.com
I would suggest to make it visible in the board whose turn is, and maybe an option to exchange turn to move to the other side.
Other than the small "w" or "b" that it's visible in the FEN code.

David Joerg

unread,
Feb 3, 2017, 9:12:24 AM2/3/17
to FishCooking, hxi...@gmail.com
Hi! This tool is super interesting. Is the code for the tool itself available somewhere? I have been working on something similar, now I wonder if I should integrate my work with what you did or continue on my own path.

Best regards, —David

David Joerg

unread,
Feb 3, 2017, 9:15:56 AM2/3/17
to FishCooking, hxi...@gmail.com
To be clear (and sorry for replying to my own post), I see https://github.com/hxim/Stockfish-Evaluation-Guide, however the code here seems like it might/must have been generated through some process of consuming the original Stockfish source, which would be the true "source code" of the project, rather than the index.html in Stockfish-Evaluation-Guide.

Alexandre Meirelles

unread,
Feb 3, 2017, 6:32:42 PM2/3/17
to FishCooking, hxi...@gmail.com
Pls!! 

This tool is amazing.

Cheers!
Message has been deleted

hxi...@gmail.com

unread,
Feb 5, 2017, 5:06:05 AM2/5/17
to FishCooking, hxi...@gmail.com
Dne pátek 3. února 2017 15:15:56 UTC+1 David Joerg napsal(a):
> To be clear (and sorry for replying to my own post), I see https://github.com/hxim/Stockfish-Evaluation-Guide, however the code here seems like it might/must have been generated through some process of consuming the original Stockfish source, which would be the true "source code" of the project, rather than the index.html in Stockfish-Evaluation-Guide.

No such process. The code for the tool (HTML, Javascript) itself is written by hand in text editor and the text for pages and code for individual evaluation parts is written by hand in the tool itself in "Edit" tab.

hxi...@gmail.com

unread,
Feb 5, 2017, 5:09:45 AM2/5/17
to FishCooking, hxi...@gmail.com
New version is available https://hxim.github.io/Stockfish-Evaluation-Guide/
- new side to move icon / button
- evaluation updated to recent Stockfish version:
* Candidate passed pawns
* Simplify away QueenContactChecks

lilmafya

unread,
Feb 5, 2017, 8:34:23 AM2/5/17
to FishCooking, hxi...@gmail.com
Thank you alot for taking into consideration my suggestion, the new button/icon looks woderful

hxi...@gmail.com

unread,
Feb 5, 2017, 12:06:29 PM2/5/17
to FishCooking, hxi...@gmail.com
One more new version https://hxim.github.io/Stockfish-Evaluation-Guide/
- added highlight of legal move target squares when doing moves on chessboard (green circle)

Gary Linscott

unread,
Feb 6, 2017, 10:53:03 PM2/6/17
to FishCooking, hxi...@gmail.com
Wow, this is truly an incredibly piece of work!!  I've linked it from fishtest.  Should be a huge help for people trying to interpret the evaluation.

hxi...@gmail.com

unread,
Feb 25, 2017, 5:29:19 AM2/25/17
to FishCooking, hxi...@gmail.com
https://hxim.github.io/Stockfish-Evaluation-Guide/

updated with recent evaluation changes:
- Simplify Queen Mobility
- Retire small bonus in passed pawn evaluation
- Retire loose enemies bonus
- Variable tuning
- Keep pawns on both flanks
- Pieces protecting king

Stephane Nicolet

unread,
Feb 26, 2017, 7:58:06 AM2/26/17
to FishCooking, hxi...@gmail.com

Thanks a lot !

Rens de Vries

unread,
Feb 27, 2017, 8:44:11 AM2/27/17
to FishCooking, hxi...@gmail.com
Thank you for the update. Keep up the good work!

Op zaterdag 25 februari 2017 11:29:19 UTC+1 schreef hxi...@gmail.com:

Patrick Goetz

unread,
Mar 4, 2017, 6:12:11 PM3/4/17
to FishCooking, hxi...@gmail.com
This tool is awesome.

lilmafya

unread,
Apr 8, 2017, 7:23:11 PM4/8/17
to FishCooking, hxi...@gmail.com
Hi dear,

I think I found a bug in the Stockfish Evaluation Tool with the help of Rocky (Alain).

In the TrappedRook code,

you are using :
if ((kx < 4) != (square.x < kx)) return 0;

While you should use the following as the master:
if ((kx < 4) != (square.x < 4)) return 0;

hxi...@gmail.com

unread,
Apr 11, 2017, 4:51:08 AM4/11/17
to FishCooking, hxi...@gmail.com
Dne neděle 9. dubna 2017 1:23:11 UTC+2 Fauzi napsal(a):
I see this in master (evaluate.cpp line 356):
if ( ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq)))
which i think is same as

hxi...@gmail.com

unread,
Apr 13, 2017, 6:38:55 AM4/13/17
to FishCooking, hxi...@gmail.com
https://hxim.github.io/Stockfish-Evaluation-Guide/

updated with recent evaluation changes:

- Change definition of "weak" in threats calculation
- Pawns count imbalance table
- Simplify ThreatBySafePawn scoring
- Remove minimum to contribution from king danger to score.

m5wi...@gmail.com

unread,
May 30, 2017, 1:37:35 AM5/30/17
to FishCooking, hxi...@gmail.com
Hi, great work!

For position "r1bqkb1r/2pp1p2/2n2n1p/1p2p3/p3P1pN/P2P2B1/BPP2PPP/RN1QK2R b KQkq - 0 1" you code gives me main evaluation value as -36 (-0.15). Stockfish 8PNACL Depth 29 at lichess for this position gives evaluation as "+0.9 1... d6 and +1.0 1... Be7". If I move black bishop to e7 than your code evaluates the position as "Main evaluation = -19 (-0.08) Middle game evaluation = -39 (-0.16)". Could you explaine me why these evaluations are so different between you code and Stockfish 8PNACL? Sorry for my English.

hxi...@gmail.com

unread,
May 30, 2017, 3:20:32 AM5/30/17
to FishCooking, hxi...@gmail.com, m5wi...@gmail.com
Dne úterý 30. května 2017 7:37:35 UTC+2 m5wi...@gmail.com napsal(a):
> Hi, great work!
>
> For position "r1bqkb1r/2pp1p2/2n2n1p/1p2p3/p3P1pN/P2P2B1/BPP2PPP/RN1QK2R b KQkq - 0 1" you code gives me main evaluation value as -36 (-0.15). Stockfish 8PNACL Depth 29 at lichess for this position gives evaluation as "+0.9 1... d6 and +1.0 1... Be7". If I move black bishop to e7 than your code evaluates the position as "Main evaluation = -19 (-0.08) Middle game evaluation = -39 (-0.16)". Could you explaine me why these evaluations are so different between you code and Stockfish 8PNACL? Sorry for my English.

Hello, "Stockfish Evaluation Guide" computes only static evaluation (the function looks only at the current position and does not explore possible moves)
see https://en.wikipedia.org/wiki/Evaluation_function
and Stockfish at lichess performs full evaluation with search to some depth so this is why is numbers so different

hxi...@gmail.com

unread,
Jun 3, 2017, 3:49:42 AM6/3/17
to FishCooking, hxi...@gmail.com
https://hxim.github.io/Stockfish-Evaluation-Guide/

updated with recent evaluation changes:

- Doubled and supported pawns
- Remove cap from space score contribution and increase bonus
- King safety parameters improved
- Remove cap in kingDanger initialization
- Bonus for pawn scrifice which create passed pawn
- King safety and rook mobility parameters tweak
- Linear Protector bonus by distance
- Limit king ring to eight squares
- Use a fraction of king danger in endgame score
- Do check analysis later in the game

Stephane Nicolet

unread,
Jun 3, 2017, 4:33:01 AM6/3/17
to FishCooking, hxi...@gmail.com
Awesome! Thanks a lot... 

Rens de Vries

unread,
Jun 5, 2017, 2:27:04 PM6/5/17
to FishCooking, hxi...@gmail.com
Thanks for updating!

hxi...@gmail.com

unread,
Sep 9, 2017, 8:03:39 AM9/9/17
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

updated with recent evaluation changes:

- Extend ShelterWeakness array by dimension isKingFile
- Queen vs. Minors imbalance
- Tuned PSQT using a custom tuner.
- Rework the "unsupported" penalty into a "supported" bonus
- Tweak connected pawns seed[] array values
- Count all weak squares in the king ring with a single popcount

Stephane Nicolet

unread,
Sep 10, 2017, 1:30:41 PM9/10/17
to FishCooking
Thanks, as usual :-)

hxi...@gmail.com

unread,
Dec 31, 2017, 2:00:53 PM12/31/17
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

fixed bug in Candidate passed eval
and updated with recent evaluation changes:
- Include x-ray attacks through all queens independently of the color.
- Remove QueenMinorsImbalance array #1340
- Simplify other checks #1334, Simplify other checks (#1337)
- Don't consider defending queen as check blocker (#1328)
- Attack threats
- Simplify away the PawnSet[] imbalance array (#1308)
- Simplify some kingring penalties expressions
- Simplify bonus for bishop on long diagonal
- Good bishops on the main diagonals
- Score unopposed weak pawns only if majors

Bryan

unread,
Dec 31, 2017, 2:19:43 PM12/31/17
to FishCooking
Thank you!

algot...@gmail.com

unread,
Dec 31, 2017, 5:40:05 PM12/31/17
to FishCooking
Thanks for maintaining this. Very useful.

hxi...@gmail.com

unread,
Jan 1, 2018, 3:52:54 AM1/1/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

Hello I just fixed more bugs and verified it produces same static evaluation as current dev Stockfish for positions that are
- not in check
- not using lazy evaluation
- not using specialized eval function
- not using specialized scaling function

I checked it for all such positions from Strategic Test Suite here: https://sites.google.com/site/strategictestsuite/

Lester Antonio Tattersall Rodriguez

unread,
Jan 1, 2018, 5:55:45 AM1/1/18
to FishCooking
Thank you very much.

Bryan

unread,
Feb 4, 2018, 8:57:04 PM2/4/18
to FishCooking
hxim, I use your tool almost every day. Thank you very much for creating it and for keeping it updated. I really like the ability to enter an entire pgn, and walk sequentially through each of a game's positions. I'd like to offer a suggestion that would help analyze games. In addition to the FEN "Graph" feature, which is very helpful, I'm wondering if you could include a pgn point-to-point line Graph, with the x-axis as move number, and the y axis as centipawns. By default it would graph all the static evaluation criteria, each with a differently colored line. But the user could select whichever static eval criteria he wanted to display in the graph. This might allow us to discover more correlations between the progression of dynamic engine eval over the course of a game, and the various criteria underling static eval. Again, thank you so much for building this useful tool. Some of the improvements to SF this past year have come directly from its use.

hxi...@gmail.com

unread,
Feb 25, 2018, 3:29:12 PM2/25/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

new game history graph (as requested by Bryan)


and updated with recent evaluation changes:

- Remove ThreatByHangingPawn bonus (#1356)
- Use mobility in kingsafety (#1360)
- Limit the king distance factor when evaluating passed pawns (#1373)
- Retire lever (#1378)
- A combo of 3 successful tuning patches
- Simplify trapped rook

Bryan

unread,
Feb 25, 2018, 3:50:39 PM2/25/18
to FishCooking
Oh my goodness, this is amazing, Jan. Wow, look at this! Thank you so much!!! This is incredible.
Screenshot-2018-2-25 Stockfish Evaluation Guide.png

Bryan

unread,
Feb 27, 2018, 1:42:38 AM2/27/18
to FishCooking
Jan, one helpful addition for the "game history graph" would be an ability to see the "main evaluation" throughout the game history as an additional line option. Again, thank you very much for this feature!

Νικόλαος Μανωλακος

unread,
Feb 27, 2018, 10:31:15 AM2/27/18
to Bryan, FishCooking
Hi Jan, I’d love to help u with this in anyway possible.

hxi...@gmail.com

unread,
Feb 27, 2018, 1:35:53 PM2/27/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

Hello I just added "Total" for "game history graph" (should be equal to main evaluation except rounding errors)
and "Add custom..." where you can custom functions for example
$middle_game_evaluation(pos) ... for middle game eval only
$threats_mg(pos)-$threats_eg(pos) ... for difference between middle game threats eval and end game threats eval
or anything you need to show in graph...

Bryan

unread,
Feb 27, 2018, 8:38:26 PM2/27/18
to FishCooking
Excellent! Thank you!

profe...@gmail.com

unread,
Feb 28, 2018, 8:47:22 PM2/28/18
to FishCooking
El domingo, 22 de enero de 2017, 9:48:16 (UTC-5), hxi...@gmail.com escribió:
> Hello,
> i developed tool where you can investigate each part of Stockfish

Hello, I invite you to know the new results of the games that Stockfish 9 got playing with the variant 23. .. Kg7 on the famous game that played against DeepMind's Alphazero.
http://openchessengines.blogspot.pe/2018/02/



Bryan

unread,
Mar 3, 2018, 3:37:15 PM3/3/18
to FishCooking
Jan, I'm using the game history graph and I notice that two additional features would be helpful. First, it would be helpful to have tick marks with move numbers (at least maybe 10, 20, 30) at the bottom of the graph on the x-axis, so the viewer can see right away at which move number something happens in the graph. Second, it would be helpful to be able to limit the game history graph to a section of move numbers (e.g. move number 17 to move number 31) so that the viewer can focus on a particular section of the game instead of viewing only the whole game. Again, thanks very much for this tool!


On Tuesday, February 27, 2018 at 12:35:53 PM UTC-6, hxi...@gmail.com wrote:

hxi...@gmail.com

unread,
Mar 5, 2018, 12:27:36 PM3/5/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

Added move number filter and move number labels to game history graph

Bryan

unread,
Mar 5, 2018, 12:33:08 PM3/5/18
to FishCooking
Perfect! Thank you!

Stephane Nicolet

unread,
Mar 5, 2018, 8:17:43 PM3/5/18
to FishCooking

Yes, thanks you VERY much for the continuous work you do of this tool.
Words are missing to describe how useful it is :-) 
Stéphane

MajorAid

unread,
Mar 14, 2018, 4:17:06 AM3/14/18
to FishCooking
This is amazing to zone in on areas needing improvements!

Many thanks

hxi...@gmail.com

unread,
Apr 21, 2018, 6:59:30 AM4/21/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

Added some worth ELO values of various evaluation parts from table by Fauzi
- https://onedrive.live.com/view.aspx?resid=7D656668E4E2C5E8!153&ithint=file%2cxlsx&app=Excel&authkey=!AKe5M9qAPiXN5z8)
- https://groups.google.com/forum/?fromgroups=#!topic/fishcooking/nHefeQYb2v8

Updated with recent evaluation changes:
- Simplify condition in space definition
- Introduce Overload
- Remove the Queen from the mobility area of minor pieces
- Candidate Passed Pawn
- Tweak queen values for midgame and endgame
- Simplification: remove pawn shelter/storm masks
- Make kingRing always 8 squares
- Adjust initiative in pure pawn endgames
- Connectivity Score S(3,1) is stronger than S(2,2)
- Implement an old Russian proverb
- Two steps slider threats on queen
- Knight threats on Queen
- Blocked pawn storm
- Count passed pawns in asymmetry measure

Bryan

unread,
Apr 21, 2018, 9:06:17 AM4/21/18
to FishCooking
Thank you!

Bryan

unread,
May 28, 2018, 4:57:20 PM5/28/18
to FishCooking
Evaluate.cpp describes the long diagonal bishop bonus at lines 360-363 as

// Bonus for bishop on a long diagonal which can "see" both center squares
if (more_than_one(Center & (attacks_bb<BISHOP>(s, pos.pieces(PAWN)) | s)))
score += LongDiagonalBishop;
}

So here's a FEN: r5k1/6pb/1q6/2pP3B/2Pn1PPP/p1Q1p3/8/B1R1K3 w - - 1 57

At that FEN, SEG gives this bonus to the white bishop on a1. (See the attached graphic.) I thought that "see both center squares" meant that either no pieces were blocking that long diagonal, or that it was occupied at most by a transparent piece, namely a queen or same-colored bishop, or a same-colored pawn on the nearer center square. So I don't understand how the bishop on a1 is thought to be seeing both center squares of the a1-h8 diagonal while a black knight occupies the d4 square, because to me a knight is not transparent to a bishop attack, and therefore the white bishop on a1 is not seeing the e5 square. What am I missing?
LongDiagonalBonus_Move57w.png

Stefan Geschwentner

unread,
May 29, 2018, 6:01:52 AM5/29/18
to FishCooking
For this calculation actually only pawns from both sides used as blockers for the bishop.

Stefan Geschwentner

unread,
May 29, 2018, 6:11:59 AM5/29/18
to FishCooking

algot...@gmail.com

unread,
May 29, 2018, 2:37:48 PM5/29/18
to FishCooking
// Bonus for bishop on a long diagonal which can "see" both center squares

Yes, we are taking about x-ray vision here (squares that are attacked by a bishop on a board with pawns but no other pieces).
If White has a Bg2 and Black a pawn d5, white gets the bonus.
If White has a Bg2 and Black some pawns on c6 and d5, white gets the bonus too.
And a bishop on e4, d4, d5 or e5 always get the bonus too.

Message has been deleted

hxi...@gmail.com

unread,
Jul 17, 2018, 2:28:34 PM7/17/18
to FishCooking
https://hxim.github.io/Stockfish-Evaluation-Guide/

Updated with recent evaluation changes:
- Remove rank limitation for MinorBehindPawn
- Tuned Values after 2 million spsa games
- Simplify ThreatByKing to be a single Score.
- Simplify KingProtector penalty.
- Simplify HinderPassedPawn bonus
- Another set of tuned values after one million games
- Increase outflanking weight to 12
- Tuned values after 505k games
- Slight simplification in scale factor computation
- Simplify BlockedByPawn to one dimension
- Simplify shelter: always do strength and danger
- Tweak kingAttackersCount and KingAttackWeights
- Include all blockers in king danger
- Consolidate pawn storm types
- Tuned some pawns and evaluation constants
- Drop the lever condition for backwards
- Simplify the backward pawns code
- Tweak the connected[] array value for pawns on rank 5
- Use special rule for BlockedByKing
- Penalty for bad bishop with blocked central files
- Always scale using pawn contribution
- No Queen in the MobilityArea
- Simplify the ShelterStrength[] array
- Simplify KBPKB endgame with opposite bishops

Bryan

unread,
Jul 21, 2018, 1:14:47 PM7/21/18