Feature: Enhance tests, fix various bus freezing bugs#200
Merged
Eli Pinkerton (wallstop) merged 3 commits intoMay 2, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens DxMessaging runtime dispatch under mutation-heavy scenarios (snapshot semantics, reset/deregistration races, token removal correctness) and significantly expands/organizes test + analyzer/source-generator coverage, with updated documentation/changelog to match the strengthened contracts.
Changes:
- Fixes runtime edge cases around in-flight deregistration,
DxMessagingStaticState.Resetvs deferred teardown, andMessageRegistrationToken.RemoveRegistration(handle)re-enable behavior. - Adds a kind-parameterized runtime test harness (
MessageScenario/ScenarioHarness) plus new contract/sentinel tests (speed budget, threading, null/invalid inputs, etc.) and applies suite categorization. - Expands analyzer/source-generator diagnostic coverage and updates docs/changelog/skills metadata accordingly.
Reviewed changes
Copilot reviewed 85 out of 87 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| llms.txt | Updates skills count and “Last Updated” metadata. |
| failed-tests.txt | Adds a captured failing test log artifact. |
| failed-tests.txt.meta | Unity meta for failed-tests.txt. |
| docs/architecture/performance.md | Updates benchmark numbers. |
| docs/architecture/comparisons.md | Updates comparison benchmark numbers. |
| Tests/Runtime/TestUtilities/ScenarioHarness.cs | Adds helper API to register/emit across message kinds for parameterized tests. |
| Tests/Runtime/TestUtilities/ScenarioHarness.cs.meta | Unity meta for ScenarioHarness. |
| Tests/Runtime/TestUtilities/MessageScenarios.cs | Adds ValueSource scenario enumerables for message-kind permutations. |
| Tests/Runtime/TestUtilities/MessageScenarios.cs.meta | Unity meta for MessageScenarios. |
| Tests/Runtime/TestUtilities/MessageScenario.cs | Adds immutable scenario descriptor used by parameterized tests. |
| Tests/Runtime/TestUtilities/MessageScenario.cs.meta | Unity meta for MessageScenario. |
| Tests/Runtime/TestUtilities/MessageKind.cs | Adds MessageKind enum for test parameterization. |
| Tests/Runtime/TestUtilities/MessageKind.cs.meta | Unity meta for MessageKind. |
| Tests/Runtime/TestUtilities/AllocationAssertions.cs | Centralizes allocation assertion warmup + measurement pattern. |
| Tests/Runtime/TestUtilities/AllocationAssertions.cs.meta | Unity meta for AllocationAssertions. |
| Tests/Runtime/Core/TestAttributeContractTests.cs | Adds contract tests enforcing kind-parameterization + allocation coverage + static reset sanity. |
| Tests/Runtime/Core/SuiteSpeedBudgetTest.cs | Adds default-suite wall-clock guard rail test. |
| Tests/Runtime/Core/SuiteSpeedBudgetTest.cs.meta | Unity meta for SuiteSpeedBudgetTest. |
| Tests/Runtime/Core/SingleThreadContractTests.cs | Adds tests pinning the single-thread/non-threadsafe contract behavior. |
| Tests/Runtime/Core/SingleThreadContractTests.cs.meta | Unity meta for SingleThreadContractTests. |
| Tests/Runtime/Core/RegistrationTests.cs | Marks as Stress and restores legacy registration fan-out via overridden Setup. |
| Tests/Runtime/Core/PostProcessorTests.cs | Marks as Stress and restores legacy registration fan-out via overridden Setup. |
| Tests/Runtime/Core/NominalTests.cs | Marks as Stress and restores legacy registration fan-out via overridden Setup. |
| Tests/Runtime/Core/MutationHighVolumeStressTests.cs | Marks mutation high-volume suite as Stress. |
| Tests/Runtime/Core/OrderingTests.cs | Comment punctuation tweak for clarity/consistency. |
| Tests/Runtime/Core/OrderingManyRegistrationsTests.cs | Consolidates kind triplets into scenario-parameterized tests + helper registration/emit routing. |
| Tests/Runtime/Core/MutationInterceptorTests.cs | Consolidates kind triplets into scenario-parameterized tests + shared helpers. |
| Tests/Runtime/Core/MutationDestructionTests.cs | Consolidates kind triplets into scenario-parameterized tests + shared helpers. |
| Tests/Runtime/Core/InterceptorCancellationTests.cs | Consolidates kind triplets into scenario-parameterized test + shared helpers. |
| Tests/Runtime/Core/MessagingTestBaseCleanupRobustnessTests.cs | Adds regression tests for destroy+reset over-deregistration noise (default + custom bus). |
| Tests/Runtime/Core/MessagingTestBase.cs | Reseeds deterministic RNG, moves reset to UnitySetup (drain destroy queue), adds drain assertions + OneTime reset. |
| Tests/Runtime/Core/EmitTests.cs | Adds parameterized “common across kinds” emit smoke test. |
| Tests/Runtime/Core/EmitTests.cs.meta | Unity meta for EmitTests. |
| Tests/Runtime/Core/EmitUntargetedSpecificTests.cs | Renames/clarifies fixture purpose for untargeted-only emission semantics. |
| Tests/Runtime/Core/EmitUntargetedSpecificTests.cs.meta | Unity meta for EmitUntargetedSpecificTests. |
| Tests/Runtime/Core/EmitTargetedSpecificTests.cs | Renames/clarifies fixture purpose for targeted-only emission semantics. |
| Tests/Runtime/Core/EmitTargetedSpecificTests.cs.meta | Unity meta update for EmitTargetedSpecificTests. |
| Tests/Runtime/Core/EmitBroadcastSpecificTests.cs | Renames/clarifies fixture purpose for broadcast-only emission semantics. |
| Tests/Runtime/Core/EmitBroadcastSpecificTests.cs.meta | Unity meta update for EmitBroadcastSpecificTests. |
| Tests/Runtime/Core/NullAndInvalidInputTests.cs | Adds contract tests for null/invalid inputs and current boundary behaviors. |
| Tests/Runtime/Core/NullAndInvalidInputTests.cs.meta | Unity meta for NullAndInvalidInputTests. |
| Tests/Runtime/Core/ReentrantEmissionTests.cs.meta | Unity meta added for new reentrancy tests (script file not shown in diff excerpt). |
| Tests/Runtime/Core/HandlerExceptionTests.cs.meta | Unity meta added for new handler-exception tests (script file not shown in diff excerpt). |
| Tests/Runtime/Benchmarks/ProviderResolutionBenchmarks.cs | Adds Performance category tagging. |
| Tests/Runtime/Benchmarks/PerformanceTests.cs | Adds Performance category tagging. |
| Tests/Runtime/Benchmarks/ComparisonPerformanceTests.cs | Adds Performance category tagging. |
| Tests/Runtime/Benchmarks/BenchmarkHarnessRobustnessTests.cs | Adds Performance category tagging. |
| Tests/Runtime/Benchmarks/AllocationMatrixTests.cs.meta | Unity meta update for allocation matrix tests. |
| Tests/Editor/MessageAwareComponentFallbackEditorTests.cs | Tightens wording/punctuation in editor tests’ contract commentary. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/GeneratorTestUtilities.cs | Comment punctuation tweak. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxMessageIdGeneratorDiagnosticsTests.cs | Expands generator diagnostics coverage (generics, record structs, nesting, nullables) + parse validation helpers. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/DxAutoConstructorGeneratorDiagnosticsTests.cs | Expands optional-parameter default/expression coverage and DXMSG005 boundary tests. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/CompilationMessageHarvestTests.cs | Comment punctuation tweaks in analyzer harvesting tests. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/BaseCallTypeScannerTests.cs | Comment punctuation tweaks in scanner tests. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/BaseCallLogMessageParserTests.cs | Comment punctuation tweaks in parser tests. |
| SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.Tests/BaseCallIlInspectorTests.cs | Comment punctuation tweaks in IL inspector tests. |
| SourceGenerators/WallstopStudios.DxMessaging.Analyzer/Analyzers/MessageAwareComponentBaseCallAnalyzer.cs | Comment/message punctuation tweaks (including DXMSG010 description). |
| Runtime/Core/MessageRegistrationToken.cs | Ensures RemoveRegistration(handle) also removes staged registration/metadata/call-count so it doesn’t re-enable later. |
| Runtime/Core/MessageHandler.cs | Adds prefreeze helpers and switches to priority-key-preserving deregistration behavior for snapshot correctness. |
| Runtime/Core/MessageBus/IMessageBus.cs | Documents cache-retention tradeoff for targeted/broadcast registrations under frozen-snapshot semantics. |
| Runtime/Core/DxMessagingStaticState.cs | Makes Reset race-safe with custom global buses by bumping reset generation on active custom concrete bus. |
| Editor/SetupCscRsp.cs | Comment punctuation tweak. |
| Editor/Settings/DxMessagingBaseCallIgnoreSync.cs | Comment punctuation tweak. |
| Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs | Comment punctuation and message wording tweak. |
| Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs | Comment punctuation tweak. |
| Editor/Analyzers/DxMessagingConsoleHarvester.cs | Comment punctuation tweaks clarifying invariants and deadlock avoidance. |
| Editor/Analyzers/BaseCallTypeScannerCore.cs | Comment punctuation tweaks. |
| Editor/Analyzers/BaseCallTypeScanner.cs | Comment punctuation tweaks. |
| Editor/Analyzers/BaseCallReportAggregator.cs | Comment punctuation tweaks. |
| Editor/Analyzers/BaseCallLogMessageParser.cs | Comment punctuation tweaks. |
| Editor/Analyzers/BaseCallIlInspector.cs | Comment punctuation tweaks. |
| CLAUDE.md | Updates “project-wide rules” list to include message-kind parameterization expectation. |
| CHANGELOG.md | Documents added tests/coverage and runtime fixes/behavioral contract changes. |
| .llm/skills/testing/tests-must-be-parameterized-by-message-kind.md | Adds new testing skill doc describing message-kind parameterization rule and enforcement. |
| .llm/skills/testing/single-thread-contract.md | Adds new testing skill doc pinning single-thread contract expectations. |
| .llm/skills/testing/allocation-coverage-required-for-dispatch.md | Adds new testing skill doc describing allocation coverage requirements. |
| .llm/skills/index.md | Regenerates skills index (counts/dates/categories). |
| .cspell.json | Updates cspell word list. |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 83 out of 86 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
Tests/Runtime/Core/EmitTargetedSpecificTests.cs.meta:3
- The Unity .meta GUID changed for an existing script. GUID churn can break Unity asset references (scenes/prefabs/serialized test assets) that point at this script. Unless the file was intentionally recreated and you’re sure nothing references it, please restore the original GUID and keep the .meta stable across renames/edits.
Tests/Runtime/Core/EmitBroadcastSpecificTests.cs.meta:3 - The Unity .meta GUID changed for an existing script. GUID churn can break Unity asset references (scenes/prefabs/serialized test assets) that point at this script. Unless the file was intentionally recreated and you’re sure nothing references it, please restore the original GUID and keep the .meta stable across renames/edits.
Tests/Runtime/Benchmarks/AllocationMatrixTests.cs.meta:3 - The Unity .meta GUID changed for an existing test asset. GUID churn can break Unity asset references to this file. Unless this was an intentional recreation and nothing references it, please revert the GUID change to keep the asset stable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR improves DxMessaging reliability under mutation-heavy dispatch scenarios and significantly hardens runtime/analyzer test coverage.
User-facing highlights:
DxMessagingStaticState.Resetrace-safe with deferred deregistration, removing spurious over-deregistration console errors.MessageRegistrationToken.RemoveRegistration(handle)so removed handlers are not silently re-registered on later enable cycles.[DxIgnoreMissingBaseCall]behavior), plus minor analyzer/editor polish.Related Issue
N/A
Type of Change
Checklist