Skip to content

Add pretty printers for cuda::std::array - #10528

Merged
Jacobfaib merged 3 commits into
NVIDIA:mainfrom
pieroevcc:10098-array-pretty-printers
Jul 29, 2026
Merged

Jacobfaib merged 3 commits into
NVIDIA:mainfrom
pieroevcc:10098-array-pretty-printers

Conversation

@pieroevcc

@pieroevcc pieroevcc commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Description

closes #10098

  • Add GDB and LLDB pretty printers for cuda::std::array

Checklist

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

@pieroevcc
pieroevcc requested review from a team as code owners July 29, 2026 02:11
@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

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: 5b479c0f-c884-481b-99ae-d7e493121d34

📥 Commits

Reviewing files that changed from the base of the PR and between aa0d251 and c70b7ce.

📒 Files selected for processing (4)
  • libcudacxx/test/debugging/array/CMakeLists.txt
  • libcudacxx/test/debugging/array/gdb.expected
  • libcudacxx/test/debugging/array/lldb.expected
  • libcudacxx/test/debugging/array/source.cu
🚧 Files skipped from review as they are similar to previous changes (4)
  • libcudacxx/test/debugging/array/CMakeLists.txt
  • libcudacxx/test/debugging/array/gdb.expected
  • libcudacxx/test/debugging/array/lldb.expected
  • libcudacxx/test/debugging/array/source.cu

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added debugger pretty-printer/formatter support for cuda::std::array in both GDB and LLDB, improving how fixed-size, empty (zero-length), nested, and aliased arrays render with element-wise visibility.
    • Includes an update-focused inspection path to show expected values before and after array mutation.
  • Tests

    • Expanded the debugging test suite with a new array target and additional cases (inspect_before_update, inspect_after_update), along with updated GDB/LLDB expected-output fixtures.

Walkthrough

Adds GDB and LLDB pretty-printers for cuda::std::array, registers them with each debugger, and adds debugging cases for normal, empty, nested, aliased, and updated arrays.

Changes

cuda::std::array debugging

Layer / File(s) Summary
GDB array printer
libcudacxx/share/libcudacxx/gdb/...
Registers a GDB printer that recognizes cuda::std::array, displays its public type name, and iterates __elems_.
LLDB synthetic provider
libcudacxx/share/libcudacxx/lldb/...
Registers an LLDB synthetic provider that recognizes array sizes and exposes __elems_ as indexed children.
Debugger coverage
libcudacxx/test/debugging/...
Adds build wiring, debugger fixtures, and CUDA cases covering normal, empty, nested, aliased, and updated arrays.

Assessment Against Linked Issues

Objective Addressed Explanation
Create GDB and LLDB pretty-printers for cuda::std::array under the requested debugger paths [#10098] ❌ The printers are implemented as std_array.py, while the issue specifies array.py.
Add exhaustive tests under libcudacxx/test/debugging/array [#10098] ✅

Suggested reviewers: bernhardmgruber


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: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7c93aba4-cba0-40f9-82d4-50fe41df2607

📥 Commits

Reviewing files that changed from the base of the PR and between a792a2b and 0137a73.

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

@pieroevcc

Copy link
Copy Markdown
Contributor Author

Named std_array.py rather than array.py because array is a builtin in LLDB's interpreter, so lldb/__init__.py's import array never reaches the local file and the resulting AttributeError disables every CCCL LLDB formatter, not just this one. GDB has the reverse problem, where a local array.py shadows the stdlib module for the whole session, so both sides use the same name.

@pieroevcc
pieroevcc force-pushed the 10098-array-pretty-printers branch from 0137a73 to aa0d251 Compare July 29, 2026 02:26

@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.

One small addition required, otherwise LGTM, thanks for the contribution!

@Jacobfaib

Copy link
Copy Markdown
Contributor

/ok to test d08e544

@Jacobfaib

Copy link
Copy Markdown
Contributor

/ok to test c70b7ce

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

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 18m: Pass: 100%/71 | Total: 2d 14h | Max: 2h 13m | Hits: 99%/332140

See results here.

@Jacobfaib
Jacobfaib merged commit 07e3029 into NVIDIA:main Jul 29, 2026
94 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jul 29, 2026
@pieroevcc
pieroevcc deleted the 10098-array-pretty-printers branch July 29, 2026 15:55
davebayer pushed a commit to davebayer/cccl that referenced this pull request Aug 4, 2026
* Add pretty printers for cuda::std::array

* Add test for printing cuda::std::array after update
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::array

2 participants