wai-rs: hyper_scale_decoder floor(>>) not truncation — byte-exact vs the reference decoder #4
Loading…
Reference in a new issue
No description provided.
Delete branch "hyperscale-floorfix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The per-channel power-of-two division is an arithmetic right shift (floor) in the reference decoder; the exported ONNX Div truncates toward zero, which differs on negatives (~1 LSB). Switching decode_hyper_scale from
/to>>takes it from 30765/40960 to 40960/40960 BYTE-EXACT vs the reference i_s on real test256.bin data.Retargets the calibration test from the (truncating) onnx.reference golden to the real reference-decoder i_s — the correct target.
General rule this establishes: the exported ONNX integer
Divis a lossy stand-in for>>; trust the reference source, not the ONNX.dcharlot referenced this pull request2026-11-06 13:54:17 -05:00