Skip to content

Run PPISP as a camera tensor processor - #8834

Closed
mataylor-nvidia wants to merge 7 commits into
isaac-sim:mainfrom
mataylor-nvidia:feat/ppisp-camera-processor
Closed

mataylor-nvidia wants to merge 7 commits into
isaac-sim:mainfrom
mataylor-nvidia:feat/ppisp-camera-processor

Conversation

@mataylor-nvidia

@mataylor-nvidia mataylor-nvidia commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #8693. PPISP (Physically Plausible Image Signal Processing) now runs as a camera tensor processor in isaaclab_ppisp, instead of inside the Isaac RTX, OVRTX, and Newton Warp renderers. The change removes more code than it adds.

from isaaclab.utils import replace
from isaaclab_ppisp import PpispCfg, PpispProcessorCfg

ppisp_camera = replace(
    front_camera,
    data_types=["rgb"],
    tensor_processors=[PpispProcessorCfg(isp_cfg=PpispCfg(inputs={"exposureOffset": 1.5}))],
)
  • Camera. CameraCfg.tensor_processors lists TensorProcessor classes. The camera constructs each one with CameraData.output, calls it after every capture, and merges the outputs it returns. The renderer is asked for the processors' inputs (here rgb_hdr) instead of their outputs. Resets and teardown reach reset and close.
  • Exposure, handled automatically. A processor class can define a prepare_camera class method, which the camera calls before the scene is cloned or exported. PpispProcessor.prepare_camera resolves CameraISPMode discovery and USD-authored coefficients. On Isaac RTX and OVRTX it also disables auto-exposure and authors neutral exposure on the camera prims. There is no rgb_radiance data type and no exposure setting. If discovery finds no PPISP attributes, the processor is removed and the camera publishes the renderer's rgb, as isp_cfg does today.
  • PPISP. PpispProcessor wraps the existing PpispPipeline and produces rgba and its zero-copy rgb view.
  • Renderers. PPISP composition and internal HDR scratch buffers are removed from all three renderers. OVRTX previously copied HdrColor to the output device after a device fallback only when PPISP was enabled; it now does so for every rgb_hdr request.
  • Deprecation. CameraCfg.isp_cfg still works: it forwards to PpispProcessorCfg with a FutureWarning.

Behavior to review:

  • Processor outputs appear in camera.data.output after the first capture, which the first camera.data access triggers. Processor inputs such as rgb_hdr are published as well.
  • As with isp_cfg today, neutral exposure applies to the whole camera prim on RTX, including the renderer's own color outputs.

Validation

Run on Windows with an RTX PRO 3000 Blackwell laptop GPU.

  • uv run --extra test --extra ovrtx python -m pytest over source/isaaclab_ppisp/test and the camera, OVRTX, Isaac RTX, and Newton renderer contract tests: 169 passed.
  • A Kit-less Newton CUDA check rendered real images. With the new API and with deprecated isp_cfg, rgb equals PPISP applied to the published rgb_hdr exactly. output and info keys match.
  • Breaking each of these made a test fail, as intended:
    • calling prepare_camera;
    • forwarding isp_cfg;
    • the RTX-only exposure decision;
    • neutralizing only after discovery succeeds;
    • processor output.
  • The OVRTX Gaussian PPISP tests (marked xfail) fail identically on this branch and on unmodified main.
  • uv run python tools/changelog/cli.py check upstream/main --include-worktree and ISAACLAB_CHANGELOG_BASE_REF=upstream/main uv run isaaclab --format: passed.
  • uv run --extra dev isaaclab --docs: full HTML build succeeded with warnings treated as errors.
  • Not run: the Isaac RTX and Newton Gaussian PPISP tests, which need Isaac Sim and Kit; remote GPU CI.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Move PPISP out of the Isaac RTX, OVRTX, and Newton Warp renderers into
