stash-rs icon indicating copy to clipboard operation
stash-rs copied to clipboard

Round trip through serialization breaks determinacy

Open spearman opened this issue 2 years ago • 1 comments

I think this behavior is acceptable, but it took me a little while to debug what was going on. Maybe a note should be added to the documentation.

Here is a gist that reproduces the behavior: https://gist.github.com/spearman/adfc6d84251169fe6075c89eef73043e

I am using Stash in the game state of a multiplayer game. When a player joins, the server sends the serialization of a an existing Stash, but since this breaks determinism they will no longer update in lock step given the same operations.

spearman avatar May 28 '23 19:05 spearman

Ah, yeah, that's because we preserve the indices but not the free list. That's a bit annoying but I'm not sure if there's a great fix other than serializing the free list and committing to it.

Documentation in #12.

Stebalien avatar May 28 '23 20:05 Stebalien