Skip to content

Stop routing OVRTX renderer logs through stdout for tests - #7035

Merged
mataylor-nvidia merged 4 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/ovrtx-renderer-log-to-file
Aug 13, 2026
Merged

mataylor-nvidia merged 4 commits into
isaac-sim:developfrom
mataylor-nvidia:mataylor/ovrtx-renderer-log-to-file

Conversation

@mataylor-nvidia

@mataylor-nvidia mataylor-nvidia commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes large blocks of NUL bytes being written to CI logs during kitless rendering tests, at the source.

The kitless rendering tests overrode OVRTXRendererCfg.log_file_path to /dev/stdout (CON on Windows), added in #5749 so the RTX shader-compilation timeline would be visible while a test appeared to hang.

OVRTX opens that path natively and, running with keep_system_alive=True, retains the handle for the lifetime of the process. Under pytest's file-descriptor capture, fd 1 is a temporary file that pytest rewinds and truncates between tests, so the retained handle keeps writing at a stale offset and the resulting sparse gap is read back as a block of NUL bytes.

This drops the override entirely rather than working around it. log_file_path already defaults to <system temp>/ovrtx_renderer.log, so _redirect_ovrtx_renderer_log_to_stdout() only ever moved the log somewhere less safe — and its hardcoded camera-name list (tiled_camera, base_camera, wrist_camera) silently missed any camera named otherwise.

To keep the log visible, an autouse fixture in source/isaaclab_tasks/test/conftest.py replays the bytes each test appends. It is a no-op for tests that never build an OVRTX renderer, records only the byte range written during the test, and replays from the beginning when the 64 bytes in front of that range changed — the log was truncated and rewritten, by OVRTX opening one an earlier pytest process left behind, say.

Net effect: 48 lines deleted, 36 added, and no test-owned file descriptor competing with pytest for stdout.

Alternative considered