isaaclab_ppisp.PpispProcessor, attached through CameraCfg.tensor_processors.
The camera routes named render outputs to processors in order, requests
their inputs from the renderer without publishing them, and publishes the
names in data_types.

Processor classes can define a prepare_camera class method that the camera
calls before the scene is cloned or exported. PpispProcessor uses it to
resolve USD-authored coefficients and neutralize RTX exposure, so PPISP
needs neither a dedicated output name nor an explicit exposure setting.

CameraCfg.isp_cfg is deprecated and forwards to a PPISP processor.
@mataylor-nvidia
mataylor-nvidia requested a review from a team October 26, 2026 18:32
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 26, 2026
@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issue was found.

Summary

Moves PPISP from the renderers into camera tensor processors.

  • Camera processors turn render buffers into ordered camera outputs.
  • PPISP processes camera HDR buffers outside the renderers.

No new actionable issues were found in the changes since the previous review. Current code also addresses all four earlier, unnumbered findings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Camera configuration] --> B[Prepare processors before scene export]
    B --> C[Request renderer inputs]
    C --> D[Render capture]
    D --> E{New capture published?}
    E -- Yes --> F[Run processors in order]
    F --> G[Publish render and processor outputs]
    E -- No --> H[Keep previous outputs]
Loading

Reviews (4) · Last reviewed commit: "Trim camera processor docs and share New..." · Reviewed by Greptile

PPISP always produces rgb and rgba, so cameras construct processors with
their output dictionary, merge the returned outputs after each capture,
and only exclude processor outputs from the renderer request. This drops
the separate private render outputs, lazy chained construction, unused
output validation, and the generic routing test, and moves PpispProcessor
next to the PpispPipeline it wraps.

@isaaclab-review-bot isaaclab-review-bot 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.

Isaac Lab Review Bot

Needs attention: Compatibility and deprecation (1), Implementation (1), Style consistency (2), Test quality (1). Other reviewed categories look good.

  • PR description: The body matches the diff and validation, but call tensor_processors configuration instances, not TensorProcessor classes, and remove the unsupported rgb_radiance/exposure-setting aside; no performance evidence is needed.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: deprecated CameraCfg.isp_cfg no longer stores its resolved value and exposes unrequested rgb_hdr; mirror the resolved value and keep processor-only inputs private during deprecation.
  • Implementation: Invalidation closes processors without clearing _tensor_processors, so destruction closes the same resources again; clear the list immediately after closing it.
  • Style consistency: Deprecation documentation is inconsistent: CameraCfg.isp_cfg lacks the established versioned directive, while CameraISPMode still describes renderer-owned discovery; use the directive and update the enum contract.
  • Test quality: The new rgb-view test checks values but not zero-copy aliasing, so a copied buffer passes; assert that rgb and rgba Warp pointers share storage.

Minor fixes needed. Posted 5 inline findings.

Automated review; human maintainers own approval decisions.


msg = "CameraCfg.isp_cfg is deprecated. Add isaaclab_ppisp.PpispProcessorCfg to tensor_processors."
warnings.warn(msg, FutureWarning, stacklevel=2)
self.cfg.tensor_processors = [PpispProcessorCfg(isp_cfg=self.cfg.isp_cfg), *self.cfg.tensor_processors]

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.

🟡 Warning · Compatibility — Deprecated isp_cfg contract not preserved

Previously this field was replaced with the resolved PpispCfg or None and HDR stayed internal; now it keeps the sentinel and publishes rgb_hdr. Mirror the prepared result and hide unrequested processor inputs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partly addressed in 687adc6.

Forwarded value: camera construction now resets isp_cfg to None after forwarding it. CameraCfg.__post_init__ already does the same for the deprecated renderer fields. Before this change, SensorBase stored a clone of the cfg that still held the value. A camera built from camera.cfg therefore forwarded it a second time and ran two PPISP processors. test_camera_isp_is_resolved_during_construction now covers that case. The resolved configuration is on camera.cfg.tensor_processors[0].isp_cfg. I did not copy it back onto isp_cfg: a cfg with both the processor and a non-None isp_cfg would still forward twice.

