Dashboard render perf: batch diff runs, async goal activation, 20 FPS#493
Merged
Conversation
Three independent improvements to the interactive dashboard, none of which change visible content: 1. HybridCellBuffer.renderDiff now batches contiguous runs of changed cells into a single cursor positioning escape, carrying ANSI color across cells and only resetting when the color changes or the run ends. The previous per-cell loop emitted N cursor jumps + N color codes + N resets for N changed cells. Most terminals (notably macOS Terminal.app) flush internal state on every cursor positioning escape, so batching dramatically reduces terminal-side load on frequently-changing scenes. 2. goalHandler.activateGoal is now launched on agentScope rather than awaited inline. Awaiting it blocked the launch of the render and input jobs below, so --goal showed a completely empty terminal until activation completed (which could take several seconds). The launch is wrapped in try/catch so failures still surface via setFailed + ATTENTION_NEEDED status. Same treatment applied to the configGoal fallback path. 3. Render loop bumped from 4 FPS (delay 250ms, deltaSeconds 0.25f) to 20 FPS (delay 50ms, deltaSeconds 0.05f) so camera orbit and pane updates read as motion rather than discrete jumps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Concept staleness check — clean. No tracked-source changes need a concept update. |
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
Three independent improvements to the interactive dashboard. None of them change visible content; they improve responsiveness and unblock the dashboard from rendering on
--goalstartup.HybridCellBuffer.renderDiff— one cursor positioning escape per changed run, ANSI color carried across cells. Previously every changed cell emitted its ownESC[r;cH+ color + reset. Most terminals (notably macOS Terminal.app) flush internal state on every cursor positioning escape, so batching dramatically reduces terminal-side load on frequently-changing scenes.goalHandler.activateGoal— was being awaited inline before the render and input jobs launched, so--goalshowed a completely empty terminal until activation finished (often several seconds). Now launched onagentScopewith try/catch that still routes failures tosetFailed+ATTENTION_NEEDED. Same treatment for theconfigGoalfallback.delay(250) → delay(50)anddeltaSeconds 0.25f → 0.05f. Camera orbit and pane updates read as motion rather than discrete jumps.Test plan
./gradlew :ampere-cli:jvmTest(all 657 tests pass)./gradlew ktlintFormat./gradlew :ampere-core:compileCommonMainKotlinMetadata./ampere-cli/ampereinteractively and confirm the dashboard renders at a smooth 20 FPS./ampere-cli/ampere --goal "..."interactively and confirm the dashboard renders immediately (instead of staying blank until activation finishes)🤖 Generated with Claude Code