A balanced approach to imbalances

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
hgm
Posts: 28420
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A balanced approach to imbalances

Post by hgm »

Lyudmil Tsvetkov wrote:..., but it seems that neither you, nor Harm, are willing to do so.
I already did so, many years ago, with thousands of games an several engines, and many positions, including the 'natural initial position' you gave (which many engines indeed cannot handle, as I explained before). I am light-years ahead of you on this. I see no reason to do it again, just because you don't believe it. I don't have to be convinced for a second time, and there is no reason why you wouldn't discard new results just as easily as the old results.

As we see, despite its tactical deficiency compared to top engines, QueeNy is the strongest engine around for games with >= 5 Knights, so the most significant test would be to play QueeNy with the Knights against an even stronger version of itself with the Queens. Top engines bungle games bot with the Queens and the Knights for different reasons: with Queens they are too much biased trading Q for 2N when this is necessary, and with the Knights they are too reluctant to march the King towards the center. A known weakness of QueeNy is that it is completely stupid in the end-game, not knowing that KNK and KNNK are draws. So it sometimes trades N+P vs Q in an easily won KNNNPKQ end-game, thinking this is a very good deal (N+P = 6, Q = 9).

I believe that QueeNy randomizes its play. I am a bit worried that QueeNy played an illegal move; I have never seen that before.

WinBoard has no problems loading these position.
lucasart
Posts: 3242
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: A balanced approach to imbalances

Post by lucasart »

Uri Blass wrote: 256 is clearly safe but not 128
Yes, I know. I think this is the most restrictive rule in practice. It's completely trivial to make the change in the code, but it makes DiscoCheck measurably slower. My guess is that it increases the cache pressure.

I need to think of ways to reduce stack usage, while not incurring any speed penalty, and then I'll be able to increase this to 256.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
hgm
Posts: 28420
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A balanced approach to imbalances

Post by hgm »

Most of my engines use a separate stack for storing their move lists. Then they don't have to reserve any space in advance, and can push as many moves on the stack as they want. Their daughter nodes can start right where their parent stopped, without wasting any space at all.

The only overhead this incurs is that it has to remember the value of the move stack pointer on entry of the node, so that it can restore it afterwards. (The latter is not overhead, as even with a move list in the local variables you would have to initialize the pointer to the end of the list.)

(Sometimes I reserve some space in front of the move list, for easy sorting during IID, allowing it to place the best move (or any move that beats alpha) of an iteration simply in front of the list before it starts the next iteration, without having to move any of the other moves).
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A balanced approach to imbalances

Post by Lyudmil Tsvetkov »

hgm wrote:
Lyudmil Tsvetkov wrote:..., but it seems that neither you, nor Harm, are willing to do so.
I already did so, many years ago, with thousands of games an several engines, and many positions, including the 'natural initial position' you gave (which many engines indeed cannot handle, as I explained before). I am light-years ahead of you on this. I see no reason to do it again, just because you don't believe it. I don't have to be convinced for a second time, and there is no reason why you wouldn't discard new results just as easily as the old results.

As we see, despite its tactical deficiency compared to top engines, QueeNy is the strongest engine around for games with >= 5 Knights, so the most significant test would be to play QueeNy with the Knights against an even stronger version of itself with the Queens. Top engines bungle games bot with the Queens and the Knights for different reasons: with Queens they are too much biased trading Q for 2N when this is necessary, and with the Knights they are too reluctant to march the King towards the center. A known weakness of QueeNy is that it is completely stupid in the end-game, not knowing that KNK and KNNK are draws. So it sometimes trades N+P vs Q in an easily won KNNNPKQ end-game, thinking this is a very good deal (N+P = 6, Q = 9).

I believe that QueeNy randomizes its play. I am a bit worried that QueeNy played an illegal move; I have never seen that before.

WinBoard has no problems loading these position.
But you did test with the positions that suited you.

I told you, for me it is difficult to play a game against engine from an entirely unfamiliar position, as the pressure would only be on me. Nevertheless, I unearthed a winboard from year 2000 and tried to play some game. I give myself more time, but the conditions are awful: the screen is so small, not adjustable, the colours are awful, my eyes got tired, and I am sure only because of this I am losing much of my strength (you know what Fischer said, he wanted ideal playing conditions, as the brain in this way works optimally, but not for me under winboard).

