Repository navigation
core: preserve truncation in signed integer division - #3021
Conversation
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
|
✅ 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
Bench numbers come from shared CI hardware and do produce false positives: a flagged |
1 similar comment
|
✅ 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
Bench numbers come from shared CI hardware and do produce false positives: a flagged |
|
reds are not yours. I'm dealing with them on the side. Thanks for the PR. |
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
🍍