Giter Site home page Giter Site logo

Comments (5)

johanhelsing avatar johanhelsing commented on June 30, 2024 1

Merging #94 first would make fixing this a bit simpler, because then it's just one place to change the hasher.

from bevy_ggrs.

johanhelsing avatar johanhelsing commented on June 30, 2024

@aleksa2808 Thanks for the detailed write-up. Do you want to contribute this as a PR (casting to u64 and replacing with SeaHash or another portable hasher)?

from bevy_ggrs.

aleksa2808 avatar aleksa2808 commented on June 30, 2024

Sure, I can make this a PR. I'm just not sure what to do with SeaHash as I'm currently using my own fork of it where I intentionally panic when trying to hash usize/isize values since this would lead to desyncs on different architectures. I could use the original, non-panicky version, but I feel like users could easily make the mistake of hashing some .len() value for example and in this case I think it is good to error out (or better yet prevent compilation if possible). Do you have any ideas regarding this?

from bevy_ggrs.

johanhelsing avatar johanhelsing commented on June 30, 2024

We don't necessarily have to do everything in one go. We could do it like this:

  1. Get rid of usize in internal checksums
  2. Change aHash to SeaHash or something else
  3. Document this gotcha (#35)

from bevy_ggrs.

aleksa2808 avatar aleksa2808 commented on June 30, 2024

Hey @johanhelsing, sorry for the late reply. I created a PR for this now with both changes included as they are both essential to calculate checksums in a portable manner.

Additionally, regarding the mentioned SeaHash fork, in this PR I used the regular, crates.io provided version. This means that users will still be able to use usize/isize types in their code which would break portability, so it is a good idea to have this mentioned in a gotcha.

from bevy_ggrs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.