Discuss Scratch

S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

Giving up a knight for capturing two pawns (one central, one future pawn shelter) at move 6 nearly turned out fatal for GoK (white) against WD: https://lichess.org/FMWzQlOy#10 GoK still won the game at the end.

This only happened because I had adjusted the penalty for that capture sequence to be lower when no current pawn shelter pawn was affected.

So reverted to previous code, replayed, much better move 6, but at the end GoK drew the game because it thought it could still win with R+N vs R: https://lichess.org/elXCcRuI#137 I once had handling for that in place, but did not work in all scenarios, as hard-coding a draw can backfire when the the knight could be captured behind the horizon.

A WD pattern visible in those two games: Ahead during midgame, cannot bring it home during late midgame / endgame.

Interesting games! I've fixed some of the issues in the second game (draw), and I'll investigate the first game more closely.
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Another issue has been resolved! In this position, WD now finds the correct move Nxg4! I did this by having a huge penalty for having no pawn on the H-file if the king is castled there, as it creates a huge attacking chance.
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

So, I've been trying to understand king-piece tropism, AKA not letting too many of your opponents pieces get near your king. And I haven't been able to find a good & easy to understand implementation…

So how should I go about adding king-piece tropism?

Thanks!
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

A very interesting blunder made by WD in this position. WD playing black doesn't take the bishop, but instead retreats the queen, this tactic is very very deep, so I'm afraid I'll just have to hard-code this line in the opening book…
Grijfland
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…
Grijfland
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!

Last edited by Grijfland (Dec. 25, 2023 17:13:34)

S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.
Grijfland
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.


For me it's just interesting to see why one version of WD manages to find the right path and another version doesn't.
GoK also has difficulty with this position and prefers to go for a draw. Unless I help GoK with a move and then suddenly find the right way.
I once learned that if there is no real rest position at a junction, one should only look further from this junction.
birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.


For me it's just interesting to see why one version of WD manages to find the right path and another version doesn't.
GoK also has difficulty with this position and prefers to go for a draw. Unless I help GoK with a move and then suddenly find the right way.
I once learned that if there is no real rest position at a junction, one should only look further from this junction.
Presumably because WD 6.3 has NMP?
I do not understand the point of these zugzwang puzzles; they are never seen in real games. I prefer puzzle setups from real games https://lichess.org/study/FqQvIf5y/rHpf2gCb#23 as an example (winning move Rxf3!!).
S_P_A_R_T
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.


For me it's just interesting to see why one version of WD manages to find the right path and another version doesn't.
GoK also has difficulty with this position and prefers to go for a draw. Unless I help GoK with a move and then suddenly find the right way.
I once learned that if there is no real rest position at a junction, one should only look further from this junction.

It's because of features added in those versions. Those resulted in a general speed-up (from ply 6-7 to 8-9), but can reduce the puzzle solving abilties. Now technically I could add some code to make puzzle-solving better, but that would be at the cost of performing well in a real game…
Grijfland
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

birdracerthree wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.


For me it's just interesting to see why one version of WD manages to find the right path and another version doesn't.
GoK also has difficulty with this position and prefers to go for a draw. Unless I help GoK with a move and then suddenly find the right way.
I once learned that if there is no real rest position at a junction, one should only look further from this junction.
Presumably because WD 6.3 has NMP?
I do not understand the point of these zugzwang puzzles; they are never seen in real games. I prefer puzzle setups from real games https://lichess.org/study/FqQvIf5y/rHpf2gCb#23 as an example (winning move Rxf3!!).

These are all chess situations from real chess games. Do you mean this ?

Pos 1… Nxg7 ( rq2r1k1/5pp1/p7/4bNP1/1p2P2P/5Q2/PP4K1/5R1R w )
GoK plays Rf2 (TW) “Short-Ribli Nxg7 gewinnt

Pos 2… Bxb6 ( 6k1/2b2p1p/ppP3p1/4p3/PP1B4/5PP1/7P/7K w )
GoK plays Bf3 “Hedinger-Dossenbach 1958 Bxb6 gewinnt

