chore: EntityId Migration + Finalized Test Migration#243
chore: EntityId Migration + Finalized Test Migration#243Eli Pinkerton (wallstop) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates DxMessaging to remain compatible with Unity’s ongoing Unity 6 object-identity (EntityId) migration by routing dispatch-key identity through a single version-gated source (InstanceId.StableId), and finishes the PlayMode “no-yield [UnityTest]” migration by converting remaining synchronous coroutine-shaped tests to plain [Test]. It also updates documentation, changelog entries, and internal AI/testing guidance to reflect the completed migrations and current benchmarking framing.
Changes:
- Introduces
InstanceId.StableId(UnityEngine.Object)(Unity 6.4+ usesEntityId.ToULong(GetEntityId())low 32 bits; older Unity usesGetInstanceID()), and updates runtime/editor call sites to use it. - Converts remaining synchronous PlayMode
[UnityTest] IEnumerator ... yield break;tests to[Test] void ..., and makes the “pending migration” allowlist empty to enforce the rule repo-wide. - Adds
InstanceIdSourceTeststo lock parity with legacy IDs (where available) and to source-scan against directGetInstanceID()usage outside the gated helper; updates docs/runbooks/changelog accordingly.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Runtime/Unity/MessagingComponentProviderIntegrationTests.cs | Converts remaining no-yield [UnityTest] methods to [Test]. |
| Tests/Runtime/Core/TestAttributeContractTests.cs | Empties the pendingMigration allowlist and updates migration-complete commentary for the no-yield [UnityTest] guard. |
| Tests/Runtime/Core/OrderingAcrossEnableCyclesTests.cs | Converts no-yield [UnityTest] methods to [Test]. |
| Tests/Runtime/Core/NominalTests.cs | Converts multiple no-yield [UnityTest] methods to [Test] and removes coroutine-only endings. |
| Tests/Runtime/Core/LifecycleEdgeCasesTests.cs | Converts no-yield [UnityTest] methods to [Test] while preserving scenario parameterization. |
| Tests/Runtime/Core/EnablementTests.cs | Converts a no-yield [UnityTest] method to [Test]. |
| Tests/Runtime/Core/EdgeCaseTests.cs | Converts multiple no-yield [UnityTest] methods to [Test]. |
| Tests/Runtime/Core/DefaultBusFallbackTests.cs | Converts remaining no-yield [UnityTest] methods to [Test]. |
| Tests/Runtime/Core/BaseCallContractTests.cs | Converts remaining no-yield [UnityTest] methods to [Test]. |
| Tests/Runtime/Core/InstanceIdSourceTests.cs | Adds tests validating StableId parity (where possible) and a drift-guard source scan to prevent reintroducing direct GetInstanceID() reads. |
| Tests/Runtime/Core/InstanceIdSourceTests.cs.meta | Adds Unity meta for the new test script. |
| Runtime/Core/MessageBus/MessageRegistrationBuilder.cs | Replaces direct GetInstanceID() usage with InstanceId.StableId(...) when resolving Unity owners. |
| Runtime/Core/InstanceId.cs | Implements StableId(...) and routes Unity-object InstanceId construction through it. |
| Editor/Testing/MessagingComponentEditorHarness.cs | Uses StableId for deterministic ordering of listener diagnostics views without calling GetInstanceID() directly. |
| Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs | Uses StableId for repaint-latch identity on Unity 6 migration path. |
| README.md | Updates performance badge text and benchmark framing/numbers to Standalone IL2CPP focus. |
| docs/runbooks/test-suite-performance.md | Updates runbook to reflect completion of the no-yield test migration and empty allowlist. |
| docs/reference/compatibility.md | Documents Unity 6 EntityId migration handling and Unity 6.5+ GetInstanceID() removal compatibility. |
| docs/architecture/comparisons.md | Reframes comparisons around Standalone IL2CPP live tables and updates historical snapshot guidance/numbers. |
| CHANGELOG.md | Adds changelog entry describing the EntityId/StableId migration and compatibility outcome for Unity 6.5+. |
| .llm/skills/testing/fast-unity-tests.md | Updates internal testing skill doc to mark no-yield migration as complete. |
| .llm/skills/index.md | Updates skill index metadata (line count). |
| .llm/context.md | Updates AI agent guidance to reflect empty allowlist and completed migration status. |
Files not reviewed (1)
- Tests/Runtime/Core/InstanceIdSourceTests.cs.meta: Generated file
Dispatch throughput (Unity 6000.3.16f1)Runner: 13th Gen Intel(R) Core(TM) i9-13900KF, 24C/32T @ 3000MHz; 64GB DDR5@4200; NVIDIA GeForce RTX 3060; Microsoft Windows 11 Pro N (10.0.26200) Regenerated by CI from commit Latest CI benchmark run: Unity 6000.3.16f1, commit Runner: 13th Gen Intel(R) Core(TM) i9-13900KF, 24C/32T @ 3000MHz; 64GB DDR5@4200; NVIDIA GeForce RTX 3060; Microsoft Windows 11 Pro N (10.0.26200) Dispatch throughput - Standalone (IL2CPP)Platform: Standalone IL2CPP x64 Release (WindowsPlayer; Unity 6000.3.16f1).
Library comparison - throughput (Standalone (IL2CPP))
Library comparison - allocations, bytes per op (Standalone (IL2CPP))
|
DxMessaging perf deltas vs master baseline (Unity 6000.3.16f1, Standalone IL2CPP)Regenerated by CI (run logs). Changed beyond tolerance: yes. Regression gate: passed.
|
Description
This PR updates DxMessaging for Unity's
EntityIdmigration and completes the no-yield PlayMode test migration.What changed:
InstanceId.StableId, to keep compatibility with Unity 6.4+ deprecations and Unity 6.5+ compile behavior while preserving the same 32-bit dispatch key.GetInstanceID()directly to use the shared stable-id source.InstanceIdSourceTeststo lock migration behavior and guard against new directGetInstanceID()usage outside the gated source.[UnityTest]methods to plain[Test]and tightened the contract test so the migration allowlist is now empty.README, compatibility, comparisons, and test-performance runbook) and internal AI testing guidance to reflect the completed migration and current benchmark framing.User-facing impact:
GetInstanceID()is removed.Related Issue
Fixes #208
Type of Change
Checklist
Note
Medium Risk
Changes how Unity object IDs are sourced for dispatch and editor tooling on the Unity 6 migration path; behavior is heavily tested and the 32-bit key is intended to be unchanged, but any mistake would affect targeting and equality.
Overview
Routes all Unity object identity reads for the dispatch key through a new version-gated
InstanceId.StableId: Unity 6.4+ usesEntityId.ToULong(...)(low 32 bits), older editors keepGetInstanceID(), with no public API change and the same 32-bit key semantics. Runtime/editor call sites that calledGetInstanceID()directly now useStableId, andInstanceIdSourceTestslocks parity plus a source-scan drift guard soGetInstanceID()cannot reappear outside the gated helper.Finishes the PlayMode test cleanup by converting the remaining synchronous
[UnityTest]methods to[Test]and clearing thependingMigrationallowlist inTestAttributeContractTests, so the no-yield rule applies tree-wide.Docs and changelog are updated for Unity 6.5+ compatibility (#208), completed fast-test migration guidance, and Standalone IL2CPP-focused benchmark framing (README/comparisons/runbooks).
Reviewed by Cursor Bugbot for commit c357c2b. Bugbot is set up for automated code reviews on this repo. Configure here.