wave4-native-disable-container-safety-restriction

Disable Unity DOTS container safety restrictions for per-worker scratch NativeContainers in IJobChunk jobs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves Unity DOTS Job safety failures and performance slowdowns when an IJobChunk job needs per-worker scratch NativeContainer during parallel execution.

Core Features & Use Cases

  • Per-worker scratch NativeContainers: Uses [NativeDisableContainerSafetyRestriction] so each parallel worker can keep its own scratch instance.
  • IJobChunk-focused correctness pattern: Leans on IJobChunk job-struct copy semantics so ownership is not shared across workers.
  • Risk-aware guidance: Clearly defines when not to use the attribute to avoid silent races.

Quick Start

Ask the AI to update your IJobChunk that uses a per-chunk scratch NativePriorityHeap so each worker has its own container safely, and to include the correct attribute plus the required initialization guard.

Frequently Asked Questions about wave4-native-disable-container-safety-restriction

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

FAQPage Schema
How do I use per-worker scratch NativeContainers in Unity DOTS without triggering job safety errors?▼

To use per-worker scratch NativeContainers in Unity DOTS without safety errors, apply the [NativeDisableContainerSafetyRestriction] attribute to the container and enforce strict per-worker ownership semantics.

Why does my IJobChunk parallel job fail Unity DOTS container safety checks when using a scratch NativeContainer?▼

Your IJobChunk parallel job fails DOTS safety checks because the system detects a shared container ownership risk. You must opt out of safety restrictions by relying on job-struct copy-per-dispatch guarantees.

What is the best way to allocate a NativePriorityHeap for each parallel worker in a Burst job?▼

The best way to allocate a NativePriorityHeap for each parallel worker is using the IJobChunk pattern, where job-struct copy semantics ensure each worker receives its own isolated scratch container instance.

When should I not use NativeDisableContainerSafetyRestriction in my parallel job system?▼

You should not use NativeDisableContainerSafetyRestriction when your job logic cannot guarantee per-worker container ownership, as bypassing safety checks can introduce silent race conditions across workers.

Does IJobChunk guarantee separate container instances for each parallel worker during execution?▼

Yes, IJobChunk guarantees separate container instances for each parallel worker during execution because its job-struct copy-per-dispatch mechanism ensures no shared container ownership occurs across workers.

Can I disable Unity DOTS container safety restrictions for performance optimization in Burst?▼

Yes, you can disable Unity DOTS container safety restrictions for performance optimization in Burst by opting out of shared-container safety, provided you manually enforce per-worker ownership semantics.