ecb-parallel-writer

Record deterministic structural changes from Unity DOTS ScheduleParallel jobs using EntityCommandBuffer.ParallelWriter.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-parallel-writer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecb-parallel-writer
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/ecb-parallel-writer
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-parallel-writer

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about ecb-parallel-writer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely make structural changes from a ScheduleParallel job in Unity DOTS?

Record structural changes in a ScheduleParallel job by converting an EntityCommandBuffer to a thread-safe AsParallelWriter, using ChunkIndexInQuery as the sort key for each command to guarantee deterministic playback ordering across worker threads.

Why do I need a chunk index sort key for EntityCommandBuffer.ParallelWriter?

You need a chunk index sort key for EntityCommandBuffer.ParallelWriter to guarantee that recorded structural commands replay in a stable, deterministic order across multiple parallel worker threads, preventing race conditions and unpredictable state mutations.

How do I instantiate or destroy entities in parallel across multiple chunks in Unity DOTS?

To instantiate or destroy entities in parallel across chunks, schedule an IJobEntity or IJobChunk with ScheduleParallel, then record structural commands via an EntityCommandBuffer.ParallelWriter using AsParallelWriter and chunk index ordering for safe, deterministic replay.

Can I use EntityCommandBuffer.ParallelWriter with both IJobEntity and IJobChunk?

Yes, you can use EntityCommandBuffer.ParallelWriter with both IJobEntity and IJobChunk scenarios scheduled with ScheduleParallel to add, remove, instantiate, destroy, or set components on entities from multiple worker threads deterministically.

What causes non-deterministic playback when recording structural changes in parallel jobs?

Non-deterministic playback occurs when structural commands recorded from parallel worker threads lack a stable sorting mechanism, which is resolved by applying AsParallelWriter plus a ChunkIndexInQuery sort key to every ParallelWriter structural call.