Skip to content

feat(export): add --depth flag to rdc rt for depth target export#239

Merged
BANANASJIM merged 1 commit into
masterfrom
feat/rt-depth-flag
Jun 10, 2026
Merged

feat(export): add --depth flag to rdc rt for depth target export#239
BANANASJIM merged 1 commit into
masterfrom
feat/rt-depth-flag

Conversation

@BANANASJIM

@BANANASJIM BANANASJIM commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a --depth flag to rdc rt so the depth attachment can be exported directly:

rdc rt 142 --depth -o depth.png

Follow-up to #236 / #237: the issue's verification steps used rdc rt --depth, but only the backend (rt_depth handler, VFS route /draws/<eid>/targets/depth.png) was implemented — the CLI flag itself was never added. Depth export previously required rdc cat /draws/<eid>/targets/depth.png or rdc snapshot.

Implementation

  • --depth routes to the existing /draws/{eid}/targets/depth.png VFS path (works in both local and remote replay mode since feat(remote): support texture/RT/depth export in remote replay mode #237); no backend changes.
  • --target default changed to a None sentinel so an explicit --target combined with --depth raises a clean UsageError (effective default remains color target 0; help text unchanged).
  • --overlay keeps priority: its branch early-returns, so --depth is inert under --overlay (note --overlay depth renders the RenderDoc depth overlay, while --depth exports the raw depth attachment — help text spells out the distinction).
  • commands.json and the skill quick-ref regenerated (check-commands / check-skill-ref pass).

Testing

  • 5 new unit tests: depth routing, mutual exclusion, default color fallback, remote pid==0 with -o, overlay precedence. Full suite: 2956 passed.
  • Real-GPU verification on AMD RX 7600 (RADV) with a vkcube capture: rdc rt 11 --depth -o produced the expected depth gradient in local mode (SaveTexture) and remote --proxy mode (GetTextureData grayscale); rdc rt 11 --depth --target 0 errors with exit 2; remote color export unaffected.

Summary by CodeRabbit

  • New Features

    • Added --depth flag to the rdc rt command to export raw depth attachment texture.
  • Documentation

    • Updated command reference to document the new --depth option and its mutual exclusivity with --target.
    • Added design proposal and test plan for the depth export feature.
  • Bug Fixes

    • Corrected --target option spelling from -target to --target.
  • Tests

    • Added five new unit tests covering depth export routing, mutual exclusion validation, and overlay behavior.

Add a --depth boolean flag to `rdc rt` that routes to
/draws/<eid>/targets/depth.png (the rt_depth VFS handler) instead of
color<target>.png, giving users an ergonomic path to the raw depth
attachment.

- --target default becomes a None sentinel so --depth + explicit
  --target can be detected and rejected with a UsageError; effective
  default of 0 is preserved and help text still documents it.
- --overlay keeps its early-return priority, so --depth is inert under
  --overlay (no mutual-exclusion error).
- Help text distinguishes --depth (raw depth attachment export) from
  --overlay depth (RenderDoc overlay visualization).
- Regenerate commands.json and the skill quick-ref so check-commands and
  check-skill-ref CI gates stay green.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces a --depth flag for the rdc rt command, enabling users to export raw depth attachment textures via VFS routing to depth.png. The implementation makes --target optional with mutual exclusion validation, defaults color index to 0 when omitted, and respects overlay priority. Design specification, command logic, documentation, and five unit tests are included.

Changes

Add --depth flag to rdc rt command

Layer / File(s) Summary
Design specification and planning
openspec/changes/2026-06-09-rt-depth-flag/proposal.md, openspec/changes/2026-06-09-rt-depth-flag/tasks.md, openspec/changes/2026-06-09-rt-depth-flag/test-plan.md
Proposal document describes routing to depth.png, mutual exclusion with --target, and overlay priority. Tasks checklist (T1–T4) outlines implementation, testing, docs regeneration, and manual verification. Test plan specifies unit and manual GPU coverage.
Command implementation and handler logic
src/rdc/commands/export.py
--target option redefined with default=None and integer parsing. --depth boolean flag added. Command handler branches on depth: enforces mutual exclusion with --target, exports depth.png on demand, and defaults color index to 0 when --target is not provided.
Command reference documentation
src/rdc/_skills/references/commands-quick-ref.md, docs-astro/src/data/commands.json
--target help text updated to indicate mutual exclusivity with --depth and documented default removed. --depth flag documented as exporting raw depth attachment texture (ignored when --overlay is set). Generated usage string corrected from -target to --target and --depth added.
Unit test coverage for depth export
tests/unit/test_export_commands.py
Five tests added: routing --depth to depth.png, mutual exclusion with explicit --target raises error, target-None defaults to color0.png, remote PID 0 depth export writes mocked PNG bytes, and --overlay depth interaction ignores depth flag export.

Sequence Diagram

sequenceDiagram
    participant User
    participant CliHandler as rt_cmd handler
    participant VfsRouter as VFS router
    participant DepthTarget as /draws/{eid}/targets/depth.png
    participant ColorTarget as /draws/{eid}/targets/color{index}.png
    User->>CliHandler: rdc rt --depth --output out.png
    CliHandler->>CliHandler: Check depth flag set
    CliHandler->>CliHandler: Validate target is None
    CliHandler->>VfsRouter: Route to depth.png
    VfsRouter->>DepthTarget: Fetch raw depth attachment
    DepthTarget->>CliHandler: Return PNG bytes
    CliHandler->>User: Write out.png (depth texture)
    User->>CliHandler: rdc rt --target 1 --output out.png
    CliHandler->>CliHandler: Check depth flag not set
    CliHandler->>VfsRouter: Route to color1.png
    VfsRouter->>ColorTarget: Fetch color target
    ColorTarget->>CliHandler: Return PNG bytes
    CliHandler->>User: Write out.png (color target)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • BANANASJIM/rdc-cli#237: Implements the remote _handle_rt_depth VFS handler (GetTextureData) that the new --depth export flag depends on for remote delivery.

Suggested labels

Review effort 1/5, feature


🐰 A depth flag hops into view,
Raw textures flowing through and through,
Mutually exclusive, no target confusion,
Docs and tests confirm the conclusion! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding a --depth flag to the rdc rt command for depth target export, which matches the core functionality across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/rt-depth-flag

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 and usage tips.

@BANANASJIM

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
openspec/changes/2026-06-09-rt-depth-flag/test-plan.md (1)

85-89: 💤 Low value

Add language identifiers to fenced code blocks.

The code blocks in the manual verification section would benefit from bash or shell language identifiers for proper syntax highlighting.

📝 Proposed fix
-   ```
+   ```bash
    rdc open capture.rdc

Apply the same fix to the other three code blocks at lines 92, 100, and 106.

Also applies to: 92-97, 100-103, 106-109

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@openspec/changes/2026-06-09-rt-depth-flag/test-plan.md` around lines 85 - 89,
Add language identifiers (bash) to the fenced code blocks in the manual
verification section containing the shell commands so they get proper syntax
highlighting; specifically update the blocks that contain the commands starting
with "rdc open capture.rdc" and the corresponding "rdc rt <EID> --depth -o
/tmp/depth_local.png" examples (the four blocks around those commands) by
changing the opening fences from ``` to ```bash.
openspec/changes/2026-06-09-rt-depth-flag/proposal.md (1)

20-22: 💤 Low value

Add language identifier to fenced code block.

The code block would benefit from a bash or shell language identifier for proper syntax highlighting.

📝 Proposed fix
-```
+```bash
 rdc rt <EID> [--depth] [-o output.png] [--raw]
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @openspec/changes/2026-06-09-rt-depth-flag/proposal.md around lines 20 - 22,
The fenced code block in proposal.md lacks a language identifier; update the
triple-backtick fence for the CLI example rdc rt <EID> [--depth] [-o output.png] [--raw] to include a language tag (e.g., bash or shell) so the
block becomes bash ... to enable proper syntax highlighting in the
document.


</details>

<!-- cr-comment:v1:2649ff63467cb15b4763e37f -->

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @openspec/changes/2026-06-09-rt-depth-flag/proposal.md:

  • Around line 20-22: The fenced code block in proposal.md lacks a language
    identifier; update the triple-backtick fence for the CLI example rdc rt <EID> [--depth] [-o output.png] [--raw] to include a language tag (e.g., bash or
    shell) so the block becomes bash ... to enable proper syntax highlighting
    in the document.

In @openspec/changes/2026-06-09-rt-depth-flag/test-plan.md:

  • Around line 85-89: Add language identifiers (bash) to the fenced code blocks
    in the manual verification section containing the shell commands so they get
    proper syntax highlighting; specifically update the blocks that contain the
    commands starting with "rdc open capture.rdc" and the corresponding "rdc rt
    --depth -o /tmp/depth_local.png" examples (the four blocks around those
    commands) by changing the opening fences from tobash.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `deeebaca-9904-4abf-b36e-4453d724fbd2`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 621528f8c04e3f60cccd0ba0d91683ca78d8ce09 and cb65ffc3e69d5b78a0f2bea19b6ab52c7c343b80.

</details>

<details>
<summary>📒 Files selected for processing (7)</summary>

* `docs-astro/src/data/commands.json`
* `openspec/changes/2026-06-09-rt-depth-flag/proposal.md`
* `openspec/changes/2026-06-09-rt-depth-flag/tasks.md`
* `openspec/changes/2026-06-09-rt-depth-flag/test-plan.md`
* `src/rdc/_skills/references/commands-quick-ref.md`
* `src/rdc/commands/export.py`
* `tests/unit/test_export_commands.py`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@BANANASJIM BANANASJIM merged commit 45eb0f8 into master Jun 10, 2026
17 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.

1 participant