Repository navigation
Workbench profiler — unify live and replay pipelines at the cache layer (#289) - #290
Merged
Merged
Conversation
- Added feature to the engine for chunk level processing - AntHill: get the "latest" code from another repo - Profiler: debugged live connect mode - Workbench: live connect mode on par with replay, few UI improvements
…scing, tick wheel + label rework
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 #289.
Summary
Refactored
TraceFileCacheBuilderinto an incremental instance-based class driven from both file (replay) and TCP-stream (live) sources. After this PR the live (Attach) and replay (Trace) profiler pipelines share one server-side cache representation and one client-side rendering path. Mode-specific code is confined to the source side of the builder.What's in this PR
Engine + Profiler library
TraceFileCacheBuilderstatic one-shot scanner →IncrementalCacheBuilderinstance class, exposingFeedRawRecords/FlushCurrentChunk/DisposeandTickFinalized/ChunkFlushedevents.ICacheChunkSinkabstraction withFileCacheSink(replay) +AppendOnlyChunkSink(live) implementations.ThreadKindbyte added to ThreadInfo records (Main / Worker / Pool / Other) — drives the filter tree's Threads subgrouping.CacheHeaderFlags.IsSelfContained(bit 0) +CacheSectionId.SourceMetadatasection (no version bump, fully backwards-compatible).Workbench backend
AttachSessionRuntimerewritten — Init parses metadata, Block decompresses + feeds builder, Shutdown flushes + disposes. DropsLiveTickBatch/EmitTickBatch/pendingTicksRef/ per-batch ring buffer.tickSummaryAdded,chunkAdded,globalMetricsUpdated,threadInfoAdded,heartbeat,shutdown. Reconnect = full metadata snapshot replay.LiveCacheTempFileowns%TEMP%/typhon-workbench/{sessionId}.cache; orphan sweep at runtime startup.IChunkProvidershared byTraceSessionRuntimeandAttachSessionRuntime; controller becomes one-liner..typhon-replayflow:POST /api/sessions/{id}/profiler/save-replaysnapshots a live attach session into a self-contained replay file (no companion.typhon-traceneeded). Bidirectional open path accepts both extensions.Workbench frontend
useProfilerCachecollapses to one branch — no moreliveAssembled,recentTicksring,liveTickCacheRef.chunkCache.ts/ OPFS untouched.TickOverviewrewrite — tick-indexed wheel (plain = move ±1 tick, Shift = resize right edge, Ctrl = pan 25%), float-drift boundary clamp ontickRows.endUs, scrollbar + drag-to-pan.TimeArearuler —#prefix on tick labels, over-P95 accent color on labels + dashed boundaries, +1px font.applyLiveBatchstore action + rAF-coalesced SSE buffering inuseProfilerLiveStream— collapses N×O(N) array spreads/frame to 1×O(N+batch)/frame; eliminates live-ingest stutter.SaveReplayDialog+ File menu entry + palette command.Tests
applyLiveBatchsemantics tests (multi-event batching, mid-batch metadata reset, last-wins metrics, shutdown)..typhon-replayround-trip tests (AttachSessionRuntimeSaveReplayTests).Bugs fixed: live p95 always 0, "all bars over P95", per-batch ring buffer stranding long captures, missing scrollbar, ThreadInfo replay on reconnect.
Net code: ~−250 LOC client-side aggregation deleted, ~−150 LOC AttachSessionRuntime tick-batching deleted, ~+200 LOC builder refactor + new features. Plus the new Save-as-replay feature on top.
Design doc
claude/design/observability/08-profiler-live-replay-unification.mdTest plan
dotnet test— engine profiler tests (374 passing)dotnet test— workbench session tests (35 passing)npx vitest run— client tests (246 passing)npx tsc --noEmit— clean/wb-dev start→ AntHill--live 9100→ workbench attach → smooth live ingest, scrollbar + wheel work, p95 has a real value.typhon-replay…→ reopen the saved file with no companion trace