Phase 5 updates

Phase 5 · Slice 20 ·

The C# Job System and Collections

  • tassix_jobs grows a dependency-ordered job scheduler (handles): a job's batches run on the rayon pool once the jobs it depends on finish; handles complete, combine and are never reused. Native API 32 exposes it; managed jobs come back through an [UnmanagedCallersOnly] batch callback on the worker threads.
  • UnityEngine.CoreModule: NativeArray (and ReadOnly, copies, sub-arrays, reinterpreting), NativeSlice, the allocators (Temp freed each frame), UnsafeUtility and the unsafe utilities, AtomicSafetyHandle, IJob, IJobParallelFor, IJobFor, IJobParallelForTransform with TransformAccessArray, JobHandle, JobsUtility.
  • The safety system follows Unity's editor: job fields are scanned for containers (with [ReadOnly], [DeallocateOnJobCompletion], [NativeDisableParallelForRestriction], [NativeSetThreadIndex]); scheduling a job that conflicts with an uncompleted one, touching a container on the main thread before Complete, deallocating one in use, using a disposed, unassigned or Temp container in a job, and reference-type fields fail with Unity's messages. Exceptions in Run are logged, as Unity does.
  • New assemblies: Unity.Burst (BurstCompile, FunctionPointer, SharedStatic, BurstRuntime, compiler hints; code runs as .NET code) and Unity.Collections (NativeList, the hash maps and sets with Unity's capacity rules and iteration orders, NativeQueue, NativeReference, UnsafeList, introsort, fixed strings generated by dotnet/Unity.Collections/generate.py with Unity's number formatting).
  • The jobs_collections scenario (195 checks, across frames) matches Unity exactly in both runs; 44 scenarios pass. Scheduler tests in tassix_jobs, an MCP e2e test and the jobs_swarm sample (a noise flow field moving 600 cubes).
  • Not yet: NativeText, NativeStream, FixedList, deferred job arrays, custom allocators, Burst compilation itself, IJobParallelForDefer/IJobFilter.
  • Next: LODGroup and mesh LODs, then GPU culling and indirect draws.