Search Unity

JobsDebugger is still broken with DOTS Physics?

Discussion in 'Physics for ECS' started by WildMaN, Jun 14, 2021.

  1. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    Since starting tinkering with DOTS Physics I'm used to ticking off JobsDebugger checkbox every time I start Unity. Recently after updating to 2020.1 decided to give it a try, but among some legit and actually useful safety errors it keeps producing stuff like this:

    InvalidOperationException: The previously scheduled job Solver:parallelApplyGravityAndCopyInputVelocitiesJob writes to the Unity.Collections.NativeArray`1[Unity.Physics.MotionVelocity] ParallelApplyGravityAndCopyInputVelocitiesJob.MotionVelocities. You are trying to schedule a new job ExportPhysicsWorld:ExportDynamicBodiesJob, which reads from the same Unity.Collections.NativeArray`1[Unity.Physics.MotionVelocity] (via ExportDynamicBodiesJob.JobData.MotionVelocities). To guarantee safety, you must include Solver:parallelApplyGravityAndCopyInputVelocitiesJob as a dependency of the newly scheduled job.

    I'm not doing anything fancy, no custom StepPhysicsWorld etc., just regular physics bodies interacting. So this error must be totally on Unity Physics side. Or am I misunderstanding something?
     
  2. WildMaN

    WildMaN

    Joined:
    Jan 24, 2013
    Posts:
    128
    Ok, after some seemingly unrelated fixes and additional safety checks errors are gone. So it sounds like JobsDebugger is actually a great tool now.
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    Pretty sure JobsDebugger works fine.

    This error is pretty much saying you missed a safety handle either reading or writing from the physics systems.

    Just a warning, you may have only coincidentally fixed it by reordering systems so that they now finish in time before physics updates.