[Spartan chess/chess variants] Imbalance of minor pieces

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

[Spartan chess/chess variants] Imbalance of minor pieces

Post by Evert »

I decided to apply HGM's method for measuring material imbalances (based on starting with an initial position in which the imbalance is present) to the minor pieces in Spartan Chess. As some of you may recall, Spartan Chess is an interesting variant with radically different armies for white and black. The only way to get to equal material on both sides is to trade down to bare kings.

The Spartan minors are the Lieutenant (~ferz + elephant) and the Captain (~wazir + dabbabah), both of which can leap over blocked squares. The Lieutenant has a colour-changing move (by stepping sideways), so is not colour-bound. The nominal value of these is equal to that of the conventional minors. However, it is still an interesting question when and which trade is most beneficial. This seemed more interesting than measuring the same thing in regular chess, where the number of possible combinations is smaller, and the same thing has been done before.

I assumed that the initial combination (NNBB-CCLL) is equal in strength. This comes down to whether the normal initial setup is balanced, which it seems to be. I then deleted one piece of each from each side and measured the winning rate. Then I deleted a pawn from the side that came out ahead and measured again. This establishes the value of a pawn in terms of winning chances (given the material imbalance) and you can get the value of the imbalance in pawn units. I took the value of the Spartan pawn (the Hoplite, a modified Berolina pawn) to be equal to that of the conventional pawn (you can argue about that one). In the following table the first pair of numbers between parenthesis is the score by either side, the second pair (labelled NP) is the same with a pawn deleted, "pv" is the measured value of a pawn (in terms of winning rate) and the final number is the value of the material imbalance, expressed in pawn units from white's point of view:

Code: Select all

NNB-CCL (51.83-48.17; NP 38.92-61.08; pv=12.91) -> +0.14
NBB-CCL (60.08-39.92; NP 44.83-55.17; pv=15.25) -> +0.66
NBB-CLL (53.92-46.08; NP 41.40-58.60; pv=12.52) -> +0.31
NNB-CLL (51.25-48.75; NP 43.33-56.67; pv= 7.92) -> +0.16
NN-CC   (43.34-56.66; NP 50.00-50.00; pv= 6.66) -> -1.00
NN-CL   (45.36-54.64; NP 56.02-43.98; pv=10.65) -> -0.44
NN-LL   (49.75-50.25; NP 54.06-45.94; pv= 4.31) -> -0.06
NB-CC   (53.56-46.44; NP 41.25-58.75; pv=12.31) -> +0.29
NB-CL   (49.73-50.27; NP 62.03-37.97; pv=12.30) -> -0.02
NB-LL   (47.60-52.40; NP 56.25-43.75; pv= 8.65) -> -0.28
BB-CC   (55.22-44.78; NP 34.84-65.16; pv=20.37) -> +0.26
BB-CL   (50.17-49.83; NP 36.64-63.36; pv=13.52) -> +0.01
BB-LL   (48.18-51.82; NP 56.25-43.75; pv= 8.07) -> -0.23
N-C     (44.84-55.16; NP 55.21-44.79; pv=10.36) -> -0.50
N-L     (41.41-58.59; NP 55.73-44.27; pv=14.32) -> -0.60
B-C     (51.33-48.67; NP 34.09-65.91; pv=17.24) -> +0.08
B-L     (46.95-53.05; NP 58.25-41.75; pv=11.30) -> -0.27
Some points to note:
  • Imbalances involving the bishop pair include the bishop pair bonus in the measured value.
  • The NN-CC imbalance looks a bit odd. I'll take a closer look at that one to make sure it's accurate.
  • The single minor imbalances should be taken with a grain of salt, since the test is still running. They look "ok" though.
Overall, I'd say:
  • Knights do relatively well against Lieutenants but fare relatively poorly against Captains. Bishops are the other way around and do best against Captains and worst against Lieutenants.
  • Beyond the first minor, exchanging minors is not really to white's advantage, from a material point of view.
This last point is interesting because it causes a bit of a problem for white: his advantage disappears if he tries to simplify the game too quickly and he'd want to keep three minors on the board until he's won some other advantage. What exactly the practical consequences of this are isn't clear to me yet. It'll be interesting to see when I get around to giving this a go in Leonidas.

One thing I should test is the case of no minors at all, I'll try to schedule that tonight. It'll be a bit tricky because deleting a pawn in that situation will always open up lines for the rooks to come out very quickly.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: [Spartan chess/chess variants] Imbalance of minor pieces

Post by hgm »

Very interesting, but I think you should also measure BBNN-CCLL, rather than take it for granted the initial position is exactly balanced. I did the original imbalance measurement with Fairy-Max, which is a bit stupid w.r.t. Bishop pairs, and this might affect B value. Furthermore, the intention was never to balance it perfectly; orthodox Chess is not balanced perfectly either. White has a 3-4% advantage there, and no one sees that as a problem. According to Fairy-Max the imbalance in Spartan Chess was smaller than 3%. But with the resolution you have now, 3% might be significant.

