-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove byte swap of valtree hash on big endian #103231
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon. Please see the contribution instructions for more information. |
i remember this not working before, i guess lets go with @bors r+ rollup=iffy |
Wasn't the problem that the |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f8c86c8): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
Hi, I tried print the value: impl StableHasherResult for u128 {
#[inline]
fn finish(hasher: StableHasher) -> Self {
let (_0, _1) = hasher.finalize();
u128::from(_0) | (u128::from(_1) << 64)
}
}
impl StableHasherResult for u64 {
#[inline]
fn finish(hasher: StableHasher) -> Self {
let f = hasher.finalize();
println!("{} {}", f.0, f.1);
f.0
}
} For the case, both little-endian and big-endian machine print:
Not sure if this can trigger the failure you mentioned, but here the cut for |
Thanks for investigating. I'm not really sure what's going on, it's seems weird to me. I remember that when we had the CI failure in that PR the values were flipped on that one machine and we had the hypothesis that this was an endianness problem and making the change in that commit did fix the CI failure. Can't explain why the original version of that code works now. |
Remove byte swap of valtree hash on big endian This addresses problem reported in rust-lang#103183. The code was originally introduced in rust-lang@e14b34c. (see rust-lang#96591) On big-endian environment, this operation sequence actually put the other half from 128-bit result, thus we got different hash result on LE and BE.
This addresses problem reported in #103183. The code was originally introduced in e14b34c. (see #96591)
On big-endian environment, this operation sequence actually put the other half from 128-bit result, thus we got different hash result on LE and BE.