Skip to content

Fix dequant left-shift overflow and clarify quant matrix naming - #298

Merged
kpchoi merged 3 commits into
mainfrom
fix_dquant_left_shift
Sep 29, 2026
Merged

kpchoi merged 3 commits into
mainfrom
fix_dquant_left_shift

Conversation

@kpchoi

@kpchoi kpchoi commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator
  • Rename the matrix arguments of the quant and dequant functions and the related core fields to q_mat and dq_mat, so they are not confused with the bitstream q_matrix.
  • In the shift <= 0 path of oapv_dquant() and its AVX and NEON versions, clip the product before the left shift. The result is unchanged for valid input, and the shift no longer overflows or operates on a negative value.

Signed-off-by: KP Choi <19379257+kpchoi@users.noreply.github.com>
Signed-off-by: KP Choi <19379257+kpchoi@users.noreply.github.com>
Signed-off-by: KP Choi <19379257+kpchoi@users.noreply.github.com>

@ssantihub ssantihub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kpchoi
kpchoi merged commit 1b935b7 into main Sep 29, 2026
10 checks passed
@kpchoi
kpchoi deleted the fix_dquant_left_shift branch September 29, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants