Add budget deltas summary to normal output#1034
Merged
Merged
Conversation
Compute CPU/memory deltas per checkpoint and surface top spike steps in CLI/TUI output.
|
@israelolrunfemi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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: #818
This branch improves the normal debugger output so operators can quickly answer: “Where did the budget spike happen?” without immediately switching to profiling mode.
Today, the debugger surfaces budget totals (CPU instructions and memory bytes consumed), plus warnings when usage approaches limits. That’s useful for knowing whether a run was expensive, but it doesn’t show where the expensive jump occurred. This change adds a lightweight “delta view” that highlights CPU and memory deltas between checkpoints and prints a top-spikes summary.
Key points:
Budget delta model: Introduces a structured representation of per-checkpoint deltas derived from the existing ResourceCheckpoint timeline. Each delta record includes:
checkpoint index and timestamp
location label (step/frame/checkpoint label)
total CPU/memory at that point
delta CPU and delta memory since the previous checkpoint
Spike ranking: Adds a simple ranking pass to extract the top-N spikes by:
CPU delta
memory delta
combined score (
c
p
u
_
d
e
l
t
a
+
m
e
m
_
d
e
l
t
a
cpu_delta+mem_delta) for quick triage
Shared formatting: Adds a formatter for a compact “Budget deltas (top spikes)” section that can be reused across presentation layers (CLI output and any other exported views).
Operator outcome: After a single run, users can immediately see:
which checkpoint label corresponded to the largest CPU jump
which checkpoint label corresponded to the largest memory jump
which checkpoints were “worst overall” when considering both dimensions
This reduces time-to-diagnosis and makes it clear whether the next action is re-run with profiler, optimize a specific call, or reduce input size.
Commit message (detailed, with rationale)
Add budget deltas summary to normal output
Compute CPU/memory deltas per checkpoint and surface top spike steps so operators can pinpoint budget jumps without switching to profiler mode.
Why: Totals alone don’t identify where the spike occurred.
What: Compute deltas from checkpoints, rank spikes, and format a compact summary for standard output.
Impact: Faster triage; less reliance on profiler for first-pass diagnosis.