Skip to main content

Module state_table

Module state_table 

Source
Expand description

StateTable — PAQ8-style 256-state bit history machine.

Each state encodes a compact (n0, n1) bit count pair with recency bias. State 0 is the initial state (no history observed).

The table maps (state, bit) -> next_state and provides an approximate probability of bit=1 for each state based on the encoded counts.

Design based on PAQ8 state table:

  • States encode (n0, n1) count pairs compactly
  • Low counts have fine granularity, high counts are coarsened
  • Transitions favor recent observations (recency bias)
  • State 0 = initial (equal probability)

Structs§

StateTable
The state table – provides transitions and initial probabilities.

Constants§

NUM_STATES
Number of states in the table.