Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.3.X - Entities
7000.0.0a1
Issue ID
ECSB-1295
Regression
No
Entites World serialization not deterministic
1. What happened
A Customer Upgraded to Unity 2022.3.26f1 and discovered that world serialization was not producing deterministic outputs as expected. They found discrepancies between serialized files of two simple world instances, each containing only two entities but differing significantly in their file content. Upon investigation, the team isolated the issue to the ChunksNodeType section of the files and specifically the Unity.Entities.Chunk header.
The Chunk structure in Unity includes several fields used during serialization, such as ArchetypeIndexForSerialization and CountForSerialization, which are meant to hold valid data only during serialization and have 4-byte paddings to keep the file format compatible.
Analyzing the structure revealed that differences in the serialized files were due to padding between fields not being consistent. This inconsistency was traced back to the Chunk structure not being memcleared when allocated, leading to non-deterministic padding data.
Consequently, the team applied a temporary hack to address the immediate issue but noticed other factors causing non-deterministic outputs. They observed additional non-deterministic behavior in scene conversions performed on different machines, with differences occurring at intervals of 16k bytes and near the file header.
2. How can we reproduce it using the example you attached
1- Create two identical worlds with the same input data (each containing only 2 entities).
2 -Serialize both worlds.
3 -Observe and compare the serialized files.
Observed Result: Serialized files differ.
Expected Result: Serialized files should be identical.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Screen position out of view frustum" error is shown when displaying populated World Space canvas in Multiplayer Play Mode secondary Editor using Input System UI Input Module
- Sprite width/height is rendered differently in the Game view than in the Scene view
- Debug Mode popup window is inaccessible/cut-off when opened on widescreen monitors or resizing to specific Editor Window resolution
- Post-processing Render Features using Render Graph do not work when URP 2D Renderer is used and Render Graph enabled
- [Unity Physics] The NativeList<DistanceHit> randomly returns fewer hits than expected when using CalculateDistance in Edit mode tests
Resolution Note:
There are no fixes planned for this Bug