I sometimes practice the two knights v pawn ending against Rybka 2.3.2a mp 32-bit native (i.e.with no EGTB attached). This is because Rybka normally plays this ending reasonably well unaided, but will vary the game (as opposed to Wilhelm with an attached EGTB).

I think the superiority of Rybka in this ending over the other chess programs I have (playing native) can only be explained by embedded rules specific to this ending.

However when I played White against Rybka from position C given here (viz. N6k/2p5/2N2K2/8/8/8/8/8 w - - 0 1), the game went.

1. Ne5 Kg82. Ke6 c5

You will notice that on move 2, Rybka moves from an obviously drawn position into an obviously lost position.

I am fairly sure from playing Rybka in similar situations that Rybka "recognises" the position after move 2 to be lost for black. If that be the case, the only explanation for its second move is that it also (erroneously) evaluates the position after move 1 as a loss for black.

I think a likely explanation of this is that the program implements a version of the Troitsky line rule similar to, or actually, one of the Wikipedia versions reported in the above link, without adequately covering the exceptional cases.

The source code for Rybka is not generally available, so it's difficult to check in this particular case. Does anyone know of a similar case where a program which is generally competent in knnkp plays crap in position C and the reason is the implementation of a bad version of the Troitsky line rule?

Note that if a version of the Troitsky line rule reading:

If the black pawn stands on or behind the Troitsky line and a white knight stands immediately in front of the pawn and is protected by the other knight, then the position is won for White (and the reverse in colours)

were implemented this would not lead to the play mentioned. I don't think this would introduce any significant performance degredation over incorrect versions either. No code to cover exceptions would be required.

I think the rule could be extended to:

If a white knight stands on the same file as and in front of the black pawn no further forward (from the pawn's point of view) than one square beyond the Troitsky line and it is defended by the other knight from a square that is not both on a file adjacent to the pawn and on a rank strictly ahead of the pawn but behind the first knight, then the position is won for White (and the reverse in colours).

Martin Rattigan wrote:Note that if a version of the Troitsky line rule reading:

If the black pawn stands on or behind the Troitsky line and a white knight stands immediately in front of the pawn and is protected by the other knight, then the position is won for White (and the reverse in colours)

were implemented this would not lead to the play mentioned.

That is not a good rule for a chess evaluation function. With that rule, once the other knight moves away from protecting the blockading knight, the evaluation function will evaluate the position as a draw. The engine will therefore make sure that that other knight continues to protect the blockading knight and, as a result, draw the game.

If an evaluation function evaluates KNNvKP as a draw unless a particular rule applies, then that rule should cover not only selected positions that are known to win, but also all their "successor positions", i.e. the positions on the winning path. So it is not sufficient to limit the rule to selected positions of which you are 100% sure that they win, as that will not enable the engine to actually win these selected positions.

So for an engine the first Troitzky line with a sort of "loose" definition of securely blockading seems very useful. Whether the knight is securely blockading actually does not need to be checked in the evaluation function, as a few plies of search will take care of it.

This approach will not cover all exceptions, but that is inevitable with rules. The alternative is using a tablebase.

The particular exception that is position C is not unreachable, but is quite unlikely to occur in a real game.

I think the rule could be extended to:

If a white knight stands on the same file as and in front of the black pawn no further forward (from the pawn's point of view) than one square beyond the Troitsky line and it is defended by the other knight from a square that is not both on a file adjacent to the pawn and on a rank strictly ahead of the pawn but behind the first knight, then the position is won for White (and the reverse in colours).

I think the term "blockading" already includes the case that the pawn still has a square or more to go before it is stopped (at or before the Troitzky line) by the blockading knight.

I wasn't intending that the engine should assume that only the Troitzky line positions are won. The rule could be used to give a definite evaluation of certain positions, so that a forward search can stop at any such positions without further analysis. Any position where such a position could be forced can also be evaluated as won.

There would have to be other rules used in conjunction with this to make progress. (Possibly a DTM or DTM50 count associated with each Troitzky line position, drawing zones for the black king for each pawn position, increasing plus points for white if the black king is in outside successive octagons surrounding the central 4 squares etc. ... ).

Having worked out how to use the Wihelm analysis functions in the meantime, I realise that another complication is that the rules as I proposed them are wrong. There are still exceptions.

PPS. The "loose" definition of securely blockaded should fall out in the extended search. If the blockading knight is protected only by the king, White generally must move his other knight to take part (otherwise the Black king cannot be divorced from the blockading knight). If this cannot be done the position is generally drawn.

PPPS. You say, "This approach will not cover all exceptions, but that is inevitable with rules. The alternative is using a tablebase." This is not always true. I think I could write a perfect krk rule based routine for example. It would obviously be harder for knnkp (especially if the 50 move rule is to be enforced). Actually, isn't a tablebase just a rule based approach with a lot of rules anyway?