The first game I played was with the Q vs 3Ns imbalance against Gnuchess (the first engine I managed to upload; awful uploading, you have to write some things in a file to upload a new engine):

[Event "Computer chess game"]
[Site "OWNER-PC"]
[Date "2013.10.26"]
[Round "-"]
[White "owner"]
[Black "GNUChess"]
[Result "*"]
[TimeControl "40/60"]
[FEN "1nn1k1n1/pppppppp/8/8/8/8/PPPPPPPP/3QK3 w - - 0 1"]
[SetUp "1"]

{--------------
. n n . k . n .
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
. . . Q K . . .
white to play
--------------}
1. d4 Nd6 2. f3 f5 3. b3 Nf6 4. c4 e6 5. Qd3 b6 6. c5 bxc5 7. dxc5 Nf7 8.
Qb5 Nc6 9. Qb7 Nd5 10. e4 fxe4 11. fxe4 Nfd8 12. Qc8 Nc3 13. Qxc7 Nxe4 14.
Qf4 Nxc5 15. Qg5 e5 16. Qxg7 h5 17. Qg6+ Ke7 18. Qxh5 d5 19. Qg5+ Kd6 20.
h4 Nde6 21. Qg6 e4 22. h5 Nd3+ 23. Kd1 Nf4 24. Qf7 Nxg2 25. h6 e3 26. h7
Ncd4 27. Qh5 e2+ 28. Qxe2 Nxe2 29. h8=Q Ngf4 30. Qb8+ Kc6 31. Qxa7 Nc3+ 32.
Kc2 d4 33. Qa6+ Kd5 34. Qc4+ Kd6 35. a4 Ncd5 36. Kd2 d3 37. a5 Ng5 38. Qa6+
Ke5 39. Qxd3 Nxd3 40. Kxd3 Kd6 41. a6 Nb4+ 42. Kc4 Nxa6 43. b4 Nf7 44. b5
Nc5 45. b6 Nb7 46. Kd3 Kc6 47. Ke4 Nbd6+ 48. Kd4 Kb7 49. Kd5 Nf5
*

Well, I had some problems to draw, but it was a draw. I.e., moral victory under the specified conditions. I might play other games, if my eyes do not start smudging, but the far better solution was to test engines.

[d]8/1k3n2/1P6/3K1n2/8/8/8/8 w - - 0 50
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A balanced approach to imbalances

Post by Lyudmil Tsvetkov »

Second game:

[Event "Computer chess game"]
[Site "OWNER-PC"]
[Date "2013.10.26"]
[Round "-"]
[White "owner"]
[Black "GNUChess"]
[Result "*"]
[TimeControl "40/60"]
[FEN "1nn1k1n1/pppppppp/8/8/8/8/PPPPPPPP/3QK3 w - - 0 1"]
[SetUp "1"]

{--------------
. n n . k . n .
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
. . . Q K . . .
white to play
--------------}
1. d4 Nd6 2. c4 Nc6 3. d5 Nd8 4. Qd4 Nf6 5. e4 Ndxe4 6. Qxa7 Nd6 7. Qc5 c6
8. a4 cxd5 9. cxd5 g6 10. b4 Nde4 11. Qd4 h6 12. a5 Nd6 13. Qd3 Nf5 14. b5
e6 15. a6 bxa6 16. bxa6 Nxd5 17. Qxd5 exd5 18. a7 Ke7 19. a8=Q d4
*

[d]Q2n4/3pkp2/6pp/5n2/3p4/8/5PPP/4K3 w - - 0 20

I think this is a clear evidence that white is inimaginably better with the queen side, but, really, I stop it here. I am losing an enormous amount of my strength with unsuitable playing conditions, and am not willing to compromise any more. That is why players always complain about something.

Would be happy if someone could continue testing with engines from the starting position of the @Qs vs %Ns imbalance: it is clearly better for the queens.
User avatar
hgm
Posts: 28420
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A balanced approach to imbalances

Post by hgm »

