[Fusion] Refactor satisfiability validator#9495
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Fusion satisfiability validator to avoid deep recursion by switching to an iterative worklist-based traversal and introducing a lightweight linked-list path representation for cycle/path handling.
Changes:
- Replaced recursive traversal in
SatisfiabilityValidatorwith an iterative queue + visited set to prevent stack overflows. - Introduced
WorkItemandPathNodeto model pending validation work and path ancestry without mutable stacks. - Updated tests and removed the “max recursion depth reached” warning/resource that was tied to the previous recursion guard.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Fusion/test/Fusion.Composition.Tests/SatisfiabilityValidatorTests.cs | Updates inline snapshots for new log ordering and adjusts the large-cycle test expectation after iterative refactor. |
| src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs | Core refactor from recursion/context stacks to iterative worklist + PathNode ancestry. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Satisfiability/WorkItem.cs | Adds work item type for queued traversal. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Satisfiability/PathNode.cs | Adds linked path node type to represent ancestor chain. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Extensions/PathNodeExtensions.cs | Adds helpers for ancestor membership checks and path string rendering. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.resx | Removes recursion-depth warning resource string. |
| src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs | Removes generated accessor for deleted resource. |
| dictionary.txt | Adds “worklist” to spelling dictionary and reorders “csclient”. |
Files not reviewed (1)
- src/HotChocolate/Fusion/src/Fusion.Composition/Properties/CompositionResources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/HotChocolate/Fusion/src/Fusion.Composition/SatisfiabilityValidator.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9495 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary of the changes (Less than 80 chars)