A balanced approach to imbalances

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

Moderator: Ras

petero2
Posts: 730
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: A balanced approach to imbalances

Post by petero2 »

hgm wrote:And you don't think the fact that the Knights are totally undeveloped, do not protect each other, and that the black King is wide in the open is sufficient compensation for that? (Not to mention that the Queens have a material advantage of +650 cP in terms of naive piece-value counting...)

The spread-out / undeveloped case was treated 3 postings earlier. It did not help the Queens much. But you cannot have it both ways: the King out in the open AND spread out Pawns. Or do you really want to start with the black King on e6 before a closed Pawn rank, to give those poor Queens a chance?
King on e6 seems to be lost quickly for black because of unavoidable tactics. Interestingly enough, king on g6 seems to be playable for black. I played a game with TQueeny against itself, time control 40 moves in 7 minutes.
[pgn]
[Event "Computer Chess Game"]
[Site "acer.localdomain"]
[Date "2013.10.28"]
[Round "-"]
[White "TQueeny 64-bit"]
[Black "TQueeny 64-bit"]
[Result "0-1"]
[TimeControl "40/420"]
[FEN "nnnn1nnn/pppppppp/6k1/8/8/8/PPPPPPPP/Q2QK2Q w - - 0 1"]
[SetUp "1"]

{--------------
n n n n . n n n
p p p p p p p p
. . . . . . k .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
Q . . Q K . . Q
white to play
--------------}
1. g4 {-0.83/17 71575:56} e6 {+0.72/18 22} 2. Qe4+ {-0.64/17 9} f5
{+0.72/19 9} 3. gxf5+ {-0.47/18 9} Kf7 {+0.89/18 9} 4. Qf3 {-0.73/18 9}
exf5 {+0.67/17 9} 5. e4 {-0.71/17 9} Nf6 {+0.82/17 9} 6. e5 {-0.81/18 9}
Ng8 {+0.74/18 9} 7. c3 {-0.78/18 9} Nhg6 {+0.89/17 9} 8. Qb3+ {-0.65/19 9}
Nfe6 {+0.70/20 9} 9. Qbxb7 {-0.80/19 23} Nxb7 {+0.89/21 9} 10. Qxb7
{-0.88/20 9} Nab6 {+0.90/21 9} 11. Qxb8 {-0.86/20 9} Nxe5 {+0.84/20 9} 12.
d4 {-0.73/20 9} Nd3+ {+0.81/19 12} 13. Kf1 {-0.84/20 10} Nge7 {+0.73/19 9}
14. Qb7 {-0.82/19 9} Ndf4 {+0.81/19 9} 15. Qa6 {-0.81/19 33} d5
{+0.77/18 10} 16. b3 {-0.78/19 8} g5 {+0.83/20 9} 17. Qe1 {-0.79/20 10} Nd7
{+0.98/20 9} 18. f3 {-0.79/18 8} h5 {+1.02/20 9} 19. a3 {-0.92/18 8} Nd6
{+1.39/20 34} 20. a4 {-1.26/17 13} Nf6 {+1.44/18 8} 21. Qd1 {-1.62/18 11}
g4 {+1.74/19 8} 22. Ke1 {-1.92/18 8} Ng2+ {+1.94/18 9} 23. Kd2 {-1.96/20 8}
Nh4 {+2.07/19 11} 24. fxg4 {-2.18/20 8} hxg4 {+2.37/19 8} 25. Kc2
{-2.30/18 11} f4 {+3.02/19 9} 26. Qe1 {-2.78/18 8} Nef5 {+3.09/19 9} 27.
Kb1 {-3.43/16 9} Nde4 {+3.76/17 9} 28. Qc1 {-3.67/17 20} f3 {+4.55/18 9}
29. c4 {-4.57/17 13} Nfxd4 {+4.63/17 17} 30. cxd5 {-4.18/18 7} Nxd5
{+5.08/17 8} 31. Kb2 {-4.63/16 10} f2 {+5.66/18 9} 32. Qd3 {-5.65/18 7}
Ndf6 {+5.69/19 9} 33. Qcf1 {-5.95/19 8} Nhf5 {+7.15/19 33} 34. Qc1
{-7.02/18 8} N4c5 {+7.60/18 7} 35. Qdf1 {-7.44/17 8} g3 {+8.62/19 6} 36.
hxg3 {-8.00/19 8} Nxg3 {+8.39/19 6} 37. Qxf2 {-9.33/20 8} Nd3+
{+10.87/21 7} 38. Ka3 {-12.65/21 16} Nxf2 {+12.52/23 7} 39. b4
{-13.33/19 9} Nge4 {+17.05/20 7} 40. b5 {-19.23/19 6} N6g4 {+22.56/19 10}
41. b6 {-20.79/18 17} axb6 {+26.77/20 9} 42. a5 {-32.43/18 19} bxa5
{+30.46/17 9} 43. Ka2 {-99.64/17 34} Nd1 {+34.34/16 18} 44. Qa3
{-99.80/14 13} Nec3+ {+99.85/14 11} 45. Qxc3 {-99.86/15 5} Nxc3+
{+99.87/14 7} 46. Kb2 {-99.88/13 0.1} Nce2 {+99.89/12 0.8} 47. Kb1
{-99.90/11 0.1} Nc5 {+99.91/10 0.1} 48. Ka2 {-99.92/9 0.1} Ne3
{+99.93/8 0.1} 49. Ka3 {-99.94/7 0.1} Nc4+ {+99.95/6 0.1} 50. Ka2
{-99.96/5 0.1} Nc3+ {+99.97/4 0.1} 51. Ka1 {-99.98/3 0.2} Nc2#
{+99.99/2 0.1}
{Xboard adjudication: Checkmate} 0-1
[/pgn]
Of course it could be that TQueeny misses some critical tactics.
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 »