Lyudmil Tsvetkov wrote:Nevertheless, I unearthed a winboard from year 2000 and tried to play some game. I give myself more time, but the conditions are awful: the screen is so small, not adjustable, the colours are awful, my eyes got tired, and I am sure only because of this I am losing much of my strength (you know what Fischer said, he wanted ideal playing conditions, as the brain in this way works optimally, but not for me under winboard).
Yes, that is what you get when you use stone-age software. I wonder what version of WinBoard you were using, because even the common 4.2.7 that has been around for a decade allows sizing the board window with the mouse, and for those who cannot operate a mouse with the Board Options menu.

But if any of that bothers you, why didn't you use a WinBoard from the year 2013? It escaped your notice that 2000 is a long time ago, and that there has been a lot of progress in ICT since then?
The first game I played was with the Q vs 3Ns imbalance against Gnuchess (the first engine I managed to upload; awful uploading, you have to write some things in a file to upload a new engine):
Again your own fault; If you would have installed any WinBoard from after 2008 Fruit 2.1 would have been automatically installed with it, ready for use...
Well, I had some problems to draw, but it was a draw. I.e., moral victory under the specified conditions. I might play other games, if my eyes do not start smudging, but the far better solution was to test engines.
Well, moral victories still count as draw. (Ever heard of a Chess board? It is a sort of wooden contraption on which you can move around colored puppets know as Chess pieces. It is often used by people who have difficulty staring at a computer screen for playing Chess games. :wink: ).

So you managed to draw a game against a quite weak engine (also from last century?), from a position that according to the GM game statistics Larry Kaufman analyzed should indeed be approximately equal. Not very spectacular. As I said, the spread-out Pawns strongly disadvantage the Knights here.

Note that the second game is by no means won for white; KQKNN might b won for white. but with a few Pawns to protect the Knights it is quite hopeless for the Queen.
User avatar
hgm
Posts: 28420
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: A balanced approach to imbalances

Post by hgm »

E.g. I don't see much possibility for progress here:

[d]6k1/4p2p/5nn1/8/3K4/8/8/6Q1 w - - 0 1

Black just keeps moving its King between f8, g8, f7 and g7.

P.S.

I figured out what caused QueeNy's illegal move: QueeNy does not know under-promotion, and Critter promoted to Knight. QueeNy is really a very rudientary engine, and would probably not even score 0% against, say, Fruit, when starting from balanced positions with normal numbers of Knights and Bishops. The only reason it can beat the top engines so badly is that it depreciates the Queens (or, equivalently, upgrades the Knights) according to the elephantiasis theory.
syzygy
Posts: 5802
Joined: Tue Feb 28, 2012 11:56 pm

Re: A balanced approach to imbalances

Post by syzygy »

hgm wrote:The only reason it can beat the top engines so badly is that it depreciates the Queens (or, equivalently, upgrades the Knights) according to the elephantiasis theory.
Is this theory written down somewhere?

It is clear that the effect exists, which means that it makes sense to incorporate it in the material balance evaluation (as that can usually be done for free), but I wonder how it could best be expressed.
syzygy
Posts: 5802
Joined: Tue Feb 28, 2012 11:56 pm

Re: A balanced approach to imbalances

Post by syzygy »

hgm wrote:E.g. I don't see much possibility for progress here:

[d]6k1/4p2p/5nn1/8/3K4/8/8/6Q1 w - - 0 1

Black just keeps moving its King between f8, g8, f7 and g7.
My engine finds a forced draw for black:
+0.000 1.Ke3 Kg7 2.Qa1 h5 3.Kf2 h4 4.Qa7 h3 5.Kg1 h2+ 6.Kh1 Kh6 7.Qf2 Kg5 8.Qd2+ Nf4 9.Qa5+ Kg4 10.Qd8 Kg5 11.Qa5+
White can't capture since it would be a tablebase draw.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A balanced approach to imbalances

Post by Lyudmil Tsvetkov »

hgm wrote:
Lyudmil Tsvetkov wrote:Nevertheless, I unearthed a winboard from year 2000 and tried to play some game. I give myself more time, but the conditions are awful: the screen is so small, not adjustable, the colours are awful, my eyes got tired, and I am sure only because of this I am losing much of my strength (you know what Fischer said, he wanted ideal playing conditions, as the brain in this way works optimally, but not for me under winboard).
Yes, that is what you get when you use stone-age software. I wonder what version of WinBoard you were using, because even the common 4.2.7 that has been around for a decade allows sizing the board window with the mouse, and for those who cannot operate a mouse with the Board Options menu.

