domibel opened a new pull request, #51493:
URL: https://github.com/apache/arrow/pull/51493

   ### Rationale for this change
   
   When a packed value starts on a byte boundary its high part contributes 
nothing, but LargeKernelPlan::Build still asks for a left shift, and on 8 bit 
lanes that shift is the whole lane width. Some backends saturate and give zero, 
others use the low bits of the shift amount and return the lane unchanged, so 
its bits survive the mask.
   
   So affected values decode incorrectly with no error reported, that can lead 
to silent data corruption.
   
   ### What changes are included in this PR?
   
   Point the high swizzle back at the low byte instead and set the shift to 
zero. So the plan never asks for the shift at all.
   
   This is a compile-time change to the kernel plan. The emitted kernel is 
unchanged.
   
   ### Are these changes tested?
   
   Yes
   I also added a new assert that fails to compile on main.
   
   ### Are there any user-facing changes?
   
   No
   
   ### Was AI used for this PR?
   
   **PR code and description written by:**
   
   - [x] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to