petero2 wrote:I think it would also be interesting to modify stockfish, which is more than 300 elo stronger than texel, to understand this imbalance. Then it could be tested if TQueeny is still able to win with the knights, and if stockfish wins against itself with the knights.
Well, I have never seen the Stockfish code, and have no idea how it works. I don't want to know it that badly. My experience is that results of imbalances are hardly dependent on the level of play, in self-play, so I don't consider it worth it to spend very much effort on it. I made QueeNy because I was writing an engine anyway.
Texel, and hence TQueeny, also has a text interface, which among other things prints the evaluation score.
You should also print that in UCI mode, as 'info string', so it would be visible in a regular GUI! :idea:
petero2
Posts: 730
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: A balanced approach to imbalances

Post by petero2 »

petero2 wrote:
hgm wrote:And you don't think the fact that the Knights are totally undeveloped, do not protect each other, and that the black King is wide in the open is sufficient compensation for that? (Not to mention that the Queens have a material advantage of +650 cP in terms of naive piece-value counting...)

The spread-out / undeveloped case was treated 3 postings earlier. It did not help the Queens much. But you cannot have it both ways: the King out in the open AND spread out Pawns. Or do you really want to start with the black King on e6 before a closed Pawn rank, to give those poor Queens a chance?
King on e6 seems to be lost quickly for black because of unavoidable tactics.
Nevertheless, an elephantiasis-unaware engine like stockfish has no chance against TQueeny.
[pgn]
[Event "Computer Chess Game"]
[Site "acer.localdomain"]
[Date "2013.10.28"]
[Round "-"]
[White "Stockfish 3 64bit SSE4.2"]
[Black "TQueeny 64-bit"]
[Result "0-1"]
[TimeControl "60/300"]
[FEN "nnnn1nnn/pppppppp/4k3/8/8/8/PPPPPPPP/Q2QK2Q w - - 0 1"]
[SetUp "1"]

{--------------
n n n n . n n n
p p p p p p p p
. . . . k . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
P P P P P P P P
Q . . Q K . . Q
white to play
--------------}
1. a3 {+12.60/17 71577:59} d6 {+1.45/16 6} 2. b4 {+11.87/18 5} Nf6
{+1.51/18 5} 3. g4 {+11.83/20 21} Kd7 {+1.63/17 5} 4. f4 {+11.75/20 34} Ne8
{+1.68/16 12} 5. c4 {+12.28/17 5} c6 {+1.75/16 5} 6. f5 {+11.83/18 22} Nac7
{+1.77/16 20} 7. Qb3 {+12.12/16 8} f6 {+2.03/16 5} 8. d4 {+11.83/17 6} Nhf7
{+1.95/15 6} 9. b5 {+11.87/17 7} cxb5 {+2.17/16 5} 10. c5 {+11.03/18 9} e6
{+3.14/13 5} 11. a4 {+10.22/14 12} dxc5 {+3.57/13 4} 12. dxc5 {+10.62/14 9}
a6 {+3.70/13 4} 13. axb5 {+11.67/13 6} axb5 {+3.87/14 4} 14. Qbd1+
{+10.86/13 8} Ke7 {+4.04/14 4} 15. Qa3 {+10.22/15 11} Nbc6 {+4.29/14 4} 16.
Qh3 {+9.77/16 3} h6 {+4.57/15 4} 17. Qhb3 {+9.29/15 5} b4 {+4.75/15 7} 18.
Qa2 {+9.37/15 7} Nfe5 {+4.94/15 4} 19. h4 {+8.80/14 2.8} Nxg4 {+5.69/16 4}
20. Qh3 {+7.27/15 8} Nge5 {+5.94/16 4} 21. Kf1 {+6.74/14 5} Nfd7
{+6.23/16 4} 22. Qdc2 {+5.45/16 11} N8a7 {+6.25/16 5} 23. fxe6 {+4.80/15 6}
Nf8 {+6.66/16 4} 24. Qe4 {+6.50/14 5} Ndxe6 {+7.00/17 4} 25. Qef5
{+5.65/14 3} Nab5 {+7.29/17 4} 26. Qd2 {+4.52/15 6} Nc3 {+7.65/16 5} 27.
Qc1 {+3.95/16 4} Nxc5 {+8.29/17 4} 28. e3 {+2.94/15 3} N7d5 {+9.66/18 16}
29. Qa1 {+0.72/16 3} Nd6 {+11.09/17 4} 30. Qf2 {-2.10/19 3} Nec4
{+11.81/16 8} 31. Kg1 {-3.91/16 6} b3 {+11.92/17 3} 32. Qhg3 {-4.88/18 7}
Nfe6 {+12.19/16 4} 33. Qh3 {-7.83/15 1.7} Ncb4 {+14.25/15 4} 34. Qa8
{-8.80/17 5} b2 {+16.66/16 4} 35. Qxb2 {-12.36/17 2.0} Nxb2 {+18.38/17 4}
36. e4 {-13.45/18 2.8} N3xe4 {+18.98/16 4} 37. Kh2 {-9.05/14 1.7} N2d3
{+20.24/18 4} 38. Qa3 {-12.08/15 1.6} Ne5 {+23.35/18 5} 39. Qg2
{-18.10/16 1.5} Ndf4 {+34.85/19 4} 40. Qf1 {-19.75/16 0.8} Nbd3
{+40.34/18 4} 41. Qaa1 {-109.66/18 5} Nd2 {+99.73/15 4} 42. Qg2
{-30.67/14 5} Nxg2 {+99.87/11 4} 43. Kh1 {-99.88/14 0.7} Nxh4 {+99.89/11 6}
44. Qg1 {-99.90/21 0.5} Nce4 {+99.91/10 2.5} 45. Qd1 {-99.92/50 0.4} Ndf2+
{+99.93/8 0.7} 46. Kg1 {-99.94/100 0.1} Nef3+ {+99.95/6 0.1} 47. Qxf3
{-99.96/100 0.1} Nhxf3+ {+99.97/4 0.1} 48. Kg2 {-99.98/100 0.1} Nf4#
{+99.99/2 0.1}
{Xboard adjudication: Checkmate} 0-1
[/pgn]
This does not mean that black has any hope against best play, it only means that it is pointless to use very strong but elephantiasis-unaware engines when testing these positions. Those engines simply do not have a clue what to do in these positions.
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 »

Indeed, that was my conclusion too. So until you produced Tqueeny (and thanks for that!), I only relied on self-play with QueeNy to judge these positions. This is why QueeNy always randomizes. I figured that when both would equally randomize, it would not really distort the results.

That might not be true for results very close to 0% or 100%, though. But I always thought that it would be kind of meaningless to try to judge positions by whethere they score 95% or 99%.

Do you have some sort of tropism in Tqueeny? In the 5N-2Q case without Pawns I have the feeling it would be very helpful to draw everything towards the opponent King. Usually Tqueeny wins this for the Knights, but it seems to do it in a very hesitant, rather than purposeful way. Put perhaps that is just out of tactical necessity; that is very hard to judge for a mere mortal...
petero2
Posts: 730
Joined: Mon Apr 19, 2010 7:07 pm
Location: Sweden
Full name: Peter Osterlund

Re: A balanced approach to imbalances

Post by petero2 »

