Hacker News new | ask | show | jobs
by sfeng 818 days ago
I would love to see this benchmarked against just running LZW compression on a list of the moves. I think the repeated nature of the moves means the entropy is actually rather low. It should be possible to come up with a compression dictionary which can save a lot more space than just a tight packing like this.
3 comments

LZW would do very badly on a list of binary chess moves.

Huffman (and even more so arithmetic encoding or ANS (asymmetric numeral systems [0]) would be significantly better, if you're careful how you encode data.

[0]: https://en.wikipedia.org/wiki/Asymmetric_numeral_systems

Or a trained zstd dictionary.
> the repeated nature of the moves

On a single game? I don’t think the goal is to pack all plays together and unpack them every time. Every game must be individually accessible as I understand.