Repository navigation
Workbench Profiler time-window single-source-of-truth refactor (closes #345) - #346
Merged
Merged
Conversation
This was referenced May 12, 2026
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.
Summary
Refactor of the Workbench profiler time-window architecture per
claude/design/Apps/Workbench/profiler-time-window-refactor.md. Eliminates the synchronous pan/zoom fan-out that caused UI judder, collapses two redundant stores into one canonical source of truth, deletes theselectionBridgesindirection, simplifies live mode, and removes three now-redundant per-panel debounces.Also bundled:
ChunksPerWorkerscheduler knob + small Workbench UI fixes (separate commit on the branch).Architectural changes
useProfilerViewStore—transientViewRange(in-flight, written on every wheel notch / drag pixel / rAF zoom frame) + committedviewRange(debounced, read by every cross-panel consumer). Debounce window isuseOptionsStore.options.profiler.viewRangeDebounceMs.useSelectionStore.timeanduseSelectionStore.focusTick— every consumer (SystemDag, CriticalPath, DataFlow, AccessMatrix, SystemDagToolbar, selectionUrlSync) readsuseProfilerViewStore.viewRangedirectly. CriticalPath's display tick collapses todominantTickInRange(viewRange)with midpoint fallback.selectionBridges.tsand its tests — the three remaining cross-store mirrors inline into store setter actions.useProfilerSessionStore.liveFollowActive,setLiveFollowActive,useProfilerViewStore.liveFollowWindowUsall removed. Attach pins viewport to first tick; subsequent ticks do not auto-move.useProfilerStatsWriter's internal 150 ms gone; DataFlow/AccessMatrix dropped theirliveTimegate (keptlatestTickNumberfor live-stream burst coalescing).viewRangeDebounceMsadded toWorkbenchOptions— default 150 ms, clamped[0, 5000], exposed in the Profiler options form.0= synchronous commit.Behaviour changes
Bundled (separate commit)
ChunksPerWorker(float)knob onSystemBuilder— caps chunk count atround(WorkerCount × factor)to oversubscribe parallel dispatch for systems whose worker efficiency falls below saturation. Default 1.0 = no change. AntUpdate set to 2.0f to address its 45% worker efficiency.TyphonRuntime: per-worker pool arrays (_partitionViews,_tierRangeViews) were sized toWorkerCountbut indexed bychunkIndex— silently threw IndexOutOfRangeException onceChunksPerWorker > 1. Fixed by indexing withworkerId. Regression testOversubscribed_AllEntitiesAreVisitedadded.Scheduler.System.Archetypekind 245, and per-tickQuery.Plankind 189 withOwnerSystemIdx) from worker lanes — they cover all-workers ranges but were emitted from the completer worker and appeared on its lane.Test plan
useProfilerViewStore.transient.test.ts,useProfilerViewStore.migration.test.ts(v3 → v4 persisted-state migration),ChunksPerWorkerTests,ScheduleValidationTestsadditionsselectionBridges.test.tsdeleted; URL-sync tests updated to round-trip viaviewRangeCloses #345
🤖 Generated with Claude Code