Thank you for enlightening me. I had seen a forum post (on chess.com IIRC) that led me to believe in the nonsense I had posted above. There goes the idea of having permanent indices for even/odd bishops.hgm wrote: ↑Fri Apr 10, 2020 5:24 pm There are certain end-game studies where the only winning move is an under-promotion to Rook or Bishop. The Saavedra study is a famous one. In such positions promoting to Queen doesn't work, because it would stalemate the opponent. And it could be the only chance at promotion that you get.
Not as a key, but rather as the value, to prevent collisions (yes, I am familiar with the "Hash Collisions Don't Matter" article). In any case, I don't see how 192 bits cover STM and castling rights.I am not sure if using the entire 256-bit game state as key for TT, OB or EGT probing would ever be competitive. In any case it prompts the question why it wouldn't be much better to use a 192-bit game state for that.
Well, I was hoping to only use perft to confirm that my ideas work (with mixed results so far) and move to engine implementation at a later stage.I am not sure that a LUT with function pointers was used before in perft, but it is a standard technique.
I believe 8 bytes are not strictly a requirement on x86-64, so an optimising compiler should be able to shrink those to at least half that. I guess I should try and see how it works.Pointers are 8 bytes on x64 architecture, square numbers or step vectors only 1 byte, so the size of the LUT could also be an argument.
My idea is to limit the pawns to the latter 8 indices, but allow those to promote to queen or knight (that's actually the easiest update - only a single bit flip).Disjoint lists are often the best solution to allow for super-numerary promotions. IIRC Qperft also splits the list in a pawn, leaper and slider section. That makes it easy to add Knights or sliders; otherwise you would have to shuffle the pieces, or alter their type, so that you can no longer be sure which type you are dealing with just from the list index.
Why would you want that particular order? Why not KRBNQP or KRBQNP?(And you would have to shuffle them around in an engine which needs them ordered by decreasing value, etc.)
Yes, Shogi and Xiangqi seem to present a real challenge, as bitboards don't work for those (at least until 128-bit CPUs are commonplace).In HaQiKi D I do use a contiguous list, because Xiangqi doesn't have promotions. So pieces are either there, or not, and in the latter case I use an invalid square number. (With 90 board squares you have plenty of those without needing extra bits.)