ssm_h_stored_bytes

Function ssm_h_stored_bytes 

Source
pub fn ssm_h_stored_bytes(h_f32_bytes: usize, f16_pool: bool) -> usize
Expand description

Storage width of one h-state blob in the SSM state pools (stage 3 of --ssm-h-dtype f16): 2 bytes per element under the f16-SIZED pool, the FP32 4 bytes otherwise. SSOT — SsmStatePool::new (allocation strides), preflight_reserve (the pre-load reserve) and every byte-copier that moves h-state between pool regions derive their width from THIS, so sizing and copies cannot disagree.

f16_pool is gdn_flags::ssm_h_f16_pool_enabled() at the production call sites (--ssm-h-dtype f16-pool), passed as a parameter so pool construction and sizing stay testable without the process-global flag cell. NOTE stage 1/2 (--ssm-h-dtype f16) deliberately keep the pool FP32-SIZED (f16_pool = false): the state bits are FP16 during decode but prefill still writes FP32 in place, so the slot must stay wide.