Add a graphify knowledge graph of ICSharpCode.Decompiler - #3957
Draft
christophwille wants to merge 1 commit into
Draft
Add a graphify knowledge graph of ICSharpCode.Decompiler#3957christophwille wants to merge 1 commit into
christophwille wants to merge 1 commit into
Conversation
The decompiler library is large enough that its architecture is hard to hold in one head, and the coupling that matters most is the part no directory listing shows: which of the 283 clusters actually talk to each other. Building the graph surfaced that CSharp/Annotations.cs is the single bridge where the C# AST layer holds direct references back into IL instructions - every cross-layer connection the analysis flagged as surprising lands in that one file. Scoped to ICSharpCode.Decompiler/ rather than the whole repo: at 2,145 files the full tree exceeds what the clustering step handles usefully, and the test fixtures and UI would dominate the communities without explaining the engine. Extraction is deterministic AST parsing for the 580 code files; only the two markdown files and the package icon needed a model. graph.json is committed in full so the graph is queryable from a clean clone without re-running extraction. The AST caches are deliberately left out - they key off absolute paths on the machine that produced them. Assisted-by: Claude:claude-opus-5[1m]:Claude Code
christophwille
marked this pull request as draft
August 6, 2026 12:47
Member
Author
|
Claude added one Q: ▎ The most interesting question this graph can answer: How does CSharp/Annotations.cs bridge the IL layer and the C# syntax layer, and what does that coupling let the decompiler do? Want me to trace it? |
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.
Adds a graphify knowledge graph of
ICSharpCode.Decompiler/, committed undergraphify-out/.Built on
ICSharpCode.Decompiler/(583 files), narrowed from the 2,145-file repo. 9,519 nodes / 27,828 edges / 283 communities. Extraction was 9,615 AST nodes (free, deterministic) plus 39 semantic nodes from 2 docs and 1 image.Two caveats worth stating plainly:
DecompilerSettingshas 121 separateboolfield references that fold into one edge - but it means edge counts understate raw reference density.cost.jsonrecords it all as input.Benchmark: 7.1x fewer tokens per query vs. naive corpus reads (~634,600 -> ~89,918).
God Nodes
ITypeILInstructionSystemICSharpCode.Decompiler.TypeSystemAstNodeILVisitorIMethodCSharpOutputVisitorExpressionBuilderICSharpCode.Decompiler.CSharp.SyntaxSurprising Connections
ForeachAnnotation--references-->ILInstruction-CSharp/Annotations.cs->IL/Instructions.csImplicitReturnAnnotation--references-->Leave-CSharp/Annotations.cs->IL/Instructions.csQueryGroupClauseAnnotation--references-->ILFunction-CSharp/Annotations.cs->IL/Instructions.csQueryJoinClauseAnnotation--references-->ILFunction-CSharp/Annotations.cs->IL/Instructions.csILVariableResolveResult--references-->ILVariable-CSharp/Annotations.cs->IL/ILVariable.csSuggested Questions
ITypeconnect 80+ communities spanning the IL layer, the C# syntax layer, and the type system?The
Annotations.cscluster is the standout: it is the single file where the C# AST layer holds direct references back into IL instructions - the bridge that lets decompiled syntax nodes carry their originating IL. Every surprising connection the graph found lands there.Notes on what is and is not committed
graph.jsonis 18 MB and is committed in full, so the graph is queryable from a clean clone without re-running extraction. The AST/semantic caches are excluded via.gitignore- they key off absolute paths on the machine that produced them and are not portable.🤖 Generated with Claude Code