qa-validation
Validation rules for Unity DOTS features — correctness, scale, determinism, regression coverage, and release-readiness checklists. Use when creating test matrices, stress scenarios, reproduction steps, or performance regression anchors.
- License 许可
- MIT
- 最近更新
- 2026-07-25
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- qa-validation
- metadata
- { "tier": 1, "source": "internal", "version": "1.0.0", "user-invocable": false }
- use-when
- Load for tester agent for any task requiring test design, regression validation, performance sign-off, or release-readiness verification. Also load for data-tool agent when building validation pipelines or authoring content validators.
- platforms
- [ "claude-code", "codex", "copilot", "cursor", "windsurf" ]
- description
- Validation rules for Unity DOTS features — correctness, scale, determinism, regression coverage, and release-readiness checklists. Use when creating test matrices, stress scenarios, reproduction steps, or performance regression anchors.
- do-not-use-when
- Do not load for unity-dev or unity-dots-dev during Phase 2 implementation. Do not load for architect or triage roles. Not needed before implementation is complete.
- task-categories
- [ "testing", "qa", "validation", "evidence", "playmode" ]
02 资源文件 1
- 参考文档verification-contract.md6.4 KB
03 SKILL.md 正文
QA Validation — Unity DOTS
When validating Unity DOTS features, prove correctness with evidence, not intuition. See @.claude/docs/mcp-integration.md for ai-game-developer and agentmemory tool usage.
MANDATORY contract: every verification run by the
testerorverifieragent MUST satisfy the Tester Runtime + Static Verification Contract. Read@.claude/skills/qa-validation/verification-contract.mdbefore producingworkspace/verification_result.json. Both layers (static + runtime) are required unless explicitly impossible per §7 of the contract.
Core Principles
- Test correctness, edge cases, failure modes, scale limits.
- Verify baker output, component state transitions, system ordering, entity lifecycle.
- Add stress scenarios for high entity counts, bursty spawn/despawn, and structural changes.
- Check regression risk after every fix — every defect becomes a regression test.
- Prefer reproducible setups, measurable evidence, concise failure reports.
- Use
mcp__ai-game-developer__tests-runandconsole-get-logsas primary evidence — not assertion in chat.
Test Layers
| Layer | Tool | When |
|---|---|---|
| EditMode unit | [Test] in Tests/EditMode |
Pure logic, baker output, blob construction |
| EditMode integration | [Test] with World.Default |
System interaction, ECB playback, query results |
| PlayMode | [UnityTest] in Tests/PlayMode |
Multi-frame behavior, gameplay scenarios |
| Stress | Custom scenes + [UnityTest] |
10k–100k entity scaling, churn, performance |
ECS Test Patterns
Pure system test
[Test]
public void HealthSystem_AppliesDamage_ReducesHP() {
using var world = new World("test");
// arrange: create entity with HealthComponent
// act: world.Update<HealthSystem>()
// assert: query HealthComponent.Value
}
Baker test
[Test]
public void HealthAuthoring_BakesTo_HealthComponent() {
var go = new GameObject();
go.AddComponent<HealthAuthoring>();
// Use BakingUtility or manual bake via test world
// assert baker output
}
Stress harness
- Build the test scene with
mcp__ai-game-developer__scene-create+gameobject-duplicate. - Enter play mode via
editor-application-set-state. - Sample frame time over a stable window (skip first 60 frames for warm-up).
- Capture results via
tests-runoutput andconsole-get-logs.
Evidence Requirements
Every validation report must answer:
- What behavior was tested? — link to acceptance criteria
- Under what setup? — scene, fixtures, seed, entity count, hardware
- What was expected? — from Architect's spec
- What actually happened? — raw output, not paraphrase
- Does the feature remain stable under stress? — frame time, memory, error count
- What risks remain open? — explicit "not tested" list
Stress Test Targets
- Frame time: median + p99 over a 5s window after warm-up.
- Memory: GC alloc per frame should be 0 in steady state; managed heap stable; native allocations bounded.
- Determinism: same seed + same input → same output across 3 runs.
- Race risk: parallel jobs with overlapping writes must not produce per-run-different state.
Anti-Patterns
- Sign-off based on a single play-mode session
- Ignoring intermittent failures ("ran 3 times, passed twice")
- Stress tests without warm-up — first-frame cost is not steady-state cost
- Regression tests that don't actually exercise the original fix path
- Reports without reproduction steps
- "It works on my machine" — capture hardware, Unity version, package versions
Reproduction Format
ENV: Unity 2022.3.x, Entities 1.x, Windows 11
SCENE: Assets/Tests/StressScene_Health.unity
SEED: 12345
ENTITIES: 50000
STEPS:
1. Open scene
2. Play mode
3. Wait 60 frames
4. Frame 61: trigger DamageBurst event
EXPECTED: HP component count == initial; no exceptions in console
ACTUAL: 47 entities with HP < 0; NullReferenceException in HealthSystem.OnUpdate line 42
EVIDENCE: console-get-logs output attached; screenshot-game-view at frame 61
04 同仓库更多 Skills
dots-update-groups
How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup / SimulationSystemGroup / PresentationSystemGroup / FixedStepSimulationSystemGroup / VariableRateSimulationSystemGroup, UpdateBefore / UpdateAfter peer ordering, OrderFirst / OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing "value visible one frame late" bugs, or coupling simulation to a fixed timestep.
dots-transform-patterns
The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent/Child hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent/child hierarchies, runtime reparenting (mount/dismount/socket), or choosing transform components at the Baker boundary.
dots-singleton-patterns
Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton / GetSingletonRW / HasSingleton / TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the "exactly one entity" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.
dots-hybrid-bridge
The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes / Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input/UI must trigger ECS work.
dots-event-driven-ecs
Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event / UnityEvent / static bus anti-patterns. Use when input/UI/network must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.
valid_skill
A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.