So I had added a simple algorithm that, once a bare King is detected and its centralization weight increased (so that it would consider it most important to corner that King, even if it has to decentralize 4 other pieces to achieve that), the bare King started to decrease the penalty for every square it visited. So that when Fairy-Max failed to mate it in the corner where it was trapped, it would actually get a bonus to be in that corner after some time, so that Fairy-Max would start to drive it out of there again, to the nearest other corner. (Where it then would find a checkmate.) This worked to some extent, but had still several problems:
- It took about 10 turns to turn the penalty in a corner into a bonus, and this often wasted too much time to meet the 50-move requirement.
- During this period not all pieces were needed to keep the King trapped, and one of the pieces then started freely diffusing over the board, and thus could be far away. (E.g. when Bb3 and Nd3 have the bare King trapped on a1/b1, the other King could easily wander to h8, as it would always be back on e4 in the leaf to reap the full center bonus.)
- If the corner painting went on too long after that corner turned positive for the bare King, because the strong side had to recall his dispersed forces again to drive that King away, the bonus in that corner became so large that it started to act as a trap for the pieces of the strong side (as all pieces use the same centralization table, just with different weights), so that they rather dwelled there than drive the bare King to the other corner.
- When a bare King is detected, its centralization weight is not switched from 1 to 5 immediately, but increases linearly with the 50-move counter from 1 to 10. This gives the strong side the opportunity to amass its forces in the center, before it starts to worry too much on hindering the King. This prevents it chasing the bare King only with its fast pieces, leaving a slow one behind in a corner, where it is of no use in driving the King from the safe corner to the deadly one, so that it escapes in the attempt.
- The normal (corner-color-blind) centralization table stays in use until the bare King actually visits a corner square, and the 50-move counter is at least 10 (ply). This prevents concluding too early that you cannot mate the King in that corner.
- Once the bare King is forced into a corner, or sufficiently much material is present near that corner to drive it out, a checkmate in that corner would usually be within the horizon, and then the centralization table no longer matters, as mate scores are not based on static eval.
- So when in the corner after at least 10 moves, a 4x4 area in that corner is immediately painted in the following way: The penalty in all non-edge squares in it is set to -2, where 0 would be the normal valuein a center square. This attracts the pieces of the strong side in range of the bare King.
- The edge squares get penalties 0, 3, 6, 9, increasing away from the corner, defining a monotonous path along the board edge along which the bare King is to be driven. Once it gets outside the 4x4 area, the normal centralization table makes the penalty increase further towards the deadly corner. E.g. for a bare King on a1:
Code: Select all
28 21 16 13 12 13 16 21 22 15 10 7 6 7 10 15 18 11 6 3 2 3 6 11 16 9 4 1 0 1 4 9 9 -2 -2 -2 0 1 4 9 6 -2 -2 -2 2 3 6 11 3 -2 -2 -2 6 7 10 15 0 3 6 9 12 13 16 21
- The hash table is invalidated, making Fairy-Max also forget the game history, so that it would not shy away from making a first repetition if this is necessary in view of the new goal.
There is one tricky case, which is a Knight plus two (Ferz) Queens on the same color. In principle mate is possible in corners of both colors, but the mate in the color opposite to that of the Queens is so difficult to find that at blitz TC Fairy-Max would not find it even with the bare King in that corner and the normal corner penalties. This because the Queens are typically far away as a result of driving the King there, and would have to be moved near the edge, which normally is a bad location:
[d]8/8/8/8/8/KN6/2Q5/2kQ4 b
coming from something like
[d]8/8/8/1Q6/4Q3/2KN4/k7/8 w
and involving zugzwang. So it now treats this case by driving the bare King to the other corner as well, which it usually manages within the available time.