Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Chunk iteration time splicing and determinism

Discussion in 'Entity Component System' started by yc960, Feb 8, 2019.

  1. yc960

    yc960

    Joined:
    Apr 30, 2015
    Posts:
    228
    Let's say I have some pathfinding workload that I want done over multiple frames. So I have 12 chunks of entities and I iterate one chunk per frame so everything gets done in 12 frames. My question is that, would the result be deterministic across different platforms/specs? What is the recommend pattern for time splicing workload while preserving determinism in ECS/C# jobs?
     
  2. BrendonSmuts

    BrendonSmuts

    Joined:
    Jun 12, 2017
    Posts:
    86
    At the moment we are guaranteed determinism only when executing on the same platform.

    In theory you would have cross platform determinism in the execution order of your ECS systems and scheduled jobs so long as you are not using any floating point math to make decisions on whether you want to execute a system/schedule a job.

    In the future the intention is that the Burst compiler will be able to enable floating point determinism across platforms through class/method compilation using attributes.
     
  3. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Deterministic simulation will generally have to assume that the order of chunks is the same across machines.

    So in terms of timeslicing processing, you just have to have some index for which chunks to process every frame that index has to be chosen deterministically. Should be very straightforward.