Skip to content

Dashboard render perf: batch diff runs, async goal activation, 20 FPS#493

Merged
wow-miley merged 1 commit into
mainfrom
perf/dashboard-render-improvements
May 23, 2026
Merged

Dashboard render perf: batch diff runs, async goal activation, 20 FPS#493
wow-miley merged 1 commit into
mainfrom
perf/dashboard-render-improvements

Conversation

@wow-miley
Copy link
Copy Markdown
Contributor

Summary

Three independent improvements to the interactive dashboard. None of them change visible content; they improve responsiveness and unblock the dashboard from rendering on --goal startup.

  • Batch contiguous diff runs in HybridCellBuffer.renderDiff — one cursor positioning escape per changed run, ANSI color carried across cells. Previously every changed cell emitted its own ESC[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.
  • Async goalHandler.activateGoal — was being awaited inline before the render and input jobs launched, so --goal showed a completely empty terminal until activation finished (often several seconds). Now launched on agentScope with try/catch that still routes failures to setFailed + ATTENTION_NEEDED. Same treatment for the configGoal fallback.
  • Render loop 4 FPS → 20 FPSdelay(250) → delay(50) and deltaSeconds 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
  • Run ./ampere-cli/ampere interactively and confirm the dashboard renders at a smooth 20 FPS
  • Run ./ampere-cli/ampere --goal "..." interactively and confirm the dashboard renders immediately (instead of staying blank until activation finishes)
  • Sanity check that no rendering regressions appear (status bar, dividers, pane content all draw correctly)

🤖 Generated with Claude Code

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>
@github-actions
Copy link
Copy Markdown

Concept staleness check — clean. No tracked-source changes need a concept update.

@wow-miley wow-miley merged commit e53774e into main May 23, 2026
3 checks passed
@wow-miley wow-miley deleted the perf/dashboard-render-improvements branch May 23, 2026 04:03
@wow-miley wow-miley mentioned this pull request May 23, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant