Skip to content
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

update ahash and hashbrown #8623

Merged
merged 1 commit into from
May 23, 2023

Conversation

mockersf
Copy link
Member

Objective

Solution

  • Update the dependencies

This is a breaking change because we were creating two fixed hashers with AHasher::new_with_keys, which was a method that existed only for testing purpose and has been removed from public.

I replaced it with RandomState::with_seeds which is the proper way to get a fixed hasher (see this table). This means that hashes won't be the same across versions


Migration Guide

  • If you were using hashes to an asset or using one of the fixed hasher exposed by Bevy with a previous version, you will have to update the hashes

@mockersf mockersf added C-Dependencies A change to the crates that Bevy depends on M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels May 16, 2023
AHasher::new_with_keys(42, 23)
RandomState::with_seeds(42, 23, 13, 8).build_hasher()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is possible those seeds are not very secure. But then they weren't before, so...

Comment on lines -66 to +69
AHasher::new_with_keys(
0b1001010111101110000001001100010000000011001001101011001001111000,
0b1100111101101011011110001011010100000100001111100011010011010101,
RandomState::with_seeds(
0b10010101111011100000010011000100,
0b00000011001001101011001001111000,
0b11001111011010110111100010110101,
0b00000100001111100011010011010101,
Copy link
Member Author

@mockersf mockersf May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for those seeds, I split the previous two values into the now required four

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

crates/bevy_asset/src/assets.rs Show resolved Hide resolved
examples/3d/tonemapping.rs Show resolved Hide resolved
@james7132 james7132 added this to the 0.11 milestone May 16, 2023
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 22, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 23, 2023
Merged via the queue into bevyengine:main with commit ebac7e8 May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants