decentraland / unity-explorer

Apache License 2.0
6 stars 6 forks source link

Flying around for some time can break the partitioning system #1181

Open m3taphysics opened 1 month ago

m3taphysics commented 1 month ago

Explorer Alpha build version:

Main

Issue Description:

Partition system can be broken by flying around rapidly.

IndexOutOfRangeException: Index was outside the bounds of the array.
Arch.LowLevel.Jagged.JaggedArray`1[T].Add (System.Int32 index, T& item) (at <7bb4cf50d14c4e7ca1f7dd19b34ab139>:0)
Arch.Core.EntityInfoStorage.Add (System.Int32 id, System.Int32 version, Arch.Core.Archetype archetype, Arch.Core.Slot slot) (at <8704400f3ef34475945ffb62bfb102d6>:0)
Arch.Core.World.Create[T0] (T0& t0Component) (at <8704400f3ef34475945ffb62bfb102d6>:0)
ECS.SceneLifeCycle.IncreasingRadius.LoadPointersByIncreasingRadiusSystem.ResolveActivePromise (ECS.SceneLifeCycle.Components.VolatileScenePointers& volatileScenePointers, ECS.SceneLifeCycle.Components.ProcessedScenePointers& processedScenePointers) (at Assets/Scripts/ECS/SceneLifeCycle/IncreasingRadius/LoadPointersByIncreasingRadiusSystem.cs:162)
ECS.SceneLifeCycle.IncreasingRadius.LoadPointersByIncreasingRadiusSystem.ResolveActivePromiseQuery (Arch.Core.World world) (at Arch.System.SourceGenerator/Arch.System.SourceGenerator.QueryGenerator/LoadPointersByIncreasingRadiusSystem.ResolveActivePromise(ref VolatileScenePointers, ref ProcessedScenePointers).g.cs:35)
ECS.SceneLifeCycle.IncreasingRadius.LoadPointersByIncreasingRadiusSystem.Update (System.Single t) (at Assets/Scripts/ECS/SceneLifeCycle/IncreasingRadius/LoadPointersByIncreasingRadiusSystem.cs:63)
ECS.Abstract.BaseUnityLoopSystem.Update (System.Single& t) (at Assets/Scripts/ECS/Abstract/BaseUnityLoopSystem.cs:29)
Rethrow as EcsSystemException: [SCENE_LOADING]: [LoadPointersByIncreasingRadiusSystem]
ECS.Abstract.BaseUnityLoopSystem.Update (System.Single& t) (at Assets/Scripts/ECS/Abstract/BaseUnityLoopSystem.cs:35)
Arch.SystemGroups.ExecutionNode`1[T].Update (T& t, System.Boolean throttle) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/ExecutionNode.cs:78)
Arch.SystemGroups.CustomGroupBase`1[T].UpdateInternal (T& t, System.Boolean throttle) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/Groups/CustomGroupBase.cs:119)
Arch.SystemGroups.DefaultGroup`1[T].Update (T& t, System.Boolean throttle) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/Groups/DefaultGroup.cs:46)
Arch.SystemGroups.ExecutionNode`1[T].Update (T& t, System.Boolean throttle) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/ExecutionNode.cs:74)
Arch.SystemGroups.SystemGroup.Update (Arch.SystemGroups.UnityBridge.TimeProvider+Info& timeInfo) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/SystemGroup.cs:118)
Arch.SystemGroups.DefaultSystemGroups.SimulationSystemGroup.Update () (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/DefaultSystemGroups/SimulationSystemGroup.cs:22)
Arch.SystemGroups.SystemGroupAggregate.TriggerUpdate () (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/PlayerLoopHelper/Aggregation/SystemGroupAggregate.cs:36)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
DCL.Diagnostics.DebugLogReportHandler:LogExceptionInternal(EcsSystemException) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/DebugLogReportHandler.cs:88)
DCL.Diagnostics.DebugLogReportHandler:LogExceptionInternal(Exception, ReportData, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/DebugLogReportHandler.cs:99)
DCL.Diagnostics.ReportHandlerBase:LogException(Exception, ReportData, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs:49)
DCL.Diagnostics.ReportHubLogger:UnityEngine.ILogHandler.LogException(Exception, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/ReportHubLogger.cs:38)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
InvalidOperationException: The previously scheduled job ParcelMathJobifiedHelper:CalculateRingJob writes to the Unity.Collections.NativeArray`1[Utility.ParcelMathJobifiedHelper+ParcelInfo] CalculateRingJob.Rings. You must call JobHandle.Complete() on the job ParcelMathJobifiedHelper:CalculateRingJob, before you can write to the Unity.Collections.NativeArray`1[Utility.ParcelMathJobifiedHelper+ParcelInfo] safely.
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <c5ed782439084ef1bc2ad85eec89e9fe>:0)
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <c5ed782439084ef1bc2ad85eec89e9fe>:0)
Unity.Collections.NativeArray`1[T].CheckElementWriteAccess (System.Int32 index) (at <c5ed782439084ef1bc2ad85eec89e9fe>:0)
Unity.Collections.NativeArray`1[T].set_Item (System.Int32 index, T value) (at <c5ed782439084ef1bc2ad85eec89e9fe>:0)
Utility.ParcelMathJobifiedHelper.StartParcelsRingSplit (Unity.Mathematics.int2 centerParcel, System.Int32 maxRadius, Unity.Collections.NativeHashSet`1[T] processedParcels) (at Assets/Scripts/Utility/ParcelMathJobifiedHelper.cs:62)
ECS.SceneLifeCycle.IncreasingRadius.StartSplittingByRingsSystem.StartSplitting (ECS.SceneLifeCycle.Components.ProcessedScenePointers& processedScenePointers, ECS.Prioritization.Components.CameraSamplingData& cameraSamplingData) (at Assets/Scripts/ECS/SceneLifeCycle/IncreasingRadius/StartSplittingByRingsSystem.cs:62)
ECS.SceneLifeCycle.IncreasingRadius.StartSplittingByRingsSystem.StartSplittingQuery (Arch.Core.World world, ECS.SceneLifeCycle.Components.ProcessedScenePointers& processedscenepointers) (at Arch.System.SourceGenerator/Arch.System.SourceGenerator.QueryGenerator/StartSplittingByRingsSystem.StartSplitting(in ProcessedScenePointers, ref CameraSamplingData).g.cs:33)
ECS.SceneLifeCycle.IncreasingRadius.StartSplittingByRingsSystem.ProcessRealm (ECS.SceneLifeCycle.Components.ProcessedScenePointers& processedScenePointers) (at Assets/Scripts/ECS/SceneLifeCycle/IncreasingRadius/StartSplittingByRingsSystem.cs:55)
ECS.SceneLifeCycle.IncreasingRadius.StartSplittingByRingsSystem.ProcessRealmQuery (Arch.Core.World world) (at Arch.System.SourceGenerator/Arch.System.SourceGenerator.QueryGenerator/StartSplittingByRingsSystem.ProcessRealm(ref ProcessedScenePointers).g.cs:33)
ECS.SceneLifeCycle.IncreasingRadius.StartSplittingByRingsSystem.Update (System.Single t) (at Assets/Scripts/ECS/SceneLifeCycle/IncreasingRadius/StartSplittingByRingsSystem.cs:42)
ECS.Abstract.BaseUnityLoopSystem.Update (System.Single& t) (at Assets/Scripts/ECS/Abstract/BaseUnityLoopSystem.cs:29)
Rethrow as EcsSystemException: [ECS]: [StartSplittingByRingsSystem]
ECS.Abstract.BaseUnityLoopSystem.Update (System.Single& t) (at Assets/Scripts/ECS/Abstract/BaseUnityLoopSystem.cs:35)
Arch.SystemGroups.ExecutionNode`1[T].Update (T& t, System.Boolean throttle) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/ExecutionNode.cs:78)
Arch.SystemGroups.SystemGroup.Update (Arch.SystemGroups.UnityBridge.TimeProvider+Info& timeInfo) (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/SystemGroup.cs:118)
Arch.SystemGroups.DefaultSystemGroups.PresentationSystemGroup.Update () (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/DefaultSystemGroups/PresentationSystemGroup.cs:23)
Arch.SystemGroups.SystemGroupAggregate.TriggerUpdate () (at ./Library/PackageCache/com.arch.systemgroups@bd58275fb1/PlayerLoopHelper/Aggregation/SystemGroupAggregate.cs:36)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
DCL.Diagnostics.DebugLogReportHandler:LogExceptionInternal(EcsSystemException) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/DebugLogReportHandler.cs:88)
DCL.Diagnostics.DebugLogReportHandler:LogExceptionInternal(Exception, ReportData, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/DebugLogReportHandler.cs:99)
DCL.Diagnostics.ReportHandlerBase:LogException(Exception, ReportData, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/Handlers/ReportHandlerBase.cs:49)
DCL.Diagnostics.ReportHubLogger:UnityEngine.ILogHandler.LogException(Exception, Object) (at Assets/DCL/PerformanceAndDiagnostics/Diagnostics/ReportsHandling/ReportHubLogger.cs:38)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

Steps to reproduce:

Fly around in this pattern for approx 15mins: image

Ludmilafantaniella commented 3 weeks ago

I have been able to reproduce the issue described in ticket #1181, which is supposed to be fixed in PR #1225. Flying around rapidly for approximately 10 minutes caused scenes to appear and then disappear as I got closer (e.g., Genesis Plaza). Some parts of the terrain failed to load or took a significantly long time to load, despite remaining stationary to allow loading time. In many instances, the terrain did not load completely. I encountered an IndexOutOfRangeException error in the logs.

LOGS Evidence