Published rgb_hdr: this is intended, so I left it. The deprecated field forwards to the same PpispProcessorCfg that users are asked to migrate to, and so it publishes the same outputs: render outputs plus processor outputs. 349ea82 removed the data_types filtering on purpose to keep that contract simple. The extra entries only add keys; rgb still holds the PPISP result.

I'm leaving this thread open in case the author wants the filtering back for the deprecated path.

def _invalidate_initialize_callback(self, event):
"""Invalidates the scene elements."""
for processor in self._tensor_processors:
processor.close()

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.

🟡 Warning · Implementation — Clear processors after closing them

Unlike _render_data and _view below, the closed processors stay in _tensor_processors, so del closes each one a second time. Clear the list after the loop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 0e829b0. _invalidate_initialize_callback now sets self._tensor_processors = [] after closing them, so they are not closed a second time.

scalar coefficients, so every cloned view in a tiled batch shares the same
ISP configuration — there is no per-view ISP today.
isp_cfg: Any | CameraISPMode | None = None
"""Deprecated: add ``isaaclab_ppisp.PpispProcessorCfg(isp_cfg=...)`` to :attr:`tensor_processors` instead.

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.

🟡 Warning · Style Consistency — Use the deprecated Sphinx directive

Sibling deprecated fields in this class use a .. deprecated:: <version> directive; this plain-prose note renders no admonition and records no removal version. Use the same directive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 687adc6. isp_cfg now uses .. deprecated:: 42.0.0, like the sibling fields. 42.0.0 is the next isaaclab release, because upstream already has .major fragments waiting to be compiled.

# SPDX-License-Identifier: BSD-3-Clause

"""Sentinel enum for :attr:`~isaaclab.sensors.camera.CameraCfg.isp_cfg`.
"""Sentinel enum for ``isaaclab_ppisp.PpispProcessorCfg.isp_cfg``.

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.

🟡 Warning · Style Consistency — Stale ISP enum documentation

The updated module docstring points at PpispProcessorCfg, but the class and member docstrings below still document CameraCfg.isp_cfg, isp_cfg=None, and renderer-side stage walking. Update them to the processor-owned contract.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 687adc6. The CameraISPMode class and member docstrings now describe PpispProcessorCfg.isp_cfg. They say discovery reads the camera's ppisp:* attributes during camera construction, and that the camera drops the processor when discovery finds nothing. The RenderProduct and shader-walking description is gone.

expected = _rgba((2, 3, 4, 4))
apply_ppisp_to_rgba(hdr.warp, expected, normalize_ppisp_cfg(PpispCfg(inputs={"exposureOffset": 1.0})))
assert (outputs["rgba"].warp.numpy() == expected.numpy()).all()
assert (outputs["rgb"].warp.numpy() == expected.numpy()[..., :3]).all()

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.

🟡 Warning · Test Quality — Assert rgb aliases rgba storage

The name promises an rgb view, but only values are compared, so a full copy would pass. Assert warp pointer aliasing, as test_camera_data_allocates_supported_subset_and_aliases_rgb does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 687adc6. The test now asserts outputs["rgb"].warp.ptr == outputs["rgba"].warp.ptr, the same check test_camera_data_allocates_supported_subset_and_aliases_rgb uses.

Asynchronous OVRTX rendering retains the priming image on the second
capture after startup or reset, but cameras still ran their tensor
processors, advancing stateful processors twice on the same image.
BaseRenderer.read_output now returns whether it published a capture,
the render context forwards those results in request order, and cameras
run processors only for published captures.

Masked camera resets passed None to processors, which reset every
environment. They now pass only the masked environment ids.

Also give the render-context test camera stub its processor list, which
the processor integration had left missing.
@mataylor-nvidia

Copy link
Copy Markdown
Contributor Author

@greptile review

Cameras constructed every processor from the render outputs before any
processor ran, so a processor that reads an earlier processor's output
could not start. Processors are again constructed in order at the first
published capture, each from the render outputs and the outputs of
earlier processors.

The render request also dropped every name a processor produces, and
processor outputs replaced entries in the dictionary that the renderer
fills, so a processor could not filter an output in place. The renderer
now produces each input that no earlier processor produces, and cameras
keep its buffers separate from the published outputs.

Closed processors are cleared so that reinitialization constructs new
ones and destruction does not close them again.
@mataylor-nvidia

Copy link
Copy Markdown
Contributor Author

@greptile review

Camera construction now resets CameraCfg.isp_cfg after forwarding it to
the PPISP processor, as CameraCfg.__post_init__ does for the deprecated
renderer fields, so a camera built from camera.cfg does not add a second
processor. The field uses the deprecated directive, CameraISPMode
documents processor-side discovery, and the PPISP processor test checks
that rgb aliases rgba.
Shortens the processor, renderer, and changelog wording added during
review, and moves the Newton cube scene shared by the HDR background and
processor chaining tests into one helper. Behavior is unchanged.
@mataylor-nvidia

Copy link
Copy Markdown
Contributor Author

@greptile review

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Experimental review tooling 🤖

Thanks for opening this PR to IsaacLab! We're currently experimenting with automated review tooling, and we'd appreciate a little human time to review the review! The reviewer is under review, too.

Please reply with feedback on useful findings, false positives, and anything the tool missed.

Open Code Review v1.13.3 with Sol6.1 (azure/openai/gpt-6.1-sol, via NVIDIA Inference Hub) reviewed 29f6e353064259082cff37172d49c826358cabea.

Result: No findings reported across 36 selected text files.

Scope: 36 of 39 changed files selected, including Python tests and .rst files. This was a static review; simulation tests were not run.

Review time: 2m11s. Token usage: 621,480.

@mataylor-nvidia
mataylor-nvidia marked this pull request as draft October 27, 2026 16:32
With update_period > 0, environments capture on different steps, so a processor call can mix new rows with rows that still hold the previous capture. Stateful processors can list env_mask in their inputs to receive a boolean mask of the environments with a new capture. The name is reserved, never requested from the renderer, and not published in camera output.
for processor_cfg in cfg.tensor_processors:
if CAPTURE_MASK_NAME in processor_cfg.outputs:
raise ValueError(f"Processor output name {CAPTURE_MASK_NAME!r} is reserved for the capture mask.")
inputs += [name for name in processor_cfg.inputs if name not in produced and name != CAPTURE_MASK_NAME]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not requested from the renderer: _render_data_types skips env_mask when collecting processor inputs. A new unit test (test_capture_mask_is_not_requested_from_the_renderer) checks that a processor with inputs=["rgb_hdr", "env_mask"] gives renderer data types of just ["rgb_hdr"]. The same test checks that declaring env_mask as an output raises a ValueError saying the name is reserved.

The reserved-output ValueError is raised from _render_data_types, so it only fires when a camera is constructed with that config.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would move this to

def validate_config(self) -> None:
        """Validate the requested data types against the selected renderer contract."""
        """Validate processor output names and the requested data types against the selected renderer contract."""
        if any(CAPTURE_MASK_NAME in processor_cfg.outputs for processor_cfg in self.tensor_processors):
            raise ValueError(f"Processor output name {CAPTURE_MASK_NAME!r} is reserved for the capture mask.")

return
buffers = dict(self._render_outputs)
# The capture mask is an input for processors, not a camera output.
mask = {CAPTURE_MASK_NAME: ProxyArray(self._is_outdated)}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not published: _apply_tensor_processors adds the mask only to the dict it passes to processors, never to buffers, so camera.data.output never receives it. The chain test (which runs on a real CUDA Newton camera) already compared the set of output names. I added explicit checks that env_mask is absent from both camera.data.output and camera.data.info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants