Skip to content

Refactor shared CUDA dependencies in testshade and testrender - #2190

Open
tgrant-nv wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
tgrant-nv:issue-2183-example-common
Open

tgrant-nv wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
tgrant-nv:issue-2183-example-common

Conversation

@tgrant-nv

@tgrant-nv tgrant-nv commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

This change fixes #2183 (and, with a little luck, also closes #2183).

There is some unfortunate sharing of the CUDA sources between testshade and testrender that requires each project to reach into the other's source directory, which clouds the boundary between projects.

The solution we are proposing is to move the shared sources to a common directory.

Tests

No new tests added, nor any change in test results before and after the patch.

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have read the Policy on AI Coding Assistants
    and if I used AI coding assistants, I have an Assisted-by: TOOL / MODEL
    line in the pull request description above.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested in the testsuite.
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.

Assisted-by: OpenAI Codex / GPT-6

* Move shared render state, free-function renderer services, and the CUDA
  renderer library into a common source directory.
* Give each example explicit source and include paths for host bitcode, NVCC
  PTX, and embedded CUDA bitcode while preserving the generated symbols and PTX
  filenames.
* Use source-root include paths to remove parent-directory includes from these
  examples.
* Keep testshade's camera ray flag independent of testrender's Ray definition.

Assisted-by: OpenAI Codex / GPT-6

Signed-off-by: Tim Grant <tgrant@nvidia.com>

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

LGTM

Instead of example_common, maybe it should be test_common (or testcommon) ?

testshade and testrender are both examples, but also used for unit testing.

Not a strong feeling, just throwing it out there for discussion.

@tgrant-nv

Copy link
Copy Markdown
Contributor Author

I definitely waffled on the name a bit. I'm happy to change it to something that communicates the intent of the projects more clearly.

testshade and testrender are used by the testsuite as well as serving as
examples. Rename their shared source directory accordingly and update the
CMake and include paths. The compiled code is unchanged.

Assisted-by: OpenAI Codex / GPT-6

Signed-off-by: Tim Grant <tgrant@nvidia.com>
@lgritz

lgritz commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Does this fully solve #2183?

If so, before merging, we should edit the description to use the magic words

Closes #2183 

Or "fixes". Either one will actually cause the issue to close when this merges. But just mentioning the issue in other ways doesn't do so.

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.

testrender testshade: implicit interdependence

3 participants