My conclusion at the time was that first Bishop > Lieutenant > second Bishop ~ Knight > Captain.

But there are a few concerns in doing this with a stupid engine like Fairy-Max. It was not aware of mating potential, and therefore might not have been exploiting the fact that a Captain has it. This could lead to over-estimation of the Knight-Captain difference. It was also unaware of drawishness of unlike Bishops. Although it is still a mystery to me how this generalizes to Bishop vs other pieces, I could imagine that (especially with connected or nearby Pawns) KBPPKL is just as dead a draw KBPPKB with unlike colors. And the Lieutenant can pick its color and stay there.

There also is an important issue with a Bishop defending against Hoplite Pawns, which might affect the value of both: Hoplites for practical purposes are also color bound, so it really matters a lot whether the Hoplite is of like or unlike color as the Bishop. With unlike colors a Hoplite can march to promotion without even seeing the Bishop, and KBKH could be lost! "Bad Bishop" really gets an extra dimension in Spartan Chess...
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: [Spartan chess/chess variants] Imbalance of minor pieces

Post by Evert »

hgm wrote:Very interesting, but I think you should also measure BBNN-CCLL, rather than take it for granted the initial position is exactly balanced.
I can certainly do that, but in practical terms I don't think there's much that I can do about it if it isn't.
Although I could do the following two tests: measure the performance of white against black (keeping the armies the same) and measuring the effectiveness of the Spartan army if it gets the first move (effectively making the Spartans play white). Together, these could determine the first-move advantage and the relative strength of the two armies if the first move advantage is averaged out.

I think I've done the self-play test once, mainly to measure the draw-rate. I think I came to about 52%-48% for white, with a draw rate of 12%, but I'd have to measure that again. This may also have been Sjaak rather than Leonidas, but it shouldn't matter much for this.
My conclusion at the time was that first Bishop > Lieutenant > second Bishop ~ Knight > Captain.
I think that's probably the best "0-parameter" representation of my data as well. Certainly it seems that Lieutenant > Captain and NBB > CLL while NB=CL, pretty much.

