Some more ideas
Moderator: Ras
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Some more ideas
As said, I will post now, when I have time, and people might browse the thread at their ease and discuss at a later point, when it is convenient for them.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
No pawn shelter
I think we somehow discussed this in the past, but my impression is that the message did not quite get through.
Maybe I was too unspecific, or maybe people simply did not understand me.
What is clear is that even engines like SF have very hard time getting this right, so I suppose it is even worse with weaker engines.
Anyway, the idea runs as follows: give some penalty, maybe some 20-30cps, only for the mg, in the case that on ranks 2 and 3 you do not find even a single own pawn part of the shelter.
[d]6k1/5p1p/6p1/6P1/5P2/8/8/6K1 w - - 0 1
the black king has couple of pawns part of the shelter on ranks 2 and 3, but the white king does not have even a single own pawn part of the shelter on ranks 2 and 3.
So a penalty is due in this case for the white king safety.
Under a shelter I understand squares on the files where the king is and the 2 adjacent files on the rank where the king is and the 2 ranks further apart.
The location of the king does not change the due penalty at that, as long as there are no own pawns on the file where the king is and the 2 adjacent files on the 2nd and 3rd ranks.
Of course, the penalty is very well deserved in the mg, for the simple reason that the king needs at least one own pawn nearby, in order to be safe. Having just a single own pawn nearby is fine, king safety could still be maintained, but having no pawns at all nearby usually means one way or another this king will come under an irresistible attack sooner or later.
The search might not see it, as quite often big depths are involved, but such a bare king definitely will come under an irresistible attack in the mg.
You might try applying this as an ad-hoc penalty, and if sufficiently well tuned, this might even bring you something, however, I think it is best to apply the rule and the penalty, only when the side that has no pawn shelter is not leading in score, i.e. the score is negative or 0.0.
With positive scores, it might be reasonable not to apply such a rule, as the side leading in score might quite often very well afford the luxury of having no pawn shelter at all, bringing all of its storming pawns into the attack, as it is the opponent that will have to defend, meaning that the own king will be safe.
So that, if you are leading in score, you might not apply the penalty, but if your score is not positive, even if fully equal, staying with no pawn shelter at all is extremely dangerous.
I do not know about SF, how the rule is applicable in SF, I know Joerg tried something along these lines that failed, however the point is that SF considers as a pawn shelter all ranks up to the 7th, which for me really does not make much sense.
Whatever, the way I think the rule should go is:
- no pawns on the 2nd and 3rd ranks on the files where the king is and the two adjacent files, then give the penalty for the mg
- if an ad-hoc penalty does not quite work, try to give the penalty only if score for the side with no pawn shelter is not positive
Anyone having tried something along these lines?
Maybe I was too unspecific, or maybe people simply did not understand me.
What is clear is that even engines like SF have very hard time getting this right, so I suppose it is even worse with weaker engines.
Anyway, the idea runs as follows: give some penalty, maybe some 20-30cps, only for the mg, in the case that on ranks 2 and 3 you do not find even a single own pawn part of the shelter.
[d]6k1/5p1p/6p1/6P1/5P2/8/8/6K1 w - - 0 1
the black king has couple of pawns part of the shelter on ranks 2 and 3, but the white king does not have even a single own pawn part of the shelter on ranks 2 and 3.
So a penalty is due in this case for the white king safety.
Under a shelter I understand squares on the files where the king is and the 2 adjacent files on the rank where the king is and the 2 ranks further apart.
The location of the king does not change the due penalty at that, as long as there are no own pawns on the file where the king is and the 2 adjacent files on the 2nd and 3rd ranks.
Of course, the penalty is very well deserved in the mg, for the simple reason that the king needs at least one own pawn nearby, in order to be safe. Having just a single own pawn nearby is fine, king safety could still be maintained, but having no pawns at all nearby usually means one way or another this king will come under an irresistible attack sooner or later.
The search might not see it, as quite often big depths are involved, but such a bare king definitely will come under an irresistible attack in the mg.
You might try applying this as an ad-hoc penalty, and if sufficiently well tuned, this might even bring you something, however, I think it is best to apply the rule and the penalty, only when the side that has no pawn shelter is not leading in score, i.e. the score is negative or 0.0.
With positive scores, it might be reasonable not to apply such a rule, as the side leading in score might quite often very well afford the luxury of having no pawn shelter at all, bringing all of its storming pawns into the attack, as it is the opponent that will have to defend, meaning that the own king will be safe.
So that, if you are leading in score, you might not apply the penalty, but if your score is not positive, even if fully equal, staying with no pawn shelter at all is extremely dangerous.
I do not know about SF, how the rule is applicable in SF, I know Joerg tried something along these lines that failed, however the point is that SF considers as a pawn shelter all ranks up to the 7th, which for me really does not make much sense.
Whatever, the way I think the rule should go is:
- no pawns on the 2nd and 3rd ranks on the files where the king is and the two adjacent files, then give the penalty for the mg
- if an ad-hoc penalty does not quite work, try to give the penalty only if score for the side with no pawn shelter is not positive
Anyone having tried something along these lines?
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
3-fold shuffling
Well, Daniel is responsible for this.
He said, I am currently trying to establish when my engine is shuffling, and that made me also think at some point.
I am certain by that time Daniel has already successfully resolved the issue of shuffling, but, in case he still did not get to the core of it, here is my idea:
Whenever your engine shows exactly same scores in cps on 3 consecutive plies, this means the engine is shuffling, and you could simply consider the game as a draw, no matter what the size of the score is.
For example, you search up to ply 20, on plies 4,5 and 6 your engines shows exactly same score, say 67/67/67cps, the engine is shuffling, it sees no way to increase its advantage, hitting the same end position with optimal play, and the game could safely be considered as a draw.
Or, your engine shows exactly same score, say 23/23/23cps on plies 10,11 and 12, same conclusion, the engine knows not how to proceed, hits the same end position with optimal play, and the game is a draw.
Or, your engine shows 180/180/180cps on plies 17,18 and 19, same conclusion, the game is a draw.
Please note, that the size of the score does not matter at all, as long as there are 3 consecutive plies with exactly same score.
Having exactly the same score on 3 consecutive plies is absolutely impossible, if the game is not a draw.
In any case, you can safely declare the game as a draw, as your very engine sees nothing better.
As you already guess, this might let you easily prune as draws any lines with such exactly same consecutive scores, to the benefit of other lines with, although smaller, but more realistic advantage.
If 3-fold shuffling happens early on in the search, this might be quite efficient pruning technique, but even at later plies this might help to eliminate undesirable lines.
You simply check your previous ply score, and, if exactly same as current, check also the next ply, then you draw your conclusions.
The rule is based on the fact not that the particular position is necessarily a draw, which in most cases it will still be, but rather that your engine does not know how proceed to improve its score.
I am not certain if the rule should be applied throughout the game, or maybe only in the endgame or late endgame, what I am certain is that it is better to go for a line with smaller score that has no same score for 3 consecutive plies, rather than for a line with bigger or significantly bigger score, containing such 3-fold consecutive shuffling.
Any feedback on this?
I wonder if Daniel completely disagrees here?
He said, I am currently trying to establish when my engine is shuffling, and that made me also think at some point.
I am certain by that time Daniel has already successfully resolved the issue of shuffling, but, in case he still did not get to the core of it, here is my idea:
Whenever your engine shows exactly same scores in cps on 3 consecutive plies, this means the engine is shuffling, and you could simply consider the game as a draw, no matter what the size of the score is.
For example, you search up to ply 20, on plies 4,5 and 6 your engines shows exactly same score, say 67/67/67cps, the engine is shuffling, it sees no way to increase its advantage, hitting the same end position with optimal play, and the game could safely be considered as a draw.
Or, your engine shows exactly same score, say 23/23/23cps on plies 10,11 and 12, same conclusion, the engine knows not how to proceed, hits the same end position with optimal play, and the game is a draw.
Or, your engine shows 180/180/180cps on plies 17,18 and 19, same conclusion, the game is a draw.
Please note, that the size of the score does not matter at all, as long as there are 3 consecutive plies with exactly same score.
Having exactly the same score on 3 consecutive plies is absolutely impossible, if the game is not a draw.
In any case, you can safely declare the game as a draw, as your very engine sees nothing better.
As you already guess, this might let you easily prune as draws any lines with such exactly same consecutive scores, to the benefit of other lines with, although smaller, but more realistic advantage.
If 3-fold shuffling happens early on in the search, this might be quite efficient pruning technique, but even at later plies this might help to eliminate undesirable lines.
You simply check your previous ply score, and, if exactly same as current, check also the next ply, then you draw your conclusions.
The rule is based on the fact not that the particular position is necessarily a draw, which in most cases it will still be, but rather that your engine does not know how proceed to improve its score.
I am not certain if the rule should be applied throughout the game, or maybe only in the endgame or late endgame, what I am certain is that it is better to go for a line with smaller score that has no same score for 3 consecutive plies, rather than for a line with bigger or significantly bigger score, containing such 3-fold consecutive shuffling.
Any feedback on this?
I wonder if Daniel completely disagrees here?
-
PK
- Posts: 913
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
Re: 3-fold shuffling
I'm afraid that no-shield penalty would interfere with long pawn chains, and this is not something You can afford, Lyudmil
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Doubled isolated pawns
It seems very reasonable to increase the penalty, when a doubled pawn is isolated at the same time.
Maybe the doubled pawn penalty could be increased by further 50% or so, in any case by some percentage point of the doubled pawn penalty.
As obvious, having doubled pawn penalty and isolated pawn penalty separately does not quite resolve the issue of evaluating a doubled isolated pawn weakness, which is always bigger as usual, as there are doubled pawns that are not isolated and isolated pawns that are not doubled.
Tuning for the general case will always bring less benefit than tuning for the specific case.
[d]6k1/2p3p1/1p2p2p/8/1P6/6P1/1P4PP/6K1 w - - 0 1
g3 is a doubled pawn that is not isolated, b4 is doubled pawn that is isolated, and e6 is an isolated pawn that is not doubled.
As you see, everything is specific, and tuning for the general case would quite probably not be the optimal approach.
The reasonable approach would be to tune doubled and isolated pawns separately, and then also specifically tune the penalty for a doubled isolated pawn, as b4 above.
Maybe the doubled pawn penalty could be increased by further 50% or so, in any case by some percentage point of the doubled pawn penalty.
As obvious, having doubled pawn penalty and isolated pawn penalty separately does not quite resolve the issue of evaluating a doubled isolated pawn weakness, which is always bigger as usual, as there are doubled pawns that are not isolated and isolated pawns that are not doubled.
Tuning for the general case will always bring less benefit than tuning for the specific case.
[d]6k1/2p3p1/1p2p2p/8/1P6/6P1/1P4PP/6K1 w - - 0 1
g3 is a doubled pawn that is not isolated, b4 is doubled pawn that is isolated, and e6 is an isolated pawn that is not doubled.
As you see, everything is specific, and tuning for the general case would quite probably not be the optimal approach.
The reasonable approach would be to tune doubled and isolated pawns separately, and then also specifically tune the penalty for a doubled isolated pawn, as b4 above.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Re: 3-fold shuffling
Why so, Pawel?PK wrote:I'm afraid that no-shield penalty would interfere with long pawn chains, and this is not something You can afford, Lyudmil
Btw., you posted under 3-fold shuffling, and not under no pawn shelter.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Re: No pawn shelter
One observation I have of SF games is that, whenever SF remains with no pawn shelter on the 2nd and 3rd ranks, and it has not been leading in score, it almost always loses the game.
No pawn shelter on the 2nd and 3rd ranks is extremely dangerous, and the existing separate penalties for placements of pawns of the shelter or their lack might absolutely be insufficient, as long as they do not consider the option of lacking even a single shelter pawn, but simply regard the shelter pawns as separate units and not as an union.
As said, having one shelter pawn and the remaining 2 pawns attacking as storming pawns is times better than having not a single shelter pawn.
It might be the case that having a single shelter pawn and the other 2 attacking is actually much better than having 2 or 3 shelter pawns on the 2nd and 3rd ranks, but no attacking storming pawns.
One shelter pawn is more than sufficient for king safety, when you are attacking, but having no shelter pawns at all is very dangerous if not leading in score.
The engine might not see anything dangerous coming up in its search, as usually the relevant losing lines are deep or very deep, but the danger will certainly come at some point.
The term is not the most frequent of all, as usually at least one pawn stays with the king, but it is not very rare too, and king safety is always important.
No pawn shelter on the 2nd and 3rd ranks is extremely dangerous, and the existing separate penalties for placements of pawns of the shelter or their lack might absolutely be insufficient, as long as they do not consider the option of lacking even a single shelter pawn, but simply regard the shelter pawns as separate units and not as an union.
As said, having one shelter pawn and the remaining 2 pawns attacking as storming pawns is times better than having not a single shelter pawn.
It might be the case that having a single shelter pawn and the other 2 attacking is actually much better than having 2 or 3 shelter pawns on the 2nd and 3rd ranks, but no attacking storming pawns.
One shelter pawn is more than sufficient for king safety, when you are attacking, but having no shelter pawns at all is very dangerous if not leading in score.
The engine might not see anything dangerous coming up in its search, as usually the relevant losing lines are deep or very deep, but the danger will certainly come at some point.
The term is not the most frequent of all, as usually at least one pawn stays with the king, but it is not very rare too, and king safety is always important.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Re: No pawn shelter
[d]r1b2rk1/1pbq1n1p/p1ppp1pP/5pP1/5P2/1PPP1B2/P1QBPN2/R4RK1 w - - 0 1
There are excellent chances white will lose this, although currently no specific danger is to be found for the white king.
SF on my computer even prefers white here at shallow depths.
Then I try couple of quick shootouts. SF starts with white advantage and goes on to lose the game in most cases, or at least the eval changes in black's favour.
Now, I do not say this position is necessarily won for black, I just posted it as a concrete example to illustrate things.
When I am thinking now, SF sees itself in advantage with white, but things change afterwards, so maybe considering who is in the lead is not that perfect a solution after all.
Quite probably, one will have to just give an ad-hoc mg penalty for the specific case of no pawn shelter in all situations, and then try to tune the term to the whole as good as possible.
But you should tune it very well to existing shelter points, storming pawns bonus, etc....
Chess is so complex.
Another good example was a game SF lost to Houdini in TCEC Season 6, maybe someone could post it, it also involved white having no pawn shelter.
So the term is not that rare at all, but seemingly very difficult to tune.
There are excellent chances white will lose this, although currently no specific danger is to be found for the white king.
SF on my computer even prefers white here at shallow depths.
Then I try couple of quick shootouts. SF starts with white advantage and goes on to lose the game in most cases, or at least the eval changes in black's favour.
Now, I do not say this position is necessarily won for black, I just posted it as a concrete example to illustrate things.
When I am thinking now, SF sees itself in advantage with white, but things change afterwards, so maybe considering who is in the lead is not that perfect a solution after all.
Quite probably, one will have to just give an ad-hoc mg penalty for the specific case of no pawn shelter in all situations, and then try to tune the term to the whole as good as possible.
But you should tune it very well to existing shelter points, storming pawns bonus, etc....
Chess is so complex.
Another good example was a game SF lost to Houdini in TCEC Season 6, maybe someone could post it, it also involved white having no pawn shelter.
So the term is not that rare at all, but seemingly very difficult to tune.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Any check
Of course, safe checks and contact safe checks are worth a nice bonus in eval, primarily because of their ability to change the position tactically to advantage of the side giving such checks.
SF does that excellently.
However, it is not only safe checks and safe contact checks that could successfully be scored in eval, but also any check given, regardless if it is safe or not.
Of course, when safe checks are already considered, the bonus will be only for checks that are not safe.
The bonus for any safe check will be due again, for the ability to create tactical changes to the benefit of the player giving the check. Obviously, the bonus points should be smaller or much smaller in the case of non-safe checks, as this tactical property is not so salient as with safe checks.
However, there is one major distinction. In sharp contrast to safe checks and safe contact checks, where, as far as I remember, SF gives higher bonus for safe queen and rook checks, for any check that is not safe the proportion of values is exactly the opposite: i.e. any non-safe knight check gets highest bonus, followed by any non-safe bishop check, any non-safe rook check, and then any non-safe queen check comes last.
The bonus points for any non-safe piece checks could be as follows:
- non-safe knight check 10cps
- non-safe bishop check 6cps
- non-safe rook check 4cps
- non-safe queen check 2cps
The bonus points are mainly associated with possible tactical sacrifices.
As far as I rememeber, SF tried something similar in the past, but I am not certain if it was exactly the same, and quite probably they did not quite specify the bonus points in the way as above.
SF does that excellently.
However, it is not only safe checks and safe contact checks that could successfully be scored in eval, but also any check given, regardless if it is safe or not.
Of course, when safe checks are already considered, the bonus will be only for checks that are not safe.
The bonus for any safe check will be due again, for the ability to create tactical changes to the benefit of the player giving the check. Obviously, the bonus points should be smaller or much smaller in the case of non-safe checks, as this tactical property is not so salient as with safe checks.
However, there is one major distinction. In sharp contrast to safe checks and safe contact checks, where, as far as I remember, SF gives higher bonus for safe queen and rook checks, for any check that is not safe the proportion of values is exactly the opposite: i.e. any non-safe knight check gets highest bonus, followed by any non-safe bishop check, any non-safe rook check, and then any non-safe queen check comes last.
The bonus points for any non-safe piece checks could be as follows:
- non-safe knight check 10cps
- non-safe bishop check 6cps
- non-safe rook check 4cps
- non-safe queen check 2cps
The bonus points are mainly associated with possible tactical sacrifices.
As far as I rememeber, SF tried something similar in the past, but I am not certain if it was exactly the same, and quite probably they did not quite specify the bonus points in the way as above.
-
Lyudmil Tsvetkov
- Posts: 6052
- Joined: Tue Jun 12, 2012 12:41 pm
Re: Any check
[d]6k1/5pp1/5N1p/4P3/8/q3b3/3P4/6K1 w - - 0 1
extremely reasonable bonus points for non-safe knight and bishop checks are due here to white Nf6 and black Be3.
[d]6k1/5p2/6Rp/4P3/8/8/2Q5/6K1 b - - 0 1
and here also to Rg6
Whether safe or non-safe, checks are always important, as they severely limit the number of non-forced variations available to the opponent.
extremely reasonable bonus points for non-safe knight and bishop checks are due here to white Nf6 and black Be3.
[d]6k1/5p2/6Rp/4P3/8/8/2Q5/6K1 b - - 0 1
and here also to Rg6
Whether safe or non-safe, checks are always important, as they severely limit the number of non-forced variations available to the opponent.