amitvijapur opened a new pull request, #11175:
URL: https://github.com/apache/arrow-rs/pull/11175

   # Which issue does this PR close?
   
   Part of #10952.
   
   # Rationale for this change
   
   Running the benches once under `cargo test --benches` (the check #10952 asks 
for) turns up one bench that cannot even start: `buffer_bit_ops` panics at line 
31 with `attempt to shift left with overflow`. `0b01010101 << i` is assigned 
into a `u8` slot, so the literal infers `u8` and the shift overflows for every 
`i >= 8`. `cargo bench` builds in release, where the shift amount is masked and 
the bench runs, which is why it has never shown up.
   
   # What changes are included in this PR?
   
   The two shifts become `wrapping_shl`, which masks the shift amount the same 
way release mode does, so the fixture bytes are identical to what the benchmark 
has been measuring all along (checked for `i` in `0..64`). rustfmt split the 
expression over three lines.
   
   # Are these changes tested?
   
   `cargo test -p arrow --features test_utils --bench buffer_bit_ops` panics on 
`main` and passes here. The byte-identity check was a small standalone program 
comparing the new expression against the masked semantics of the old one.
   
   # Are there any user-facing changes?
   
   No.
   


-- 
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