But if any of that bothers you, why didn't you use a WinBoard from the year 2013? It escaped your notice that 2000 is a long time ago, and that there has been a lot of progress in ICT since then?
The first game I played was with the Q vs 3Ns imbalance against Gnuchess (the first engine I managed to upload; awful uploading, you have to write some things in a file to upload a new engine):
Again your own fault; If you would have installed any WinBoard from after 2008 Fruit 2.1 would have been automatically installed with it, ready for use...
Well, I had some problems to draw, but it was a draw. I.e., moral victory under the specified conditions. I might play other games, if my eyes do not start smudging, but the far better solution was to test engines.
Well, moral victories still count as draw. (Ever heard of a Chess board? It is a sort of wooden contraption on which you can move around colored puppets know as Chess pieces. It is often used by people who have difficulty staring at a computer screen for playing Chess games. :wink: ).

So you managed to draw a game against a quite weak engine (also from last century?), from a position that according to the GM game statistics Larry Kaufman analyzed should indeed be approximately equal. Not very spectacular. As I said, the spread-out Pawns strongly disadvantage the Knights here.

Note that the second game is by no means won for white; KQKNN might b won for white. but with a few Pawns to protect the Knights it is quite hopeless for the Queen.
I unearthed what I got on my disk, and winboard from the year 2000 was the last version used by me. Why should I use winboard now when I have Fritz with a wonderful interface and usually sufficient features?

Still, as the positions interest me, I downloaded Arena and played some games in it. The interface is not extremely convenient, but still better than winboard.

Just started playing Rybka 2.2, which is the strongest engine coming with Arena. Below a typical game. 5 minutes each side.

[pgn][Event "Computer chess game"]
[Site "OWNER-PC"]
[Date "2013.10.26"]
[Round "?"]
[White "owner"]
[Black "Rybka 2.2 64 bit"]
[Result "1/2-1/2"]
[BlackElo "2000"]
[Time "15:58:23"]
[WhiteElo "2400"]
[TimeControl "300"]
[SetUp "1"]
[FEN "1nn1k1n1/pppppppp/8/8/8/8/PPPPPPPP/3QK3 w - - 0 1"]
[Termination "normal"]
[PlyCount "35"]
[WhiteType "human"]
[BlackType "program"]

1. d4 Nf6 {(Ng8-f6 Qd1-d3 Nb8-c6 e2-e4 d7-d6 f2-f3 Nc8-b6 Ke1-f2) -1.32/15
5} 2. c4 Nc6 {(Nb8-c6 Qd1-d3 e7-e6 e2-e4 d7-d5 c4xd5 e6xd5 e4xd5 Nc6-d8
Qd3-g3 Nc8-b6 d5-d6 c7xd6 Qg3xd6) -0.92/15 7} 3. d5 Nd8 {(Nc6-d8 Qd1-d3
Nc8-b6 g2-g4 h7-h6 f2-f4 d7-d6 g4-g5 h6xg5 f4xg5 Nf6-g4 Qd3-d4) -0.47/14 5}
4. f3 Nb6 {(Nc8-b6 b2-b3 d7-d6 e2-e4 e7-e6 Ke1-e2 e6xd5 e4xd5 Ke8-d7 Qd1-e1
g7-g6 Qe1-c3) -0.46/14 8} 5. b3 d6 {(d7-d6 e2-e4 e7-e6 Qd1-d2 h7-h6 Ke1-e2
Ke8-e7 h2-h4 e6xd5 e4xd5 Ke7-d7 Qd2-f4 Kd7-e7 a2-a4) -0.46/16 4} 6. e4 Nbd7
{(Nb6-d7 Qd1-d2 b7-b6 Ke1-e2 e7-e6 g2-g4 h7-h6 h2-h4 Nd7-e5 g4-g5 h6xg5
h4xg5 Nf6-h5 Ke2-e3) -0.42/15 43} 7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