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

Use valid keys to initialize AHasher in FixedState #1268

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Jan 20, 2021

Using 0 as keys causes the hasher to get stuck.

Thanks @TheRawMeatball for noticing this! https://discord.com/channels/691052431525675048/749335865876021248/801422400326729728

Using 0 as keys causes the hasher to get stuck
AHasher::new_with_keys(0, 0)
AHasher::new_with_keys(
0b1001010111101110000001001100010000000011001001101011001001111000,
0b1100111101101011011110001011010100000100001111100011010011010101,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are randomly generated.

@cart
Copy link
Member

cart commented Jan 20, 2021

Just a quick sanity check: is AHasher::default actually using PI / non-random state on every platform (aka will it actually be stable across runs)?

image

Might be safer to just specify the keys ourselves.

@cart
Copy link
Member

cart commented Jan 20, 2021

I don't even see "runtime-rng" in the crate features: https://github.com/tkaitchuck/aHash/blob/master/Cargo.toml

@bjorn3
Copy link
Contributor Author

bjorn3 commented Jan 20, 2021

Switched back to explicitly specifying the keys.

@cart
Copy link
Member

cart commented Jan 20, 2021

Yeah I think their definition of "fixed_keys" is "constant for this run". And based on configuration, its either compile time randomness, run time randomness, or PI

@cart cart merged commit 7aefd72 into bevyengine:master Jan 20, 2021
@bjorn3 bjorn3 deleted the patch-1 branch January 20, 2021 22:31
rparrett pushed a commit to rparrett/bevy that referenced this pull request Jan 27, 2021
Using 0 as keys causes the hasher to get stuck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants