mcg

exllamav3's default codebook: 3INST without the addend. One multiply, one LOP3, one fp16 add.

How it decodes

stepoperation
1x = (state · 0xCBAC1FED) mod 2³²
2x = (x & 0x8FFF8FFF) ^ 0x3B603B60
3v = fp16(x & 0xFFFF) + fp16(x >> 16)

Dropping the addend saves an instruction. A multiply alone maps state 0 to 0, so one state always decodes to the XOR constant's value; the rest still look Gaussian.

E4M3 rounding

Set ROUND_E4M3 = true. Over all 65,536 states, mcg then decodes to exactly the 145 E4M3 values in [−4, 4]: the codebook already covers the FP8 grid, so there is nothing left to gain from designing a hash around FP8. EXLR8 rounds inside the Viterbi search, so the encoder only picks paths whose weights are exact in FP8.

Things to try