Skip to content

Implemented the root fix for the NUL/binary logs - #7031

Closed
pbarejko wants to merge 2 commits into
isaac-sim:developfrom
pbarejko:pbarejko/binary-data
Closed

pbarejko wants to merge 2 commits into
isaac-sim:developfrom
pbarejko:pbarejko/binary-data

Conversation

@pbarejko

Copy link
Copy Markdown
Collaborator

Description

Fixes large blocks of NUL bytes being written to GitHub Actions logs during kitless rendering tests.

OVRTX writes native logs through /dev/stdout. Pytest’s default file-descriptor capture replaces stdout with a temporary file that is rewound and truncated between tests. Because the native logger retains an independently opened
stdout handle, later writes can use a stale offset and create sparse regions that are emitted as NUL bytes.

This change runs child pytest processes with --capture=sys. Python output remains captured and displayed for failures, while native loggers write to a stable subprocess pipe instead of pytest’s temporary capture file.

A regression test verifies that child pytest commands use --capture=sys while retaining --show-capture=all.

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

Please attach before and after screenshots of the change if applicable.

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

@pbarejko
pbarejko requested a review from a team August 12, 2026 00:34
@github-actions github-actions Bot added isaac-lab Related to Isaac Lab team infrastructure labels Aug 12, 2026

@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 targeted --capture=sys change is focused and covered by a command-construction regression test, but the PR touches source/isaaclab without adding the required changelog fragment.

  • Design and architecture: The capture-mode fix remains localized to the orchestrator’s child-pytest command construction and does not alter retry, report, or parsing architecture. No design concern was identified.
  • API: No public package API, export, or configuration field changes. The internal child-pytest invocation now explicitly selects system-level capture while retaining --show-capture=all.
  • Implementation: The implementation and regression test directly cover the intended command-line behavior. Before merge, add a changelog fragment under source/isaaclab/changelog.d/; a .skip fragment is appropriate if this CI-tooling fix does not warrant a release note.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

)


def test_inner_pytest_uses_sys_capture(monkeypatch, tmp_path: Path) -> None:

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.

🔵 Suggestion · Implementation — Missing changelog fragment for touched package

This PR modifies a file under source/isaaclab but adds no fragment in source/isaaclab/changelog.d/. Repository policy requires a fragment for every touched source package, using a .skip fragment when no release note is warranted. Add a .skip fragment for this CI-tooling-only change so release metadata processing accounts for the package.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the large blocks of NUL bytes appearing in GitHub Actions logs during kitless rendering tests, addressing the native OVTRX logger retaining a stale descriptor-backed pytest capture file. It requires no new dependencies.

  • Adds --capture=sys to child pytest invocations so Python output remains captured while native output uses the stable subprocess pipe.
  • Retains --show-capture=all for Python failure diagnostics.
  • Adds a regression test covering the child pytest command’s capture arguments.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness or security issues identified.

The child process remains fully enclosed by the orchestrator’s stdout and stderr pipes, Python failure output remains captured by pytest, and the new test locks in the intended command-line behavior.

Important Files Changed

Filename Overview
tools/conftest.py Changes child pytest processes to system-stream capture, preventing persistent native loggers from writing through pytest’s rewound file-descriptor capture.
source/isaaclab/test/cli/test_test_orchestrator_result_handling.py Adds focused coverage ensuring child commands use --capture=sys and retain --show-capture=all.

Reviews (1): Last reviewed commit: "Implemented the root fix for the NUL/bin..." | Re-trigger Greptile

mataylor-nvidia added a commit that referenced this pull request Aug 13, 2026
# 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

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] 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)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
@pbarejko pbarejko closed this Aug 18, 2026
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.

3 participants