Hacker News new | ask | show | jobs
by infogulch 1930 days ago
Factorio is a 2d game where logistics is one of the core problems players have to solve. When they implemented multiplayer they went for the "every player/server simulates the whole game perfectly deterministically"-strategy which is great imo, but it begs the question: what happens when simulations diverge? They call it Desyncronization [1], and it's considered a bug.

They had lots of desyncs at first, but nowadays Factorio is fantastically stable in this respect. One of the tools they developed for themselves to achieve this (and the reason why I'm bringing up Factorio here) is called "Heavy Mode" [2], which is a game option that saves & reloads the full game state on every tick (the game targets 60 ticks/s), and compares the before/after states for inconsistencies.

Perhaps a similar "Heavy Mode" for Wasm live migrations could aid in hardening such a feature. E.g. spawn two instances of the same process on different hosts, and migrate both to new hosts every, say, 100k instructions, comparing a hash of their serialized representations at each migration.

[1]: https://wiki.factorio.com/Desynchronization

[2]: https://www.factorio.com/blog/post/fff-63