joergoster/Moonfish

Material key breaks endgame/TBs functionality

Closed this issue · 1 comments

With the introduction of different material keys for otherwise same positions with 'real' bishop pair and bishops of the same color, endgame and TB functionality was unvoluntarily (because undocumented) broken.

For example

position fen 1n2k3/8/8/8/8/8/8/2B1K1B1 w - - 0 1
d

 +---+---+---+---+---+---+---+---+
 |   | n |   |   | k |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   | B |   | K |   | B |   |
 +---+---+---+---+---+---+---+---+

Fen: 1n2k3/8/8/8/8/8/8/2B1K1B1 w - - 0 1
Key: 8D2DC8F5D74CC07E
Checkers: 
Tablebases WDL: Draw (Success)
Tablebases DTZ:    0 (Success)
position fen 1n2k3/8/8/8/8/8/8/2B1K1B1 w - - 0 1
d

 +---+---+---+---+---+---+---+---+
 |   | n |   |   | k |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   |   |   |   |   |   |   |
 +---+---+---+---+---+---+---+---+
 |   |   | B |   | K |   | B |   |
 +---+---+---+---+---+---+---+---+

Fen: 1n2k3/8/8/8/8/8/8/2B1K1B1 w - - 0 1
PositionKey: 8D2DC8F5D74CC07E
MaterialKey: 97F8B84706517E19
PawnKey:     C6F19A61656271D
Checkers: 
Legal moves: 19
Tablebases WDL: Draw (Failed)
Tablebases DTZ:    0 (Failed)

The 1st one is correct, the 2nd not.

One obvious solution is to maintain an unaltered, special endgame key without the additional differentiation.

Solved with e1a57a0