Compress a position from a grandmaster chess game to as few bits as possible on average. A strong submission will probably use that these positions come from real games by top players, and so will make chess sense and strategic sense, rather than just being random legal chess positions. As illustration, a study found that grandmasters do well at memorizing positions from real games using "chunking" but with only perform at novice level memorizing random boards.
The is related to but different from Smallest chess board compression, which scores on the worst-case scenario, and Smallest chess game compression, which compresses full games. (Sandbox: Let me know if this is too similar)
You must write a compressor, which maps a chess position onto a sequence of bits, and a decompressor that returns its to the original position. You can vary the length of the bit sequence by position, and this will likely be important to getting a good score.
The position to compress will just be a the placement of pieces on the chess board. You do not to encode whose move it is, castling rights, or en-passant. It will be given in FEN string format with only the piece placement part, for example:
Each letter corresponds to a piece (pawn="P", knight="N", bishop="B", rook="R", queen="Q", and king="K"). White's pieces use uppercase letters and Black's are lowercase. Slashes separate the descriptions of each of the rows from top to bottom, that is the 8 files doing from 8 (where black's pieces start) to down to 1. Numbers are used for blocks of that many empty spaces that are horizontally adjacent.
You will be scored on the average length of your compressed bit sequence on 10,000 random game positions. They will chosen at random from games played by grandmasters, restricted to move 5 or later. [Will work out more details when generating this data.]
This Pastebin (TODO) contains 10,000 FEN strings to use as a training set that you can use to get a preliminary score. The final score will be based on a separate secret test set of 10,000 FEN strings.
Your code must correctly decode every game in the position. Be sure that it can handle all positions, such as ones with weird underpromotions, which might appear in the test set but not the training set. (Sandbox: How to handle submissions that break this? A default penalty score for games failed? Ask to resubmit?)
Your compression and decompression must complete within 5 minutes on all the games. (Sandbox: Allow to compress all games at once? Do one game at a time but store state to allow "learning"? Include a memory limit?)
The length of your code is immaterial to this challenge.