Apart from NN-CC which I mentioned already, another interesting combination is BB-LL (which comes out as a disadvantage to the bishop side, didn't expect that).
But there are a few concerns in doing this with a stupid engine like Fairy-Max. It was not aware of mating potential, and therefore might not have been exploiting the fact that a Captain has it. This could lead to over-estimation of the Knight-Captain difference.
Leonidas (and Sjaak) both have this. There may be other issues, of course. When measuring pressure against the white king the Captain gets weighted the same as a rook (the weighting is based on the attack pattern on empty 3x3 and 5x5 boards), which may be ok for that part of the evaluation, but this weighting is re-used in other parts of the evaluation (for example when calculating game phase) and it may lead to distortion there.
It was also unaware of drawishness of unlike Bishops. Although it is still a mystery to me how this generalizes to Bishop vs other pieces, I could imagine that (especially with connected or nearby Pawns) KBPPKL is just as dead a draw KBPPKB with unlike colors. And the Lieutenant can pick its color and stay there.
Can FairyGen do 6-piece endings with pawns? It may be interesting to look at this. The disadvantage of a Lieutenant compared to a Bishop is that it is short-range, so it may be possible to drive it away and allow the pawn to advance.
There also is an important issue with a Bishop defending against Hoplite Pawns, which might affect the value of both: Hoplites for practical purposes are also color bound, so it really matters a lot whether the Hoplite is of like or unlike color as the Bishop. With unlike colors a Hoplite can march to promotion without even seeing the Bishop, and KBKH could be lost! "Bad Bishop" really gets an extra dimension in Spartan Chess...
Yes, that one has been on my TODO list for a while too, but I haven't thought of a way to implement it that I like. The simplest thing is of course to simply discard bishops of the "wrong" colour when determining passers, but determining passer status for a hoplite is already interesting because as soon as a few pawns have been exchanged there will be hoplites that have an unblocked (by pawns) path to promotion. Is that enough to consider them passers? Probably not, if they're still easy to stop, but...
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: [Spartan chess/chess variants] Imbalance of minor pieces

Post by hgm »

Evert wrote:I can certainly do that, but in practical terms I don't think there's much that I can do about it if it isn't.
The idea was not so much to do something about it, as that it would act as a baseline against which to measure the effect of deleting pieces.
Apart from NN-CC which I mentioned already, another interesting combination is BB-LL (which comes out as a disadvantage to the bishop side, didn't expect that).
Indeed, the Lieutenant is surprisingly strong. It has always surprised me how little the distant moves on a Bishop seem to be worth: in a FIDE context the FA is already nearly as strong as a Knight, and thus as an isolated Bishop (suffering from the same color-binding, so that cannot be a factor). Apparently all moves of range 3 and larger are worth as much as the fact that the range-2 move cannot be blocked. While for a Rook the same difference is enormous: a Captain just has the strength of a minor (and both have mating potential, so that cannot be it either).

Yet the general Bishop value does not seem to suffer from the fact that the opponent has Hoplite Pawns. I think I once tried to play Lieutenants in a pure FIDE context too (replacing BB of one side by LL), and that the Lieutenants had the upper hand there too.
Can FairyGen do 6-piece endings with pawns? It may be interesting to look at this. The disadvantage of a Lieutenant compared to a Bishop is that it is short-range, so it may be possible to drive it away and allow the pawn to advance.
Unfortunately FairyGen cannot do 6 men. It cannot even do Pawns. I really should build a new generator that could do both.

I think that with 2 or fewer files between the Pawns the Lieutenant should be able to hold its ground. The important thing is that it should be able to stop the Pawns along the same diagonal on the other color as the attacking Bishop. With two files between the Pawns it can do that, and still move along that diagonal to avoid zugzwangs. The King can then spend his time to oppose the opponent King, making sure he protects the Lieutenant and the squares in front of the Pawns when the other king attacks those. With connected Pawns it would be trivial, as the defending King can block one Pawn while defending the square in front of the other. WIth one file between them you position the King on that file (say e2), and have the Lieutenent jump over it between d3 and f1 (if the Pawns are on d4 and f2).
Yes, that one has been on my TODO list for a while too, but I haven't thought of a way to implement it that I like. The simplest thing is of course to simply discard bishops of the "wrong" colour when determining passers, but determining passer status for a hoplite is already interesting because as soon as a few pawns have been exchanged there will be hoplites that have an unblocked (by pawns) path to promotion. Is that enough to consider them passers? Probably not, if they're still easy to stop, but...
Indeed, my passer code in Spartacus is rather complex. I think you have to detect if the Hoplite can be stopped when the FIDE Pawns are allowed to move, rather than when they are just static. So a Hoplite on e6 is not a passer if there is a Pawn on e3, (and no other PAwns), because after e4 it would be stopped. Only when it gets to play Hd5 or Hf5 it becomes a passer.

For Hoplites the absolute position on the board is also important: when they can still bump into the edge in one direction or the other KHK is not won.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: [Spartan chess/chess variants] Imbalance of minor pieces

Post by Evert »

Ok, the single minor imbalances are done. Results are not very different from what I posted earlier, but here they are anyway:

Code: Select all

   N-C     (44.84-55.16; NP 55.62-44.38; pv=10.78) -> -0.48
   N-L     (41.41-58.59; NP 51.17-48.83; pv= 9.77) -> -0.88
   B-C     (51.33-48.67; NP 37.50-62.50; pv=13.83) -> +0.10
   B-L     (46.95-53.05; NP 58.52-41.48; pv=11.56) -> -0.26
hgm wrote: The idea was not so much to do something about it, as that it would act as a baseline against which to measure the effect of deleting pieces.
Good point.
I only did a quick test, with 200 games and I didn't do the measurement of the pawn value. However, the result is 56.25-43.75, with a draw rate of 12%. Given the number of games, this 56% could well be too high. Still, it looks like a fairly significant advantage for white.
If accurate, I'll need to adjust the measured imbalance values for that, which is annoying. I guess the proper way to do this is to award the first move to black and measure again, then take the average of the two measurements?
Or can I simply subtract the measured value of the first-move advantage?
Indeed, the Lieutenant is surprisingly strong. It has always surprised me how little the distant moves on a Bishop seem to be worth: in a FIDE context the FA is already nearly as strong as a Knight, and thus as an isolated Bishop (suffering from the same color-binding, so that cannot be a factor). Apparently all moves of range 3 and larger are worth as much as the fact that the range-2 move cannot be blocked.
Perhaps it's an issue with limited mobility of the bishops on a full board? Although if that is the case you would expect the bishop to become stronger (relative to the lieutenant) in the end game.
For the rooks, I recall that in the middle game and without an open file, a rook is not actually worth (much) more than a minor, but its strength goes up a lot once lines open up (and the reason you value it as highly as you do is that opening lines is something that will happen and you want to keep the rooks around for when it does). The captain has no such benefit.
Unfortunately FairyGen cannot do 6 men. It cannot even do Pawns. I really should build a new generator that could do both.
That's unfortunate.
I once had a quick look at Ronald's tablebase generator, and it looked like it would be relatively easy to modify to handle more than 6 piece types. Changing the existing piece definitions should also work, of course, but isn't very elegant (or great if you want to mix orthodox and fairy pieces in the same end game).

The main reason I didn't do anything with it is that it requires a ton of memory to run.
Indeed, my passer code in Spartacus is rather complex. I think you have to detect if the Hoplite can be stopped when the FIDE Pawns are allowed to move, rather than when they are just static. So a Hoplite on e6 is not a passer if there is a Pawn on e3, (and no other PAwns), because after e4 it would be stopped. Only when it gets to play Hd5 or Hf5 it becomes a passer.
Hmm... ok, that makes sense. Do you give a bonus for these semi-passers? I could imagine that it would be worth it to encourage white to block them. Then again there is also no reason to panic when the hoplite is not yet passed, so it shouldn't be a large term.