Skip to content

refactor(sysrap): remove legacy PPM helpers#402

Open
plexoos wants to merge 2 commits into
mainfrom
rm-ppm
Open

refactor(sysrap): remove legacy PPM helpers#402
plexoos wants to merge 2 commits into
mainfrom
rm-ppm

Conversation

@plexoos

@plexoos plexoos commented Jul 6, 2026

Copy link
Copy Markdown
Member

Removes the legacy SysRap PPM helpers and migrates the remaining SOPTIX pixel-dump path to the existing .npy array
persistence flow.

Motivation

The current render/snapshot codebase already uses .npy array output through NP::Write, while the PPM helpers were
legacy image-writing utilities with little remaining use. Removing them reduces duplicate output code and shrinks the
installed SysRap API surface.

Breaking Change

  • SPPM.hh and sppm.h are removed.
  • Callers of SOPTIX::render_ppm(...) should use SOPTIX::render_npy(...).
  • Callers of SOPTIX_Pixels::save_ppm(...) should use SOPTIX_Pixels::save_npy(...).
  • Workflows expecting PPM_PATH should move to NPY_PATH.
  • Consumers that still need .ppm image files should convert from the emitted .npy pixel arrays downstream.

Copilot AI review requested due to automatic review settings July 6, 2026 22:20
@plexoos plexoos self-assigned this Jul 6, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63f5246330

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

int ncomp = 4;
sppm::Write(ppm_path, gm.Width(), gm.Height(), ncomp, (unsigned char*)pixels, yflip);
const char* npy_path = getenv("NPY_PATH");
NP::Write(npy_path, (unsigned char*)pixels, gm.Height(), gm.Width(), 4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the vertical flip in direct SOPTIX dumps

When SOPTIX_Scene_test is used to generate NPY_PATH, this writes the downloaded OptiX buffer in raw launch order, whereas the removed PPM path passed yflip = true and the new SOPTIX_Pixels::save_npy helper still performs that same flip before NP::Write. This makes the standalone SOPTIX dump vertically inverted relative to both the previous output and the encapsulated render_npy path, so comparisons or downstream conversions from this test produce the wrong image orientation.

Useful? React with 👍 / 👎.

Copilot AI 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.

Pull request overview

This PR removes the legacy SysRap PPM write/read helpers and migrates the remaining SOPTIX pixel-dump output to the existing .npy persistence flow via NP::Write, reducing duplicate output code and API surface.

Changes:

  • Removed SPPM.hh/.cc and sppm.h along with their unit tests and CMake entries.
  • Replaced SOPTIX::render_ppm / SOPTIX_Pixels::save_ppm with render_npy / save_npy.
  • Updated SOPTIX scene tests to emit .npy arrays (via NPY_PATH) instead of .ppm files (via PPM_PATH).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sysrap/tests/SPPMTest.cc Removes legacy SPPM test (deleted).
sysrap/tests/sppm_test.cc Removes legacy sppm test (deleted).
sysrap/tests/SOPTIX_Scene_test.cc Switches pixel dump output from PPM to NPY.
sysrap/tests/SOPTIX_Scene_Encapsulated_test.cc Updates encapsulated render call to render_npy.
sysrap/tests/CMakeLists.txt Drops SPPM test from test build sources.
sysrap/SPPM.hh Removes legacy SPPM API (deleted).
sysrap/sppm.h Removes legacy sppm helper API (deleted).
sysrap/SPPM.cc Removes legacy SPPM implementation (deleted).
sysrap/SOPTIX.h Renames render output entrypoint to render_npy and routes to save_npy.
sysrap/SOPTIX_Pixels.h Replaces PPM write path with NPY write path (with vertical flip).
sysrap/CMakeLists.txt Removes SPPM sources/headers from SysRap library build.

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

Comment on lines +130 to 132
const char* npy_path = getenv("NPY_PATH");
NP::Write(npy_path, (unsigned char*)pixels, gm.Height(), gm.Width(), 4);

Comment thread sysrap/SOPTIX_Pixels.h
Comment on lines +42 to +46
inline void SOPTIX_Pixels::save_npy(const char* path)
{
const int width = gm.Width();
const int height = gm.Height();
const int ncomp = 4;
Comment thread sysrap/SOPTIX.h
Comment on lines +149 to 156
inline void SOPTIX::render_npy(const char* _path)
{
const char* path = spath::Resolve(_path);

std::cout << "SOPTIX::render_ppm [" << ( path ? path : "-" ) << "]\n" ;
std::cout << "SOPTIX::render_npy [" << (path ? path : "-") << "]\n";

if(!pix) pix = new SOPTIX_Pixels(gm) ;
render(pix->d_pixels);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants