Skip to content

feat(mcp): full per-pass command-bucket capture for olo_render_frame_breakdown (#463) - #470

Merged
drsnuggles8 merged 1 commit into
masterfrom
feature/mcp-perpass-command-capture
Jun 29, 2026
Merged

drsnuggles8 merged 1 commit into
masterfrom
feature/mcp-perpass-command-capture

Conversation

@drsnuggles8

Copy link
Copy Markdown
Owner

Closes the still-deferred half of #316 Part 4 (tracked as #463): per-command capture of every render-graph command-bucket pass, not just the scene pass.

The gap

olo_render_frame_breakdown previously captured exactly one pass's bucket — the scene pass — because SceneRenderPass drove the FrameCaptureManager state machine and committed the pending frame at its own OnFrameEnd, before Water / Foliage / Decal / ForwardOverlay ran (each resets its bucket at the end of its Execute, so a post-frame walk found them empty).

Fix

  • Relocate the commit point out of SceneRenderPass::OnFrameEnd into a single central hook, FrameCaptureManager::CommitFrame(), called from Renderer3D::EndScene after RGraph->Execute() — so the pending frame accumulates per-pass buckets across the whole graph before commit.
  • Per-pass capture hook: each command-bucket pass calls BeginPass(GetName()) + presort snapshot at the top of its Execute (before any early-return on an empty bucket, so even an empty pass registers), and post-sort after its SortCommands(). Entries accumulate in CapturedFrameData::Passes; the top-level lists stay the source/scene pass for backward compatibility.
  • All capture calls are if (capturing)-guarded and CommitFrame() is a no-op when not capturing, so the live render path is unchanged when no capture is in flight.

Producer (McpFrameBreakdown.h)

  • New top-level passBreakdowns array — one per-command list per pass, each tagged with its graph pass name, shaped identically to the top-level bucket (shared ShapeBucket helper).
  • graphAttribution.capturedPassCount = number of per-pass captures; commandBucketPassCount = command-bucket passes that ran (non-culled). For a frame where every command-bucket pass executed, capturedPassCount == commandBucketPassCount. Each graph pass also carries a captured flag.

Acceptance criteria — met

  • ✅ Multi-pass breakdown returns per-command lists for each command-bucket pass, tagged by name.
  • ✅ capturedPassCount == commandBucketPassCount for such a frame (culled bucket passes excluded from the running count so the invariant holds on real frames).
  • ✅ Producer unit-tested against a synthetic multi-pass capture.

Verification

  • 29/29 unit tests pass — 7 FrameCaptureManager + 7 FrameCapturePipeline (backward-compat) + 15 McpFrameBreakdown (incl. 3 new multi-pass tests).
  • Visual-evidence suite passes with a real GL context (SceneRenderEvidence, WaterVisualEvidence ×6 angles, FogVisualEvidence) — rendering undisturbed.
  • Live editor over MCP: passBreakdowns returned ScenePass (24 cmds) + FoliagePass (3 cmds); capturedPassCount=2 == commandBucketPassCount=2; culled WaterPass/DecalPass flagged captured=false, culled=true and excluded from the count.

🤖 Generated with Claude Code

…breakdown (#463)

Capture every command-bucket pass that runs in a frame (Scene, Water,
Foliage, Decal, ForwardOverlay), not just the scene pass. Relocate the
frame-capture commit out of SceneRenderPass::OnFrameEnd (which fired
mid-graph, before the other passes ran) into a single central hook in
Renderer3D::EndScene after the whole render graph executes. Each
command-bucket pass now registers itself (BeginPass(GetName()) + presort
snapshot) before any early-return and captures post-sort; per-pass entries
accumulate in CapturedFrameData::Passes. All capture calls are
if(capturing)-guarded, so the non-capturing render path is unchanged.

olo_render_frame_breakdown emits a per-pass `passBreakdowns` array (each
tagged by graph pass name) and graphAttribution now reports capturedPassCount
and commandBucketPassCount (command-bucket passes that RAN, i.e. non-culled),
so capturedPassCount == commandBucketPassCount for a frame in which every
command-bucket pass executed.

Verified live: ScenePass + FoliagePass captured per-command, invariant holds,
culled Water/Decal correctly excluded. Visual-evidence suite passes with a GL
context (rendering undisturbed); 29 unit tests pass (incl. 3 new multi-pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@drsnuggles8, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d0b07166-799f-4f75-9e29-8f60ba1ed088

📥 Commits

Reviewing files that changed from the base of the PR and between 21a8d89 and e42f78a.

📒 Files selected for processing (11)
  • OloEditor/src/MCP/McpFrameBreakdown.h
  • OloEngine/src/OloEngine/Renderer/Debug/CapturedFrameData.h
  • OloEngine/src/OloEngine/Renderer/Debug/FrameCaptureManager.cpp
  • OloEngine/src/OloEngine/Renderer/Debug/FrameCaptureManager.h
  • OloEngine/src/OloEngine/Renderer/Passes/DecalRenderPass.cpp
  • OloEngine/src/OloEngine/Renderer/Passes/FoliageRenderPass.cpp
  • OloEngine/src/OloEngine/Renderer/Passes/ForwardOverlayRenderPass.cpp
  • OloEngine/src/OloEngine/Renderer/Passes/SceneRenderPass.cpp
  • OloEngine/src/OloEngine/Renderer/Passes/WaterRenderPass.cpp
  • OloEngine/src/OloEngine/Renderer/Renderer3DFrameExecution.cpp
  • OloEngine/tests/MCP/McpFrameBreakdownTest.cpp

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@drsnuggles8
drsnuggles8 merged commit 06facd4 into master Jun 29, 2026
6 of 8 checks passed
@drsnuggles8
drsnuggles8 deleted the feature/mcp-perpass-command-capture branch June 29, 2026 15:23
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