hgm wrote:Do you have some sort of tropism in Tqueeny? In the 5N-2Q case without Pawns I have the feeling it would be very helpful to draw everything towards the opponent King. Usually Tqueeny wins this for the Knights, but it seems to do it in a very hesitant, rather than purposeful way. Put perhaps that is just out of tactical necessity; that is very hard to judge for a mere mortal...
There is no knight tropism in TQueeny. The only changes compared to texel is the huge bonus for the knight side and the king safety modifications I described before. There may be an indirect effect acting like tropism though. Since the knight side wants to force the enemy king to move to its least favorable square, the search will likely realize that the only way to do that is to keep at least most of the knights close to the enemy king.

Knight tropism might help in normal chess positions too, so I might test that some time.

To maximize strength in these QvsN positions it would probably be a good idea to implement the evaluation terms Lyudmil Tsvetkov described earlier: http://talkchess.com/forum/viewtopic.ph ... 53&t=49808
encourage trading of queen for 2 knights at the earliest opportunity
Already taken care of by the elphantiasis bonus.
encourage play on the wings, rather than in the center (playing with pawns on the wings), as it is easier to break through on the wings where the knights can not concentrate in the same amount as in the center
Not implemented in TQueeny. It has the same evaluation as texel, which considers center pawns more valuable.
discourage backward pawns for the queen side, as the knights will land there
Texel knows backwards pawns are bad and it knows that knight outposts are good, so it sort of has this knowledge already, but not exactly. Backwards pawns that can not be exploited by creating a knight outpost within the search horizon may not be evaluated as bad enough for the queen side.
discourage allowing passers for the knight side, as those are usually more dangerous than passers for the queen side
This is already implemented, mostly by accident. As the knight side is considered to be closer to the endgame phase (in order to encourage centralizing the king), this also means that it values its passed pawns higher.
keep king for the queens as far away from the knights as possible; always keep at least one pawn with the king to shelter it
As stated above, there is no knight tropism. There is code to handle pawn shelter though.
discourage blocked positions, as well as symmetrical pawn structures
Not implemented in TQueeny.
allow tactics as deep as possible
TQueeny always searches as deep as it can, but if the idea was to intentionally try to complicate the position on the assumption that you are tactically stronger than your opponent, TQueeny does not do that.
enhorning
Posts: 342
Joined: Wed Jan 05, 2011 10:05 pm

Re: A balanced approach to imbalances

Post by enhorning »

I posted this in the other Elephantiasis thread... (confusing having two threads about the same topic) but thought I might put it here as well:

I am finding these imbalances interesting... enough that I think I will run an Elephantiasis tournament after the Makruk one.

About 4-6 pawns on each side, as I think the full 8 leads to too blocked positions. White pawns on c/d/e-h, black pawns on a-d/e/f. Kings on g / b.

My preliminary thoughts would be to run these pairings:
3Q6P - 7N5P
3Q5P - 6N5P
3Q5P - 7B5P
3Q5P - 6B6P
3Q5P - 5R6P
3Q6P - 6R5P
5R5P - 7N5P
5R4P - 6N6P
5R5P - 7B5P
5R4P - 6B6P
7B5P - 7N5P

HGM, Eelco de Groot, Peter österlund, any suggestions for how to adjust the starting positions to be reasonably balanced? I want two positions for each piece pairing... ideal would be one position where White (the side with fewer but stronger pieces) is marginally advantaged and one where Black (the side with more but weaker pieces) is marginally advantaged.

As for 7B - 7N, I don't even know which is the stronger side... so need to find that out before deciding whether the second pairing should be 6B - 7N or 6N - 7B.
User avatar
Eelco de Groot
Posts: 4689
Joined: Sun Mar 12, 2006 2:40 am
Full name:   Eelco de Groot

Re: A balanced approach to imbalances

Post by Eelco de Groot »

Hello Ola,

I think it is mostly unexplored territory so your tournament would have to give the answers! I think I would just try to limit the available parameters as much as possible. So I think just concentrate on the pieces, keeping the number of pawns at eight. Closed positions are not much of a threat I think as chessprograms usually hate closed positions :) Mobility rules alone in chessprograms will lead to open positions, although specialized programs, playing the weaker side, might want to close the positions more. I think this is rather unexplored territory in normal computer-chess as well, keeping positions closed I mean. 7 bishops against 7 knights might be fun and if you want two positions you could add 7 against 6. But I think we just do not really know whether there are a lot of balanced positions possible with these kind of piece set-ups.

Addendum: playing with more than one thread will solve the problem of identical games that Lyudmil also asked about. But not all programs are multithreading so this may not be possible always.

Regards, Eelco
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan