-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: Add Desync hash detection via DesyncHash trait, opt in with #[net] attribute #462
base: main
Are you sure you want to change the base?
Conversation
@RockasMockas I added desync tree, it gets dumped on frames that detect desync. Need to enable feature Right now it will show which component/resource desynced if you compare the two logs, but it's hard to determine which entity it is that is desync'd for components. Decent amount of stuff that needs cleanup, will comment more later but mostly pushing so can test with it. I would enable this, check the first frame that is desync'd, compare the logs, and see what component or resource is causing it (you will need to opt them in - I will add something to make this easier to see what needs opt-in later). |
6a11666
to
0826906
Compare
|
be06ab0
to
9a73585
Compare
May also be used directly on enum variant to opt out all of its fields (but enum variant itself still included in hash). |
Hook up desync detection.
tree iteratable for testing, cleanup generics / simplify.
ad73a4f
to
f88be6c
Compare
Rebased this onto latest + Added the Did a bit of cleaning up of the desync tree types, made less generic and simplified. Made it iterable, mostly for testing. I think this will probably be the last feature for now, will be doing cleanup pass next / prepping for merge. |
#[net]
may be used to opt in a type that implementsDesyncHash
such that whenDesyncHash
is used on itsSchemaRef
, it will contribute to hash. (Otherwise it does not modify hash). This allows us to hash the World, conditionally over resources / components we want included.Desync detection may now be configured on ggrs session, and the default hash function, which uses everything opted in in World, can be overridden as well.
Right now only
Transform
is opted in - need to see if there are other core types we want. It is possible there are common types missing impls forDesyncHash
, but tried to cover most of what I could think of.I made the api update a hasher from value, instead of just returning a hash. Unsure if this will pan out to be the best move, might change it, or add both. It is nice to be able to bring your own hasher though, and I'm not sure I can make these functions generic as need function pointer to them...
Details
#[net]
will error if used with something that isno_clone
. It does not deriveDesyncHash
, but requires it.