Skip to content

Add budget deltas summary to normal output#1034

Merged
Timi16 merged 1 commit into
Timi16:mainfrom
israelolrunfemi:epic/c-budget-deltas
Apr 28, 2026
Merged

Add budget deltas summary to normal output#1034
Timi16 merged 1 commit into
Timi16:mainfrom
israelolrunfemi:epic/c-budget-deltas

Conversation

@israelolrunfemi
Copy link
Copy Markdown
Contributor

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.

Compute CPU/memory deltas per checkpoint and surface top spike steps in CLI/TUI output.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@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! 🚀

Learn more about application limits

@Timi16 Timi16 merged commit af6ee0f into Timi16:main Apr 28, 2026
6 of 8 checks passed
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.

Add budget delta rendering

2 participants