stockfish evaluation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Uri Blass
Posts: 10358
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

stockfish evaluation

Post by Uri Blass »

I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: stockfish evaluation

Post by bob »

Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
yl84
Posts: 21
Joined: Tue Sep 07, 2010 6:37 pm

Re: stockfish evaluation

Post by yl84 »

bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: stockfish evaluation

Post by bob »

yl84 wrote:
bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
I simply do not worry about pins. Since in normal games, we can now reach depths > 24 plies, that should be _plenty_ of time for the search to find a way to exploit the pin, if it is exploitable. Otherwise, it can be ignored. Yes, the idea of trying to categorize positions as "static" or "dynamic" is a good idea. But it is non-trivial and certainly has a computational cost. Can one make the cost low enough that the benefit outweighs it? Hard to say. So far, it would seem "no" but that doesn't mean "forever no".
yl84
Posts: 21
Joined: Tue Sep 07, 2010 6:37 pm

Re: stockfish evaluation

Post by yl84 »

bob wrote:
yl84 wrote:
bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
I simply do not worry about pins. Since in normal games, we can now reach depths > 24 plies, that should be _plenty_ of time for the search to find a way to exploit the pin, if it is exploitable. Otherwise, it can be ignored. Yes, the idea of trying to categorize positions as "static" or "dynamic" is a good idea. But it is non-trivial and certainly has a computational cost. Can one make the cost low enough that the benefit outweighs it? Hard to say. So far, it would seem "no" but that doesn't mean "forever no".
I understand that when the engine reach depths > 24 plies, you do not have to worry about things that you should when reaching only 8 plies for instance. I'm not speaking about Crafty of course but for weaker engines, for example when remaining time is not enough, in some cases the reached depths are lower than those at the beginning of the game. May it be that looking at these dynamic components is interesting for low depths? This remember me other discussions here, people saying that extensions/reductions were more important in the past compared to the present (because of high depths reached by modern engines). Nevertheless the extensions reductions remains important for weak engines like mine :wink: . Although I have not found a good way to make them efficient up to now (I should try again the hanging pieces, pins, mate threats idea)
Uri Blass
Posts: 10358
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: stockfish evaluation

Post by Uri Blass »

bob wrote:
yl84 wrote:
bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
I simply do not worry about pins. Since in normal games, we can now reach depths > 24 plies, that should be _plenty_ of time for the search to find a way to exploit the pin, if it is exploitable. Otherwise, it can be ignored. Yes, the idea of trying to categorize positions as "static" or "dynamic" is a good idea. But it is non-trivial and certainly has a computational cost. Can one make the cost low enough that the benefit outweighs it? Hard to say. So far, it would seem "no" but that doesn't mean "forever no".
I think that the only way to know is by testing and pins clearly may be relevant in order to have better evaluation of the leaves of the tree.

The fact that you reach depth>24 plies does not mean that pins cannot happen in the leaves of the tree and
I see no reason to assume that it is not better to have better evaluation of these positions.

Of course you can usually solve pins that happens near the root by search but not all the pins happen near the root.

I remember reading that Zappa evaluates pins so it is not obvious that evaluating pins is a bad idea.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: stockfish evaluation

Post by bob »

