ai-velocity-batch-compile-unity
AI-Velocity Batch-Compile: Unity / DOTS engine specifics
Section titled “AI-Velocity Batch-Compile: Unity / DOTS engine specifics”Extends core parallelize-batch-work.md (module t1k-parallel, bullet “Batch, verify once”) with Unity compile / domain-reload specifics (the round-trip dominates cost on a DOTS project).
Batch-compile = write ALL the files first, then ONE t1k unity refresh --compile (or recompile), never one compile per edit.
Compile = t1k unity recompile (every compile error) + t1k unity test (every failure) in the SAME pass, never stopping at the first error or trusting a stale run.
Never trigger a domain reload at the wrong moment. A reload on top of an in-flight one crashes the editor; one during Play silently kills the DOTS world. Any new/changed file under Assets/ fires Unity’s own auto-refresh, no CLI call needed. Before t1k unity refresh, an asset edit, or a git checkout/submodule update, confirm the editor is idle and Play mode is off. t1k unity status not ready means a reload is running;
Multi-agent hazard: one agent’s Write under Assets/ kills another’s Play session, with no error for the writer. While any agent holds Play, freeze every write under Assets/ — the orchestrator owns this.
A .cs file can compile into nothing while looking healthy — absent from EditorCompilation’s registration since creation, surviving every refresh and cache nuke. Fix: move the file away and back through the AssetDatabase (t1k unity eval).
Lanes and PRs: merge first, ONE total gate at the merge-tree root (no per-lane or per-PR suite). A lane runs cheap static checks and an agent diff read, then merges. The root runs verificationTiers.heavyRun (t1k-config-unity.json) once; core mergeUpTree.rootHeavyGate decides when. Never merge past a red required check.
Mutation re-runs are targeted: only the fixtures covering the mutated files, never the suite (t1k-unity-testing-workflow references/mutation-rerun-targeting.md).
Fast, fail fast, finish-then-verify. Write the WHOLE deliverable blind, then ONE compile + ONE total gate, collect the WHOLE failure set, fix in ONE batch, gate once more: at most 2 Unity gates per deliverable.
A busy or locked Unity is never a reason to stop: keep editing blind. Finish the whole deliverable, launch ONE chain when the slot frees, verify once after. Never kill or bypass the lock (unity-forbidden-operations.md).
Full detail
Section titled “Full detail”Measurements, incidents, crash signatures, anti-patterns: docs/ai-velocity-batch-compile-unity.md.
Related
Section titled “Related”parallelize-batch-work.md (core, module t1k-parallel) · unity-forbidden-operations.md · offline-compile-gate.md (t1k-unity-blind-edit-assets, jobs and concurrency) · t1k-unity-editor-cli references/incident-history.md