Pos 3… Re6 ( 5r1k/p1q2pp1/1pb4p/n3R1NQ/7P/3B1P2/2P3P1/7K w )
GoK plays Nh3 “Kwinones-Mjagmarsuren Skopje 1972 Re6 gewinnt

Pos 4… Qf7 ( 5r1k/1P4pp/3P1p2/4p3/1P5P/3q2P1/Q2b2K1/B3R3 w )
GoK plays Qd7 “Harding 1978 Qf7 gewinnt

Pos 5… Ka6 ( 3B4/8/2B5/1K6/8/8/3p4/3k4 w )
GoK plays Bf3 “Only winning move for white, Ka6 gewinnt”

Pos 6… e3 ( 1k1r4/1pp4p/2n5/P6R/2R1p1r1/2P2p2/1PP2B1P/4K3 b )
GoK plays Re8 “Feustel Testbuch Schachtaktik …e3 gewinnt

Pos 7… Rd6 ( 6k1/p3q2p/1nr3pB/8/3Q1P2/6P1/PP5P/3R2K1 b )
GoK plays Rc8 “Black forces a draw, Majzeliw …Rd6 haelt remis”

Pos 8… Rxc6 ( 2krr3/1p4pp/p1bRpp1n/2p5/P1B1PP2/8/1PP3PP/R1K3B1 w )
GoK plays Bxc6 “Schachversand Nord 1989 Rxc6 gewinnt”

Pos 9… g5 ( r5k1/pp2p1bp/6p1/n1p1P3/2qP1NP1/2PQB3/P5PP/R4K2 b )
GoK plays Bh4 “Reitz-Bednorz 1989 …g5 bester Zug"

Pos 10… Rxg7 ( 2r3k1/1qr1b1p1/p2pPn2/nppPp3/8/1PP1B2P/P1BQ1P2/5KRR w )
GoK plays c4 “ Kasparov-Meph.Dallas Rxg7 gewinnt "

Pos 11… Qxh2+ ( 1br3k1/p4p2/2p1r3/3p1b2/3Bn1p1/1P2P1Pq/P3Q1BP/2R1NRK1 b )
GoK plays Qh5 “Karpov-Chandler 1983 …Qxh2+ gewinnt
– Qxh2/Kxh2-Nxg3/Qb2-Ne2+/Kh1-Rh6+/Bh3-Rxh3+/Kg2-Rh2+#

Pos 12… Qe4 ( 8/pp3k2/2p1qp2/2P5/5P2/1R2p1rp/PP2R3/4K2Q b )
GoK plays b5 ? "Elite Glasgow-H.Haupt …Qe4 bester Zug
Er dreigt Qb1# or QxQh1# or Rg1#

Pos 13… Nb4 (3b2k1/1pp2rpp/r2n1p1B/p2N1q2/3Q4/6R1/PPP2PPP/4R1K1 w )
GoK plays Qc5 ”Weiner, Pfleger: Scachcomputer Nb4 gewinnt"

Pos 14… Rxh7 (3r1rk1/1p3pnp/p3pBp1/1qPpP3/1P1P2R1/P2Q3R/6PP/6K1 w )
GoK plays QxQb5 “A. Mader - Mephisto MM II, 1989
HasiLover
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

Hello everyone, I am back for Engine coding. I fixed the Bugs of LernMatt0 and now am working on making it fast enough for Scratch 3. Thinking of making two different Calculation Modes, one better for Scratch 3 and one better for TW. Are there any Updates on other Engines?
HasiLover
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

HasiLover wrote:

Hello everyone, I am back for Engine coding. I fixed the Bugs of LernMatt0 and now am working on making it fast enough for Scratch 3. Thinking of making two different Calculation Modes, one better for Scratch 3 and one better for TW. Are there any Updates on other Engines?
Now there is a Mode for S3, which takes around 15 Seconds per Move at MCTS Depth 2
HasiLover_Test
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

I just found out White can get a good position against White Dove if they play 1.e4 e6 2.Nf3, the Position reaches +0.7 to +0.9 for white according to stockfish, because White Dove plays Nc6.

