wave8-handle-complete-sync-point-antipattern

Replace inline handle.Complete() calls with ECS dependency propagation in Unity DOTS systems.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill identifies unintended main-thread stalls caused by calling handle.Complete() in Unity DOTS systems and replaces that sync point with proper dependency chaining.

Core Features & Use Cases

  • Detects sync-point anti-patterns: Flags inline handle.Complete() usage that forces a WaitForJobGroupID stall and destroys frame parallelism.
  • Recommends ECS-correct scheduling: Guides replacement with state.Dependency propagation and job chaining so downstream systems consume results without explicit completion.
  • Chooses the right lifetime model: Encourages WorldUpdateAllocator for per-frame NativeArrays and reserves Allocator.Persistent for cross-frame data with correct disposal patterns.
  • Supports managed cross-boundary handoff: Advises writing results to IComponentData and reading next frame when output must reach non-Burst/managed code.

Quick Start

Ask your AI assistant to refactor the DOTS system by removing any inline handle.Complete() calls, switching per-frame NativeArray allocations to state.WorldUpdateAllocator, and chaining the producer job to the consumer job through state.Dependency without explicit completion.

Frequently Asked Questions about wave8-handle-complete-sync-point-antipattern

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

FAQPage Schema
Why does calling handle.Complete() in Unity DOTS stall the main thread?

Calling handle.Complete() in Unity DOTS forces a main-thread stall by triggering a WaitForJobGroupID, destroying frame parallelism by blocking execution until scheduled jobs finish.

How do I remove handle.Complete() sync points and use ECS dependency chaining?

Remove handle.Complete() sync points by replacing explicit synchronization with ECS dependency chaining, passing state.Dependency across Schedule or ScheduleParallel calls so downstream systems consume results without blocking.

When should I use WorldUpdateAllocator instead of Allocator.Persistent for NativeArrays in Unity DOTS?

Use WorldUpdateAllocator for per-frame NativeArrays in Unity DOTS to automatically handle disposal, reserving Allocator.Persistent for cross-frame data that requires explicit disposal patterns.

How do I pass job results to managed systems in Unity DOTS without calling Complete()?

Pass job results to managed systems by writing output to IComponentData and reading it next frame, avoiding sync points when output must reach non-Burst or managed code.

Can I schedule producer and consumer jobs in the same OnUpdate without explicit completion?

Yes, you can schedule producer and consumer jobs in the same OnUpdate by chaining them through state.Dependency, allowing the consumer job to start after the producer finishes without blocking the main thread.

What are the limitations of replacing handle.Complete() with dependency propagation in Unity DOTS?

Dependency propagation requires correct state.Dependency usage across Schedule and ScheduleParallel calls, and cross-frame handoffs need IComponentData next-frame reads when managed systems require the data immediately.