Skip to content

Fix verbose flag in capture_debug_dot_print function#1202

Merged
shi-eric merged 1 commit intoNVIDIA:mainfrom
liblaf:main
Jan 29, 2026
Merged

Fix verbose flag in capture_debug_dot_print function#1202
shi-eric merged 1 commit intoNVIDIA:mainfrom
liblaf:main

Conversation

@liblaf
Copy link
Contributor

@liblaf liblaf commented Jan 29, 2026

Description

Correct verbose flag in capture_debug_dot_print function. Default value of verbose is changed to keep the default behavior consistent.

Before your PR is "Ready for review"

  • All commits are signed-off to indicate that your contribution adheres to the Developer Certificate of Origin requirements
  • Necessary tests have been added
  • Documentation is up-to-date
  • Auto-generated files modified by compiling Warp and building the documentation have been updated (e.g. __init__.pyi, docs/api_reference/, docs/language_reference/)
  • Code passes formatting and linting checks with pre-commit run -a

Signed-off-by: liblaf <30631553+liblaf@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 29, 2026 11:55
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 29, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

The capture_debug_dot_print function in warp/_src/context.py has its default verbose parameter changed from False to True, with corresponding argument mapping reversed in the underlying runtime call to preserve correct behavior across both occurrences of the function.

Changes

Cohort / File(s) Summary
Debug Verbosity Configuration
warp/_src/context.py
Updated capture_debug_dot_print function: changed verbose parameter default from False to True, and inverted argument values passed to runtime.core.wp_capture_debug_dot_print (0 ↔ 1) to maintain correct behavior.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the verbose flag handling in the capture_debug_dot_print function, which is the primary modification in the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@greptile-apps
Copy link

greptile-apps bot commented Jan 29, 2026

Greptile Overview

Greptile Summary

Fixed a logic bug in the capture_debug_dot_print function where the verbose flag was inverted. The function now correctly passes 1 to the underlying CUDA API when verbose=True (enabling verbose output) and 0 when verbose=False (disabling verbose output). Additionally, the default value was changed from False to True to make verbose output the default behavior.

  • Corrected the inverted logic: 1 if verbose else 0 (was 0 if verbose else 1)
  • Changed default parameter value from verbose=False to verbose=True
  • Aligns Python API behavior with CUDA's cudaGraphDebugDotPrint flags (where flag value 1 enables verbose mode)

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it fixes a clear logic bug with minimal code change
  • The fix is straightforward and correct: it inverts the previously incorrect boolean logic to properly pass the verbose flag to CUDA's API. The change is minimal (2 lines), well-understood, and directly addresses a bug where the verbose parameter behaved opposite to its intended behavior
  • No files require special attention

Important Files Changed

Filename Overview
warp/_src/context.py Fixed inverted verbose flag logic - now correctly passes 1 for verbose and 0 for non-verbose, and changed default to True

Sequence Diagram

sequenceDiagram
    participant User
    participant Python as capture_debug_dot_print()
    participant Native as wp_capture_debug_dot_print()
    participant CUDA as cudaGraphDebugDotPrint()
    
    User->>Python: capture_debug_dot_print(graph, path, verbose=True)
    Note over Python: Before fix: 0 if verbose else 1<br/>After fix: 1 if verbose else 0
    Python->>Native: wp_capture_debug_dot_print(graph, path, 1)
    Native->>CUDA: cudaGraphDebugDotPrint(graph, path, flags=1)
    Note over CUDA: flags=1 enables verbose output<br/>flags=0 disables verbose output
    CUDA-->>Native: success
    Native-->>Python: true
    Python-->>User: success
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the capture_debug_dot_print function where the verbose flag was inverted, causing the opposite behavior to what was intended. When users requested verbose output, they got non-verbose output and vice versa.

Changes:

  • Fixed inverted boolean logic in the call to wp_capture_debug_dot_print (now correctly passes 1 for verbose, 0 for non-verbose)
  • Updated default value of verbose parameter from False to True to maintain backward compatibility with the actual behavior users experienced

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@shi-eric shi-eric left a comment

Choose a reason for hiding this comment

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

Thanks!

@shi-eric shi-eric added this to the 1.12.0 milestone Jan 29, 2026
@shi-eric shi-eric merged commit 75fc344 into NVIDIA:main Jan 29, 2026
8 of 9 checks passed
@shi-eric shi-eric modified the milestones: 1.12.0, 1.11.1 Feb 1, 2026
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.

2 participants