What problem does it solve?
It solves the problem of safely performing structural changes from ScheduleParallel jobs in Unity DOTS while keeping command replay deterministic and reliable.
Core Features & Use Cases
- Parallel structural writes via ECB: Converts an EntityCommandBuffer to a thread-safe AsParallelWriter and records structural commands from worker threads.
- Deterministic playback ordering: Uses chunk index ordering as the sort key (via ChunkIndexInQuery) so recorded commands replay in a stable order across parallel workers.
- Correct ECS/job integration: Applies the right pattern for IJobEntity/IJobChunk scheduled with ScheduleParallel to avoid safety and race-condition issues.
Use case: You run an IJobEntity that destroys or instantiates entities conditionally across many chunks in parallel, and you need the structural changes to be both thread-safe and replay-ordered the same way every run.
Quick Start
Tell your AI to convert your ScheduleParallel structural-change job to use an EntityCommandBuffer.ParallelWriter with chunk index sort keys so Add/Remove/Instantiate/Destroy commands replay deterministically.