Last edited by HasiLover_Test (Dec. 25, 2023 20:04:58)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.

About “qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w”, and I have mentioned that before, a puzzle is only solved when the engine choses the right move because it saw its effect. And for that one must verify the evaluation which lead to the move selection.

The checkmate happens in 9 moves, so 17 + 2 = 19 plies are required to find it. What GoK sees at ~30 seconds is a draw option, 1 ply before the checkmate, that is when it decides for Kd4 (you can observe the same on lichess analysis board). What is a bit strange is that GoK needs 21 plies to see the draw, 22 to see the checkmate (the equivalent mate in 7 it finds in 10 seconds at ply 18, mate in 8 in 50 seconds at play 20). The reason is most likely late move reduction, and the very unconventional moves white has to make, which causes a low move score and late move ranking. That is also the problem of importing the board like this: In a normal game GoK would have all the hash moves from the previous search, and rank them much better. GoK found the checkmate when I re-ran it with the transposition table filled.

BTW, the White Dove version you linked to finishes a 11 ply search, and shows a +24 evaluation for black, when it is done and selects Kd4.

Grijfland
Scratcher
100+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.

About “qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w”, and I have mentioned that before, a puzzle is only solved when the engine choses the right move because it saw its effect. And for that one must verify the evaluation which lead to the move selection.

The checkmate happens in 9 moves, so 17 + 2 = 19 plies are required to find it. What GoK sees at ~30 seconds is a draw option, 1 ply before the checkmate, that is when it decides for Kd4 (you can observe the same on lichess analysis board). What is a bit strange is that GoK needs 21 plies to see the draw, 22 to see the checkmate (the equivalent mate in 7 it finds in 10 seconds at ply 18, mate in 8 in 50 seconds at play 20). The reason is most likely late move reduction, and the very unconventional moves white has to make, which causes a low move score and late move ranking. That is also the problem of importing the board like this: In a normal game GoK would have all the hash moves from the previous search, and rank them much better. GoK found the checkmate when I re-ran it with the transposition table filled.

BTW, the White Dove version you linked to finishes a 11 ply search, and shows a +24 evaluation for black, when it is done and selects Kd4.


I am glad that you have taken this chess situation seriously and I also like that GoK finds the right continuation at the 60 second level. You know your program best and also know which buttons need to be turned. For me it is fun to see how a chess program reacts to various chess positions. Especially now, now that there are several well-performing chess programs.
birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

I am planning to add a Transposition Table to Element. Once I obtain a hash from the board state, what do I do after that (where do I index the hash, etc.)?
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

Grijfland wrote:

ArnoHu wrote:

S_P_A_R_T wrote:

Grijfland wrote:

S_P_A_R_T wrote:

Grijfland wrote:

