Repository navigation
Profiler Source Attribution v2 — file:line for every span (#302) - #303
Merged
Merged
Conversation
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.
Closes #302.
Summary
file:line · methodin the Workbench detail panel, plus one-click "Open in editor" (VS Code / Cursor / Rider / Visual Studio / Custom) and a syntax-highlighted inline preview.SourceLocationGenerator(RoslynIIncrementalGenerator+ C# 14 interceptors) discovers everyTyphonEvent.Begin*call site, sorts by(file, line, column), assigns deterministicushortsite IDs, and emits per-call-site[InterceptsLocation]wrappers that thread a literalushortthroughMakeHeader— zero hot-path cost.DagBuilderregistration resolves each system delegate's PDB sequence points (with a<Unknown>-mono fallback that searches byAssemblyName+ version), so chunk spans (e.g. AntHillMoveAll,FoodDetect) get the same source row.SpanFlagsHasSourceLocation+ 2-byteu16 SourceLocationIdafter the optional trace context.TraceFileHeaderv4→v5 with newFileTableOffset/SourceLocationManifestOffsettrailer pointers; reader is backward-compatible with v4 (treats absent fields as "no manifest").useSourceLocationStoreresolves both static call-site IDs and synthesized system IDs (0x8000 | systemIndex) through the same lookup.FileSystemWatcherhot-reload + SSEOptionsChangedStream;OptionsStoreuses[LoggerMessage]partial methods and a separate_writeLockso disk I/O doesn't block readers.EditorLauncherwith per-(EditorKind, OS)adapters,ProfilerSourceControllerwith workspace-root auto-detection and a path-traversal guard that allows already-absolute PDB paths.Test plan
dotnet build Typhon.slnx -c Debug— 0 errorsdotnet test test/Typhon.Engine.Tests/...— Profiler-scoped fixtures all green (517 tests)dotnet test test/Typhon.Workbench.Tests/...— 4 new fixtures (OptionsControllerTests,SystemControllerTests,EditorLauncherTests,ProfilerSourceControllerTests) all green; existing fixtures unaffectedfile:line · method, AntHillMoveAllchunk shows its system source, "Open in editor" opens Rider on Windows, "Show inline" renders ±20 lines highlightedushortmove)EditorLauncher(deferred — no Mac in the loop this pass)