The importance of space advantage

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

Moderators: hgm, Rebel, chrisw

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

The importance of space advantage

Post by Lyudmil Tsvetkov »

Hi.
Space advantage is very important in chess. Starting from a low base, it might be worth more than 100 elo points when implemented. Space advantage in terms of pawns on the 5th and 6th ranks is the usual case, and I think most engines might have this in their evaluations. But it is also important to evaluate space advantage in terms of minor pieces (bishop and knight) on the 5th and 6th ranks. This might bring at least some 20-30 elos, starting from a low base, as it is relatively frequent.

Below 2 examples of good judgement of space evaluation in terms of minors.

[D]r3r2k/p2q2pp/np1B2p1/3pP3/P2P4/1QP5/6PP/R4RK1 b 0 1

The first one is the position from the famous game Kasparov - Shirov from Wiik aan Zee 2001, where Kasparov refused to shake hands with Shirov. The bishop on d6 is a tremendous force, it controls the f8 and b8 squares, blocks the d file and pressures black overall. It is certainly worth close to half a pawn. And Kasparov demonstrated this with ease.

[D]6k1/1p1rnpp1/r1n1p2p/PR1pP3/B1pP2PN/2Pb1P2/3B3P/4R1K1 w 0 1

The second one is from the recent match Houdini - Rybka (a reference point for everyone because of the hardware implications). Black dominates, but it is the bishop on d3, protected by a pawn, that actually wins the game single-handedly. It controls the f1 and b1 squares, blocks the d file and exerts an overall pressure on the white pieces. It is certainly worth more than 50cps, and immediately after it is posted there the score starts rising rapidly in favour of black. Unfortunately, Houdini is one of the very few engines I can think of that efficiently uses this technique (I do not know if there are evaluation or search implications in playing the move, but the engine does so, while Rybka is more unaware of the importance of this mighty piece, judging by the evals).

So, actually, having a good space advantage is a game-winner. It is difficult for me to imagine what could one do to make the bishop go to d3 by just tuning, say, rook on an open file and double pawns (although, you never know, some testers are reputed to be extremely assiduous, and if this effort of theirs fails, there is always the chance to try tuning rook on the 7th rank and isolated pawns to get the necessary result:)) That is why specific parameters are important.

And, of course, space advantage in terms of minor pieces should not be mistaken for PST, which is supposed to just have a short-term effect, while space advantage usually assures you of a permanent, long-lasting advantage, worth many more centipawns.

It is interesting to know how many engines use space advantage in terms of pawns, and space advantage in terms of minor pieces? Maybe someone can share her point of view to add some feedback I would appreciate very much.

Best, Lyudmil
Kurt
Posts: 45
Joined: Mon Aug 01, 2011 3:18 pm

Re: The importance of space advantage

Post by Kurt »

Lyudmil Tsvetkov wrote:Hi.
Space advantage is very important in chess. Starting from a low base, it might be worth more than 100 elo points when implemented. Space advantage in terms of pawns on the 5th and 6th ranks is the usual case, and I think most engines might have this in their evaluations. But it is also important to evaluate space advantage in terms of minor pieces (bishop and knight) on the 5th and 6th ranks. This might bring at least some 20-30 elos, starting from a low base, as it is relatively frequent.

Below 2 examples of good judgement of space evaluation in terms of minors.

[D]r3r2k/p2q2pp/np1B2p1/3pP3/P2P4/1QP5/6PP/R4RK1 b 0 1

The first one is the position from the famous game Kasparov - Shirov from Wiik aan Zee 2001, where Kasparov refused to shake hands with Shirov. The bishop on d6 is a tremendous force, it controls the f8 and b8 squares, blocks the d file and pressures black overall. It is certainly worth close to half a pawn. And Kasparov demonstrated this with ease.
SCID claims an incorrect FEN position, correct seems
r3r2k/p2q2pp/np1B2p1/3pP3/P2P4/1QP5/6PP/R4RK1 b - - 0 1
and furthermore, Houdine thinks that White has a won game

4 +1.10 1.... Sc7 2.a5 Db5 3.Dxb5 Sxb5 4.axb6 axb6 (0.01)
5 +1.29 1.... Sc7 2.a5 Db5 3.Da2 Tac8 4.axb6 axb6 (0.01)
6 +1.29 1.... Sc7 2.a5 Db5 3.Da2 Tac8 4.axb6 axb6 (0.01)
7 +1.21 1.... Sc7 2.a5 Db5 3.Ta3 Tec8 4.Da2 bxa5 5.Txa5 (0.01)
8 +1.38 1.... Sc7 2.a5 Tac8 3.axb6 axb6 4.Tab1 b5 5.Lxc7 Txc7 6.Dxb5 De6 (0.03)
9 +1.31 1.... Sc7 2.a5 Tac8 3.axb6 axb6 4.Tab1 b5 5.Lxc7 Txc7 6.Dxb5 De6 7.Dd3 (0.03)
10 +1.28 1.... Sc7 2.a5 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8 Txd8 11.e6 Sc7 12.e7 Ta8 13.Tf8 Se8 14.Kf2 Ta2+ 15.Ke3 (8.17)
22 +1.31 1.... Sc7 2.a5 (14.07)
22 +1.26 1.... Sc7 2.a5 Tac8 3.axb6 axb6 4.Ta7 Db5 5.Db4 Dxb4 6.Lxb4 Sb5 7.Taf7 h5 8.T1f3 Kh7 9.Td7 Ted8 10.Txd8 Txd8 11.e6 Sc7 12.e7 Tc8 13.Tf8 Se8 14.Kf2 g5 15.Ke3 Kg6 16.Kd3 g4 17.Ld6 Ta8 18.Le5 b5 19.Ke3 h4 (18.27)
23 +1.23 1.... Sc7 2.a5 Tac8 3.axb6 axb6 4.Ta7 Db5 5.Db4 Dxb4 6.Lxb4 Sb5 7.Taf7 h6 8.T1f3 Sc7 9.Td7 Kg8 10.Kf2 Ted8 11.Tff7 Txd7 12.Txd7 g5 13.Ke3 h5 14.h3 h4 15.Kf3 Sb5 (24.75)
24 +1.32 1.... Sc7 2.a5 (33.49)
24 +1.52 1.... Sc7 2.a5 (55.89)
24 +2.02 1.... Sc7 2.a5 (113.00)
24 +2.12 1.... Sc7 2.Tf3 Tac8 3.Taf1 Kg8 4.Tf7 Dxf7 5.Txf7 Kxf7 6.Lxc7 Txc7 7.Dxd5+ Te6 8.Db3 Te7 9.c4 g5 10.Kf2 g4 11.Kg3 h5 12.a5 g6 13.Kf4 Kf8 (282.92)
25 +2.18 1.... Sc7 2.Tf3 Tac8 3.Taf1 Kg8 4.Tf7 Dxf7 5.Txf7 Kxf7 6.Lxc7 Txc7 7.Dxd5+ Te6 8.Db3 Te7 9.c4 g5 10.Kf2 g4 11.Kg3 h5 12.a5 g6 13.Kf4 (412.97)
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: The importance of space advantage

Post by lucasart »

Lyudmil Tsvetkov wrote: Space advantage (...) might be worth more than 100 elo points when implemented.
You could not be more wrong:
https://github.com/lucasart/Stockfish/c ... 3aaea76324

Chess playing and chess programming are two completely different skills. Too many people don't uinderstand that (typically everyone who hasn't coded a chess engine themself). A lot of the "chess knowledge" that works for humans is harmful to computer programs. In my experience *MOST* of it.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: The importance of space advantage

Post by Don »

lucasart wrote:
Lyudmil Tsvetkov wrote: Space advantage (...) might be worth more than 100 elo points when implemented.
You could not be more wrong:
https://github.com/lucasart/Stockfish/c ... 3aaea76324

Chess playing and chess programming are two completely different skills. Too many people don't uinderstand that (typically everyone who hasn't coded a chess engine themself). A lot of the "chess knowledge" that works for humans is harmful to computer programs. In my experience *MOST* of it.
I know it's not worth 100 ELO but you might be the one that is wrong on general principle. I looked at the log file you referenced and have an observation.

First of all, when you implement terms that overlap to some extent you often have a "tuning" issue. For example if mobility is perfectly adjusted and you add "space", then you very well may need to consider reducing the mobility in order to get a better balance. You may even have to redefine mobility or other things that could possibly interact.

Secondly, I believe that most chess principles that actually make sense should make sense in a chess program too, unless there is undue overhead involved which can often be the case. Having said that it often happens that we try to implement something that makes sense and it does not appear to work for us.

But when people say, "oh, I tried that and it didn't work", I consider it an almost meaningless statement. Most programs will respond differently to each thing and is different in many details. And in general you know very little about their implementation - except that it didn't work for them. But you don't really know why. It could be buggy, poorly defined, or just not tuned and balanced with the rest of the program. Or they may even have tested in improperly! So unless you take these things with a grain of salt you really have to try for yourself.

I'm not claiming you did this wrong or there is a problem, it's just that I have to dispute your statement that "space doesn't work." It probably DOES work in some form but it's just difficult to know how that should be. For these reasons I completely avoid using the phrase, "YYY doesn't work", and instead I say something like, "I have been unable to make YYY work for Komodo."

You also say that "chess knowledge that works for humans often doesn't work for computers" and I sort of agree with that because often human principles are stated incorrectly - with all sorts of context implied that makes these principles often impractical for computers. But what is behind them is often sound and applicable.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Kempelen
Posts: 620
Joined: Fri Feb 08, 2008 10:44 am
Location: Madrid - Spain

Re: The importance of space advantage

Post by Kempelen »

I think space in eval function is not usually a good term to have because it has some redundance with piece square table (PST). With PST, the one who has more advance pieces will get a better score for that.
Fermin Serrano
Author of 'Rodin' engine
http://sites.google.com/site/clonfsp/
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: The importance of space advantage

Post by Don »

Kempelen wrote:I think space in eval function is not usually a good term to have because it has some redundance with piece square table (PST). With PST, the one who has more advance pieces will get a better score for that.
But read what I wrote about this above. If what you say is true, it might come down to what is the best way to implement space, via the piece square table or with a more dynamic definition? If you have a more dynamic definition of space then the piece square tables values need to be adjusted accordingly as this would now replace something that is less accurate.

All these terms interact. If you raise the value of a knight by half a pawn, do you think you can get away with this without also raising the value of the bishop and perhaps making other adjustment too? Anytime you add evaluation that is partially redundant you need to make multiple adjustments.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: The importance of space advantage

Post by tpetzke »

Hi,

so far I haven't got it working for my engine too, but it is still on the list.

You probably know stockfish far better than I do as you reference it very often, but as far as I remember the stockfish implementation of space is different from the principle state by the OP.

Stockfish awards a bonus for space in its own camp where as the OP and also the common definition from wikipedia would award a space bonus for influence in the opponents camp.

So you can say that something you copied from stockfish does not work in your engine but to say that the principle in general does not work is probably not justified (considering the fact that you even refer to a different principle that just shares a common name)

Thomas...