# V2 Parallel Cooking

`V2/ue/Build/Cooking/v2-parallel-cooking.json` defines the scheduler that runs
cook work across all available cores. It uses a fixed thread pool, deterministic
queues, and work stealing so idle workers can pull independent cook tasks from
busy workers.

The scheduler consumes the cooking dependency graph. Edges use
`sourceDependsOnTarget`, so each dependency must be cooked before its dependent.
`plan-v2-parallel-cooking.py` topologically groups tasks into dependency-safe
waves. Asset independence is proven by checking that no edge has both endpoints
inside the same wave.

The `asset independence` proof and `dependency-safe waves` are required evidence
for the schedule.

The default fixture produces four waves:

- sources with no dependencies: audio, shader, and texture tasks
- materials
- meshes
- animation and level packaging

Within each wave, worker zero owns the initial queue and idle workers steal from
the longest queue. The emitted worker trace records the stealing worker, donor
worker, wave, slot, and asset id. The plan also records worker utilization,
dependency violations, independent-wave violations, and cycle count.

Required gates:

- `parallel-cooking-plan-generated`
- `parallel-cooking-worker-coverage`
- `parallel-cooking-work-stealing`
- `parallel-cooking-dependency-safe`
- `parallel-cooking-independent-wave-width`

The primary work-stealing metric is `cook.parallel.steal_operation_count`. The
CI validator is:

```bash
python3 V2/ue/Tools/check-v2-parallel-cooking.py
```
