I will think if this can be improved, but the the conversion to something like ws[], bs[], wp[], bp[] needs to be done at one point or another. Either the API does it behind to curtains, or the engine does is explicitly. Considering that such specific format will differ from other engines, it is better if the engine itself does the conversion. You ask something as low level as possible, and I think that the format I am requesting is the best I can do.mcostalba wrote:Why notmichiguel wrote:Code: Select all
int ws[17], bs[17]; /* list of squares for white and black */ int wp[17], bp[17]; /* what pieces are on those squares */
Instead of ws, bs, wp, bp arrays ?Code: Select all
int pieceList[2][8][16]; // [color][pieceType][index] int index[64]; // [square]
I understand this is a request specific to satisfy how lists are defined in Stockfish, but if it doesn't hurt performance I would propose that. And I don't think it will hurt performance (at least from user point of view) because in a real engine the piece lists will be updated incrementally in do_move(), not from scratch.
An engine with enough cache for 6-pc TBs, will have all the needed 4-pc information in cache when the time comes; so, it can only be better. The question is how much better.
Anyhow, in case of this library will be used in SF the API (and of course internals) will be changed anywayto be adapted to SF. So if you don't see negative side effects please consider this list layout in first instance.
In case data is on disk, I agree with you has no sense talking about this, but I am not sure a 6 TB on disk will result in a stronger engine then one using, say 4 TB in RAM, especially if this engine has _already_ a good handling of endgame positions.
Regarding the relative strength of an engine with or without TBs, I have seen for years the claims that it does not help. Personally, I do not believe it because I do not think that chances to use TBs optimally has been exhausted.
Miguel
PS: Let me know whenever you see an engine with a good handling of endgame positions
