Skip to content

[libcu++] Add cuda::std::tuple debugger pretty-printers - #10534

Merged
Jacobfaib merged 4 commits into
NVIDIA:mainfrom
dunga1k58bh:add-tupple-pretty-printers
Aug 1, 2026
Merged

[libcu++] Add cuda::std::tuple debugger pretty-printers#10534
Jacobfaib merged 4 commits into
NVIDIA:mainfrom
dunga1k58bh:add-tupple-pretty-printers

Conversation

@dunga1k58bh

Copy link
Copy Markdown
Contributor

Description

closes #10086

Add gdb and lldb pretty-printers for cuda::std::tuple, following the existing cuda::buffer / cuda::mr printer pattern (libcudacxx/share/libcudacxx/{gdb,lldb}/).

Without a pretty-printer, a cuda::std::tuple prints as its raw internal layout (_base, __tuple_leaf<N, T, ...>, _value, ...). With this change, printing a tuple shows its public type and element values directly, e.g.:

cuda::std::tuple<int, double, char> = {
[0] = 42,
[1] = 3.14,
[2] = 'x'
}

Handles: nested tuples (recurses automatically), empty tuples (cuda::std::tuple<>, whose _base member can be entirely elided from debug info by both GCC and Clang), empty non-final element types using the empty-base-class optimization, reference elements (dereferenced instead of printed as a bare address), const-qualified tuples, and tuples nested inside other containers (e.g. std::vector<cuda::std::tuple<...>>).

Tests are added under libcudacxx/test/debugging/tuple/, following the same harness as the existing buffer/memory_resource debugging tests, including a print, mutate, print case to confirm the formatter reflects live state rather than a cached value.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@dunga1k58bh
dunga1k58bh requested review from a team as code owners July 29, 2026 18:04
@dunga1k58bh
dunga1k58bh requested a review from griwes July 29, 2026 18:04
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 29, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: dabc5ecc-7022-4e57-8203-08763ee97147

📥 Commits

Reviewing files that changed from the base of the PR and between 4a0c459 and 5e71b28.

📒 Files selected for processing (3)
  • libcudacxx/share/libcudacxx/gdb/__init__.py
  • libcudacxx/share/libcudacxx/lldb/__init__.py
  • libcudacxx/test/debugging/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (3)
  • libcudacxx/test/debugging/CMakeLists.txt
  • libcudacxx/share/libcudacxx/gdb/init.py
  • libcudacxx/share/libcudacxx/lldb/init.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added debugger pretty-printing and synthetic views for cuda::std::tuple in GDB and LLDB, including indexed elements and nested tuples.
    • Added support for empty, reference, const, pointer, and optimized tuple layouts.
  • Tests
    • Added end-to-end debugger coverage for tuple inspection, nested and empty tuples, varied storage layouts, vector elements, and before/after updates.

Walkthrough

Adds GDB and LLDB pretty-printers for cuda::std::tuple, registers both formatters, and adds CUDA debugger tests for tuple layouts, nested and reference elements, pointers, empty-base optimization, vectors, const values, and mutations.

Changes

cuda::std::tuple debugger support

