Skip to content

Fix impact cycle detection for colliding symbol identities - #4941

Draft
Widthdom wants to merge 3 commits into
mainfrom
fix-issue4847
Draft

Fix impact cycle detection for colliding symbol identities#4941
Widthdom wants to merge 3 commits into
mainfrom
fix-issue4847

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Detect impact cycles from actual directed edges between canonical source and target symbol IDs instead of folded display names.
  • Preserve distinct same-name callers and shortest-path identities, while keeping unresolved, ambiguous, and non-unique overload-group traversal out of the canonical cycle graph.
  • Aggregate mixed target identities without undercounting and expose optional structured caller, path, and cycle identities.

Root cause

Impact traversal and cycle bookkeeping used display names as graph keys, so distinct symbols with the same name could collapse into a false singleton cycle. During identity propagation, non-unique resolved_group overload candidates also needed to remain conservative traversal candidates rather than being promoted to actual canonical edges.

User impact

Same-name methods and overload chains no longer report false cycles. Direct self-recursion and real multi-node cycles remain visible, with deterministic readable names plus disambiguating identities in structured output.

Validation

  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false --no-restore
  • dotnet test CodeIndex.sln -c Release -p:UseSharedCompilation=false --no-build --no-restore
    • .NET 9: 10,120 passed, 419 skipped, 0 failed
    • .NET 8: 10,593 passed, 7 skipped, 0 failed
  • dotnet format CodeIndex.sln --verify-no-changes --no-restore
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • Two rounds of Codex adversarial review; all actionable findings were addressed.

Documentation and changelog

Updated the English and Japanese sections of DEVELOPER_GUIDE.md, USER_GUIDE.md, and TESTING_GUIDE.md.

Changelog fragment: changelog.d/unreleased/4847.fixed.md

Follow-up candidates

None.

Fixes #4847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require a real graph edge before reporting an impact-analysis cycle

1 participant