-
Notifications
You must be signed in to change notification settings - Fork 33
feat: SyncTestSession GgrsEvent::MismatchedChecksum #98
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR!
Why do you want SyncTestSession to emit a
GgrsEvent::MismatchedChecksumin addition to returningGgrsError::MismatchedChecksum? Is there something you cannot do with error instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using
bevy_ggrsand have a system fn that checks the Session. For the P2P session variant, it can easily check any events, so it seemed desirable to have something similar for SyncTestSessions. bevy_ggrs calls advance_frame and handles error results by simply logging a warning. (This could certainly be misguided, btw!)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested/agreed that this would be a nice change to make, though for a different reason: my reasoning was that the actions I want to take on a checksum mismatch in a synctest session vs a normal p2p session (I wrap them to expose the same interface to each) are basically the same: log an error, dump game states, and end the game session (exit, return to main menu, return to lobby, etc). So having to check for desyncs in two different places makes that a little bit harder than it would be otherwise.
However, two things are a bit messy in this first cut:
DesyncDetectedevent, maybe something like this:Some thoughts on this sketch:
localandremotechecksums isn't the best naming in a synctest context, but nothing better is immediately coming to mind. I do think there is some small value in copying the checksum values themselves into the event even for a synctest failure (will require a little more work) - I've used the them to diagnose & fix a bug in ggrs's p2p desync detection before.@JorgeLGonzalez just to be clear, these are my opinions based on using ggrs and raising a couple PRs lately, but I'm not a ggrs maintainer, so don't take my words as law. Defer to @gschup :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @caspark . I have no strong opinion here. My first instinct was to use DesyncDeteced, but I didn't know what to set for addr and making it an Option seemed too invasive, so then I tried to mirror the error payload but using only the first mismatched frame since Vec isn't Copy. I think I see how to add the checksums.
I can make those changes and will await @gschup to see if and how this should PR be moved forward.