Running the child pytest with --capture=sys (#7031) avoids the sparse-file mechanism, but breaks SimulationApp.__init__, which calls faulthandler.enable() — that needs a real fd, and under sys capture sys.stderr is a CaptureIO with no fileno(). It also sends every native fd-1/fd-2 write and all subprocess output from passing tests straight to the job log, reversing #6462.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

Failure output with the fixture in place:

--------------------------- Captured stdout teardown ---------------------------

----- OVRTX renderer log: test_failing_ovrtx_test -----
[omni.rtx] BOOM

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

The kitless rendering tests overrode OVRTXRendererCfg.log_file_path to
/dev/stdout (CON on Windows) so the RTX shader-compilation timeline would
be visible while a test appeared to hang.

OVRTX opens that path natively and, running with keep_system_alive=True,
retains the handle for the lifetime of the process. Under pytest's
file-descriptor capture, fd 1 is a temporary file that pytest rewinds and
truncates between tests, so the retained handle keeps writing at a stale
offset and the resulting sparse gap is read back as a block of NUL bytes.

Drop the override entirely. log_file_path already defaults to a file
under the system temp directory, so the walk over camera cfgs only ever
moved the log somewhere less safe, and its hardcoded camera-name list
silently missed any camera named otherwise. An autouse fixture replays
the bytes each test appends, keeping the log visible per test and in
failure reports without a test-owned file descriptor competing with
pytest for stdout.
@mataylor-nvidia
mataylor-nvidia requested a review from a team August 12, 2026 03:22
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 12, 2026
@mataylor-nvidia mataylor-nvidia changed the title Stop routing OVRTX renderer logs through stdout Stop routing OVRTX renderer logs through stdout for tests Aug 12, 2026
@greptile-apps

greptile-apps Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR stops routing native OVRTX renderer output through pytest’s captured stdout and instead replays per-test additions from the renderer’s default temporary log.

  • Removes renderer-specific stdout-path overrides from kitless rendering helpers.
  • Adds an autouse fixture that tracks the prior log offset, detects apparent rewrites using a content fingerprint, and emits newly written bytes during teardown.
  • Adds the package changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
source/isaaclab_tasks/test/conftest.py Adds binary log-offset tracking and teardown replay for the shared OVRTX renderer log.
source/isaaclab_tasks/test/rendering_test_utils.py Removes the helper and call sites that redirected native OVRTX logs to stdout.
source/isaaclab_tasks/changelog.d/mataylor-ovrtx-renderer-log-to-file.skip Adds the requested skip changelog fragment for this test-only change.

Reviews (2): Last reviewed commit: "Detect OVRTX log rewrites by content, no..." | Re-trigger Greptile

Comment thread source/isaaclab_tasks/test/conftest.py Resolved

@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

The change removes the private stdout-redirection helper and all six call sites, allowing OVRTX to retain its default temporary log file while an autouse fixture replays bytes appended during each test.

  • Design and architecture: Moving log replay into the suite-level fixture avoids mutating individual camera configurations and eliminates the incomplete hardcoded camera-name discovery. Duplicating the default log path avoids importing isaaclab_ov throughout the suite, with the non-blocking maintenance tradeoff that the fixture must be updated if that default changes.
  • API: No public or extension-facing API changes were identified. OVRTXRendererCfg.log_file_path retains its existing default, and the removed helper was private with all in-patch consumers removed. The package also includes an appropriate .skip changelog fragment.
  • Implementation: The fixture snapshots the current file size, handles log shrinkage by replaying from the beginning, tolerates a missing or inaccessible log, and prints only newly read content during teardown. The diagnostic replay remains heuristic if the log is replaced or truncated and regrown beyond the prior offset during one test, but this does not affect renderer behavior or restore the stdout file-descriptor conflict.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

The replay fixture reset its offset only when the log had shrunk. A log
left behind by an earlier pytest process that OVRTX then truncates and
rewrites past that size stays as large or larger, so the offset survived
and the replay skipped the beginning of the current test's diagnostics.

Compare the 64 bytes preceding the offset instead: they only stay equal
while the log was appended to. Read the replayed range as bytes so the
offset keeps a single, unambiguous meaning.
@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.

The root-cause analysis looks credible, but the replacement still has important diagnostic gaps and no regression coverage. Requesting changes for the following:

  1. Renderer diagnostics are unavailable on hangs and native crashes (source/isaaclab_tasks/test/conftest.py:57-75). The log is replayed only after the fixture resumes from yield. That code cannot run after a segfault, abort, OOM, or when the outer CI supervisor kills a hung process with SIGKILL. These are precisely the failures where the native renderer log is most useful. Please have the outer supervisor include a bounded tail of ovrtx_renderer.log in its crash/timeout diagnostics, or otherwise collect it outside the process being diagnosed.

  2. There is no regression test for the capture bug this PR fixes. Existing rendering jobs completing successfully establish neither that retained native writes no longer introduce NUL bytes nor that renderer output is preserved on failure. The repository guidelines require a regression test to fail without the fix. Please add behavioral coverage that reproduces the retained-fd/capture interaction and asserts that the resulting output contains no NUL block while the expected renderer diagnostics remain available. Coverage for truncation/rewrite and abnormal termination would also pin the new failure paths.

  3. The 64-byte fingerprint can still mistake a rewrite for an append (source/isaaclab_tasks/test/conftest.py:42-54). OVRTX startup output is substantially deterministic. If another process truncates the shared file and rewrites the same bytes around the previous offset before appending new output, the fingerprint is unchanged, so the fixture seeks to the stale offset and omits the beginning of the current log. A process-unique log path or explicit ownership/session cleanup would avoid inferring file generation from content.

  4. Failure replay is unbounded (source/isaaclab_tasks/test/conftest.py:72-75). handle.read() prints the entire appended verbose renderer log into pytest capture and potentially JUnit output. A long failing rendering test can therefore recreate the oversized-log problem with real text rather than sparse NUL bytes. Please cap the replay to a documented tail size and state when earlier bytes were omitted.

I verified these findings against head commit e7155265df5350ccda8644fd92e87e7ee8190e1d. The passing kitless-rendering CI job contains no NUL bytes, but it also contains no OVRTX renderer log: replay section because no failure exercised that path.

@mataylor-nvidia

mataylor-nvidia commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Added fixes for the 4 comments AntoineRichard posted

Comment thread tools/conftest.py Outdated
"""
section = ovrtx_log.format_log_section(ovrtx_log.LOG_PATH, label)
if section:
logger.info(section)

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.

It seems you redirect all ovrtx logging into info, should we redirect ovrtx logged messages to appropriate loggers?

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 removed this

@mataylor-nvidia

Copy link
Copy Markdown
Contributor Author

I created another PR ontop of this one and broke the test on purpose to see we are indeed still receiving ovrtx logs:

https://github.com/isaac-sim/IsaacLab/actions/runs/31644824736/job/94280076646#step:5:695

@mataylor-nvidia
mataylor-nvidia merged commit f26ab38 into isaac-sim:develop Aug 13, 2026
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants