Repository navigation
Run PPISP as a camera tensor processor - #8834
mataylor-nvidia wants to merge 7 commits into
Conversation
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.
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryMoves PPISP from the renderers into camera tensor processors.
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]
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.
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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``. |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
🟡 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.
There was a problem hiding this comment.
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.
|
@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.
|
@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.
|
@greptile review |
AntoineRichard
left a comment
There was a problem hiding this comment.
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.
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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)} |
There was a problem hiding this comment.
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.
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.CameraCfg.tensor_processorslistsTensorProcessorclasses. The camera constructs each one withCameraData.output, calls it after every capture, and merges the outputs it returns. The renderer is asked for the processors'inputs(herergb_hdr) instead of theiroutputs. Resets and teardown reachresetandclose.prepare_cameraclass method, which the camera calls before the scene is cloned or exported.PpispProcessor.prepare_cameraresolvesCameraISPModediscovery and USD-authored coefficients. On Isaac RTX and OVRTX it also disables auto-exposure and authors neutral exposure on the camera prims. There is norgb_radiancedata type and no exposure setting. If discovery finds no PPISP attributes, the processor is removed and the camera publishes the renderer'srgb, asisp_cfgdoes today.PpispProcessorwraps the existingPpispPipelineand producesrgbaand its zero-copyrgbview.HdrColorto the output device after a device fallback only when PPISP was enabled; it now does so for everyrgb_hdrrequest.CameraCfg.isp_cfgstill works: it forwards toPpispProcessorCfgwith aFutureWarning.Behavior to review:
camera.data.outputafter the first capture, which the firstcamera.dataaccess triggers. Processor inputs such asrgb_hdrare published as well.isp_cfgtoday, 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 pytestoversource/isaaclab_ppisp/testand the camera, OVRTX, Isaac RTX, and Newton renderer contract tests: 169 passed.isp_cfg,rgbequals PPISP applied to the publishedrgb_hdrexactly.outputandinfokeys match.prepare_camera;isp_cfg;xfail) fail identically on this branch and on unmodifiedmain.uv run python tools/changelog/cli.py check upstream/main --include-worktreeandISAACLAB_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.Type of change
Checklist
pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists thereRelease backport
develop