Repository navigation
Off-CPU sample classification (#364) + Workbench evolutions (#365) - #366
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.
Two independent commits landing together on this branch — each maps to its own tracking issue.
Commit 1 — Solve #365 (Workbench evolutions)
Eight independent Workbench-side buckets that accumulated on this branch alongside the #364 work. Full per-bucket detail and suggested PR sub-split is in #365; summary:
202 Accepted+Retry-After; client envelopes 202 and hooks poll quietly viarefetchInterval. Replaces the old "Query failed" log spam during fresh-trace cache builds.silenceErrorsopt-out on the global query/mutation cache logger (bool or predicate viameta.silenceErrors); newFetchErrorcarrying parsed ProblemDetails. Schema hooks silence URL-restored 404s; RecentFiles silences fs/stat 404s.Microsoft.CodeAnalysis.CSharp5.3.0 replaces brace-counting so braces inside strings/comments/interpolations no longer truncate the cropped method block. New View menu entry + command palette entry +surfacePanelhelper that expands collapsed edge groups.fitTokenconsumed by<FitController/>that waits for xyflow readiness; fixes fits-to-off-screen-targets on dockview hidden-tab mount. Middle-click fit.--wb-dv-header/--wb-dv-selected-tabcolor-mixshades so the panel header and the active view are visually identifiable in both themes.body,pointerdowninstead ofmousedown, z-index 10000.Commit 2 — Solve #364 (Off-CPU sample classification) +
ClaimSlotInCelloptim#364 — Off-CPU sample classification
§8.7 of the CPU sampling integration design. A wall-clock CPU sample stack is no longer trusted as on-CPU evidence by itself — each sample is classified by joining it against GC-suspension intervals and EtwSchedulingPump context-switch slices:
ThreadSchedulingdefault coupled toCpuSampling— enabling CPU sampling pulls scheduling capture on too (the classifier needs the slices). An explicitProfiler:Runtime:ThreadScheduling:Enabledstill wins.CpuSampleParser— a sample whose leaf isThread.PollGC/<PollGC>g__PollGCWorker|NN_Nis the cost of being sampled, not program execution. Memoised per-CodeAddressIndex.SampleClassifier(Workbench-side) labels each sample on-CPU / voluntary-wait / involuntary-stall (GC / Scheduler / Paging). Lazy per-session, best-effort — degrades to theSampleTypeproxy when context-switch data is absent.CallTreeFolder§8.7 integration — voluntary waits fold per-method in wall-clock but drop in on-CPU view; involuntary stalls never fold per-method, they collapse into synthetic aggregate nodes[GC suspension]/[Preempted]/[Paging]hung off the root, with negativeFrameIds (-2, -3, -4) to mark them synthetic.ClassificationAvailableflag flows through the DTO so the panel labels its on-CPU view "Thread time" in degraded mode.ClaimSlotInCelloptim (piggy-backed)Discovered while profiling for #364: parallel-fence migration releases were resetting the source cell's scan cursor on every release, thrashing it and re-introducing O(M²) re-scans during
ExecuteMigrations. Fix:[0, scanStart). Cursor becomes a pure hint; staleness costs a redundant scan, never a missed free slot.DecrementCellEntityCountOnRelease(resetCursor:)— serial releases (Transaction.Destroy) reset the cursor for immediate reuse; parallel-fence releases skip the reset (would zero cursors of cells other workers are actively claiming into → cursor thrash + false sharing).CellClusterPool.SetScanCursor— backwards-capable cursor write for the phase-2 reclaim path. Safe as a plain write because every cell's cursor is single-writer across all paths.Tests cover the migration-release cursor invariant and the phase-2 reclaim path.
Closes #364
Closes #365