wave4-ijobchunk-full-anatomy

Iterate Unity ECS chunks in parallel with enableable-component mask handling.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of correctly iterating Unity ECS chunks in parallel while handling enableable-component masks and accessing per-chunk/per-entity metadata deterministically.

Core Features & Use Cases

  • Enableable-component mask correctness: Applies an explicit enableable-component mask via a chunk entity enumerator so disabled entities are not processed.
  • Deterministic parallel ECB writes: Uses unfilteredChunkIndex as the EntityCommandBuffer.ParallelWriter sort key to keep command playback order stable.
  • Proper type handle management: Builds and uses ComponentTypeHandle<T> values in the right place so stale handles don’t cause safety errors or incorrect behavior.

Use it when a system needs per-chunk details like unfilteredChunkIndex, DidChange, shared component values, or chunk headers, and when IJobEntity cannot express the required low-level behavior.

Quick Start

Implement an IJobChunk that reads required component type handles, iterates entities using a ChunkEntityEnumerator with useEnableMask and chunkEnabledMask, and schedules it with ScheduleParallel while using unfilteredChunkIndex for all Ecb.ParallelWriter operations.

Frequently Asked Questions about wave4-ijobchunk-full-anatomy

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

FAQPage Schema
How do I iterate Unity ECS chunks in parallel while respecting enableable-component masks?

To iterate Unity ECS chunks in parallel while respecting enableable-component masks, use IJobChunk with a ChunkEntityEnumerator configured for useEnableMask, ensuring disabled entities are skipped during processing.

Why do my EntityCommandBuffer.ParallelWriter operations play back non-deterministically in Unity DOTS?

ParallelWriter operations play back non-deterministically when sort keys are inconsistent. Use the unfilteredChunkIndex from IJobChunk as the EntityCommandBuffer.ParallelWriter sort key to guarantee stable deterministic command playback.

When should I use IJobChunk instead of IJobEntity for Unity DOTS burst-compiled jobs?

Use IJobChunk instead of IJobEntity when your Unity DOTS system requires per-chunk metadata like unfilteredChunkIndex, DidChange, or chunk headers that higher-level iteration cannot express.

How do I avoid stale ComponentTypeHandle safety errors during parallel chunk iteration in Unity DOTS?

To avoid stale ComponentTypeHandle safety errors, build and acquire ComponentTypeHandle values per-frame inside the system and pass them into the IJobChunk before scheduling with ScheduleParallel.

Does IJobChunk support accessing chunk headers and shared component values in parallel Unity ECS systems?

Yes, IJobChunk supports accessing chunk headers and shared component values in parallel Unity ECS systems. It exposes per-chunk metadata directly, enabling deterministic processing scenarios that higher-level iteration cannot express.