Skip to main content

Module engine

Module engine 

Source
Expand description

CMEngine – orchestrates all context models + mixer + APM.

Phase 5+: Multi-output ContextMap engine.

Each order model (O1-O9) now produces 3 predictions:

  • StateMap prediction (primary)
  • Run-count prediction (consecutive same-bit tracking)
  • Byte-history prediction (last byte seen in this context)

Total mixer inputs: 1 (O0) + 9*3 (O1-O9) + 9 (other) = 37.

Both presets use:

  • Triple logistic mixer (fine 64K + med 16K + coarse 4K)
  • 7-stage APM cascade

Probability always in [1, 4095] – clamped after every operation. CRITICAL: Encoder/decoder must use IDENTICAL prediction sequence.

Structs§

CMConfig
Configuration for the CM engine – controls memory/quality trade-off.
CMEngine
Context mixing engine – orchestrates all models, mixer, and APM.