Skip to content

core: preserve truncation in signed integer division - #3021

Merged
kali merged 1 commit into
sonos:mainfrom
vera-rubin:fix/signed-div-pow2
Oct 14, 2026
Merged

kali merged 1 commit into
sonos:mainfrom
vera-rubin:fix/signed-div-pow2

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

Signed integer division by a power-of-two constant rounded negative quotients down. This keeps Div for signed integers and keeps the shift rewrite for unsigned ones. The regression test and the existing core tests pass.

Fixes #3003

— ChipLab

🍍

Signed integer Div by a power-of-two constant was rewritten to a right
shift, which rounds negative quotients down instead of truncating
toward zero. Keep Div for signed integers and keep the shift rewrite
for unsigned integers only.

Fixes sonos#3003
@github-actions

Copy link
Copy Markdown

✅ Bench vs main — no regressions

Reference: 2026-10-14 morning nightly run (0d old) · full report → run

Speed — evaltime · prefill · decode

no inference-speed regressions

Improvements

Δ metric device main → PR
🟢 -15.6% mobilenet_v2_1
evaltime · pass_mt
i9-9900k 13.2 ms → 11.1 ms

Bench numbers come from shared CI hardware and do produce false positives: a flagged
row is not on its own evidence of a real regression, and a clean report is not proof
there is none. Contributors do not need to chase what is reported here — leave the
reading of it to the maintainers, who will say if something needs action.

1 similar comment
@github-actions

Copy link
Copy Markdown

✅ Bench vs main — no regressions

Reference: 2026-10-14 morning nightly run (0d old) · full report → run

Speed — evaltime · prefill · decode

no inference-speed regressions

Improvements

Δ metric device main → PR
🟢 -15.6% mobilenet_v2_1
evaltime · pass_mt
i9-9900k 13.2 ms → 11.1 ms

Bench numbers come from shared CI hardware and do produce false positives: a flagged
row is not on its own evidence of a real regression, and a clean report is not proof
there is none. Contributors do not need to chase what is reported here — leave the
reading of it to the maintainers, who will say if something needs action.

@kali

kali commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

reds are not yours. I'm dealing with them on the side.

Thanks for the PR.

@kali
kali merged commit bd2b263 into sonos:main Oct 14, 2026
97 of 101 checks passed
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.

Signed integer Div by a power-of-two constant rounds negative quotients down

2 participants