yl84 wrote:
bob wrote:
yl84 wrote:
bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
I simply do not worry about pins. Since in normal games, we can now reach depths > 24 plies, that should be _plenty_ of time for the search to find a way to exploit the pin, if it is exploitable. Otherwise, it can be ignored. Yes, the idea of trying to categorize positions as "static" or "dynamic" is a good idea. But it is non-trivial and certainly has a computational cost. Can one make the cost low enough that the benefit outweighs it? Hard to say. So far, it would seem "no" but that doesn't mean "forever no".
I understand that when the engine reach depths > 24 plies, you do not have to worry about things that you should when reaching only 8 plies for instance. I'm not speaking about Crafty of course but for weaker engines, for example when remaining time is not enough, in some cases the reached depths are lower than those at the beginning of the game. May it be that looking at these dynamic components is interesting for low depths? This remember me other discussions here, people saying that extensions/reductions were more important in the past compared to the present (because of high depths reached by modern engines). Nevertheless the extensions reductions remains important for weak engines like mine :wink: . Although I have not found a good way to make them efficient up to now (I should try again the hanging pieces, pins, mate threats idea)
I suspect it is easier to reach reasonable depth than to try to statically evaluate pins, forks, threats, etc. The ideas behind LMR, futility pruning, null-move search, etc. are all well-known and well-publicized. As a beginner, I would first start by catching up to state-of-the-art before branching off into an area of search that has been left alone for good reasons to date...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: stockfish evaluation

Post by bob »

Uri Blass wrote:
bob wrote:
yl84 wrote:
bob wrote:
Uri Blass wrote:I played some games between stockfish and itself at small depth and
I think that it is possible to learn from games at small depth about ideas to improve the evaluation.

[D]r1bqkb1r/pppp1pp1/2n2n1p/6N1/4p3/1P2P3/PBPP1PPP/RN1QKB1R w KQkq - 0 6

stockfish suggests Bxf6 at depth 2
I think that with improved evaluation it is possible to prevent the mistake because even if you do not have enough depth to calculate that you lose a piece a smart evaluation should tell you that 2 of your pieces are under threat and reduce something from the evaluation because of the fork.

[D]r6r/1ppk1pp1/8/3pq1p1/8/1P1nPP2/P2PK1PP/R2Q3R b - - 0 18

stockfish played Qf5 that is losing the knight after Qb1
A smart evaluation can detect the pin after Qf5 Qb1 and punish black for the pin.

I wonder the stockfish team tried to detect tactical motives in the evaluation.

Note that if you use evaluation for pruning decisions then detecting tactical motives can help to have better pruning(and it is more dangerous to prune when there the evaluation detects uncertainty because of pins or because of fork).
My comment is that the cost is simply too great. Once you start trying to evaluate dynamic (vs static) considerations, you've opened Pandora's box. Pins are not always bad. If you evaluate them, you have to get it right. Or else, let the deep search resolve the pin (which is a dynamic consideration) using a dynamic solution.

The better answer is to simply not give your (static) evaluation a position that has complex dynamic components, it is going to make mistakes. That's why we have the q-search, the extensions, etc... To try to remove the dynamic components and give only a quiet static position to the Evaluation.
So in the first position, you do not allow to enter in QS after 1. Bxf6 Qxf6 ? That means it is better not to enter in QS when there are hanging pieces of high value (to be defined), and also that you are giving this position "an extension" ? This question is just to undertand and try to improve my engine: I have noticed some silly lines in the PV of my engine since I do not have this kind of extension (nor threat mate detection)
Yves
I simply do not worry about pins. Since in normal games, we can now reach depths > 24 plies, that should be _plenty_ of time for the search to find a way to exploit the pin, if it is exploitable. Otherwise, it can be ignored. Yes, the idea of trying to categorize positions as "static" or "dynamic" is a good idea. But it is non-trivial and certainly has a computational cost. Can one make the cost low enough that the benefit outweighs it? Hard to say. So far, it would seem "no" but that doesn't mean "forever no".
I think that the only way to know is by testing and pins clearly may be relevant in order to have better evaluation of the leaves of the tree.

The fact that you reach depth>24 plies does not mean that pins cannot happen in the leaves of the tree and
I see no reason to assume that it is not better to have better evaluation of these positions.

Of course you can usually solve pins that happens near the root by search but not all the pins happen near the root.

I remember reading that Zappa evaluates pins so it is not obvious that evaluating pins is a bad idea.
Just because it does that doesn't mean it is the right thing to do. But we were discussing going much farther than just pins, to include forks and other such tactical ideas. Those are very difficult to evaluate. They are hard enough to resolve with search.