How to store a chess position in 26 bytes (2022)
ezzeriesa.notion.site
How to store a chess position in 26 bytes (2022)
1–10 of 108 posts
Re: How to store a chess position in 26 bytes (2022)
#2Re: How to store a chess position in 26 bytes (2022)
#3Re: How to store a chess position in 26 bytes (2022)
#4With a few bytes more more you can create an implementation that is a lot easier to understand. Bytes are cheap, developer time isn't.
Re: How to store a chess position in 26 bytes (2022)
#5[edit] This made me look for articles estimating this and I found this one [1] which confirms the above is in the right ballpark. Actual study (according to the article) says 4.822 x10^44 is their upper bounds
[1] https://chess-grandmaster.com/how-many-possible-chess-positi...
Re: How to store a chess position in 26 bytes (2022)
#6Very clever, but that's the problem, clever is never the correct solution. With a few bytes more more you can create an implementation that is a lot easier to understand. Bytes are cheap, developer time isn't.
Re: How to store a chess position in 26 bytes (2022)
#726 bytes is 208 bits, about twice what you really need for a minimal encoding that has enough context (en passant, castling) to generate an accurate set of legal moves. I wrote a chess database tool back in the 90's (CDB) that used 96-bit encodings (if memory serves) to index all the positions reached in a collection of games so that one could see the moves made from any position, their frequencies, and their game ou…
Chess Position Ranking provides a 153 bit encoding but it's very slow to decode.
If the encoding only needs to work for the set of positions occurring in some database, then there's almost no limit to the number of coding optimizations one can make (until the encoding just becomes an index in the set of all unique db positions).
Re: How to store a chess position in 26 bytes (2022)
#8Very clever, but that's the problem, clever is never the correct solution. With a few bytes more more you can create an implementation that is a lot easier to understand. Bytes are cheap, developer time isn't.
If you are writing a chess engine you'll want to store hundreds of millions of positions while you search for the best move and at that scale a byte is important because it gets multiplied by an enormous factor.
Re: How to store a chess position in 26 bytes (2022)
#926 bytes is 208 bits, about twice what you really need for a minimal encoding that has enough context (en passant, castling) to generate an accurate set of legal moves. I wrote a chess database tool back in the 90's (CDB) that used 96-bit encodings (if memory serves) to index all the positions reached in a collection of games so that one could see the moves made from any position, their frequencies, and their game ou…
Re: How to store a chess position in 26 bytes (2022)
#10Very clever, but that's the problem, clever is never the correct solution. With a few bytes more more you can create an implementation that is a lot easier to understand. Bytes are cheap, developer time isn't.