ArnoHu, S_P_A_R_T,
In the past, computer chess programs were often tested with positions on the chessboard. For example, we know the BT-2450 tests chess positions and later the improved BT-2650 tests. The Colditz Test is also famous or the Kaufmann chess tests. But for me, 1 chess position is far at the top of the series. I call it “The King goes for a walk”. In this position, Black has many expensive chess pieces on the chessboard, but they cannot make a move. Except the black bishop. Black is so far ahead in value of the chess pieces, but that is only an appearance. White has a white bishop, which can checkmate the king by capturing the knight. The white king must now walk across the chessboard to the Bishop. The great thing now is that you can help the white king by bringing him further to the black Bishop every time. At which move does the chess program suddenly see the correct continuation under its own power. It is now striking that WD performed an excellent evaluation, even slightly better than GoK. Until an update came from WD and now the program has suddenly lost its way. I highly recommend that you run these tests with your program. The starting position is:
qrb5/rk1p1K2/p2N4/Pp6/1N2n3/6p1/5nBb/8 w The king then walks via Kg6..Kf5..Ke5..Kd4..Ke3..Ke2..Kf1 and then KxBg1 WD has long seen that there is a checkmate will follow. White is not allowed to remove the knight on b4, because then the black king will escape. GoK has long thought that it could force a Draw by repeating moves, but GoK has become better at calculating. Yet GoK has a hard time with this chess position qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w Here the king has moved to an important position. In TW, GoK must be brought to 60 seconds via the c key, while WD sees the right move immediately. By the way, the old version of WD (https://turbowarp.org/938080938 and not the 858052938 version) from WD and not the new version 6.3 (?!?)

Interesting positon! Is it supposed to be black to move because black is in check at the start of the position…


Sorry knight must be a pawn
qrb5/rk1p1K2/p2P4/Pp6/1N2n3/6p1/5nBb/8 w

So this is the starting position. The first correct move is not seen by any chess program. That is why it is wiser to place the white king further away.
qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w

From this position on the chessboard, Kd4 is the correct continuation on the way to the Bishop !!


Oh, I understand why engines can't solve this. This is because of something known as “null move pruning”. It's supposed to work by pruning / not calculating / skipping the node if the position is so good that even without making a move, it still beta cutoffs.

This is very risky in endgames as there are positions where you would rather not make a move. Normally an engine would just disable this in endgames, but since this isn't “really” an endgame, as there are still lots of pieces left, it decides that this isn't an endgame. The solution (I think) it to disable null move pruning if there's only 1 move to make, as those situations are most likely to be those were you would rather “skip” your turn.

About “qrb5/rk1p4/p2P4/Pp2K3/1N2n3/6p1/5nB1/6b1 w”, and I have mentioned that before, a puzzle is only solved when the engine choses the right move because it saw its effect. And for that one must verify the evaluation which lead to the move selection.

The checkmate happens in 9 moves, so 17 + 2 = 19 plies are required to find it. What GoK sees at ~30 seconds is a draw option, 1 ply before the checkmate, that is when it decides for Kd4 (you can observe the same on lichess analysis board). What is a bit strange is that GoK needs 21 plies to see the draw, 22 to see the checkmate (the equivalent mate in 7 it finds in 10 seconds at ply 18, mate in 8 in 50 seconds at play 20). The reason is most likely late move reduction, and the very unconventional moves white has to make, which causes a low move score and late move ranking. That is also the problem of importing the board like this: In a normal game GoK would have all the hash moves from the previous search, and rank them much better. GoK found the checkmate when I re-ran it with the transposition table filled.

BTW, the White Dove version you linked to finishes a 11 ply search, and shows a +24 evaluation for black, when it is done and selects Kd4.


I am glad that you have taken this chess situation seriously and I also like that GoK finds the right continuation at the 60 second level. You know your program best and also know which buttons need to be turned. For me it is fun to see how a chess program reacts to various chess positions. Especially now, now that there are several well-performing chess programs.

Well, it is a very special (AKA “rare”) position, and some tunings in an engine are meant to be advantageous for 95% of scenarios, at the risk of missing out on the 5% other cases, and one has to decide whether cost/benefit are worth it.

Any way, it was not LMR that caused GoK to see it late, it was - again - null move pruning under Zugzwang (I should have read all replies, S_P_A_R_T had actually stated that before). I disabled null moves in competition mode (press ‘c’) for even earlier endgame stages now, GoK (competition mode) finds checkmate at ply 17 (as predicted), but needs 24 seconds to get there, hence lost ~3 plies of search depth.

Last edited by ArnoHu (Dec. 26, 2023 10:48:37)

birdracerthree
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

HasiLover_Test wrote:

I just found out White can get a good position against White Dove if they play 1.e4 e6 2.Nf3, the Position reaches +0.7 to +0.9 for white according to stockfish, because White Dove plays Nc6.
I think this is very notable because if you don’t play c5 in the French defense white is better +/- (although Wikibooks says white has a slight advantage (+=, I think this is wrong. However, maybe you shouldn’t listen to a 1400 chesscom rated player over WikiBooks ).

At some point I will make a post showing all of WD’s opening weaknesses (esp. after e4 e5 as WD cannot play these positions well).

Powered by DjangoBB