hgm wrote:I found thge distinction light (B,N-class) and heavy (R-class or stronger) more fundamental than the minor/major distinction based on mating potential. There are plenty of pieces not stronger than Knight which do have mating potential (the Shogi Gold General being one of the weakest, with only 6 target squares). But this seems to contribute very little to their vaue. OTOH pieces can easily be stronger than Rook, and not have mating potential (e.g. Nightrider).
I had a quick look at the code to remind myself how these are actually handled in the code.
In the classification code, a minor is any piece that doesn't have mate potential. A super piece is a major piece that is stronger than a rook. The "strength" is measured by the sum of the attack pattern on a 3x3 and 5x5 board, adjusted for whether the piece attacks any squares at all on the 3x3 board (a knight doesn't, if placed at the centre) and whether the piece is colour-bound or not. The idea behind this is that this is a measure of how dangerous an enemy piece is if it is close to your king.
This attack-score is what is actually used when evaluating king safety or game-phase. I mis-remembered how the evaluation scaling is handled (perhaps it's something I planned to do but didn't get round to doing). The score is adjusted for the presence of mate potential on either side and the number of surplus pieces, independent of their classification. This may cause Sjaak to unfairly penalise KQKM in the same way it would KRKM, but I don't think this will actually change the outcome of the game. It will just prefer to not exchange surplus material until winning the minor comes within the horizon.
Of course piece values are input, so the user is free to set these in a way that breaks things horribly. Sadly, I don't believe any of the clever algorithms people have published to estimate piece value from the rules alone.
'Super-piece' is a bit ill-defined. Capablanca Archbishop and Chancellor should clearly count as such, as they differ less than a Pawn in value from a Queen. But they cannot generally beat Rook (although for KCKR it can in about half the cases).
Well, as I said, the distinction is a bit arbitrary, and more based on how dangerous the piece is in a king attack than how it performs in the end game. As it is, KQKR, KCKR and KAKR would all be classified as pawn-less, single piece with mate potential on either side and penalised (scaled) accordingly.
A Queen does not even beat a Commoner (non-royal King), once it connects with its King, while the Commoner should count as a light piece. (Even in the end-game it is only marginally stronger than Knight.)
True, but knowing that requires some fairly specific knowledge (which could be implemented in a general way: a King cannot attack a Commoner and a Commoner can retain the protection of the King when either of them moves. The first means you can't do a double-attack on it and the latter means that you cannot break the connection once it is established). As it is, KQKC (or KQKK in Spartan) would get the same penalty as KQKR or KAKR (since the Commoner has mate potential).
However, the attack rating of the Commoner is indeed the same as for a Knight or Bishop so in evaluation terms that are based on this it would be weighed as a minor piece.
There are even pieces with value close to 8 that have no mating potential (e.g. the Aanca, which moves one step orthogonal, and then continues like a Bishop). I guess a piece that could teleport to all squares of the color it is on would be far stronger than a Queen, but as it is color bound, it has no mating potential. (And teleporting to opposite colored squares even guarantees you a draw at any time by perpetual checking...)
Sure, rules of thumb can only help you so much in the end. The trick is to get them to help you as much as possible, while preventing them from messing up in situations where they don't apply.
This is why I test "mate potential" explicitly when deciding whether to scale or not and "attack strength" when the actual power of the piece is in question and "piece value" when assessing material balance.
Typically, pieces with a high "attack strength" have a high piece value but there is (obviously) no strict correspondence: the Spartan General (Dragon King), the Archbishop and the Chancellor all have the same "attack strength" but they don't have the same piece value. An even better case are the promoted pieces in Shogi: most have the same "strength" as a Gold, but they don't have the same value. I tend to use "attack strength" when I prefer an "objective" (as in, not a number that the user specifies) guestimate for the value of a piece and the exact nuances are less important.