Layer / File(s) Summary
GDB tuple printer
libcudacxx/share/libcudacxx/gdb/tuple.py, libcudacxx/share/libcudacxx/gdb/__init__.py
Adds tuple type detection, tuple-leaf element extraction, indexed children, and GDB printer registration.
LLDB tuple formatter
libcudacxx/share/libcudacxx/lldb/tuple.py, libcudacxx/share/libcudacxx/lldb/__init__.py
Adds tuple recognition, synthetic children, summaries, nested type-name reconstruction, and LLDB formatter registration.
Debugger test coverage
libcudacxx/test/debugging/tuple/*, libcudacxx/test/debugging/CMakeLists.txt
Adds CUDA inspection cases and expected GDB and LLDB output for empty, nested, reference, pointer, EBCO, vector, const, and updated tuples.

Assessment against linked issues

Objective Addressed Explanation
Add GDB and LLDB pretty-printers under the requested debugger directories [#10086]
Add exhaustive tuple debugger tests under libcudacxx/test/debugging/tuple [#10086]

Possibly related PRs

  • NVIDIA/cccl#10563: Adds parallel GDB and LLDB pretty-printers and debugger tests for cuda::std::complex.
  • NVIDIA/cccl#10564: Adds parallel GDB and LLDB pretty-printers and debugger tests for inplace_vector.

Suggested reviewers: griwes, wmaxey


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 868a58cc-7b7d-4d64-96c0-470f7abd8f6e

📥 Commits

Reviewing files that changed from the base of the PR and between 16fd3fe and 263a6ef.

📒 Files selected for processing (9)
  • libcudacxx/share/libcudacxx/gdb/__init__.py
  • libcudacxx/share/libcudacxx/gdb/tuple.py
  • libcudacxx/share/libcudacxx/lldb/__init__.py
  • libcudacxx/share/libcudacxx/lldb/tuple.py
  • libcudacxx/test/debugging/CMakeLists.txt
  • libcudacxx/test/debugging/tuple/CMakeLists.txt
  • libcudacxx/test/debugging/tuple/gdb.expected
  • libcudacxx/test/debugging/tuple/lldb.expected
  • libcudacxx/test/debugging/tuple/source.cu

Comment thread libcudacxx/share/libcudacxx/lldb/tuple.py Outdated
Comment thread libcudacxx/share/libcudacxx/lldb/tuple.py Outdated
@dunga1k58bh
dunga1k58bh force-pushed the add-tupple-pretty-printers branch from 263a6ef to 7a7f8e2 Compare July 29, 2026 18:11
@dunga1k58bh dunga1k58bh changed the title Add tupple pretty printers libcu++] Add cuda::std::tuple debugger pretty-printers Jul 29, 2026
@dunga1k58bh dunga1k58bh changed the title libcu++] Add cuda::std::tuple debugger pretty-printers [libcu++] Add cuda::std::tuple debugger pretty-printers Jul 29, 2026
@dunga1k58bh
dunga1k58bh marked this pull request as draft July 30, 2026 17:07
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Review to In Progress in CCCL Jul 30, 2026
…formatting

Add EBCO-first/last/adjacent, pointer, and nested-empty tuple test
cases, and register an explicit lldb type summary so tuples render
consistently instead of falling back to LLDB's default heuristic.
@dunga1k58bh
dunga1k58bh force-pushed the add-tupple-pretty-printers branch from a337ec7 to 4a0c459 Compare July 30, 2026 18:02
@dunga1k58bh
dunga1k58bh marked this pull request as ready for review July 30, 2026 18:02
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Jul 30, 2026
@dunga1k58bh

dunga1k58bh commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@griwes I tried to build and test with lldb >= 22 and C++20, but it didn't pass. With lldb <= 21, all tests pass. The error may be related to the LLVM issue mentioned in this PR: llvm/llvm-project#207704

@Jacobfaib

Copy link
Copy Markdown
Contributor

/ok to test 5e71b28

@Jacobfaib Jacobfaib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the contribution!

@Jacobfaib
Jacobfaib enabled auto-merge (squash) July 31, 2026 12:11
@github-actions

This comment has been minimized.

@dunga1k58bh

Copy link
Copy Markdown
Contributor Author

@Jacobfaib The [CTK13.3 GCC15 C++20] Test(amd64, H100 2-GPU): sm{90} job seems to have failed due to a runner issue - the log cuts off mid-run with all tests passing (2858/3769), the raw log returns BlobNotFound. Could you re-trigger CI. Thanks

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 23h 41m: Pass: 100%/68 | Total: 16h 34m | Max: 49m 39s | Hits: 99%/318204

See results here.

@Jacobfaib
Jacobfaib merged commit 5e1fc16 into NVIDIA:main Aug 1, 2026
177 of 180 checks passed
@dunga1k58bh
dunga1k58bh deleted the add-tupple-pretty-printers branch August 1, 2026 11:59
davebayer pushed a commit to davebayer/cccl that referenced this pull request Aug 4, 2026
* [libcu++] Add cuda::std::tuple debugger pretty-printers

* [libcu++] Test more cuda::std::tuple edge cases and fix lldb summary formatting

Add EBCO-first/last/adjacent, pointer, and nested-empty tuple test
cases, and register an explicit lldb type summary so tuples render
consistently instead of falling back to LLDB's default heuristic.

* [libcu++] Fix lldb tuple type name and empty-tuple summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[FEA]: Debugger pretty-printers: cuda::std::tuple

2 participants